1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/hedgedoc_ynh.git synced 2024-09-03 19:25:52 +02:00
* [autopatch] Automatic patch attempt for helpers 2.1 (#77)

* [autopatch] Automatic patch attempt for helpers 2.1

* cleaning

---------

Co-authored-by: Yunohost-Bot <>
Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com>

* Auto-update READMEs

* Update manifest.toml

* Auto-update READMEs

---------

Co-authored-by: YunoHost Bot <yunohost-bot@users.noreply.github.com>
Co-authored-by: yunohost-bot <yunohost@yunohost.org>
This commit is contained in:
eric_G 2024-09-01 17:40:32 +02:00 committed by GitHub
parent e5fec91d12
commit c0d176700d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 222 additions and 196 deletions

View file

@ -5,4 +5,6 @@
- [Irakurri README euskaraz](README_eu.md) - [Irakurri README euskaraz](README_eu.md)
- [Lire le README en français](README_fr.md) - [Lire le README en français](README_fr.md)
- [Le o README en galego](README_gl.md) - [Le o README en galego](README_gl.md)
- [Baca README dalam bahasa bahasa Indonesia](README_id.md)
- [Прочитать README на русский](README_ru.md)
- [阅读中文(简体)的 README](README_zh_Hans.md) - [阅读中文(简体)的 README](README_zh_Hans.md)

View file

@ -5,7 +5,7 @@ It shall NOT be edited by hand.
# HedgeDoc for YunoHost # 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://ci-apps.yunohost.org/ci/apps/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) [![Install HedgeDoc with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=hedgedoc)
@ -29,7 +29,7 @@ You can use it to easily collaborate on notes, graphs and even presentations in
- Low system requirements - Low system requirements
**Shipped version:** 1.9.9~ynh3 **Shipped version:** 1.10.0~ynh1
**Demo:** <https://demo.hedgedoc.org/> **Demo:** <https://demo.hedgedoc.org/>

View file

@ -5,7 +5,7 @@ No se debe editar a mano.
# HedgeDoc para Yunohost # HedgeDoc para Yunohost
[![Nivel de integración](https://dash.yunohost.org/integration/hedgedoc.svg)](https://dash.yunohost.org/appci/app/hedgedoc) ![Estado funcional](https://ci-apps.yunohost.org/ci/badges/hedgedoc.status.svg) ![Estado En Mantención](https://ci-apps.yunohost.org/ci/badges/hedgedoc.maintain.svg) [![Nivel de integración](https://dash.yunohost.org/integration/hedgedoc.svg)](https://ci-apps.yunohost.org/ci/apps/hedgedoc/) ![Estado funcional](https://ci-apps.yunohost.org/ci/badges/hedgedoc.status.svg) ![Estado En Mantención](https://ci-apps.yunohost.org/ci/badges/hedgedoc.maintain.svg)
[![Instalar HedgeDoc con Yunhost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=hedgedoc) [![Instalar HedgeDoc con Yunhost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=hedgedoc)
@ -29,7 +29,7 @@ You can use it to easily collaborate on notes, graphs and even presentations in
- Low system requirements - Low system requirements
**Versión actual:** 1.9.9~ynh3 **Versión actual:** 1.10.0~ynh1
**Demo:** <https://demo.hedgedoc.org/> **Demo:** <https://demo.hedgedoc.org/>

View file

@ -5,7 +5,7 @@ EZ editatu eskuz.
# HedgeDoc YunoHost-erako # HedgeDoc YunoHost-erako
[![Integrazio maila](https://dash.yunohost.org/integration/hedgedoc.svg)](https://dash.yunohost.org/appci/app/hedgedoc) ![Funtzionamendu egoera](https://ci-apps.yunohost.org/ci/badges/hedgedoc.status.svg) ![Mantentze egoera](https://ci-apps.yunohost.org/ci/badges/hedgedoc.maintain.svg) [![Integrazio maila](https://dash.yunohost.org/integration/hedgedoc.svg)](https://ci-apps.yunohost.org/ci/apps/hedgedoc/) ![Funtzionamendu egoera](https://ci-apps.yunohost.org/ci/badges/hedgedoc.status.svg) ![Mantentze egoera](https://ci-apps.yunohost.org/ci/badges/hedgedoc.maintain.svg)
[![Instalatu HedgeDoc YunoHost-ekin](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=hedgedoc) [![Instalatu HedgeDoc YunoHost-ekin](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=hedgedoc)
@ -29,7 +29,7 @@ You can use it to easily collaborate on notes, graphs and even presentations in
- Low system requirements - Low system requirements
**Paketatutako bertsioa:** 1.9.9~ynh3 **Paketatutako bertsioa:** 1.10.0~ynh1
**Demoa:** <https://demo.hedgedoc.org/> **Demoa:** <https://demo.hedgedoc.org/>

View file

@ -5,7 +5,7 @@ Il NE doit PAS être modifié à la main.
# HedgeDoc pour YunoHost # HedgeDoc pour YunoHost
[![Niveau dinté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 dintégration](https://dash.yunohost.org/integration/hedgedoc.svg)](https://ci-apps.yunohost.org/ci/apps/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) [![Installer HedgeDoc avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=hedgedoc)
@ -29,7 +29,7 @@ Vous pouvez l'utiliser pour collaborer facilement sur des notes, des graphiques
- Faible configuration système requise - Faible configuration système requise
**Version incluse:** 1.9.9~ynh3 **Version incluse:** 1.10.0~ynh1
**Démo:** <https://demo.hedgedoc.org/> **Démo:** <https://demo.hedgedoc.org/>

View file

@ -5,7 +5,7 @@ NON debe editarse manualmente.
# HedgeDoc para YunoHost # HedgeDoc para YunoHost
[![Nivel de integración](https://dash.yunohost.org/integration/hedgedoc.svg)](https://dash.yunohost.org/appci/app/hedgedoc) ![Estado de funcionamento](https://ci-apps.yunohost.org/ci/badges/hedgedoc.status.svg) ![Estado de mantemento](https://ci-apps.yunohost.org/ci/badges/hedgedoc.maintain.svg) [![Nivel de integración](https://dash.yunohost.org/integration/hedgedoc.svg)](https://ci-apps.yunohost.org/ci/apps/hedgedoc/) ![Estado de funcionamento](https://ci-apps.yunohost.org/ci/badges/hedgedoc.status.svg) ![Estado de mantemento](https://ci-apps.yunohost.org/ci/badges/hedgedoc.maintain.svg)
[![Instalar HedgeDoc con YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=hedgedoc) [![Instalar HedgeDoc con YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=hedgedoc)
@ -29,7 +29,7 @@ You can use it to easily collaborate on notes, graphs and even presentations in
- Low system requirements - Low system requirements
**Versión proporcionada:** 1.9.9~ynh3 **Versión proporcionada:** 1.10.0~ynh1
**Demo:** <https://demo.hedgedoc.org/> **Demo:** <https://demo.hedgedoc.org/>

60
README_id.md Normal file
View file

@ -0,0 +1,60 @@
<!--
N.B.: README ini dibuat secara otomatis oleh <https://github.com/YunoHost/apps/tree/master/tools/readme_generator>
Ini TIDAK boleh diedit dengan tangan.
-->
# HedgeDoc untuk YunoHost
[![Tingkat integrasi](https://dash.yunohost.org/integration/hedgedoc.svg)](https://ci-apps.yunohost.org/ci/apps/hedgedoc/) ![Status kerja](https://ci-apps.yunohost.org/ci/badges/hedgedoc.status.svg) ![Status pemeliharaan](https://ci-apps.yunohost.org/ci/badges/hedgedoc.maintain.svg)
[![Pasang HedgeDoc dengan YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=hedgedoc)
*[Baca README ini dengan bahasa yang lain.](./ALL_README.md)*
> *Paket ini memperbolehkan Anda untuk memasang HedgeDoc secara cepat dan mudah pada server YunoHost.*
> *Bila Anda tidak mempunyai YunoHost, silakan berkonsultasi dengan [panduan](https://yunohost.org/install) untuk mempelajari bagaimana untuk memasangnya.*
## Ringkasan
HedgeDoc (formerly known as CodiMD) is an open-source, web-based, self-hosted, collaborative markdown editor.
You can use it to easily collaborate on notes, graphs and even presentations in real-time. All you need to do is to share your note-link to your co-workers and theyre ready to go.
### Features
- Real-time collaboration
- Graphs & diagrams
- Revisions
- Presentation mode
- Easy to use permission system
- Low system requirements
**Versi terkirim:** 1.10.0~ynh1
**Demo:** <https://demo.hedgedoc.org/>
## Tangkapan Layar
![Tangkapan Layar pada HedgeDoc](./doc/screenshots/screenshot.png)
## Dokumentasi dan sumber daya
- Website aplikasi resmi: <https://hedgedoc.org>
- Dokumentasi admin resmi: <https://docs.hedgedoc.org/>
- Depot kode aplikasi hulu: <https://github.com/hedgedoc/hedgedoc>
- Gudang YunoHost: <https://apps.yunohost.org/app/hedgedoc>
- Laporkan bug: <https://github.com/YunoHost-Apps/hedgedoc_ynh/issues>
## Info developer
Silakan kirim pull request ke [`testing` branch](https://github.com/YunoHost-Apps/hedgedoc_ynh/tree/testing).
Untuk mencoba branch `testing`, silakan dilanjutkan seperti:
```bash
sudo yunohost app install https://github.com/YunoHost-Apps/hedgedoc_ynh/tree/testing --debug
atau
sudo yunohost app upgrade hedgedoc -u https://github.com/YunoHost-Apps/hedgedoc_ynh/tree/testing --debug
```
**Info lebih lanjut mengenai pemaketan aplikasi:** <https://yunohost.org/packaging_apps>

60
README_ru.md Normal file
View file

@ -0,0 +1,60 @@
<!--
Важно: этот README был автоматически сгенерирован <https://github.com/YunoHost/apps/tree/master/tools/readme_generator>
Он НЕ ДОЛЖЕН редактироваться вручную.
-->
# HedgeDoc для YunoHost
[![Уровень интеграции](https://dash.yunohost.org/integration/hedgedoc.svg)](https://ci-apps.yunohost.org/ci/apps/hedgedoc/) ![Состояние работы](https://ci-apps.yunohost.org/ci/badges/hedgedoc.status.svg) ![Состояние сопровождения](https://ci-apps.yunohost.org/ci/badges/hedgedoc.maintain.svg)
[![Установите HedgeDoc с YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=hedgedoc)
*[Прочтите этот README на других языках.](./ALL_README.md)*
> *Этот пакет позволяет Вам установить HedgeDoc быстро и просто на YunoHost-сервер.*
> *Если у Вас нет YunoHost, пожалуйста, посмотрите [инструкцию](https://yunohost.org/install), чтобы узнать, как установить его.*
## Обзор
HedgeDoc (formerly known as CodiMD) is an open-source, web-based, self-hosted, collaborative markdown editor.
You can use it to easily collaborate on notes, graphs and even presentations in real-time. All you need to do is to share your note-link to your co-workers and theyre ready to go.
### Features
- Real-time collaboration
- Graphs & diagrams
- Revisions
- Presentation mode
- Easy to use permission system
- Low system requirements
**Поставляемая версия:** 1.10.0~ynh1
**Демо-версия:** <https://demo.hedgedoc.org/>
## Снимки экрана
![Снимок экрана HedgeDoc](./doc/screenshots/screenshot.png)
## Документация и ресурсы
- Официальный веб-сайт приложения: <https://hedgedoc.org>
- Официальная документация администратора: <https://docs.hedgedoc.org/>
- Репозиторий кода главной ветки приложения: <https://github.com/hedgedoc/hedgedoc>
- Магазин YunoHost: <https://apps.yunohost.org/app/hedgedoc>
- Сообщите об ошибке: <https://github.com/YunoHost-Apps/hedgedoc_ynh/issues>
## Информация для разработчиков
Пришлите Ваш запрос на слияние в [ветку `testing`](https://github.com/YunoHost-Apps/hedgedoc_ynh/tree/testing).
Чтобы попробовать ветку `testing`, пожалуйста, сделайте что-то вроде этого:
```bash
sudo yunohost app install https://github.com/YunoHost-Apps/hedgedoc_ynh/tree/testing --debug
или
sudo yunohost app upgrade hedgedoc -u https://github.com/YunoHost-Apps/hedgedoc_ynh/tree/testing --debug
```
**Больше информации о пакетировании приложений:** <https://yunohost.org/packaging_apps>

View file

@ -5,7 +5,7 @@
# YunoHost 上的 HedgeDoc # YunoHost 上的 HedgeDoc
[![集成程度](https://dash.yunohost.org/integration/hedgedoc.svg)](https://dash.yunohost.org/appci/app/hedgedoc) ![工作状态](https://ci-apps.yunohost.org/ci/badges/hedgedoc.status.svg) ![维护状态](https://ci-apps.yunohost.org/ci/badges/hedgedoc.maintain.svg) [![集成程度](https://dash.yunohost.org/integration/hedgedoc.svg)](https://ci-apps.yunohost.org/ci/apps/hedgedoc/) ![工作状态](https://ci-apps.yunohost.org/ci/badges/hedgedoc.status.svg) ![维护状态](https://ci-apps.yunohost.org/ci/badges/hedgedoc.maintain.svg)
[![使用 YunoHost 安装 HedgeDoc](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=hedgedoc) [![使用 YunoHost 安装 HedgeDoc](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=hedgedoc)
@ -29,7 +29,7 @@ You can use it to easily collaborate on notes, graphs and even presentations in
- Low system requirements - Low system requirements
**分发版本:** 1.9.9~ynh3 **分发版本:** 1.10.0~ynh1
**演示:** <https://demo.hedgedoc.org/> **演示:** <https://demo.hedgedoc.org/>

View file

@ -8,9 +8,9 @@ Type=simple
User=__APP__ User=__APP__
Group=__APP__ Group=__APP__
WorkingDirectory=__INSTALL_DIR__ WorkingDirectory=__INSTALL_DIR__
Environment="__YNH_NODE_LOAD_PATH__" Environment="PATH=__PATH_WITH_NODEJS__"
Environment="NODE_ENV=production" Environment="NODE_ENV=production"
ExecStart=__YNH_NPM__ start --production ExecStart=__NODEJS_DIR__/npm start --production
Restart=always Restart=always
# Sandboxing options to harden security # Sandboxing options to harden security

View file

@ -5,7 +5,7 @@ name = "HedgeDoc"
description.en = "Collaborative editor to work on notes written in Markdown" description.en = "Collaborative editor to work on notes written in Markdown"
description.fr = "Éditeur collaboratif pour travailler sur des notes en Markdown" description.fr = "Éditeur collaboratif pour travailler sur des notes en Markdown"
version = "1.9.9~ynh3" version = "1.10.0~ynh1"
maintainers = [] maintainers = []
@ -17,7 +17,8 @@ admindoc = "https://docs.hedgedoc.org/"
code = "https://github.com/hedgedoc/hedgedoc" code = "https://github.com/hedgedoc/hedgedoc"
[integration] [integration]
yunohost = ">= 11.2" yunohost = ">= 11.2.29"
helpers_version = "2.1"
architectures = "all" architectures = "all"
multi_instance = true multi_instance = true
@ -48,8 +49,8 @@ ram.runtime = "50M"
[resources.sources] [resources.sources]
[resources.sources.main] [resources.sources.main]
url = "https://github.com/hedgedoc/hedgedoc/releases/download/1.9.9/hedgedoc-1.9.9.tar.gz" url = "https://github.com/hedgedoc/hedgedoc/releases/download/1.10.0/hedgedoc-1.10.0.tar.gz"
sha256 = "1769d30e60458040475a6d74f53952101962c40c390765e19e6ff6f3fe70c008" sha256 = "c0024ff8b7d5483d5115af3a8981ad8a2c6237fc2d63893219f1e6ce3079938e"
autoupdate.strategy = "latest_github_tag" autoupdate.strategy = "latest_github_tag"
[resources.ports] [resources.ports]

View file

@ -1,19 +1,7 @@
#!/bin/bash #!/bin/bash
#================================================= #=================================================
# COMMON VARIABLES # COMMON VARIABLES AND CUSTOM HELPERS
#================================================= #=================================================
nodejs_version=20 nodejs_version=20
#=================================================
# PERSONAL HELPERS
#=================================================
#=================================================
# EXPERIMENTAL HELPERS
#=================================================
#=================================================
# FUTURE OFFICIAL HELPERS
#=================================================

View file

@ -1,42 +1,33 @@
#!/bin/bash #!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source ../settings/scripts/_common.sh source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
#================================================= ynh_print_info "Declaring files to be backed up..."
# DECLARE DATA AND CONF FILES TO BACKUP
#=================================================
ynh_print_info --message="Declaring files to be backed up..."
#================================================= #=================================================
# BACKUP THE APP MAIN DIR # BACKUP THE APP MAIN DIR
#================================================= #=================================================
ynh_backup --src_path="$install_dir" ynh_backup "$install_dir"
#================================================= #=================================================
# SYSTEM CONFIGURATION # SYSTEM CONFIGURATION
#================================================= #=================================================
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_backup --src_path="/etc/systemd/system/$app.service" ynh_backup "/etc/systemd/system/$app.service"
#================================================= #=================================================
# BACKUP THE POSTGRESQL DATABASE # BACKUP THE POSTGRESQL DATABASE
#================================================= #=================================================
ynh_print_info --message="Backing up the PostgreSQL database..." ynh_print_info "Backing up the PostgreSQL database..."
ynh_psql_dump_db --database="$db_name" > db.sql ynh_psql_dump_db > db.sql
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." ynh_print_info "Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."

View file

@ -1,29 +1,21 @@
#!/bin/bash #!/bin/bash
#=================================================
# GENERIC STARTING
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh source _common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
#=================================================
# STANDARD MODIFICATIONS
#================================================= #=================================================
# STOP SYSTEMD SERVICE # STOP SYSTEMD SERVICE
#================================================= #=================================================
ynh_script_progression --message="Stopping a systemd service..." --weight=1 ynh_script_progression "Stopping $app's systemd service..."
ynh_systemd_action --service_name=$app --action=stop --log_path=systemd ynh_systemctl --service=$app --action=stop --log_path=systemd
#================================================= #=================================================
# MODIFY URL IN NGINX CONF # MODIFY URL IN NGINX CONF
#================================================= #=================================================
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1 ynh_script_progression "Updating NGINX web server configuration..."
ynh_change_url_nginx_config ynh_config_change_url_nginx
#================================================= #=================================================
# SPECIFIC MODIFICATIONS # SPECIFIC MODIFICATIONS
@ -31,28 +23,26 @@ ynh_change_url_nginx_config
# CONFIGURE HEDGEDOC # CONFIGURE HEDGEDOC
#================================================= #=================================================
ynh_backup_if_checksum_is_different --file="$install_dir/config.json" ynh_backup_if_checksum_is_different "$install_dir/config.json"
domain=$new_domain domain=$new_domain
url_path=${new_path#/} url_path=${new_path#/}
ynh_add_config --template="../conf/config.json.example" --destination="$install_dir/config.json" ynh_config_add --template="config.json.example" --destination="$install_dir/config.json"
chmod 400 "$install_dir/config.json" #REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 400 "$install_dir/config.json"
chown $app:$app "$install_dir/config.json" #REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown $app:$app "$install_dir/config.json"
#=================================================
# GENERIC FINALISATION
#================================================= #=================================================
# START SYSTEMD SERVICE # START SYSTEMD SERVICE
#================================================= #=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_script_progression "Starting $app's systemd service..."
# Start a systemd service # Start a systemd service
ynh_systemd_action --service_name=$app --action=start --log_path=systemd --line_match="HTTP Server listening" ynh_systemctl --service=$app --action=start --log_path=systemd --wait_until="HTTP Server listening"
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Change of URL completed for $app" --last ynh_script_progression "Change of URL completed for $app"

View file

@ -1,11 +1,5 @@
#!/bin/bash #!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh source _common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
@ -23,39 +17,34 @@ require_free_url_authentication=false
# STORE SETTINGS FROM MANIFEST # STORE SETTINGS FROM MANIFEST
#================================================= #=================================================
ynh_app_setting_set --app=$app --key=allow_anonymous --value=$allow_anonymous ynh_app_setting_set --key=allow_anonymous --value=$allow_anonymous
ynh_app_setting_set --app=$app --key=allow_email_registration --value=$allow_email_registration ynh_app_setting_set --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 --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 --key=require_free_url_authentication --value=$require_free_url_authentication
ynh_app_setting_set --app=$app --key=allow_anonymous_edits --value=$allow_anonymous_edits ynh_app_setting_set --key=allow_anonymous_edits --value=$allow_anonymous_edits
#================================================= #=================================================
# INSTALL DEPENDENCIES # INSTALL DEPENDENCIES
#================================================= #=================================================
ynh_script_progression --message="Installing dependencies..." --weight=20 ynh_script_progression "Installing dependencies..."
# Install Nodejs ynh_nodejs_install
ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
#================================================= #=================================================
ynh_script_progression --message="Setting up source files..." --weight=2 ynh_script_progression "Setting up source files..."
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir=$install_dir ynh_setup_source --dest_dir=$install_dir
chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir"
#================================================= #=================================================
# SYSTEM CONFIGURATION # SYSTEM CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Adding system configurations related to $app..." --weight=1 ynh_script_progression "Adding system configurations related to $app..."
ynh_add_nginx_config ynh_config_add_nginx
ynh_add_systemd_config ynh_config_add_systemd
yunohost service add $app --description="Collaborative Markdown editor" --log="/var/log/$app/$app.log" yunohost service add $app --description="Collaborative Markdown editor" --log="/var/log/$app/$app.log"
@ -64,35 +53,31 @@ yunohost service add $app --description="Collaborative Markdown editor" --log="/
#============================================== #==============================================
# INSTALL HEDGEDOC # INSTALL HEDGEDOC
#============================================== #==============================================
ynh_script_progression --message="Building $app... (this will take some time and resources!)" --weight=10 ynh_script_progression "Building $app... (this will take some time and resources!)"
pushd "$install_dir" pushd "$install_dir"
ynh_use_nodejs
ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH yarn workspaces focus --production ynh_hide_warnings ynh_exec_as_app yarn workspaces focus --production
ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH yarn cache clean ynh_hide_warnings ynh_exec_as_app yarn cache clean
popd popd
#================================================= #=================================================
# MODIFY A CONFIG FILE # MODIFY A CONFIG FILE
#================================================= #=================================================
ynh_script_progression --message="Modifying a config file..." --weight=1 ynh_script_progression "Updating configuration..."
url_path=${path#/} url_path=${path#/}
ynh_add_config --template="config.json.example" --destination="$install_dir/config.json" ynh_config_add --template="config.json.example" --destination="$install_dir/config.json"
chmod 600 "$install_dir/config.json"
chown $app:$app "$install_dir/config.json"
#================================================= #=================================================
# START SYSTEMD SERVICE # START SYSTEMD SERVICE
#================================================= #=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=2 ynh_script_progression "Starting $app's systemd service..."
# Start a systemd service ynh_systemctl --service=$app --action=start --log_path=systemd --wait_until="HTTP Server listening"
ynh_systemd_action --service_name=$app --action=start --log_path=systemd --line_match="HTTP Server listening"
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Installation of $app completed" --last ynh_script_progression "Installation of $app completed"

View file

@ -1,36 +1,27 @@
#!/bin/bash #!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh source _common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
#================================================= #=================================================
# REMOVE SYSTEM CONFIGURATIONS # REMOVE SYSTEM CONFIGURATIONS
#================================================= #=================================================
# REMOVE SYSTEMD SERVICE ynh_script_progression "Removing system configurations related to $app..."
#=================================================
ynh_script_progression --message="Removing system configurations related to $app..." --weight=1
# Remove the service from the list of services known by YunoHost (added from `yunohost service add`) if ynh_hide_warnings yunohost service status $app >/dev/null
if ynh_exec_warn_less yunohost service status $app >/dev/null
then then
ynh_script_progression --message="Removing $app service..." --weight=1 ynh_script_progression "Removing $app service..."
yunohost service remove $app yunohost service remove $app
fi fi
ynh_remove_systemd_config ynh_config_remove_systemd
ynh_remove_nodejs ynh_nodejs_remove
ynh_remove_nginx_config ynh_config_remove_nginx
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Removal of $app completed" --last ynh_script_progression "Removal of $app completed"

View file

@ -1,49 +1,38 @@
#!/bin/bash #!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source ../settings/scripts/_common.sh source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
#================================================= #=================================================
# RESTORE THE APP MAIN DIR # RESTORE THE APP MAIN DIR
#================================================= #=================================================
ynh_script_progression --message="Restoring HedgeDoc main directory..." --weight=10 ynh_script_progression "Restoring HedgeDoc main directory..."
ynh_restore_file --origin_path="$install_dir" ynh_restore "$install_dir"
chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir"
#=================================================
# SPECIFIC RESTORATION
#================================================= #=================================================
# REINSTALL DEPENDENCIES # REINSTALL DEPENDENCIES
#================================================= #=================================================
ynh_script_progression --message="Reinstalling dependencies..." --weight=6 ynh_script_progression "Reinstalling dependencies..."
# Install Nodejs # Install Nodejs
ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version ynh_nodejs_install
#================================================= #=================================================
# RESTORE THE POSTGRESQL DATABASE # RESTORE THE POSTGRESQL DATABASE
#================================================= #=================================================
ynh_script_progression --message="Restoring the PostgreSQL database..." --weight=6 ynh_script_progression "Restoring the PostgreSQL database..."
ynh_psql_execute_file_as_root --file="./db.sql" --database=$db_name ynh_psql_db_shell < "./db.sql"
#================================================= #=================================================
# RESTORE SYSTEMD # RESTORE SYSTEMD
#================================================= #=================================================
ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1 ynh_script_progression "Restoring system configurations related to $app..."
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_restore "/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_restore_file --origin_path="/etc/systemd/system/$app.service" ynh_restore "/etc/systemd/system/$app.service"
systemctl enable $app.service --quiet systemctl enable $app.service --quiet
yunohost service add $app --description="Collaborative Markdown editor" --log="/var/log/$app/$app.log" yunohost service add $app --description="Collaborative Markdown editor" --log="/var/log/$app/$app.log"
@ -51,14 +40,14 @@ yunohost service add $app --description="Collaborative Markdown editor" --log="/
#================================================= #=================================================
# RELOAD NGINX AND PHP-FPM OR THE APP SERVICE # RELOAD NGINX AND PHP-FPM OR THE APP SERVICE
#================================================= #=================================================
ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1 ynh_script_progression "Reloading NGINX web server and $app's service..."
ynh_systemd_action --service_name=$app --action=start --log_path=systemd --line_match="HTTP Server listening" ynh_systemctl --service=$app --action=start --log_path=systemd --wait_until="HTTP Server listening"
ynh_systemd_action --service_name=nginx --action=reload ynh_systemctl --service=nginx --action=reload
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Restoration completed for $app" --last ynh_script_progression "Restoration completed for $app"

View file

@ -1,109 +1,78 @@
#!/bin/bash #!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh source _common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
#================================================= #=================================================
# ENSURE DOWNWARD COMPATIBILITY # ENSURE DOWNWARD COMPATIBILITY
#================================================= #=================================================
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 ynh_script_progression "Ensuring downward compatibility..."
if [ -z "${allow_anonymous:-}" ]; then ynh_app_setting_set_default --key=allow_anonymous --value="false"
allow_anonymous="false"
ynh_app_setting_set --app=$app --key=allow_anonymous --value=$allow_anonymous
fi
if [ -z "${allow_anonymous_edits:-}" ]; then ynh_app_setting_set_default --key=allow_anonymous_edits --value="false"
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 ynh_app_setting_set_default --key=allow_email_registration --value="false"
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 ynh_app_setting_set_default --key=allow_free_url --value="false"
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 ynh_app_setting_set_default --key=require_free_url_authentication --value="false"
require_free_url_authentication="false"
ynh_app_setting_set --app=$app --key=require_free_url_authentication --value=$require_free_url_authentication
fi
#=================================================
# STANDARD UPGRADE STEPS
#================================================= #=================================================
# STOP SYSTEMD SERVICE # STOP SYSTEMD SERVICE
#================================================= #=================================================
ynh_script_progression --message="Stopping a systemd service..." --weight=1 ynh_script_progression "Stopping $app's systemd service..."
ynh_systemd_action --service_name=$app --action=stop --log_path=systemd ynh_systemctl --service=$app --action=stop --log_path=systemd
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
#================================================= #=================================================
ynh_script_progression --message="Upgrading source files..." --weight=10 ynh_script_progression "Upgrading source files..."
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir=$install_dir --keep="config.json" ynh_setup_source --dest_dir=$install_dir --keep="config.json"
chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir"
#================================================= #=================================================
# REAPPLY SYSTEM CONFIGURATIONS # REAPPLY SYSTEM CONFIGURATIONS
#================================================= #=================================================
ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1 ynh_script_progression "Upgrading system configurations related to $app..."
ynh_add_nginx_config ynh_config_add_nginx
ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version ynh_nodejs_install
ynh_add_systemd_config ynh_config_add_systemd
yunohost service add $app --description="Collaborative Markdown editor" --log="/var/log/$app/$app.log" yunohost service add $app --description="Collaborative Markdown editor" --log="/var/log/$app/$app.log"
#============================================== #==============================================
# INSTALL HEDGEDOC # INSTALL HEDGEDOC
#============================================== #==============================================
ynh_script_progression --message="Building $app... (this will take some time and resources!)" --weight=10 ynh_script_progression "Building $app... (this will take some time and resources!)"
pushd "$install_dir" pushd "$install_dir"
ynh_secure_remove /usr/local/share/.cache/yarn ynh_safe_rm /usr/local/share/.cache/yarn
ynh_use_nodejs ynh_hide_warnings ynh_exec_as_app yarn workspaces focus --production
ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH yarn workspaces focus --production ynh_hide_warnings ynh_exec_as_app yarn cache clean
ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH yarn cache clean
popd popd
#================================================= #=================================================
# MODIFY A CONFIG FILE # MODIFY A CONFIG FILE
#================================================= #=================================================
ynh_script_progression --message="Modifying a config file..." --weight=1 ynh_script_progression "Updating configuration..."
url_path=${path#/} url_path=${path#/}
ynh_add_config --template="config.json.example" --destination="$install_dir/config.json" ynh_config_add --template="config.json.example" --destination="$install_dir/config.json"
chmod 600 "$install_dir/config.json"
chown $app:$app "$install_dir/config.json"
#================================================= #=================================================
# START SYSTEMD SERVICE # START SYSTEMD SERVICE
#================================================= #=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_script_progression "Starting $app's systemd service..."
ynh_systemd_action --service_name=$app --action=start --log_path=systemd --line_match="HTTP Server listening" ynh_systemctl --service=$app --action=start --log_path=systemd --wait_until="HTTP Server listening"
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Upgrade of $app completed" --last ynh_script_progression "Upgrade of $app completed"