Commit c3b1585e6eaaf344fc8c5e456a1e989c5e7603d0
1 parent
32519fe4
Exists in
master
and in
79 other branches
Revert "Create noosfero-admin and get this private_token"
This reverts commit 064023e49718558286de994411609ff25aecbc81.
Showing
2 changed files
with
3 additions
and
36 deletions
Show diff stats
cookbooks/colab/recipes/default.rb
@@ -96,52 +96,20 @@ execute 'create-admin-token-gitlab' do | @@ -96,52 +96,20 @@ execute 'create-admin-token-gitlab' do | ||
96 | user 'git' | 96 | user 'git' |
97 | end | 97 | end |
98 | 98 | ||
99 | -execute 'create-admin-token-noosfero' do | ||
100 | - user = "admin-noosfero" | ||
101 | - email = "admin-noosfero@example.com" | ||
102 | - password = SecureRandom.random_number.to_s | ||
103 | - | ||
104 | - command "bundle exec rails c production <<EOF | ||
105 | - user = User.create(login: \'#{user}\', email: \'#{email}\', password: \'#{password}\', password_confirmation: \'#{password}\') | ||
106 | - user.activate | ||
107 | - user.generate_private_token_if_not_exist | ||
108 | - Environment.default.add_admin user.person | ||
109 | - exit | ||
110 | - " | ||
111 | - | ||
112 | - user_exist = lambda do | ||
113 | - Dir.chdir '/usr/lib/noosfero' do | ||
114 | - `RAILS_ENV=production bundle exec rails runner \"puts User.find_by_identifier(\'admin-noosdero\').nil?\"`.strip | ||
115 | - end | ||
116 | - end | ||
117 | - | ||
118 | - not_if {user_exist.call == "false"} | ||
119 | - | ||
120 | - cwd '/usr/lib/noosfero' | ||
121 | - user 'noosfero' | ||
122 | -end | ||
123 | - | ||
124 | template '/etc/colab/settings.d/01-apps.yaml' do | 99 | template '/etc/colab/settings.d/01-apps.yaml' do |
125 | owner 'root' | 100 | owner 'root' |
126 | group 'colab' | 101 | group 'colab' |
127 | mode 0640 | 102 | mode 0640 |
128 | notifies :restart, 'service[colab]' | 103 | notifies :restart, 'service[colab]' |
129 | 104 | ||
130 | - get_gitlab_private_token = lambda do | 105 | + get_private_token = lambda do |
131 | Dir.chdir '/usr/lib/gitlab' do | 106 | Dir.chdir '/usr/lib/gitlab' do |
132 | `sudo -u git RAILS_ENV=production bundle exec rails runner \"puts User.find_by_name(\'admin-gitlab\').private_token\"`.strip | 107 | `sudo -u git RAILS_ENV=production bundle exec rails runner \"puts User.find_by_name(\'admin-gitlab\').private_token\"`.strip |
133 | end | 108 | end |
134 | end | 109 | end |
135 | 110 | ||
136 | - get_noosfero_private_token = lambda do | ||
137 | - Dir.chdir '/usr/lib/noosfero' do | ||
138 | - `sudo -u noosfero RAILS_ENV=production bundle exec rails runner \"puts User.find_by_name(\'admin-noosfero\').private_token\"`.strip | ||
139 | - end | ||
140 | - end | ||
141 | - | ||
142 | variables( | 111 | variables( |
143 | - :get_gitlab_private_token => get_gitlab_private_token, | ||
144 | - :get_noosfero_private_token => get_noosfero_private_token | 112 | + :get_private_token => get_private_token |
145 | ) | 113 | ) |
146 | end | 114 | end |
147 | 115 |
cookbooks/colab/templates/01-apps.yaml.erb
@@ -2,7 +2,6 @@ | @@ -2,7 +2,6 @@ | ||
2 | PROXIED_APPS: | 2 | PROXIED_APPS: |
3 | gitlab: | 3 | gitlab: |
4 | upstream: 'http://<%= node['peers']['integration'] %>:81/gitlab/' | 4 | upstream: 'http://<%= node['peers']['integration'] %>:81/gitlab/' |
5 | - private_token: '<%= @get_gitlab_private_token.call %>' | 5 | + private_token: '<%= @get_private_token.call %>' |
6 | noosfero: | 6 | noosfero: |
7 | upstream: 'http://<%= node['peers']['social'] %>:80/social/' | 7 | upstream: 'http://<%= node['peers']['social'] %>:80/social/' |
8 | - private_token: '<%= @get_noosfero_private_token.call %>' |