mirror of
https://github.com/YunoHost/SSOwat.git
synced 2024-09-03 20:06:27 +02:00
Make sure ssowat log file is created and exists when starting nginx/ssowat
This commit is contained in:
parent
1eb322df17
commit
d71075dfed
1 changed files with 9 additions and 3 deletions
12
init.lua
12
init.lua
|
@ -8,6 +8,10 @@
|
|||
-- another.
|
||||
--
|
||||
|
||||
-- Path of the configuration
|
||||
conf_path = "/etc/ssowat/conf.json"
|
||||
log_file = "/var/log/nginx/ssowat.log"
|
||||
|
||||
-- Remove prepending '@' & trailing 'init.lua'
|
||||
script_path = string.sub(debug.getinfo(1).source, 2, -9)
|
||||
|
||||
|
@ -23,6 +27,11 @@ local socket = require "socket"
|
|||
local config = require "config"
|
||||
lustache = require "lustache"
|
||||
|
||||
-- Make sure the log file exists and we can write in it
|
||||
io.popen("touch "..log_file)
|
||||
io.popen("chown www-data "..log_file)
|
||||
io.popen("chmod u+w "..log_file)
|
||||
|
||||
-- Persistent shared table
|
||||
flashs = {}
|
||||
i18n = {}
|
||||
|
@ -54,8 +63,5 @@ for file in lfs.dir(locale_dir) do
|
|||
end
|
||||
end
|
||||
|
||||
-- Path of the configuration
|
||||
conf_path = "/etc/ssowat/conf.json"
|
||||
|
||||
-- You should see that in your Nginx error logs by default
|
||||
ngx.log(ngx.INFO, "SSOwat ready")
|
||||
|
|
Loading…
Reference in a new issue