diff --git a/README.md b/README.md index 91ff443..4e14c87 100644 --- a/README.md +++ b/README.md @@ -15,9 +15,18 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in ## Overview -Self-hosted To-Do list application +Vikunja is a self-hosted open-source to-do list application for all platforms. -**Shipped version:** 0.18.1~ynh3 +### Features + +- Stay organized +- Collaborate with peers +- Tasks +- Kanban board +- CalDAV +- Links + +**Shipped version:** 0.18.2~ynh1 **Demo:** https://try.vikunja.io/login diff --git a/README_fr.md b/README_fr.md index 099dc09..eb5817d 100644 --- a/README_fr.md +++ b/README_fr.md @@ -13,7 +13,16 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour Vikunja est une application de liste de tâches Open Source auto-hébergée pour toutes les plateformes. -**Version incluse :** 0.18.1~ynh3 +### Features + +- Stay organized +- Collaborate with peers +- Tasks +- Kanban board +- CalDAV +- Links + +**Version incluse :** 0.18.2~ynh1 **Démo :** https://try.vikunja.io/login diff --git a/conf/config.yml b/conf/config.yml index 4ea9c3c..384ad0f 100644 --- a/conf/config.yml +++ b/conf/config.yml @@ -16,11 +16,11 @@ 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 - enableregistration: true + enableregistration: __ENABLE_REGISTRATION__ # Whether to enable task attachments or not enabletaskattachments: true # The time zone all timestamps are in. Please note that time zones have to use [the official tz database names](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). UTC or GMT offsets won't work. diff --git a/conf/front.src b/conf/front.src index c9d3457..80f5a3b 100644 --- a/conf/front.src +++ b/conf/front.src @@ -1,7 +1,6 @@ -SOURCE_URL=https://dl.vikunja.io/frontend/vikunja-frontend-0.18.1.zip -SOURCE_SUM=bb85c0e89aa7fa9d89d2c07629a6f0658fe517065a91912f51487f7a7ae1b4de +SOURCE_URL=https://dl.vikunja.io/frontend/vikunja-frontend-0.18.2.zip +SOURCE_SUM=d2f1069f91ba660fe898d4df7efb40a35dbe743dadaa853a09c79955521ee16f SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=zip SOURCE_IN_SUBDIR=false -SOURCE_FILENAME= SOURCE_EXTRACT=true \ No newline at end of file diff --git a/config_panel.toml b/config_panel.toml new file mode 100644 index 0000000..ae8fec3 --- /dev/null +++ b/config_panel.toml @@ -0,0 +1,23 @@ +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 shown in Vikunja login page" + bind = "motd:/etc/vikunja/config.yml" + + [main.config.enable_registration] + ask = "Enable registration" + type = "boolean" + yes = "true" + no = "false" + help = "Whether to let new users registering themselves or not" + bind = "enableregistration:/etc/vikunja/config.yml" + diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md new file mode 100644 index 0000000..2467012 --- /dev/null +++ b/doc/DESCRIPTION.md @@ -0,0 +1,10 @@ +Vikunja is a self-hosted open-source to-do list application for all platforms. + +### Features + +- Stay organized +- Collaborate with peers +- Tasks +- Kanban board +- CalDAV +- Links \ No newline at end of file diff --git a/doc/DESCRIPTION_fr.md b/doc/DESCRIPTION_fr.md index 22f755e..e1f69a4 100644 --- a/doc/DESCRIPTION_fr.md +++ b/doc/DESCRIPTION_fr.md @@ -1 +1,10 @@ -Vikunja est une application de liste de tâches Open Source auto-hébergée pour toutes les plateformes. \ No newline at end of file +Vikunja est une application de liste de tâches Open Source auto-hébergée pour toutes les plateformes. + +### Features + +- Stay organized +- Collaborate with peers +- Tasks +- Kanban board +- CalDAV +- Links \ No newline at end of file diff --git a/manifest.json b/manifest.json index cfd6598..14bc238 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Self-hosted To-Do list application", "fr": "Application de liste de tâches auto-hébergée" }, - "version": "0.18.1~ynh3", + "version": "0.18.2~ynh1", "url": "https://vikunja.io/", "upstream": { "license": "GPL-3.0", diff --git a/scripts/_common.sh b/scripts/_common.sh index 2bd68b5..4d4651e 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -19,34 +19,6 @@ pkg_dependencies="postgresql apt-transport-https" # FUTURE OFFICIAL HELPERS #================================================= -# Check the architecture -# -# example: architecture=$(ynh_detect_arch) -# -# usage: ynh_detect_arch -# -# Requires YunoHost version 2.2.4 or higher. - -ynh_detect_arch(){ - local architecture - if [ -n "$(uname -m | grep arm64)" ] || [ -n "$(uname -m | grep aarch64)" ]; then - architecture="arm64" - elif [ -n "$(uname -m | grep 64)" ]; then - architecture="amd64" - elif [ -n "$(uname -m | grep 86)" ]; then - architecture="386" - elif [ -n "$(uname -m | grep armv7)" ]; then - architecture="arm7" - elif [ -n "$(uname -m | grep armv6)" ]; then - architecture="arm6" - elif [ -n "$(uname -m | grep armv5)" ]; then - architecture="arm5" - else - architecture="unknown" - fi - echo $architecture -} - #================================================= # REDIS HELPERS #================================================= diff --git a/scripts/change_url b/scripts/change_url index 9028263..094fe89 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -35,6 +35,9 @@ db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd) secret=$(ynh_string_random --length=32) timezone="$(cat /etc/timezone)" +set_motd=$(ynh_app_setting_get --app=$app --key=set_motd) +enable_registration=$(ynh_app_setting_get --app=$app --key=enable_registration) + #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= diff --git a/scripts/install b/scripts/install index 6812e5f..71f5866 100644 --- a/scripts/install +++ b/scripts/install @@ -24,11 +24,13 @@ domain=$YNH_APP_ARG_DOMAIN path_url="/" is_public=$YNH_APP_ARG_IS_PUBLIC timezone="$(cat /etc/timezone)" -architecture=$(ynh_detect_arch) secret=$(ynh_string_random --length=32) app=$YNH_APP_INSTANCE_NAME +set_motd="" +enable_registration="true" + #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= @@ -38,7 +40,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 @@ -50,6 +51,8 @@ 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 +ynh_app_setting_set --app=$app --key=enable_registration --value=$enable_registration #================================================= # STANDARD MODIFICATIONS @@ -108,7 +111,11 @@ 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 + +mkdir -p "/opt/vikunja/files" + chmod +x "/opt/vikunja/vikunja" +chown -R $app:www-data "/opt/vikunja/files" #================================================= # NGINX CONFIGURATION @@ -125,8 +132,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 600 "/etc/vikunja/config.yml" +chmod 400 "/etc/vikunja/config.yml" +chown $app:$app "/etc/vikunja/config.yml" #================================================= # SETUP SYSTEMD diff --git a/scripts/remove b/scripts/remove index 00d6e5d..c17afff 100644 --- a/scripts/remove +++ b/scripts/remove @@ -74,7 +74,7 @@ ynh_script_progression --message="Removing $app main directory..." --weight=6 # Remove the app directory securely ynh_secure_remove --file="$final_path" -ynh_secure_remove --file="/etc/vikunja" +#ynh_secure_remove --file="/etc/vikunja" #================================================= # REMOVE NGINX CONFIGURATION diff --git a/scripts/restore b/scripts/restore index 507b857..a5f7ea0 100644 --- a/scripts/restore +++ b/scripts/restore @@ -69,6 +69,7 @@ ynh_restore_file --origin_path="/etc/vikunja/config.yml" ynh_restore_file --origin_path="/opt/vikunja" chmod +x "/opt/vikunja/vikunja" +chown -R $app:www-data "/opt/vikunja/files" #================================================= # REINSTALL DEPENDENCIES diff --git a/scripts/upgrade b/scripts/upgrade index 9fdf937..9d1a724 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -20,17 +20,18 @@ domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) final_path=$(ynh_app_setting_get --app=$app --key=final_path) port=$(ynh_app_setting_get --app=$app --key=port) -architecture=$(ynh_detect_arch) db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_user=$db_name 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) +enable_registration=$(ynh_app_setting_get --app=$app --key=enable_registration) + #================================================= # CHECK VERSION #================================================= -ynh_script_progression --message="Checking version..." upgrade_type=$(ynh_check_app_version_changed) @@ -39,6 +40,16 @@ 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 + +if [ -z "$enable_registration" ]; then + enable_registration="true" + ynh_app_setting_set --app=$app --key=enable_registration --value=$enable_registration +fi + # Cleaning legacy permissions if ynh_legacy_permissions_exists; then ynh_legacy_permissions_delete_all @@ -46,6 +57,11 @@ if ynh_legacy_permissions_exists; then ynh_app_setting_delete --app=$app --key=is_public fi +# Create a permission if needed +if ! ynh_permission_exists --permission="api"; then + ynh_permission_create --permission="api" --url="/api" --allowed="visitors" --auth_header="false" --show_tile="false" --protected="true" +fi + #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= @@ -93,17 +109,21 @@ then # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" --source_id="front" --keep="/etc/vikunja/config.yml" + + mkdir -p "/opt/vikunja/files" + fi chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" -chmod +x /opt/vikunja/vikunja +chmod +x "/opt/vikunja/vikunja" +chown -R $app:www-data "/opt/vikunja/files" #================================================= # ADD A CONFIGURATION #================================================= -ynh_script_progression --message="Adding a configuration file..." --weight=1 +#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"