diff --git a/README.md b/README.md index f9cfdf8..9480479 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,8 @@ It shall NOT be edited by hand. # HedgeDoc for YunoHost -[![Integration level](https://dash.yunohost.org/integration/hedgedoc.svg)](https://dash.yunohost.org/appci/app/hedgedoc) ![Working status](https://ci-apps.yunohost.org/ci/badges/hedgedoc.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/hedgedoc.maintain.svg) +[![Integration level](https://dash.yunohost.org/integration/hedgedoc.svg)](https://dash.yunohost.org/appci/app/hedgedoc) ![Working status](https://ci-apps.yunohost.org/ci/badges/hedgedoc.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/hedgedoc.maintain.svg) + [![Install HedgeDoc with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=hedgedoc) *[Lire ce readme en français.](./README_fr.md)* @@ -28,7 +29,7 @@ You can use it to easily collaborate on notes, graphs and even presentations in - Easy to use permission system - Low system requirements -**Shipped version:** 1.9.6~ynh2 +**Shipped version:** 1.9.7~ynh1 **Demo:** https://demo.hedgedoc.org/ diff --git a/README_fr.md b/README_fr.md index 106324b..3e2d0fb 100644 --- a/README_fr.md +++ b/README_fr.md @@ -5,15 +5,16 @@ It shall NOT be edited by hand. # HedgeDoc pour YunoHost -[![Niveau d'intégration](https://dash.yunohost.org/integration/hedgedoc.svg)](https://dash.yunohost.org/appci/app/hedgedoc) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/hedgedoc.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/hedgedoc.maintain.svg) +[![Niveau d’intégration](https://dash.yunohost.org/integration/hedgedoc.svg)](https://dash.yunohost.org/appci/app/hedgedoc) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/hedgedoc.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/hedgedoc.maintain.svg) + [![Installer HedgeDoc avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=hedgedoc) *[Read this readme in english.](./README.md)* -> *Ce package vous permet d'installer HedgeDoc rapidement et simplement sur un serveur YunoHost. -Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.* +> *Ce package vous permet d’installer HedgeDoc rapidement et simplement sur un serveur YunoHost. +Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l’installer et en profiter.* -## Vue d'ensemble +## Vue d’ensemble HedgeDoc (formerly known as CodiMD) is an open-source, web-based, self-hosted, collaborative markdown editor. @@ -28,13 +29,13 @@ You can use it to easily collaborate on notes, graphs and even presentations in - Easy to use permission system - Low system requirements -**Version incluse :** 1.9.6~ynh2 +**Version incluse :** 1.9.7~ynh1 **Démo :** https://demo.hedgedoc.org/ -## Captures d'écran +## Captures d’écran -![Capture d'écran de HedgeDoc](./doc/screenshots/screenshot.png) +![Capture d’écran de HedgeDoc](./doc/screenshots/screenshot.png) ## Avertissements / informations importantes @@ -45,9 +46,9 @@ Lorsque vous avez terminé de modifier la configuration, pour que vos modificati ## Documentations et ressources -* Site officiel de l'app : -* Documentation officielle de l'admin : -* Dépôt de code officiel de l'app : +* Site officiel de l’app : +* Documentation officielle de l’admin : +* Dépôt de code officiel de l’app : * Documentation YunoHost pour cette app : * Signaler un bug : @@ -63,4 +64,4 @@ ou sudo yunohost app upgrade hedgedoc -u https://github.com/YunoHost-Apps/hedgedoc_ynh/tree/testing --debug ``` -**Plus d'infos sur le packaging d'applications :** +**Plus d’infos sur le packaging d’applications :** \ No newline at end of file diff --git a/conf/app.src b/conf/app.src index 268b8cf..03fcd47 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/hedgedoc/hedgedoc/releases/download/1.9.6/hedgedoc-1.9.6.tar.gz -SOURCE_SUM=dfd0fca006f9075f072df058476ea542adb32b63964afb2985211e1114ab333e +SOURCE_URL=https://github.com/hedgedoc/hedgedoc/releases/download/1.9.7/hedgedoc-1.9.7.tar.gz +SOURCE_SUM=c9bd99c65cf45fa1d7808855b46abbfa13b24400254d8da5e81dae2965494bb3 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/conf/config.json.example b/conf/config.json.example index 7b30ba4..19aadbd 100644 --- a/conf/config.json.example +++ b/conf/config.json.example @@ -7,9 +7,10 @@ "loglevel": "info", "useCDN": false, "allowGravatar": false, - "allowFreeURL": false, + "allowFreeURL": __ALLOW_FREE_URL__, + "requireFreeURLAuthentication": __REQUIRE_FREE_URL_AUTHENTICATION__, "allowAnonymous": __ALLOW_ANONYMOUS__, - "allowAnonymousEdits": true, + "allowAnonymousEdits": __ALLOW_ANONYMOUS_EDITS__, "defaultPermission": "locked", "email": true, "allowEmailRegister": __ALLOW_EMAIL_REGISTRATION__, diff --git a/conf/nginx.conf b/conf/nginx.conf index ab4eec6..c333c47 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,4 +1,5 @@ -location ^~ __PATH__/ { +#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; +location __PATH__/ { proxy_pass http://127.0.0.1:__PORT__/; proxy_redirect off; diff --git a/config_panel.toml b/config_panel.toml new file mode 100644 index 0000000..b56edb0 --- /dev/null +++ b/config_panel.toml @@ -0,0 +1,51 @@ +version = "1.0" + +[main] +name = "HedgeDoc configuration" + + [main.config] + name = "Configuration Options" + + [main.config.allow_anonymous] + ask = "Allow anonymous usage" + type = "boolean" + yes = "true" + no = "false" + help = "Set to allow anonymous usage (default is true)." + bind = "allow_anonymous:__FINALPATH__/config.json" + + [main.config.allow_anonymous_edits] + ask = "Allow anonymous edits" + type = "boolean" + yes = "true" + no = "false" + help = "Allow users to select freely permission, allowing guests to edit existing notes." + bind = "allow_anonymous_edits:__FINALPATH__/config.json" + + + [main.config.allow_email_registration] + ask = "Allow email registration" + type = "boolean" + yes = "true" + no = "false" + help = "Set to allow registration of new accounts using an email address. If set to false, you can still create accounts using the command line." + bind = "allow_email_registration:__FINALPATH__/config.json" + + [main.config.allow_free_url] + ask = "Allow new note creation" + type = "boolean" + yes = "true" + no = "false" + help = "Set to allow new note creation by accessing a nonexistent note URL. This is the behavior familiar from Etherpad." + bind = "allow_free_url:__FINALPATH__/config.json" + + [main.config.require_free_url_authentication] + ask = "Require FreeURL authentication" + type = "boolean" + yes = "true" + no = "false" + help = "Set to require authentication for FreeURL mode style note creation." + bind = "require_free_url_authentication:__FINALPATH__/config.json" + + + diff --git a/manifest.json b/manifest.json index a38fa58..34af6e6 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Collaborative editor to work on notes written in Markdown", "fr": "Éditeur collaboratif pour travailler sur des notes en Markdown" }, - "version": "1.9.6~ynh2", + "version": "1.9.7~ynh1", "url": "https://hedgedoc.org", "upstream": { "license": "AGPL-3.0-only", diff --git a/scripts/change_url b/scripts/change_url index 5fd09f8..945e228 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -34,7 +34,10 @@ db_user=$db_name db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd) allow_anonymous=$(ynh_app_setting_get --app=$app --key=allow_anonymous) +allow_anonymous_edits=$(ynh_app_setting_get --app=$app --key=allow_anonymous_edits) allow_email_registration=$(ynh_app_setting_get --app=$app --key=allow_email_registration) +allow_free_url=$(ynh_app_setting_get --app=$app --key=allow_free_url) +require_free_url_authentication=$(ynh_app_setting_get --app=$app --key=require_free_url_authentication) #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP diff --git a/scripts/install b/scripts/install index ed5aea4..6d257e0 100644 --- a/scripts/install +++ b/scripts/install @@ -30,7 +30,10 @@ is_public=$YNH_APP_ARG_IS_PUBLIC app=$YNH_APP_INSTANCE_NAME allow_anonymous=false +allow_anonymous_edits=false allow_email_registration=false +allow_free_url=false +require_free_url_authentication=false #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS @@ -52,6 +55,9 @@ 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=allow_anonymous --value=$allow_anonymous ynh_app_setting_set --app=$app --key=allow_email_registration --value=$allow_email_registration +ynh_app_setting_set --app=$app --key=allow_free_url --value=$allow_free_url +ynh_app_setting_set --app=$app --key=require_free_url_authentication --value=$require_free_url_authentication +ynh_app_setting_set --app=$app --key=allow_anonymous_edits --value=$allow_anonymous_edits #================================================= # STANDARD MODIFICATIONS diff --git a/scripts/upgrade b/scripts/upgrade index d0f97ad..9c81389 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -25,7 +25,10 @@ db_user=$db_name db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd) allow_anonymous=$(ynh_app_setting_get --app=$app --key=allow_anonymous) +allow_anonymous_edits=$(ynh_app_setting_get --app=$app --key=allow_anonymous_edits) allow_email_registration=$(ynh_app_setting_get --app=$app --key=allow_email_registration) +allow_free_url=$(ynh_app_setting_get --app=$app --key=allow_free_url) +require_free_url_authentication=$(ynh_app_setting_get --app=$app --key=require_free_url_authentication) #================================================= # CHECK VERSION @@ -43,11 +46,26 @@ if [ -z "$allow_anonymous" ]; then ynh_app_setting_set --app=$app --key=allow_anonymous --value=$allow_anonymous fi +if [ -z "$allow_anonymous_edits" ]; then + allow_anonymous_edits="false" + ynh_app_setting_set --app=$app --key=allow_anonymous_edits --value=$allow_anonymous_edits +fi + if [ -z "$allow_email_registration" ]; then allow_email_registration="false" ynh_app_setting_set --app=$app --key=allow_email_registration --value=$allow_email_registration fi +if [ -z "$allow_free_url" ]; then + allow_free_url="false" + ynh_app_setting_set --app=$app --key=allow_free_url --value=$allow_free_url +fi + +if [ -z "$require_free_url_authentication" ]; then + require_free_url_authentication="false" + ynh_app_setting_set --app=$app --key=require_free_url_authentication --value=$require_free_url_authentication +fi + # Cleaning legacy permissions if ynh_legacy_permissions_exists; then ynh_legacy_permissions_delete_all @@ -134,6 +152,7 @@ then ynh_script_progression --message="Building HedgeDoc... (this will take some time and resources!)" --weight=20 pushd "$final_path" + ynh_secure_remove /usr/local/share/.cache/yarn ynh_use_nodejs bin/setup popd