diff --git a/config/deploy.rb b/config/deploy.rb index 57d210e6..8519deb5 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -38,6 +38,7 @@ task :deploy do in_path(fetch(:current_path)) do command %{mkdir -p tmp/} command %{touch tmp/restart.txt} + command %{sudo systemctl restart osem-dj} end end end diff --git a/dist/apache-vhost.conf b/dist/apache-vhost.conf new file mode 100644 index 00000000..994593bf --- /dev/null +++ b/dist/apache-vhost.conf @@ -0,0 +1,45 @@ + + ServerAdmin admin@opensuse.org + ServerName events.opensuse.org + ServerAlias conference.opensuse.org + ServerAlias summit.opensuse.org + + DocumentRoot /home/osem/events/current/public + + CustomLog /home/osem/events/current/log/access.log combined + ErrorLog /home/osem/events/current/log/error.log + + RewriteEngine on + RewriteRule "^/conference/(.+)" "https://events.opensuse.org/conferences/$1" [R,L] + + # Serve assets and uploads directly + + ProxyPass ! + + + ProxyPass ! + + + # Pass the rest on to puma + ProxyPass / http://127.0.0.1:3000/ + ProxyPassReverse / http://127.0.0.1:3000/ + + # don't loose time with IP address lookups + HostnameLookups Off + UseCanonicalName Off + + # enable the footer on server-generated documents + ServerSignature On + + + Options FollowSymLinks + + + + Options FollowSymLinks + AllowOverride All + Options -MultiViews + Require all granted + + + diff --git a/dist/osem-dj.service b/dist/osem-dj.service new file mode 100644 index 00000000..53702769 --- /dev/null +++ b/dist/osem-dj.service @@ -0,0 +1,17 @@ +[Unit] +Description=Open Source Event Manager Delayed Jobs +Wants=osem.service +Before=osem.service + +[Service] +User=osem +EnvironmentFile=/home/osem/events/current/.env.production +WorkingDirectory=/home/osem/events/current +ExecStart = /usr/bin/bundle exec bin/delayed_job -e production start +ExecStop = /usr/bin/bundle exec bin/delayed_job -e production stop +Type = forking +PIDFile = /home/osem/events/current/tmp/pids/delayed_job.pid + +[Install] +WantedBy=multi-user.target + diff --git a/dist/osem.service b/dist/osem.service new file mode 100644 index 00000000..0c6ec304 --- /dev/null +++ b/dist/osem.service @@ -0,0 +1,13 @@ +[Unit] +Description=Open Source Event Manager +Wants=apache2.service +Before=apache2.service + +[Service] +User=osem +EnvironmentFile=/home/osem/events/current/.env.production +WorkingDirectory=/home/osem/events/current +ExecStart=/usr/bin/bundle exec puma -e production + +[Install] +WantedBy=multi-user.target