mirror of
https://github.com/YunoHost-Apps/zeronet_ynh.git
synced 2024-09-03 17:46:12 +02:00
Sets zeronet --ui_host start parameter
to value of yunohost domain the zeronet app is running on. Otherwise access would be denied with "invalid host forbidden".
This commit is contained in:
parent
5e488f188b
commit
98d7ee352c
2 changed files with 4 additions and 2 deletions
|
@ -4,7 +4,7 @@ After=network.target
|
|||
|
||||
[Service]
|
||||
User=__USER__
|
||||
ExecStart=/usr/bin/python2 ./zeronet.py --ui_port __UI_PORT__ --data_dir __DATA_DIR__ --log_dir __LOG_DIR__
|
||||
ExecStart=/usr/bin/python2 ./zeronet.py --ui_port __UI_PORT__ --ui_host __UI_HOST__ --data_dir __DATA_DIR__ --log_dir __LOG_DIR__
|
||||
WorkingDirectory=__WORKING_DIRECTORY__
|
||||
ExecReload=/bin/kill -HUP $MAINPID
|
||||
KillMode=process
|
||||
|
|
|
@ -50,6 +50,7 @@ update_systemd_configuration() {
|
|||
local port=$6
|
||||
local symlink_to_deploy_path=$7
|
||||
local zeronet_dir=$8
|
||||
local ui_host=$9
|
||||
|
||||
# create zeronet user data location
|
||||
local data_dir=$zeronet_dir/data
|
||||
|
@ -64,6 +65,7 @@ update_systemd_configuration() {
|
|||
|
||||
sudo sed --in-place "s@__USER__@$user@g" $service_file
|
||||
sudo sed --in-place "s@__UI_PORT__@$port@g" $service_file
|
||||
sudo sed --in-place "s@__UI_HOST__@$ui_host@g" $service_file
|
||||
sudo sed --in-place "s@__APP_NAME__@$app@g" $service_file
|
||||
sudo sed --in-place "s@__WORKING_DIRECTORY__@$symlink_to_deploy_path@g" $service_file
|
||||
sudo sed --in-place "s@__DATA_DIR__@$data_dir@g" $service_file
|
||||
|
@ -142,7 +144,7 @@ main() {
|
|||
|
||||
update_nginx_configuration $app $nginx_config_template $nginx_config_file $path $port
|
||||
update_systemd_configuration $app $systemd_service_template $systemd_service_name $systemd_service_file \
|
||||
$user $port $symlink_to_deploy_path $user_zeronet_dir
|
||||
$user $port $symlink_to_deploy_path $user_zeronet_dir $domain
|
||||
}
|
||||
|
||||
main
|
||||
|
|
Loading…
Reference in a new issue