finishing touches to gxg.service

This commit is contained in:
G. Gibson 2024-04-28 18:47:33 -07:00
parent 74b120416d
commit 0125b2179c
3 changed files with 14 additions and 16 deletions

View file

@ -1,4 +1,4 @@
#!/usr/bin/env ruby
#!/usr/bin/env jruby
#
# ### Standard Ruby is fine for small installations and development.
# ### JRuby is best for scaled production as it uses *real* threads for each request.
@ -40,10 +40,13 @@ www_paths[:www_javascript] = "#{www_paths[:www_public]}/javascript"
www_paths[:www_images] = "#{www_paths[:www_public]}/images"
www_paths[:www_audio] = "#{www_paths[:www_public]}/audio"
www_paths[:www_video] = "#{www_paths[:www_public]}/video"
# TODO: work out how to publish files to the public (cdn-style) no matter the internal origin.
www_paths[:www_files] = "#{www_paths[:www_public]}/files"
www_paths.values.each do |a_path|
unless Dir.exist?(a_path)
begin
FileUtils.mkpath(a_path, 0755)
# FileUtils.mkpath(a_path, 0755)
FileUtils.mkpath(a_path)
rescue Exception => error
log_error({:error => error, :parameters => a_path})
end
@ -69,7 +72,7 @@ class Node0 < Sinatra::Application
set :public_folder, ::GxG::SYSTEM_PATHS[:www_public]
set :logging, true
set :logger, ::GxG::LOG
secret = ::GxG::uuid_generate.to_s + ::GxG::uuid_generate.to_s
secret = (::GxG::uuid_generate.to_s + "-" + ::GxG::uuid_generate.to_s)
set :session_secret, secret
use Rack::Session::Pool, {:expire_after => 318513600, :secure => true}
use Rack::Session::Cookie, {:key => 'rack.session', :path => '/', :expire_after => 318513600, :secret => secret, :secure => true}

View file

@ -8,18 +8,12 @@ Type=simple
User=root
WorkingDirectory=/srv/gxg-server
#ExecStart=/srv/gxg-server/daemon start
#ExecStop=/srv/gxg-server/daemon stop
#ExecStart=/usr/bin/sudo -u www-data /usr/bin/env jruby /srv/gxg-server/Services/core.rb
#ExecStart=/usr/bin/sudo -u mistergibson /usr/bin/env jruby /srv/gxg-server/Services/core.rb
ExecStart=/usr/bin/sudo -u mistergibson /srv/gxg-server/daemon start
PIDFile=/srv/gxg-server/System/Temporary/server.pid
ExecStop=/usr/bin/sudo -u mistergibson /srv/gxg-server/daemon stop
ExecStart=/usr/bin/sudo -u mistergibson /srv/gxg-server/server start
PIDFile=/srv/gxg-server/System/Temporary/server.pid
ExecStop=/usr/bin/sudo -u mistergibson /srv/gxg-server/server stop
Restart=always

View file

@ -9,10 +9,11 @@ User=root
WorkingDirectory=/srv/gxg-server
#ExecStart=/srv/gxg-server/daemon start
#ExecStop=/srv/gxg-server/daemon stop
ExecStart=/usr/bin/env jruby /srv/gxg-server/Services/core.rb
ExecStop=/srv/gxg-server/daemon stop
ExecStart=/usr/bin/sudo -u www-data /srv/gxg-server/server start --quiet
PIDFile=/srv/gxg-server/System/Temporary/server.pid
ExecStop=/usr/bin/sudo -u www-data /srv/gxg-server/server stop
Restart=always