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 #28 from YunoHost-Apps/Multi

Multi install
This commit is contained in:
Éric Gaspar 2022-06-16 06:17:13 +02:00 committed by GitHub
commit f411c59d51
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 26 additions and 26 deletions

View file

@ -7,8 +7,8 @@ Requires=postgresql.service redis.service
Type=simple
User=__APP__
Group=__APP__
WorkingDirectory=/opt/vikunja
ExecStart=/opt/vikunja/vikunja
WorkingDirectory=/opt/__APP__
ExecStart=/opt/__APP__/vikunja
RestartSec=2s
Restart=always

View file

@ -22,7 +22,7 @@
"requirements": {
"yunohost": ">= 4.3.0"
},
"multi_instance": false,
"multi_instance": true,
"services": [
"nginx"
],

View file

@ -40,10 +40,10 @@ ynh_print_info --message="Declaring files to be backed up..."
ynh_backup --src_path="$final_path"
# Config
ynh_backup --src_path="/etc/vikunja/config.yml"
ynh_backup --src_path="/etc/$app/config.yml"
# Backend
ynh_backup --src_path="/opt/vikunja"
ynh_backup --src_path="/opt/$app"
#=================================================
# BACKUP THE NGINX CONFIGURATION

View file

@ -117,9 +117,9 @@ 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"
ynh_add_config --template="../conf/config.yml" --destination="/etc/$app/config.yml"
chmod 600 "/etc/vikunja/config.yml"
chmod 600 "/etc/$app/config.yml"
#=================================================
# GENERIC FINALISATION

View file

@ -108,15 +108,15 @@ chown -R $app:www-data "$final_path"
ynh_script_progression --message="Setting up backend..." --weight=1
# Download, check integrity, uncompress and patch the source from app.src
mkdir -p "/opt/vikunja"
mkdir -p "/opt/vikunja/files"
mkdir -p "/opt/$app"
mkdir -p "/opt/$app/files"
tempdir="$(mktemp -d)"
ynh_setup_source --dest_dir=$tempdir --source_id=$YNH_ARCH
back="$(find $tempdir -name "vikunja-*" \! -name "*.sha256")"
cp "$back" "/opt/vikunja/vikunja"
cp "$back" "/opt/$app/vikunja"
chmod +x "/opt/vikunja/vikunja"
chown -R $app:www-data "/opt/vikunja/files"
chmod +x "/opt/$app/vikunja"
chown -R $app:www-data "/opt/$app/files"
#=================================================
# NGINX CONFIGURATION
@ -131,12 +131,12 @@ ynh_add_nginx_config
#=================================================
ynh_script_progression --message="Adding a configuration file..." --weight=1
mkdir -p "/etc/vikunja"
mkdir -p "/etc/$app"
redis_db=$(ynh_redis_get_free_db)
ynh_add_config --template="../conf/config.yml" --destination="/etc/vikunja/config.yml"
ynh_add_config --template="../conf/config.yml" --destination="/etc/$app/config.yml"
chmod 400 "/etc/vikunja/config.yml"
chown $app:$app "/etc/vikunja/config.yml"
chmod 400 "/etc/$app/config.yml"
chown $app:$app "/etc/$app/config.yml"
#=================================================
# SETUP SYSTEMD

View file

@ -98,7 +98,7 @@ ynh_system_user_delete --username=$app
ynh_script_progression --message="Removing backend..." --weight=1
# Delete /opt/vikunja
ynh_secure_remove --file="/opt/vikunja"
ynh_secure_remove --file="/opt/$app"
#=================================================
# END OF SCRIPT

View file

@ -66,12 +66,12 @@ chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"
# Config
ynh_restore_file --origin_path="/etc/vikunja/config.yml"
ynh_restore_file --origin_path="/etc/$app/config.yml"
# Backend
ynh_restore_file --origin_path="/opt/vikunja"
chmod +x "/opt/vikunja/vikunja"
chown -R $app:www-data "/opt/vikunja/files"
ynh_restore_file --origin_path="/opt/$app"
chmod +x "/opt/$app/vikunja"
chown -R $app:www-data "/opt/$app/files"
#=================================================
# REINSTALL DEPENDENCIES

View file

@ -103,21 +103,21 @@ then
# Download, check integrity, uncompress and patch the source from app.src
# Frontend
ynh_setup_source --dest_dir="$final_path" --source_id="front" --keep="/etc/vikunja/config.yml"
ynh_setup_source --dest_dir="$final_path" --source_id="front" --keep="/etc/$app/config.yml"
# Backend
mkdir -p "/opt/vikunja/files"
mkdir -p "/opt/$app/files"
tempdir="$(mktemp -d)"
ynh_setup_source --dest_dir=$tempdir --source_id=$YNH_ARCH
back="$(find $tempdir -name "vikunja-*" \! -name "*.sha256")"
cp "$back" "/opt/vikunja/vikunja"
cp "$back" "/opt/$app/vikunja"
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"
chmod +x "/opt/$app/vikunja"
chown -R $app:www-data "/opt/$app/files"
#=================================================
# NGINX CONFIGURATION