diff --git a/conf/supervisord.conf b/conf/supervisord.conf deleted file mode 100644 index bcfc715..0000000 --- a/conf/supervisord.conf +++ /dev/null @@ -1,16 +0,0 @@ -[supervisord] -loglevel=info -nodaemon=true -user=root - -[program:nginx] -command=/usr/local/nginx/sbin/nginx -g "daemon off;" -autostart=true -autorestart=true -priority=10 -stdout_events_enabled=true -stderr_events_enabled=true -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 \ No newline at end of file diff --git a/www/samkomur.lua b/www/samkomur.lua index 7acd3ba..56bd60d 100644 --- a/www/samkomur.lua +++ b/www/samkomur.lua @@ -4,7 +4,7 @@ local function ends_with(str, ending) return ending == "" or str:sub(-#ending) == ending end -local p = io.popen('ls -a "/content/kennslur"') +local p = io.popen('ls -a "/srv/filo_web/kennslur"') for file in p:lines() do if ends_with(file, '.mp4') and not ends_with(file, 'klippt.mp4') then table.insert(files, file) diff --git a/www/samkomur_json.lua b/www/samkomur_json.lua index cd6f498..1373cdf 100644 --- a/www/samkomur_json.lua +++ b/www/samkomur_json.lua @@ -21,7 +21,7 @@ local function ends_with(str, ending) return ending == "" or str:sub(-#ending) == ending end -local p = io.popen('ls -a "/content/kennslur"') +local p = io.popen('ls -a "/srv/filo_web/kennslur"') for file in p:lines() do if ends_with(file, '.mp4') and not ends_with(file, 'klippt.mp4') then table.insert(files, file) diff --git a/www/start_the_recording.lua b/www/start_the_recording.lua index 759c4fc..7be289e 100644 --- a/www/start_the_recording.lua +++ b/www/start_the_recording.lua @@ -1,9 +1,16 @@ -if not ngx.var.arg_output then +local arg_output = ngx.var.arg_output + +if not arg_output then ngx.say("Missing query 'output'") return end -assert(io.popen("/usr/bin/ffmpeg -y -i 'rtmp://192.168.93.59:1935/live/ljosbrot live=1' -vcodec copy -acodec copy /content/kennslur/".. ngx.var.arg_output ..".mp4 /dev/null 2>/dev/null &")) +if not (arg_output:gsub("[A-Za-z0-9_.]","")=="") then + ngx.say("Invalid query 'output'") + return +end + +assert(io.popen("/usr/bin/ffmpeg -y -i 'rtmp://192.168.93.58:1935/live/ljosbrot live=1' -vcodec copy -acodec copy /srv/filo_web/kennslur/".. arg_output ..".mp4 /dev/null 2>/dev/null &")) ngx.say([[