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:
ericgaspar 2022-01-16 16:12:55 +01:00
parent ff1e634135
commit 0fdf0be4a6
No known key found for this signature in database
GPG key ID: 574F281483054D44
4 changed files with 28 additions and 2 deletions

View file

@ -16,7 +16,7 @@ service:
# Enable the caldav endpoint, see the docs for more details
enablecaldav: true
# Set the motd message, available from the /info endpoint
motd: ""
motd: __SET_MOTD__
# Enable sharing of lists via a link
enablelinksharing: true
# Whether to let new users registering themselves or not

15
config_panel.toml Normal file
View file

@ -0,0 +1,15 @@
version = "1.0"
[main]
name = "Vikunja configuration"
services = ["__APP__"]
[main.config]
name = "Configuration Options"
[main.config.set_motd]
ask = "Set MOTD"
type = "string"
help = "Set the motd message, available from the /info endpoint"
bind = "motd:/etc/vikunja/config.yml"

View file

@ -28,6 +28,8 @@ secret=$(ynh_string_random --length=32)
app=$YNH_APP_INSTANCE_NAME
set_motd=""
#=================================================
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
#=================================================
@ -37,7 +39,6 @@ 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
@ -49,6 +50,7 @@ ynh_script_progression --message="Storing installation settings..." --weight=2
ynh_app_setting_set --app=$app --key=domain --value=$domain
ynh_app_setting_set --app=$app --key=path --value=$path_url
ynh_app_setting_set --app=$app --key=set_motd --value=$set_motd
#=================================================
# STANDARD MODIFICATIONS
@ -128,6 +130,8 @@ 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 400 "/etc/vikunja/config.yml"
chown $app:$app "/etc/vikunja/config.yml"
#=================================================
# SETUP SYSTEMD

View file

@ -26,6 +26,8 @@ db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd)
timezone="$(cat /etc/timezone)"
secret=$(ynh_string_random --length=32)
set_motd=$(ynh_app_setting_get --app=$app --key=set_motd)
#=================================================
# CHECK VERSION
#=================================================
@ -37,6 +39,11 @@ upgrade_type=$(ynh_check_app_version_changed)
#=================================================
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
if [ -z "$set_motd" ]; then
set_motd=""
ynh_app_setting_set --app=$app --key=set_motd --value=$set_motd
fi
# Cleaning legacy permissions
if ynh_legacy_permissions_exists; then
ynh_legacy_permissions_delete_all