diff --git a/conf/config.yml b/conf/config.yml index 384ad0f..88b1401 100644 --- a/conf/config.yml +++ b/conf/config.yml @@ -10,7 +10,7 @@ service: # The base path on the file system where the binary and assets are. # Vikunja will also look in this path for a config file, so you could provide only this variable to point to a folder # with a config file which will then be used. - rootpath: "/opt/vikunja/" + rootpath: "__FINALPATH__" # The max number of items which can be returned per page maxitemsperpage: 50 # Enable the caldav endpoint, see the docs for more details diff --git a/conf/systemd.service b/conf/systemd.service index 8f38aa5..59181d0 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -7,8 +7,8 @@ Requires=postgresql.service redis.service Type=simple User=__APP__ Group=__APP__ -WorkingDirectory=/opt/vikunja -ExecStart=/opt/vikunja/vikunja +WorkingDirectory=__FINALPATH__/ +ExecStart=__FINALPATH__/vikunja RestartSec=2s Restart=always diff --git a/scripts/install b/scripts/install index 33a90ef..81509de 100644 --- a/scripts/install +++ b/scripts/install @@ -99,23 +99,14 @@ ynh_script_progression --message="Setting up source files..." --weight=1 ynh_app_setting_set --app=$app --key=final_path --value=$final_path # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" --source_id="front" +ynh_setup_source --dest_dir="$final_path" --source_id="$architecture" + +mkdir -p "$final_path/files" chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" - -#================================================= -# INSTALL BACKEND -#================================================= -ynh_script_progression --message="Installing backend..." --weight=15 - -mkdir -p "/opt/vikunja" -mkdir -p "/opt/vikunja/files" - -ynh_setup_source --dest_dir="/opt/vikunja" --source_id="$architecture" - -chmod +x "/opt/vikunja/vikunja" -chown -R $app:www-data "/opt/vikunja/files" +chmod +x "$final_path/vikunja" #================================================= # NGINX CONFIGURATION diff --git a/scripts/upgrade b/scripts/upgrade index 9d1a724..508fe1c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -99,17 +99,11 @@ ynh_system_user_create --username=$app --home_dir="$final_path" if [ "$upgrade_type" == "UPGRADE_APP" ] then - ynh_script_progression --message="Installing backend..." --weight=5 - - tempdir="$(mktemp -d)" - ynh_setup_source --dest_dir=$tempdir --source_id=api - ynh_exec_warn_less N | dpkg -i $tempdir/vikunja-unstable-amd64.deb - ynh_script_progression --message="Upgrading source files..." --weight=5 # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" --source_id="front" --keep="/etc/vikunja/config.yml" - + ynh_setup_source --dest_dir="$final_path" --source_id="$architecture" mkdir -p "/opt/vikunja/files" fi @@ -117,18 +111,8 @@ fi chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" -chmod +x "/opt/vikunja/vikunja" -chown -R $app:www-data "/opt/vikunja/files" - -#================================================= -# ADD A CONFIGURATION -#================================================= -#ynh_script_progression --message="Adding a configuration file..." --weight=1 - -# redis_db=$(ynh_redis_get_free_db) -# ynh_add_config --template="../conf/config.yml" --destination="/etc/vikunja/config.yml" - -#chmod 600 "/etc/vikunja/config.yml" +chmod +x "$final_path/vikunja" +chown -R $app:www-data "$final_path/files" #================================================= # NGINX CONFIGURATION