1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/vikunja_ynh.git synced 2024-09-03 18:06:26 +02:00

Merge pull request #3 from YunoHost-Apps/testing

Testing
This commit is contained in:
Éric Gaspar 2021-08-08 14:23:56 +02:00 committed by GitHub
commit 3a86776acb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 27 additions and 18 deletions

View file

@ -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

View file

@ -111,9 +111,10 @@ 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"
redis_db=$(ynh_redis_get_free_db)
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

View file

@ -37,6 +37,9 @@ 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"
#touch "/etc/vikunja/config.yml"
# Register (book) web path
ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url
@ -97,26 +100,15 @@ 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
#=================================================
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
chmod +x "/opt/vikunja/vikunja"
#=================================================
# NGINX CONFIGURATION
@ -126,6 +118,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
#=================================================

View file

@ -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

View file

@ -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
#=================================================

View file

@ -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