1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/vikunja_ynh.git synced 2024-09-03 18:06:26 +02:00
This commit is contained in:
Éric Gaspar 2024-07-29 21:56:27 +02:00
parent 64a3337545
commit 6bc10dd6a0
10 changed files with 26 additions and 58 deletions

View file

@ -21,7 +21,7 @@ service:
# The base path on the file system where the binary and assets are. # 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 # 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. # with a config file which will then be used.
rootpath: "/opt/vikunja/" rootpath: "__INSTALL_DIR__/backend"
# Path on the file system to serve static files from. Set to the path of the frontend files to host frontend alongside the api. # Path on the file system to serve static files from. Set to the path of the frontend files to host frontend alongside the api.
staticpath: "" staticpath: ""
# The max number of items which can be returned per page # The max number of items which can be returned per page

View file

@ -2,7 +2,7 @@
location __PATH__/ { location __PATH__/ {
# Path to source # Path to source
alias __INSTALL_DIR__/; alias __INSTALL_DIR__/front/;
try_files $uri $uri/ /; try_files $uri $uri/ /;

View file

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

View file

@ -13,7 +13,7 @@ services = ["__APP__"]
ask.fr = "Définir le MOTD" ask.fr = "Définir le MOTD"
type = "string" type = "string"
help = "Set the MOTD message shown in Vikunja login page" help = "Set the MOTD message shown in Vikunja login page"
bind = "motd:/opt/__APP__/config.yml" bind = "motd:__INSTALL_DIR__/backend/config.yml"
[main.config.enable_registration] [main.config.enable_registration]
ask.en = "Enable registration" ask.en = "Enable registration"
@ -22,7 +22,7 @@ services = ["__APP__"]
yes = "true" yes = "true"
no = "false" no = "false"
help = "Whether to let new users registering themselves or not" help = "Whether to let new users registering themselves or not"
bind = "enableregistration:/opt/__APP__/config.yml" bind = "enableregistration:__INSTALL_DIR__/backend/config.yml"
[main.config.enable_linksharing] [main.config.enable_linksharing]
ask.en = "Enable links sharing" ask.en = "Enable links sharing"
@ -31,7 +31,7 @@ services = ["__APP__"]
yes = "true" yes = "true"
no = "false" no = "false"
help = "Enable sharing of lists via a link" help = "Enable sharing of lists via a link"
bind = "enablelinksharing:/opt/__APP__/config.yml" bind = "enablelinksharing:__INSTALL_DIR__/backend/config.yml"
[main.config.enable_taskattachments] [main.config.enable_taskattachments]
ask.en = "Enable tasks attachments" ask.en = "Enable tasks attachments"
@ -40,7 +40,7 @@ services = ["__APP__"]
yes = "true" yes = "true"
no = "false" no = "false"
help = "Whether to enable task attachments or not" help = "Whether to enable task attachments or not"
bind = "enabletaskattachments:/opt/__APP__/config.yml" bind = "enabletaskattachments:__INSTALL_DIR__/backend/config.yml"
[main.config.enable_taskcomments] [main.config.enable_taskcomments]
ask.en = "Enable task comments" ask.en = "Enable task comments"
@ -49,7 +49,7 @@ services = ["__APP__"]
yes = "true" yes = "true"
no = "false" no = "false"
help = "Whether task comments should be enabled or not" help = "Whether task comments should be enabled or not"
bind = "enabletaskcomments:/opt/__APP__/config.yml" bind = "enabletaskcomments:__INSTALL_DIR__/backend/config.yml"
[main.config.enable_emailreminders] [main.config.enable_emailreminders]
ask.en = "Enable email reminders" ask.en = "Enable email reminders"
@ -58,7 +58,7 @@ services = ["__APP__"]
yes = "true" yes = "true"
no = "false" no = "false"
help = "If enabled, vikunja will send an email to everyone who is either assigned to a task or created it when a task reminder is due." help = "If enabled, vikunja will send an email to everyone who is either assigned to a task or created it when a task reminder is due."
bind = "enableemailreminders:/opt/__APP__/config.yml" bind = "enableemailreminders:__INSTALL_DIR__/backend/config.yml"
[main.config.enable_userdeletion] [main.config.enable_userdeletion]
ask.en = "Enable user deletion" ask.en = "Enable user deletion"
@ -67,19 +67,19 @@ services = ["__APP__"]
yes = "true" yes = "true"
no = "false" no = "false"
help = "If true, will allow users to request the complete deletion of their account. When using external authentication methods it may be required to coordinate with them in order to delete the account. This setting will not affect the cli commands for user deletion" help = "If true, will allow users to request the complete deletion of their account. When using external authentication methods it may be required to coordinate with them in order to delete the account. This setting will not affect the cli commands for user deletion"
bind = "enableuserdeletion:/opt/__APP__/config.yml" bind = "enableuserdeletion:__INSTALL_DIR__/backend/config.yml"
[main.config.maxavatarsize] [main.config.maxavatarsize]
ask.en = "Max avatar size" ask.en = "Max avatar size"
ask.fr = "Taille maximum de l'avatar" ask.fr = "Taille maximum de l'avatar"
type = "number" type = "number"
help = "The maximum size clients will be able to request for user avatars. If clients request a size bigger than this, it will be changed on the fly" help = "The maximum size clients will be able to request for user avatars. If clients request a size bigger than this, it will be changed on the fly"
bind = "maxavatarsize:/opt/__APP__/config.yml" bind = "maxavatarsize:__INSTALL_DIR__/backend/config.yml"
[main.config.maxitemsperpage] [main.config.maxitemsperpage]
ask.en = "Max items per page" ask.en = "Max items per page"
ask.fr = "Nombre d'éléments maximum par page" ask.fr = "Nombre d'éléments maximum par page"
type = "number" type = "number"
help = "The max number of items which can be returned per page" help = "The max number of items which can be returned per page"
bind = "maxitemsperpage:/opt/__APP__/config.yml" bind = "maxitemsperpage:__INSTALL_DIR__/backend/config.yml"

View file

@ -64,7 +64,6 @@ ram.runtime = "50M"
in_subdir = false in_subdir = false
format = "zip" format = "zip"
[resources.ports] [resources.ports]
[resources.system_user] [resources.system_user]

View file

@ -18,22 +18,14 @@ ynh_print_info --message="Declaring files to be backed up..."
# BACKUP THE APP MAIN DIR # BACKUP THE APP MAIN DIR
#================================================= #=================================================
# Frontend
ynh_backup --src_path="$install_dir" ynh_backup --src_path="$install_dir"
# Backend
ynh_backup --src_path="$backend_path"
#================================================= #=================================================
# BACKUP THE NGINX CONFIGURATION # BACKUP THE NGINX CONFIGURATION
#================================================= #=================================================
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# BACKUP SYSTEMD
#=================================================
ynh_backup --src_path="/etc/systemd/system/$app.service" ynh_backup --src_path="/etc/systemd/system/$app.service"
#================================================= #=================================================

View file

@ -49,26 +49,15 @@ ynh_app_setting_set --app=$app --key=maxitemsperpage --value=$maxitemsperpage
ynh_script_progression --message="Setting up frontend..." --weight=1 ynh_script_progression --message="Setting up frontend..." --weight=1
# Download, check integrity, uncompress and patch the source from app.src # Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$install_dir" --source_id="front" ynh_setup_source --dest_dir="$install_dir/front" --source_id="front"
ynh_setup_source --dest_dir="$install_dir/backend" --source_id="back"
tempdir="$(mktemp -d)"
back="$(find $tempdir -name "vikunja-*" \! -name "*.sha256")"
cp "$back" "$install_dir/backend/vikunja"
chmod -R o-rwx "$install_dir" chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir" chown -R $app:www-data "$install_dir"
chmod +x "$install_dir/backend/vikunja"
#=================================================
# INSTALL BACKEND
#=================================================
ynh_script_progression --message="Setting up backend..." --weight=1
# Download, check integrity, uncompress and patch the source from app.src
mkdir -p "$backend_path"
mkdir -p "$backend_path/files"
tempdir="$(mktemp -d)"
ynh_setup_source --dest_dir=$tempdir --source_id="back"
back="$(find $tempdir -name "vikunja-*" \! -name "*.sha256")"
cp "$back" "$backend_path/vikunja"
chmod +x "$backend_path/vikunja"
chown -R $app:www-data "$backend_path/files"
#================================================= #=================================================
# SYSTEM CONFIGURATION # SYSTEM CONFIGURATION

View file

@ -28,9 +28,6 @@ ynh_remove_systemd_config
ynh_redis_remove_db "$redis_db" ynh_redis_remove_db "$redis_db"
# Remove backend
ynh_secure_remove --file="$backend_path"
# Remove the dedicated NGINX config # Remove the dedicated NGINX config
ynh_remove_nginx_config ynh_remove_nginx_config

View file

@ -14,16 +14,11 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
ynh_script_progression --message="Restoring $app main directory..." --weight=4 ynh_script_progression --message="Restoring $app main directory..." --weight=4
# Frontend
ynh_restore_file --origin_path="$install_dir" ynh_restore_file --origin_path="$install_dir"
chmod 750 "$install_dir"
chmod -R o-rwx "$install_dir" chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir" chown -R $app:www-data "$install_dir"
chmod +x "$install_dir/backend/vikunja"
# Backend
ynh_restore_file --origin_path="$backend_path"
chmod +x "$backend_path/vikunja"
chown -R $app:www-data "$backend_path/files"
#================================================= #=================================================
# RESTORE THE POSTGRESQL DATABASE # RESTORE THE POSTGRESQL DATABASE

View file

@ -92,20 +92,16 @@ ynh_systemd_action --service_name=$app --action=stop --log_path=systemd
#================================================= #=================================================
ynh_script_progression --message="Upgrading source files..." --weight=5 ynh_script_progression --message="Upgrading source files..." --weight=5
# Frontend # Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$install_dir" --source_id="front" ynh_setup_source --dest_dir="$install_dir/front" --source_id="front" --full_replace=1
ynh_setup_source --dest_dir="$install_dir/backend" --source_id="back" --full_replace=1 --keep="$install_dir/backend/config.yml"
# Backend
mkdir -p "$backend_path/files"
tempdir="$(mktemp -d)" tempdir="$(mktemp -d)"
ynh_setup_source --dest_dir=$tempdir --source_id="back"
back="$(find $tempdir -name "vikunja-*" \! -name "*.sha256")" back="$(find $tempdir -name "vikunja-*" \! -name "*.sha256")"
cp "$back" "$backend_path/vikunja" cp "$back" "$install_dir/backend/vikunja"
chmod -R o-rwx "$install_dir" chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir" chown -R $app:www-data "$install_dir"
chmod +x "$backend_path/vikunja" chmod +x "$install_dir/backend/vikunja"
chown -R $app:www-data "$backend_path/files"
#================================================= #=================================================
# UPGRADE A CONFIGURATION # UPGRADE A CONFIGURATION