Commit c5e829e3 authored by HQ's avatar HQ
Browse files

Various improvements

parent 861b7100
......@@ -8,7 +8,7 @@ $gw = "$ip.1" if ($ip);
my $appinfo_ref = get_appinfo();
if (!$appinfo_ref) {
sleep 5;
sleep 10;
$appinfo_ref = get_appinfo();
}
if (!$appinfo_ref) {
......@@ -43,8 +43,6 @@ unless (-e '/etc/discourse.seeded') {
print `sudo -u postgres psql discourse -c "CREATE EXTENSION hstore;"`;
print `sudo -u postgres psql discourse -c "CREATE EXTENSION pg_trgm;"`;
print `cd /var/discourse ; RAILS_ENV=production bundle exec rake db:migrate`;
print `cd /var/discourse ; RAILS_ENV=production bundle exec rake assets:precompile`;
my $me_json = `curl -k --silent https://$gw/stabile/users/me`;
my $me_ref = from_json($me_json);
my $email = $me_ref->[0]->{'email'};
......@@ -58,10 +56,14 @@ unless (-e '/etc/discourse.seeded') {
`perl -pi -e 's/smtp_domain =.*/smtp_domain = $dom/g' /var/discourse/config/discourse.conf`;
`perl -pi -e 's/myhostname =.*/myhostname = $dom/g' /var/discourse/config/discourse.conf`;
print `sudo -u postgres psql discourse -c "UPDATE site_settings SET value = 'noreply\@$dom' WHERE name = 'notification_email';"`;
`systemctl restart postfix`;
print `cd /var/discourse ; RAILS_ENV=production bundle exec rake db:migrate`;
print `cd /var/discourse ; RAILS_ENV=production bundle exec rake assets:precompile`;
`chown -R www-data:www-data /var/www`;
`chown -R www-data:www-data /var/discourse`;
`systemctl restart postfix`;
`systemctl restart apache2`;
`touch /etc/discourse.seeded`;
}
......
......@@ -341,8 +341,8 @@ if (!$rebuild && -e "$cwd/$dname.master.qcow2") { # Master image already exists,
[Unit]
DefaultDependencies=no
Description=Stabile $dname
After=network-online.target stabile-ubuntu.target
Wants=network-online.target
After=network-online.target stabile-ubuntu.service webmin.service
Wants=network-online.target stabile-ubuntu.service webmin.service
[Service]
Type=oneshot
......
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