mirror of
https://github.com/mistergibson/gxg-server.git
synced 2026-08-15 10:24:29 -07:00
finishing touches to gxg.service
This commit is contained in:
parent
74b120416d
commit
0125b2179c
3 changed files with 14 additions and 16 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env ruby
|
#!/usr/bin/env jruby
|
||||||
#
|
#
|
||||||
# ### Standard Ruby is fine for small installations and development.
|
# ### Standard Ruby is fine for small installations and development.
|
||||||
# ### JRuby is best for scaled production as it uses *real* threads for each request.
|
# ### 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_images] = "#{www_paths[:www_public]}/images"
|
||||||
www_paths[:www_audio] = "#{www_paths[:www_public]}/audio"
|
www_paths[:www_audio] = "#{www_paths[:www_public]}/audio"
|
||||||
www_paths[:www_video] = "#{www_paths[:www_public]}/video"
|
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|
|
www_paths.values.each do |a_path|
|
||||||
unless Dir.exist?(a_path)
|
unless Dir.exist?(a_path)
|
||||||
begin
|
begin
|
||||||
FileUtils.mkpath(a_path, 0755)
|
# FileUtils.mkpath(a_path, 0755)
|
||||||
|
FileUtils.mkpath(a_path)
|
||||||
rescue Exception => error
|
rescue Exception => error
|
||||||
log_error({:error => error, :parameters => a_path})
|
log_error({:error => error, :parameters => a_path})
|
||||||
end
|
end
|
||||||
|
|
@ -69,7 +72,7 @@ class Node0 < Sinatra::Application
|
||||||
set :public_folder, ::GxG::SYSTEM_PATHS[:www_public]
|
set :public_folder, ::GxG::SYSTEM_PATHS[:www_public]
|
||||||
set :logging, true
|
set :logging, true
|
||||||
set :logger, ::GxG::LOG
|
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
|
set :session_secret, secret
|
||||||
use Rack::Session::Pool, {:expire_after => 318513600, :secure => true}
|
use Rack::Session::Pool, {:expire_after => 318513600, :secure => true}
|
||||||
use Rack::Session::Cookie, {:key => 'rack.session', :path => '/', :expire_after => 318513600, :secret => secret, :secure => true}
|
use Rack::Session::Cookie, {:key => 'rack.session', :path => '/', :expire_after => 318513600, :secret => secret, :secure => true}
|
||||||
|
|
|
||||||
|
|
@ -8,18 +8,12 @@ Type=simple
|
||||||
User=root
|
User=root
|
||||||
|
|
||||||
WorkingDirectory=/srv/gxg-server
|
WorkingDirectory=/srv/gxg-server
|
||||||
#ExecStart=/srv/gxg-server/daemon start
|
|
||||||
#ExecStop=/srv/gxg-server/daemon stop
|
ExecStart=/usr/bin/sudo -u mistergibson /srv/gxg-server/server start
|
||||||
#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
|
|
||||||
|
|
||||||
PIDFile=/srv/gxg-server/System/Temporary/server.pid
|
PIDFile=/srv/gxg-server/System/Temporary/server.pid
|
||||||
|
|
||||||
|
ExecStop=/usr/bin/sudo -u mistergibson /srv/gxg-server/server stop
|
||||||
|
|
||||||
Restart=always
|
Restart=always
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,10 +9,11 @@ User=root
|
||||||
|
|
||||||
WorkingDirectory=/srv/gxg-server
|
WorkingDirectory=/srv/gxg-server
|
||||||
|
|
||||||
#ExecStart=/srv/gxg-server/daemon start
|
ExecStart=/usr/bin/sudo -u www-data /srv/gxg-server/server start --quiet
|
||||||
#ExecStop=/srv/gxg-server/daemon stop
|
|
||||||
ExecStart=/usr/bin/env jruby /srv/gxg-server/Services/core.rb
|
PIDFile=/srv/gxg-server/System/Temporary/server.pid
|
||||||
ExecStop=/srv/gxg-server/daemon stop
|
|
||||||
|
ExecStop=/usr/bin/sudo -u www-data /srv/gxg-server/server stop
|
||||||
|
|
||||||
Restart=always
|
Restart=always
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue