Fix bug where users can't connect to Master source due to hardcoded path in liquidsoap

This commit is contained in:
Duncan Sommerville 2015-05-21 12:49:26 -04:00
parent 2f20729e05
commit 196e08fc90
2 changed files with 6 additions and 3 deletions

View file

@ -1,4 +1,5 @@
import logging import logging
import os
import sys import sys
import time import time
import traceback import traceback
@ -23,7 +24,9 @@ def generate_liquidsoap_config(ss):
str_buffer = "%s = %s\n" % (key, val) str_buffer = "%s = %s\n" % (key, val)
fh.write(str_buffer.encode('utf-8')) fh.write(str_buffer.encode('utf-8'))
auth_path = os.path.dirname(os.path.realpath(__file__))
fh.write('log_file = "/var/log/airtime/pypo-liquidsoap/<script>.log"\n') fh.write('log_file = "/var/log/airtime/pypo-liquidsoap/<script>.log"\n')
fh.write('auth_path = "%s/liquidsoap_auth.py"\n' % auth_path)
fh.close() fh.close()
def run(): def run():

View file

@ -3,7 +3,7 @@
set("log.file.path", log_file) set("log.file.path", log_file)
set("server.telnet", true) set("server.telnet", true)
set("server.telnet.port", 1234) set("server.telnet.port", 1234)
set("init.daemon.pidfile.path", "/var/run/airtime/airtime-liquidsoap.pid") # set("init.daemon.pidfile.path", "/var/run/airtime/airtime-liquidsoap.pid")
%include "library/pervasives.liq" %include "library/pervasives.liq"
@ -213,7 +213,7 @@ end
def check_master_dj_client(user,password) = def check_master_dj_client(user,password) =
log("master connected") log("master connected")
#get the output of the php script #get the output of the php script
ret = get_process_lines("python /usr/lib/airtime/pypo/bin/liquidsoap_scripts/liquidsoap_auth.py --master #{user} #{password}") ret = get_process_lines("python #{auth_path} --master #{user} #{password}")
#ret has now the value of the live client (dj1,dj2, or djx), or "ERROR"/"unknown" ... #ret has now the value of the live client (dj1,dj2, or djx), or "ERROR"/"unknown" ...
ret = list.hd(ret) ret = list.hd(ret)
@ -224,7 +224,7 @@ end
def check_dj_client(user,password) = def check_dj_client(user,password) =
log("live dj connected") log("live dj connected")
#get the output of the php script #get the output of the php script
ret = get_process_lines("python /usr/lib/airtime/pypo/bin/liquidsoap_scripts/liquidsoap_auth.py --dj #{user} #{password}") ret = get_process_lines("python #{auth_path} --dj #{user} #{password}")
#ret has now the value of the live client (dj1,dj2, or djx), or "ERROR"/"unknown" ... #ret has now the value of the live client (dj1,dj2, or djx), or "ERROR"/"unknown" ...
hd = list.hd(ret) hd = list.hd(ret)
log("Live DJ authenticated: #{hd}") log("Live DJ authenticated: #{hd}")