From 529d4beb3cab4b5743d2c44e67a9567cfb65fb5a Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 5 Aug 2021 23:37:04 +0200 Subject: [PATCH 1/6] Fix --- conf/{vikunja.src => api.src} | 0 scripts/install | 2 +- scripts/upgrade | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename conf/{vikunja.src => api.src} (100%) diff --git a/conf/vikunja.src b/conf/api.src similarity index 100% rename from conf/vikunja.src rename to conf/api.src diff --git a/scripts/install b/scripts/install index c7239c8..4783f40 100644 --- a/scripts/install +++ b/scripts/install @@ -114,7 +114,7 @@ ynh_add_config --template="../conf/config.yml" --destination="/etc/vikunja/confi ynh_script_progression --message="Installing backend..." --weight=15 tempdir="$(mktemp -d)" -ynh_setup_source --dest_dir=$tempdir --source_id=vikunja +ynh_setup_source --dest_dir=$tempdir --source_id=api ynh_exec_warn_less dpkg -i $tempdir/vikunja-unstable-amd64.deb chmod +x /opt/vikunja/vikunja diff --git a/scripts/upgrade b/scripts/upgrade index 189c788..609771e 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -86,7 +86,7 @@ then ynh_script_progression --message="Installing backend..." --weight=5 tempdir="$(mktemp -d)" - ynh_setup_source --dest_dir=$tempdir --source_id=vikunja + ynh_setup_source --dest_dir=$tempdir --source_id=api ynh_exec_warn_less dpkg -i $tempdir/vikunja-unstable-amd64.deb ynh_script_progression --message="Upgrading source files..." --weight=5 From 4648a9484f7ec59d9f6ae0271a95ade0865db6fa Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 7 Aug 2021 22:24:06 +0200 Subject: [PATCH 2/6] Update install --- scripts/install | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/scripts/install b/scripts/install index 4783f40..aecd1b8 100644 --- a/scripts/install +++ b/scripts/install @@ -37,6 +37,8 @@ ynh_script_progression --message="Validating installation parameters..." --weigh final_path=/var/www/$app test ! -e "$final_path" || ynh_die --message="This path already contains a folder" +mkdir -p "/etc/vikunja" + # Register (book) web path ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url @@ -97,17 +99,6 @@ chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" -#================================================= -# ADD A CONFIGURATION -#================================================= -ynh_script_progression --message="Adding a configuration file..." --weight=1 - -mkdir -p "/etc/vikunja" -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" - #================================================= # INSTALL BACKEND #================================================= @@ -126,6 +117,16 @@ ynh_script_progression --message="Configuring NGINX web server..." --weight=3 # Create a dedicated NGINX config ynh_add_nginx_config +#================================================= +# 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" + #================================================= # SETUP SYSTEMD #================================================= From 5addde9fd58f60230feae1f9dd12cd72c6e14eba Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 8 Aug 2021 09:24:05 +0200 Subject: [PATCH 3/6] Update install --- scripts/install | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index aecd1b8..b2671c9 100644 --- a/scripts/install +++ b/scripts/install @@ -38,6 +38,7 @@ final_path=/var/www/$app test ! -e "$final_path" || ynh_die --message="This path already contains a folder" mkdir -p "/etc/vikunja" +touch "/etc/vikunja/config.yml" # Register (book) web path ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url @@ -107,7 +108,7 @@ ynh_script_progression --message="Installing backend..." --weight=15 tempdir="$(mktemp -d)" ynh_setup_source --dest_dir=$tempdir --source_id=api ynh_exec_warn_less dpkg -i $tempdir/vikunja-unstable-amd64.deb -chmod +x /opt/vikunja/vikunja +chmod +x "/opt/vikunja/vikunja" #================================================= # NGINX CONFIGURATION From 3f38a8db2346cfc03ecdd4a054e23b78576162e3 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 8 Aug 2021 13:19:44 +0200 Subject: [PATCH 4/6] Fix --- scripts/install | 2 +- scripts/remove | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index b2671c9..1e035bd 100644 --- a/scripts/install +++ b/scripts/install @@ -38,7 +38,7 @@ final_path=/var/www/$app test ! -e "$final_path" || ynh_die --message="This path already contains a folder" mkdir -p "/etc/vikunja" -touch "/etc/vikunja/config.yml" +#touch "/etc/vikunja/config.yml" # Register (book) web path ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url diff --git a/scripts/remove b/scripts/remove index 27cefd7..00d6e5d 100644 --- a/scripts/remove +++ b/scripts/remove @@ -58,7 +58,7 @@ ynh_script_progression --message="Removing dependencies..." --weight=1 # Remove metapackage and its dependencies ynh_remove_app_dependencies -dpkg --remove vikunja +dpkg --purge vikunja #================================================= # REMOVE THE REDIS DATABASE From 560f24fa2d086bcf46a6422f2f54574666d9a92d Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 8 Aug 2021 14:00:19 +0200 Subject: [PATCH 5/6] fix --- scripts/backup | 2 ++ scripts/change_url | 4 ++-- scripts/restore | 6 +++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/scripts/backup b/scripts/backup index 2eaa6b2..f131305 100644 --- a/scripts/backup +++ b/scripts/backup @@ -37,6 +37,8 @@ ynh_print_info --message="Declaring files to be backed up..." #================================================= ynh_backup --src_path="$final_path" +ynh_backup --src_path="/etc/vikunja/config.yml" +ynh_backup --src_path="/opt/vikunja" #================================================= # BACKUP THE NGINX CONFIGURATION diff --git a/scripts/change_url b/scripts/change_url index 3200555..08a39e7 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -111,9 +111,9 @@ ynh_script_progression --message="Adding a configuration file..." --weight=1 domain="$new_domain" path="$new_path" -ynh_add_config --template="../conf/miniflux.conf" --destination="$final_path/$app.conf" +ynh_add_config --template="../conf/config.yml" --destination="/etc/vikunja/config.yml" -chmod 600 "$final_path/$app.conf" +chmod 600 "/etc/vikunja/config.yml" #================================================= # GENERIC FINALISATION diff --git a/scripts/restore b/scripts/restore index cc1e9c3..04b3a9f 100644 --- a/scripts/restore +++ b/scripts/restore @@ -66,9 +66,13 @@ ynh_restore_file --origin_path="$final_path" chmod 750 "$final_path" chmod -R o-rwx "$final_path" -chmod +x "$final_path/miniflux" chown -R $app:www-data "$final_path" +ynh_restore_file --origin_path="/etc/vikunja/config.yml" + +ynh_restore_file --origin_path="/opt/vikunja" +chmod +x "/opt/vikunja/vikunja" + #================================================= # REINSTALL DEPENDENCIES #================================================= From 37e96406b216398d41133b107384365ea17a4049 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 8 Aug 2021 14:23:34 +0200 Subject: [PATCH 6/6] Update change_url --- scripts/change_url | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/change_url b/scripts/change_url index 08a39e7..4fc8d54 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -111,6 +111,7 @@ ynh_script_progression --message="Adding a configuration file..." --weight=1 domain="$new_domain" path="$new_path" +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"