Commit 6a9c04959032561b93d65b32cf6c5715ccf58e4e
1 parent
9426b750
Exists in
master
and in
79 other branches
colab: retrieve and store noosfero api token
Showing
2 changed files
with
6 additions
and
0 deletions
Show diff stats
cookbooks/colab/recipes/default.rb
| ... | ... | @@ -148,6 +148,10 @@ template '/etc/colab/plugins.d/noosfero.py' do |
| 148 | 148 | group 'colab' |
| 149 | 149 | mode 0640 |
| 150 | 150 | notifies :restart, 'service[colab]' |
| 151 | + get_private_token = lambda do | |
| 152 | + `psql --tuples-only --host database --user colab -c "select private_token from users where login = 'admin-noosfero'" noosfero`.strip | |
| 153 | + end | |
| 154 | + variables(:get_private_token => get_private_token) | |
| 151 | 155 | end |
| 152 | 156 | |
| 153 | 157 | template '/etc/colab/plugins.d/spb.py' do | ... | ... |
cookbooks/colab/templates/noosfero.py.erb
| ... | ... | @@ -10,6 +10,8 @@ verbose_name = 'Noosfero Plugin' |
| 10 | 10 | |
| 11 | 11 | upstream = 'http://<%= node['peers']['social'] %>:80/social/' |
| 12 | 12 | |
| 13 | +private_token = '<%= @get_private_token.call %>' | |
| 14 | + | |
| 13 | 15 | urls = { |
| 14 | 16 | 'include': 'colab_noosfero.urls', |
| 15 | 17 | 'namespace': 'noosfero', # TODO: do not allow to change namespace | ... | ... |