From ca6836181e0e929f27ae15430ae9579fc92dd6e8 Mon Sep 17 00:00:00 2001 From: liberodark Date: Thu, 11 Apr 2019 11:27:10 +0200 Subject: [PATCH] update --- conf/systemd.service | 16 ++++++++++++++++ scripts/install | 29 ++++++++++++++++++++--------- 2 files changed, 36 insertions(+), 9 deletions(-) create mode 100644 conf/systemd.service diff --git a/conf/systemd.service b/conf/systemd.service new file mode 100644 index 0000000..820abc5 --- /dev/null +++ b/conf/systemd.service @@ -0,0 +1,16 @@ +[Unit] +Description=opentracker +After=network.target + +[Service] +WorkingDirectory=/opt/opentracker +User=admin +Group=users +Type=simple +UMask=000 +ExecStart=/opt/opentracker/opentracker & +RestartSec=15 +Restart=always + +[Install] +WantedBy=multi-user.target diff --git a/scripts/install b/scripts/install index 025c0c0..46960f5 100644 --- a/scripts/install +++ b/scripts/install @@ -47,7 +47,7 @@ app=$YNH_APP_INSTANCE_NAME ### If the app uses nginx as web server (written in HTML/PHP in most cases), the final path should be "/var/www/$app". ### If the app provides an internal web server (or uses another application server such as uwsgi), the final path should be "/opt/yunohost/$app" -final_path=/opt/yunohost/$app +final_path=/opt/$app test ! -e "$final_path" || ynh_die "This path already contains a folder" # Normalize the url path syntax @@ -79,11 +79,6 @@ ynh_print_info "Installing dependencies..." ### - As well as the section "REINSTALL DEPENDENCIES" in the restore script ### - And the section "UPGRADE DEPENDENCIES" in the upgrade script -wget -O - https://repo.jellyfin.org/debian/jellyfin_team.gpg.key | apt-key add - -echo "deb [arch=amd64] https://repo.jellyfin.org/debian $( lsb_release -c -s ) main" >> /etc/apt/sources.list.d/jellyfin.list - -ynh_package_update - ynh_install_app_dependencies jellyfin #================================================= @@ -96,11 +91,27 @@ ynh_install_app_dependencies jellyfin ### - Remove the section "CLOSE A PORT" in the remove script # Find a free port -port=$(ynh_find_port 8096) +port=$(ynh_find_port 6969) # Open this port -yunohost firewall allow --no-upnp TCP $port 2>&1 +yunohost firewall allow --no-upnp UDP $port 2>&1 ynh_app_setting_set $app port $port +#================================================= +# DOWNLOAD, CHECK AND UNPACK SOURCE +#================================================= +ynh_print_info "Installing OpenTracker..." + +ynh_app_setting_set $app final_path $final_path +# Download, check integrity, uncompress and patch the source from app.src +ynh_setup_source "$final_path" "front" + +#================================================= +# SETUP SYSTEMD +#================================================= + +ynh_add_systemd_config +systemctl enable $app.service + #================================================= # NGINX CONFIGURATION #================================================= @@ -145,7 +156,7 @@ ynh_system_user_create $app ### that really need such authorization. # Set permissions to app files -#chown -R root: /etc/loolwsd +chown -R $app:$app $final_path #=================================================