Commit a36c2895 authored by HQ's avatar HQ
Browse files

Various improvements

parent be803e0e
...@@ -51,7 +51,8 @@ unless (-e '/etc/discourse.seeded') { ...@@ -51,7 +51,8 @@ unless (-e '/etc/discourse.seeded') {
print `cd /var/discourse ; RAILS_ENV=production bundle exec rake db:migrate >> /tmp/discourse.out 2>&1`; print `cd /var/discourse ; RAILS_ENV=production bundle exec rake db:migrate >> /tmp/discourse.out 2>&1`;
print `cd /var/discourse ; RAILS_ENV=production bundle exec rake assets:precompile >> /tmp/discourse.out 2>&1`; print `cd /var/discourse ; RAILS_ENV=production bundle exec rake assets:precompile >> /tmp/discourse.out 2>&1`;
# We do it twice because, well, Rails... # We do it thrice because, well, Rails...
print `cd /var/discourse ; RAILS_ENV=production bundle exec rake assets:precompile >> /tmp/discourse.out 2>&1`;
print `cd /var/discourse ; RAILS_ENV=production bundle exec rake assets:precompile >> /tmp/discourse.out 2>&1`; print `cd /var/discourse ; RAILS_ENV=production bundle exec rake assets:precompile >> /tmp/discourse.out 2>&1`;
my $me_json = `curl -k --silent https://$gw/stabile/users/me`; my $me_json = `curl -k --silent https://$gw/stabile/users/me`;
...@@ -68,14 +69,14 @@ unless (-e '/etc/discourse.seeded') { ...@@ -68,14 +69,14 @@ unless (-e '/etc/discourse.seeded') {
print `perl -pi -e 's/(DocumentRoot .*)/DocumentRoot \\/var\\/discourse\\/public\\nRailsBaseURI \\/\\nPassengerBaseURI \\/\\nPassengerResolveSymlinksInDocumentRoot on\\nPassengerAppRoot \\/var\\/discourse\\n/g' /etc/apache2/sites-available/000-default.conf`; print `perl -pi -e 's/(DocumentRoot .*)/DocumentRoot \\/var\\/discourse\\/public\\nRailsBaseURI \\/\\nPassengerBaseURI \\/\\nPassengerResolveSymlinksInDocumentRoot on\\nPassengerAppRoot \\/var\\/discourse\\n/g' /etc/apache2/sites-available/000-default.conf`;
} }
`chown -R www-data:www-data /var/www`;
`chown -R www-data:www-data /var/discourse`;
`perl -pi -e 's/PrivateTmp=true/PrivateTemp=false/' /lib/systemd/system/apache2.service`; `perl -pi -e 's/PrivateTmp=true/PrivateTemp=false/' /lib/systemd/system/apache2.service`;
`systemctl daemon-reload`; `systemctl daemon-reload`;
`systemctl restart postfix`; `systemctl restart postfix`;
`systemctl restart apache2`; `systemctl restart apache2`;
`touch /etc/discourse.seeded`; `touch /etc/discourse.seeded`;
} }
`chown -R www-data:www-data /var/www`;
`chown -R www-data:www-data /var/discourse`;
system("cd /var/discourse ; RAILS_ENV=production bundle exec sidekiq -C config/sidekiq.yml &"); system("cd /var/discourse ; RAILS_ENV=production bundle exec sidekiq -C config/sidekiq.yml &");
sub get_internalip { sub get_internalip {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment