Skip to content
Snippets Groups Projects
funkwhale_server 973 B
Newer Older
#!/bin/sh

# PROVIDE: funkwhale_server
# REQUIRE: LOGIN postgresql nginx redis
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable funkwhale_server:
# funkwhale_server (bool):        Set it to "YES" to enable Funkwhale web server.
#                                 Default is "NO".

PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin

. /etc/rc.subr

desc="Funkwhale server"
name=funkwhale_server
rcvar=funkwhale_server_enable

load_rc_config $name

: ${funkwhale_server_enable:=NO}

funkwhale_server_chdir="/usr/local/www/funkwhale/api"
funkwhale_server_user=funkwhale
funkwhale_server_env=$(cat /usr/local/www/funkwhale/config/.env | grep -v ^# | xargs)
command_interpreter="/usr/local/www/funkwhale/virtualenv/bin/python3"

command="/usr/local/www/funkwhale/virtualenv/bin/daphne"
command_args="-b 127.0.0.1 -p 5000 config.asgi:application --proxy-headers \
>> /var/log/funkwhale/${name##funkwhale_}.log 2>&1 &"

run_rc_command "$1"