1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/hedgedoc_ynh.git synced 2024-09-03 19:25:52 +02:00

Merge branch 'testing' into v2

This commit is contained in:
Éric Gaspar 2024-05-28 23:26:18 +02:00
commit 4a83da3d50
29 changed files with 664 additions and 619 deletions

8
ALL_README.md Normal file
View file

@ -0,0 +1,8 @@
# All available README files by language
- [Read the README in English](README.md)
- [Lea el README en español](README_es.md)
- [Irakurri README euskaraz](README_eu.md)
- [Lire le README en français](README_fr.md)
- [Le o README en galego](README_gl.md)
- [阅读中文(简体)的 README](README_zh_Hans.md)

View file

@ -1,55 +1,60 @@
<!-- <!--
N.B.: This README was automatically generated by https://github.com/YunoHost/apps/tree/master/tools/README-generator N.B.: This README was automatically generated by <https://github.com/YunoHost/apps/tree/master/tools/readme_generator>
It shall NOT be edited by hand. 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) ![](https://ci-apps.yunohost.org/ci/badges/hedgedoc.status.svg) ![](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) [![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)* *[Read this README in other languages.](./ALL_README.md)*
> *This package allows you to install HedgeDoc quickly and simply on a YunoHost server. > *This package allows you to install HedgeDoc quickly and simply on a YunoHost server.*
If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.* > *If you don't have YunoHost, please consult [the guide](https://yunohost.org/install) to learn how to install it.*
## Overview ## Overview
Collaborative editor to work on notes written in Markdown 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.
**Shipped version:** 2.0.0~ynh1 **Shipped version:** 2.0.0~ynh1
**Demo:** https://demo.hedgedoc.org/ - Real-time collaboration
- Graphs & diagrams
- Revisions
- Presentation mode
- Easy to use permission system
- Low system requirements
**Shipped version:** 1.9.9~ynh3
**Demo:** <https://demo.hedgedoc.org/>
## Screenshots ## Screenshots
![](./doc/screenshots/screenshot.png) ![Screenshot of HedgeDoc](./doc/screenshots/screenshot.png)
## Disclaimers / important information
## Configuration
You can configure HedgeDoc by editing this file `/var/www/hedgedoc/config.json` using the [documentation](https://github.com/hedgedoc/hedgedoc/blob/master/docs/configuration.md)
When you finished editing the configuration, for your changes to take effect, you will have to run: `sudo systemctl restart hedgedoc`.
## Documentation and resources ## Documentation and resources
* Official app website: https://hedgedoc.org - Official app website: <https://hedgedoc.org>
* Official user documentation: https://yunohost.org/en/app_hedgedoc - Official admin documentation: <https://docs.hedgedoc.org/>
* Official admin documentation: https://docs.hedgedoc.org/ - Upstream app code repository: <https://github.com/hedgedoc/hedgedoc>
* Upstream app code repository: https://github.com/hedgedoc/hedgedoc - YunoHost Store: <https://apps.yunohost.org/app/hedgedoc>
* YunoHost documentation for this app: https://yunohost.org/app_hedgedoc - Report a bug: <https://github.com/YunoHost-Apps/hedgedoc_ynh/issues>
* Report a bug: https://github.com/YunoHost-Apps/hedgedoc_ynh/issues
## Developer info ## Developer info
Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/hedgedoc_ynh/tree/testing). Please send your pull request to the [`testing` branch](https://github.com/YunoHost-Apps/hedgedoc_ynh/tree/testing).
To try the testing branch, please proceed like that. To try the `testing` branch, please proceed like that:
```
```bash
sudo yunohost app install https://github.com/YunoHost-Apps/hedgedoc_ynh/tree/testing --debug sudo yunohost app install https://github.com/YunoHost-Apps/hedgedoc_ynh/tree/testing --debug
or or
sudo yunohost app upgrade hedgedoc -u 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
``` ```
**More info regarding app packaging:** https://yunohost.org/packaging_apps **More info regarding app packaging:** <https://yunohost.org/packaging_apps>

60
README_es.md Normal file
View file

@ -0,0 +1,60 @@
<!--
Este archivo README esta generado automaticamente<https://github.com/YunoHost/apps/tree/master/tools/readme_generator>
No se debe editar a mano.
-->
# 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)
[![Instalar HedgeDoc con Yunhost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=hedgedoc)
*[Leer este README en otros idiomas.](./ALL_README.md)*
> *Este paquete le permite instalarHedgeDoc rapidamente y simplement en un servidor YunoHost.*
> *Si no tiene YunoHost, visita [the guide](https://yunohost.org/install) para aprender como instalarla.*
## Descripción general
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ón actual:** 1.9.9~ynh3
**Demo:** <https://demo.hedgedoc.org/>
## Capturas
![Captura de HedgeDoc](./doc/screenshots/screenshot.png)
## Documentaciones y recursos
- Sitio web oficial: <https://hedgedoc.org>
- Documentación administrador oficial: <https://docs.hedgedoc.org/>
- Repositorio del código fuente oficial de la aplicación : <https://github.com/hedgedoc/hedgedoc>
- Catálogo YunoHost: <https://apps.yunohost.org/app/hedgedoc>
- Reportar un error: <https://github.com/YunoHost-Apps/hedgedoc_ynh/issues>
## Información para desarrolladores
Por favor enviar sus correcciones a la [`branch testing`](https://github.com/YunoHost-Apps/hedgedoc_ynh/tree/testing
Para probar la rama `testing`, sigue asÍ:
```bash
sudo yunohost app install https://github.com/YunoHost-Apps/hedgedoc_ynh/tree/testing --debug
o
sudo yunohost app upgrade hedgedoc -u https://github.com/YunoHost-Apps/hedgedoc_ynh/tree/testing --debug
```
**Mas informaciones sobre el empaquetado de aplicaciones:** <https://yunohost.org/packaging_apps>

60
README_eu.md Normal file
View file

@ -0,0 +1,60 @@
<!--
Ohart ongi: README hau automatikoki sortu da <https://github.com/YunoHost/apps/tree/master/tools/readme_generator>ri esker
EZ editatu eskuz.
-->
# 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)
[![Instalatu HedgeDoc YunoHost-ekin](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=hedgedoc)
*[Irakurri README hau beste hizkuntzatan.](./ALL_README.md)*
> *Pakete honek HedgeDoc YunoHost zerbitzari batean azkar eta zailtasunik gabe instalatzea ahalbidetzen dizu.*
> *YunoHost ez baduzu, kontsultatu [gida](https://yunohost.org/install) nola instalatu ikasteko.*
## Aurreikuspena
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
**Paketatutako bertsioa:** 1.9.9~ynh3
**Demoa:** <https://demo.hedgedoc.org/>
## Pantaila-argazkiak
![HedgeDoc(r)en pantaila-argazkia](./doc/screenshots/screenshot.png)
## Dokumentazioa eta baliabideak
- Aplikazioaren webgune ofiziala: <https://hedgedoc.org>
- Administratzaileen dokumentazio ofiziala: <https://docs.hedgedoc.org/>
- Jatorrizko aplikazioaren kode-gordailua: <https://github.com/hedgedoc/hedgedoc>
- YunoHost Denda: <https://apps.yunohost.org/app/hedgedoc>
- Eman errore baten berri: <https://github.com/YunoHost-Apps/hedgedoc_ynh/issues>
## Garatzaileentzako informazioa
Bidali `pull request`a [`testing` abarrera](https://github.com/YunoHost-Apps/hedgedoc_ynh/tree/testing).
`testing` abarra probatzeko, ondorengoa egin:
```bash
sudo yunohost app install https://github.com/YunoHost-Apps/hedgedoc_ynh/tree/testing --debug
edo
sudo yunohost app upgrade hedgedoc -u https://github.com/YunoHost-Apps/hedgedoc_ynh/tree/testing --debug
```
**Informazio gehiago aplikazioaren paketatzeari buruz:** <https://yunohost.org/packaging_apps>

View file

@ -1,51 +1,60 @@
<!--
Nota bene: ce README est automatiquement généré par <https://github.com/YunoHost/apps/tree/master/tools/readme_generator>
Il NE doit PAS être modifié à la main.
-->
# HedgeDoc pour YunoHost # HedgeDoc pour YunoHost
[![Niveau d'intégration](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) [![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)
[![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)
*[Read this readme in english.](./README.md)* *[Lire le README dans d'autres langues.](./ALL_README.md)*
*[Lire ce readme en français.](./README_fr.md)*
> *Ce package vous permet d'installer HedgeDoc rapidement et simplement sur un serveur YunoHost. > *Ce package vous permet dinstaller 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.* > *Si vous navez pas YunoHost, consultez [ce guide](https://yunohost.org/install) pour savoir comment linstaller et en profiter.*
## Vue d'ensemble ## Vue densemble
Éditeur collaboratif pour travailler sur des notes en Markdown HedgeDoc (anciennement connu sous le nom de CodiMD) est un éditeur open source, basé sur le Web, auto-hébergé et collaboratif.
Vous pouvez l'utiliser pour collaborer facilement sur des notes, des graphiques et même des présentations en temps réel. Tout ce que vous avez à faire est de partager votre lien de note avec vos collègues et ils sont prêts à partir.
**Version incluse :** 2.0.0~ynh1 **Version incluse :** 2.0.0~ynh1
**Démo :** https://demo.hedgedoc.org/ - Collaboration en temps réel
- Graphiques et diagrammes
- Révisions
- Mode présentation
- Système d'autorisation facile à utiliser
- Faible configuration système requise
## Captures d'écran
![](./doc/screenshots/screenshot.png) **Version incluse:** 1.9.9~ynh3
## Avertissements / informations importantes **Démo:** <https://demo.hedgedoc.org/>
## Configuration ## Captures décran
Vous pouvez configurer HedgeDoc en modifiant le fichier `/var/www/hedgedoc/config.json` et en vous aidant de la [documentation](https://github.com/hedgedoc/hedgedoc/blob/master/docs/configuration.md) ![Capture décran de HedgeDoc](./doc/screenshots/screenshot.png)
Lorsque vous avez terminé de modifier la configuration, pour que vos modifications prennent effet, vous devrez exécuter : `sudo systemctl restart hedgedoc`.
## Documentations et ressources ## Documentations et ressources
* Site officiel de l'app : https://hedgedoc.org - Site officiel de lapp: <https://hedgedoc.org>
* Documentation officielle utilisateur : https://yunohost.org/en/app_hedgedoc - Documentation officielle de ladmin: <https://docs.hedgedoc.org/>
* Documentation officielle de l'admin : https://docs.hedgedoc.org/ - Dépôt de code officiel de lapp: <https://github.com/hedgedoc/hedgedoc>
* Dépôt de code officiel de l'app : https://github.com/hedgedoc/hedgedoc - YunoHost Store: <https://apps.yunohost.org/app/hedgedoc>
* Documentation YunoHost pour cette app : https://yunohost.org/app_hedgedoc - Signaler un bug: <https://github.com/YunoHost-Apps/hedgedoc_ynh/issues>
* Signaler un bug : https://github.com/YunoHost-Apps/hedgedoc_ynh/issues
## Informations pour les développeurs ## Informations pour les développeurs
Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/hedgedoc_ynh/tree/testing). Merci de faire vos pull request sur la [branche `testing`](https://github.com/YunoHost-Apps/hedgedoc_ynh/tree/testing).
Pour essayer la branche testing, procédez comme suit. Pour essayer la branche `testing`, procédez comme suit:
```
```bash
sudo yunohost app install https://github.com/YunoHost-Apps/hedgedoc_ynh/tree/testing --debug sudo yunohost app install https://github.com/YunoHost-Apps/hedgedoc_ynh/tree/testing --debug
ou ou
sudo yunohost app upgrade hedgedoc -u 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
``` ```
**Plus d'infos sur le packaging d'applications :** https://yunohost.org/packaging_apps **Plus dinfos sur le packaging dapplications:** <https://yunohost.org/packaging_apps>

60
README_gl.md Normal file
View file

@ -0,0 +1,60 @@
<!--
NOTA: Este README foi creado automáticamente por <https://github.com/YunoHost/apps/tree/master/tools/readme_generator>
NON debe editarse manualmente.
-->
# 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)
[![Instalar HedgeDoc con YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=hedgedoc)
*[Le este README en outros idiomas.](./ALL_README.md)*
> *Este paquete permíteche instalar HedgeDoc de xeito rápido e doado nun servidor YunoHost.*
> *Se non usas YunoHost, le a [documentación](https://yunohost.org/install) para saber como instalalo.*
## Vista xeral
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ón proporcionada:** 1.9.9~ynh3
**Demo:** <https://demo.hedgedoc.org/>
## Capturas de pantalla
![Captura de pantalla de HedgeDoc](./doc/screenshots/screenshot.png)
## Documentación e recursos
- Web oficial da app: <https://hedgedoc.org>
- Documentación oficial para admin: <https://docs.hedgedoc.org/>
- Repositorio de orixe do código: <https://github.com/hedgedoc/hedgedoc>
- Tenda YunoHost: <https://apps.yunohost.org/app/hedgedoc>
- Informar dun problema: <https://github.com/YunoHost-Apps/hedgedoc_ynh/issues>
## Info de desenvolvemento
Envía a túa colaboración á [rama `testing`](https://github.com/YunoHost-Apps/hedgedoc_ynh/tree/testing).
Para probar a rama `testing`, procede deste xeito:
```bash
sudo yunohost app install https://github.com/YunoHost-Apps/hedgedoc_ynh/tree/testing --debug
ou
sudo yunohost app upgrade hedgedoc -u https://github.com/YunoHost-Apps/hedgedoc_ynh/tree/testing --debug
```
**Máis info sobre o empaquetado da app:** <https://yunohost.org/packaging_apps>

60
README_it.md Normal file
View file

@ -0,0 +1,60 @@
<!--
N.B.: Questo README è stato automaticamente generato da <https://github.com/YunoHost/apps/tree/master/tools/readme_generator>
NON DEVE essere modificato manualmente.
-->
# HedgeDoc per YunoHost
[![Livello di integrazione](https://dash.yunohost.org/integration/hedgedoc.svg)](https://dash.yunohost.org/appci/app/hedgedoc) ![Stato di funzionamento](https://ci-apps.yunohost.org/ci/badges/hedgedoc.status.svg) ![Stato di manutenzione](https://ci-apps.yunohost.org/ci/badges/hedgedoc.maintain.svg)
[![Installa HedgeDoc con YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=hedgedoc)
*[Leggi questo README in altre lingue.](./ALL_README.md)*
> *Questo pacchetto ti permette di installare HedgeDoc su un server YunoHost in modo semplice e veloce.*
> *Se non hai YunoHost, consulta [la guida](https://yunohost.org/install) per imparare a installarlo.*
## Panoramica
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
**Versione pubblicata:** 1.9.9~ynh2
**Prova:** <https://demo.hedgedoc.org/>
## Screenshot
![Screenshot di HedgeDoc](./doc/screenshots/screenshot.png)
## Documentazione e risorse
- Sito web ufficiale dellapp: <https://hedgedoc.org>
- Documentazione ufficiale per gli amministratori: <https://docs.hedgedoc.org/>
- Repository upstream del codice dellapp: <https://github.com/hedgedoc/hedgedoc>
- Store di YunoHost: <https://apps.yunohost.org/app/hedgedoc>
- Segnala un problema: <https://github.com/YunoHost-Apps/hedgedoc_ynh/issues>
## Informazioni per sviluppatori
Si prega di inviare la tua pull request alla [branch di `testing`](https://github.com/YunoHost-Apps/hedgedoc_ynh/tree/testing).
Per provare la branch di `testing`, si prega di procedere in questo modo:
```bash
sudo yunohost app install https://github.com/YunoHost-Apps/hedgedoc_ynh/tree/testing --debug
o
sudo yunohost app upgrade hedgedoc -u https://github.com/YunoHost-Apps/hedgedoc_ynh/tree/testing --debug
```
**Maggiori informazioni riguardo il pacchetto di questapp:** <https://yunohost.org/packaging_apps>

60
README_zh_Hans.md Normal file
View file

@ -0,0 +1,60 @@
<!--
注意:此 README 由 <https://github.com/YunoHost/apps/tree/master/tools/readme_generator> 自动生成
请勿手动编辑。
-->
# 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)
[![使用 YunoHost 安装 HedgeDoc](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=hedgedoc)
*[阅读此 README 的其它语言版本。](./ALL_README.md)*
> *通过此软件包,您可以在 YunoHost 服务器上快速、简单地安装 HedgeDoc。*
> *如果您还没有 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.9.9~ynh3
**演示:** <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>
- 报告 bug <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

@ -1,26 +0,0 @@
;; Test complet
; Manifest
domain="domain.tld"
path="/path"
admin="john"
is_public=1
; Checks
pkg_linter=1
setup_sub_dir=1
setup_root=1
setup_nourl=0
setup_private=1
setup_public=1
upgrade=1
upgrade=1 from_commit=2a6ed9db5f7f0644eab251b2495c190811735832
backup_restore=1
multi_instance=1
change_url=1
;;; Options
Email=
Notification=none
;;; Upgrade options
; commit=2a6ed9db5f7f0644eab251b2495c190811735832
name=Testing (#13)
manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&password=pass&port=666&

View file

@ -1,6 +0,0 @@
SOURCE_URL=https://github.com/hedgedoc/hedgedoc/releases/download/1.8.2/hedgedoc-1.8.2.tar.gz
SOURCE_SUM=e325d433aba6f5e9de91162dd97a605e29ebc5e740750cd47054abfdc1f8fd42
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true
SOURCE_FILENAME=

View file

@ -7,19 +7,41 @@ After=network.target postgresql.service
Type=simple Type=simple
User=__APP__ User=__APP__
Group=__APP__ Group=__APP__
WorkingDirectory=__FINALPATH__/backend WorkingDirectory=__INSTALL_DIR__/backend
Environment="PATH=__ENV_PATH__" Environment="__YNH_NODE_LOAD_PATH__"
Environment="NODE_ENV=production" Environment="NODE_ENV=production"
ExecStart=__YNH_NPM__ start ExecStart=__YNH_NPM__ start
Restart=always Restart=always
PrivateTmp=true
PrivateDevices=true
ProtectControlGroups=true # Sandboxing options to harden security
ProtectHome=true # Depending on specificities of your service/app, you may need to tweak these
ProtectKernelTunables=true # .. but this should be a good baseline
# Details for these options: https://www.freedesktop.org/software/systemd/man/systemd.exec.html
NoNewPrivileges=yes
PrivateTmp=yes
PrivateDevices=yes
RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6
RestrictNamespaces=yes
RestrictRealtime=yes
DevicePolicy=closed
ProtectSystem=full ProtectSystem=full
RestrictSUIDSGID=true ProtectControlGroups=yes
ProtectKernelModules=yes
ProtectKernelTunables=yes
LockPersonality=yes
SystemCallFilter=~@clock @debug @module @mount @obsolete @reboot @setuid @swap
# Denying access to capabilities that should not be relevant for webapps
# Doc: https://man7.org/linux/man-pages/man7/capabilities.7.html
CapabilityBoundingSet=~CAP_RAWIO CAP_MKNOD
CapabilityBoundingSet=~CAP_AUDIT_CONTROL CAP_AUDIT_READ CAP_AUDIT_WRITE
CapabilityBoundingSet=~CAP_SYS_BOOT CAP_SYS_TIME CAP_SYS_MODULE CAP_SYS_PACCT
CapabilityBoundingSet=~CAP_LEASE CAP_LINUX_IMMUTABLE CAP_IPC_LOCK
CapabilityBoundingSet=~CAP_BLOCK_SUSPEND CAP_WAKE_ALARM
CapabilityBoundingSet=~CAP_SYS_TTY_CONFIG
CapabilityBoundingSet=~CAP_MAC_ADMIN CAP_MAC_OVERRIDE
CapabilityBoundingSet=~CAP_NET_ADMIN CAP_NET_BROADCAST CAP_NET_RAW
CapabilityBoundingSet=~CAP_SYS_ADMIN CAP_SYS_PTRACE CAP_SYSLOG
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target

View file

@ -1,9 +1,5 @@
location ^~ __PATH__/ { #sub_path_only rewrite ^__PATH__$ __PATH__/ permanent;
location __PATH__/ {
# Force usage of https
if ($scheme = http) {
rewrite ^ https://$server_name$request_uri? permanent;
}
proxy_pass http://127.0.0.1:__PORT_FRONTEND__/; proxy_pass http://127.0.0.1:__PORT_FRONTEND__/;
proxy_redirect off; proxy_redirect off;

52
config_panel.toml Normal file
View file

@ -0,0 +1,52 @@
version = "1.0"
[main]
name = "HedgeDoc configuration"
services = ["__APP__"]
[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 = "allowAnonymous:__INSTALL_DIR__/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 = "allowAnonymousEdits:__INSTALL_DIR__/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 = "allowEmailRegister:__INSTALL_DIR__/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 = "allowFreeURL:__INSTALL_DIR__/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 = "requireFreeURLAuthentication:__INSTALL_DIR__/config.json"

4
doc/ADMIN.md Normal file
View file

@ -0,0 +1,4 @@
## Configuration
You can configure HedgeDoc by editing this file `__INSTALL_DIR__/config.json` using the [documentation](https://github.com/hedgedoc/hedgedoc/blob/master/docs/configuration.md)
When you finished editing the configuration, for your changes to take effect, you will have to run: `sudo systemctl restart hedgedoc`.

4
doc/ADMIN_fr.md Normal file
View file

@ -0,0 +1,4 @@
## Configuration
Vous pouvez configurer HedgeDoc en modifiant le fichier `__INSTALL_DIR__/config.json` et en vous aidant de la [documentation](https://github.com/hedgedoc/hedgedoc/blob/master/docs/configuration.md)
Lorsque vous avez terminé de modifier la configuration, pour que vos modifications prennent effet, vous devrez exécuter : `sudo systemctl restart hedgedoc`.

11
doc/DESCRIPTION.md Normal file
View file

@ -0,0 +1,11 @@
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

11
doc/DESCRIPTION_fr.md Normal file
View file

@ -0,0 +1,11 @@
HedgeDoc (anciennement connu sous le nom de CodiMD) est un éditeur open source, basé sur le Web, auto-hébergé et collaboratif.
Vous pouvez l'utiliser pour collaborer facilement sur des notes, des graphiques et même des présentations en temps réel. Tout ce que vous avez à faire est de partager votre lien de note avec vos collègues et ils sont prêts à partir.
### Caractéristiques
- Collaboration en temps réel
- Graphiques et diagrammes
- Révisions
- Mode présentation
- Système d'autorisation facile à utiliser
- Faible configuration système requise

View file

@ -1,4 +0,0 @@
## Configuration
You can configure HedgeDoc by editing this file `/var/www/hedgedoc/config.json` using the [documentation](https://github.com/hedgedoc/hedgedoc/blob/master/docs/configuration.md)
When you finished editing the configuration, for your changes to take effect, you will have to run: `sudo systemctl restart hedgedoc`.

View file

@ -1,4 +0,0 @@
## Configuration
Vous pouvez configurer HedgeDoc en modifiant le fichier `/var/www/hedgedoc/config.json` et en vous aidant de la [documentation](https://github.com/hedgedoc/hedgedoc/blob/master/docs/configuration.md)
Lorsque vous avez terminé de modifier la configuration, pour que vos modifications prennent effet, vous devrez exécuter : `sudo systemctl restart hedgedoc`.

View file

@ -1,54 +0,0 @@
{
"name": "HedgeDoc",
"id": "hedgedoc",
"packaging_format": 1,
"description": {
"en": "Collaborative editor to work on notes written in Markdown",
"fr": "Éditeur collaboratif pour travailler sur des notes en Markdown"
},
"version": "2.0.0~ynh1",
"url": "https://hedgedoc.org",
"upstream": {
"license": "free",
"website": "https://hedgedoc.org",
"demo": "https://demo.hedgedoc.org/",
"admindoc": "https://docs.hedgedoc.org/",
"userdoc": "https://yunohost.org/en/app_hedgedoc",
"code": "https://github.com/hedgedoc/hedgedoc"
},
"license": "AGPL-3.0-only",
"maintainer": {
"name": "eric_G"
},
"requirements": {
"yunohost": ">= 4.2.4"
},
"multi_instance": true,
"services": [
"nginx"
],
"arguments": {
"install" : [
{
"name": "domain",
"type": "domain",
"example": "domain.org"
},
{
"name": "path",
"type": "path",
"example": "/hedgedoc",
"default": "/hedgedoc"
},
{
"name": "is_public",
"type": "boolean",
"help": {
"en": "If enabled, HedgeDoc will be accessible by people who do not have an account. This can be changed later via the webadmin.",
"fr": "Si cette case est cochée, HedgeDoc sera accessible aux personnes nayant pas de compte. Vous pourrez changer ceci plus tard via la webadmin."
},
"default": true
}
]
}
}

72
manifest.toml Normal file
View file

@ -0,0 +1,72 @@
packaging_format = 2
id = "hedgedoc"
name = "HedgeDoc"
description.en = "Collaborative editor to work on notes written in Markdown"
description.fr = "Éditeur collaboratif pour travailler sur des notes en Markdown"
version = "1.9.9~ynh3"
maintainers = []
[upstream]
license = "AGPL-3.0-only"
website = "https://hedgedoc.org"
demo = "https://demo.hedgedoc.org/"
admindoc = "https://docs.hedgedoc.org/"
code = "https://github.com/hedgedoc/hedgedoc"
[integration]
yunohost = ">= 11.2"
architectures = "all"
multi_instance = true
ldap = true
sso = true
disk = "50M"
ram.build = "900M"
ram.runtime = "50M"
[install]
[install.domain]
type = "domain"
[install.path]
type = "path"
default = "/hedgedoc"
[install.init_main_permission]
help.en = "Set to visitors, HedgeDoc will be accessible by people who do not have an account. This can be changed later via the webadmin."
help.fr = "Défini sur visiteurs, HedgeDoc sera accessible aux personnes nayant pas de compte. Vous pourrez changer ceci plus tard via la webadmin."
type = "group"
default = "visitors"
[resources]
[resources.sources]
[resources.sources.main]
url = "https://github.com/hedgedoc/hedgedoc/releases/download/1.9.9/hedgedoc-1.9.9.tar.gz"
sha256 = "1769d30e60458040475a6d74f53952101962c40c390765e19e6ff6f3fe70c008"
autoupdate.strategy = "latest_github_tag"
[resources.ports]
[resources.system_user]
[resources.install_dir]
[resources.permissions]
main.url = "/"
[resources.apt]
packages = "postgresql"
extras.yarn.repo = "deb https://dl.yarnpkg.com/debian/ stable main"
extras.yarn.key = "https://dl.yarnpkg.com/debian/pubkey.gpg"
extras.yarn.packages = "yarn"
[resources.database]
type = "postgresql"

View file

@ -4,10 +4,7 @@
# COMMON VARIABLES # COMMON VARIABLES
#================================================= #=================================================
# dependencies used by the app nodejs_version=20
pkg_dependencies="postgresql apt-transport-https"
nodejs_version=14
#================================================= #=================================================
# PERSONAL HELPERS # PERSONAL HELPERS

View file

@ -9,27 +9,6 @@
source ../settings/scripts/_common.sh source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
#=================================================
# MANAGE SCRIPT FAILURE
#=================================================
ynh_clean_setup () {
ynh_clean_check_starting
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#=================================================
# LOAD SETTINGS
#=================================================
ynh_print_info --message="Loading installation settings..."
app=$YNH_APP_INSTANCE_NAME
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
domain=$(ynh_app_setting_get --app=$app --key=domain)
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
#================================================= #=================================================
# DECLARE DATA AND CONF FILES TO BACKUP # DECLARE DATA AND CONF FILES TO BACKUP
#================================================= #=================================================
@ -39,20 +18,14 @@ ynh_print_info --message="Declaring files to be backed up..."
# BACKUP THE APP MAIN DIR # BACKUP THE APP MAIN DIR
#================================================= #=================================================
ynh_backup --src_path="$final_path" ynh_backup --src_path="$install_dir"
#================================================= #=================================================
# BACKUP THE NGINX CONFIGURATION # SYSTEM 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"
#=================================================
# SPECIFIC BACKUP
#=================================================
# BACKUP SYSTEMD
#=================================================
ynh_backup --src_path="/etc/systemd/system/$app.service" ynh_backup --src_path="/etc/systemd/system/$app.service"
#================================================= #=================================================
@ -66,4 +39,4 @@ ynh_psql_dump_db --database="$db_name" > db.sql
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_print_info --message="Backup script completed for HedgeDoc. (YunoHost will then actually copy those files to the archive)." ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."

View file

@ -9,63 +9,6 @@
source _common.sh source _common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
#=================================================
# RETRIEVE ARGUMENTS
#=================================================
old_domain=$YNH_APP_OLD_DOMAIN
old_path=$YNH_APP_OLD_PATH
new_domain=$YNH_APP_NEW_DOMAIN
new_path=$YNH_APP_NEW_PATH
app=$YNH_APP_INSTANCE_NAME
#=================================================
# LOAD SETTINGS
#=================================================
ynh_script_progression --message="Loading installation settings..." --weight=1
# Needed for helper "ynh_add_nginx_config"
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
port=$(ynh_app_setting_get --app=$app --key=port)
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)
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
ynh_script_progression --message="Backing up HedgeDoc before changing its URL (may take a while)..." --weight=1
# Backup the current version of the app
ynh_backup_before_upgrade
ynh_clean_setup () {
# Remove the new domain config file, the remove script won't do it as it doesn't know yet its location.
ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf"
# restore it if the upgrade fails
ynh_restore_upgradebackup
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#=================================================
# CHECK WHICH PARTS SHOULD BE CHANGED
#=================================================
change_domain=0
if [ "$old_domain" != "$new_domain" ]
then
change_domain=1
fi
change_path=0
if [ "$old_path" != "$new_path" ]
then
change_path=1
fi
#================================================= #=================================================
# STANDARD MODIFICATIONS # STANDARD MODIFICATIONS
#================================================= #=================================================
@ -73,36 +16,14 @@ fi
#================================================= #=================================================
ynh_script_progression --message="Stopping a systemd service..." --weight=1 ynh_script_progression --message="Stopping a systemd service..." --weight=1
ynh_systemd_action --service_name=$app --action=stop --log_path="/var/log/$app/$app.log" ynh_systemd_action --service_name=$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 --message="Updating NGINX web server configuration..." --weight=1
nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf ynh_change_url_nginx_config
# Change the path in the NGINX config file
if [ $change_path -eq 1 ]
then
# Make a backup of the original NGINX config file if modified
ynh_backup_if_checksum_is_different --file="$nginx_conf_path"
# Set global variables for NGINX helper
domain="$old_domain"
path_url="$new_path"
# Create a dedicated NGINX config
ynh_add_nginx_config
fi
# Change the domain for NGINX
if [ $change_domain -eq 1 ]
then
# Delete file checksum for the old conf file location
ynh_delete_file_checksum --file="$nginx_conf_path"
mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf
# Store file checksum for the new config file location
ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf"
fi
#================================================= #=================================================
# SPECIFIC MODIFICATIONS # SPECIFIC MODIFICATIONS
@ -110,12 +31,15 @@ fi
# CONFIGURE HEDGEDOC # CONFIGURE HEDGEDOC
#================================================= #=================================================
ynh_backup_if_checksum_is_different --file="$final_path/config.json" ynh_backup_if_checksum_is_different --file="$install_dir/config.json"
domain=$new_domain domain=$new_domain
path=${new_path:1} url_path=${new_path#/}
ynh_add_config --template="../conf/config.json.example" --destination="$final_path/config.json" ynh_add_config --template="../conf/config.json.example" --destination="$install_dir/config.json"
chmod 400 "$install_dir/config.json"
chown $app:$app "$install_dir/config.json"
#================================================= #=================================================
# GENERIC FINALISATION # GENERIC FINALISATION
@ -127,15 +51,8 @@ ynh_script_progression --message="Starting a systemd service..." --weight=1
# 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_systemd_action --service_name=$app --action=start --log_path=systemd --line_match="HTTP Server listening"
#=================================================
# RELOAD NGINX
#=================================================
ynh_script_progression --message="Reloading NGINX web server..." --weight=1
ynh_systemd_action --service_name=nginx --action=reload
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Change of URL completed for HedgeDoc" --last ynh_script_progression --message="Change of URL completed for $app" --last

View file

@ -9,41 +9,19 @@
source _common.sh source _common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
#=================================================
# MANAGE SCRIPT FAILURE
#=================================================
ynh_clean_setup () {
ynh_clean_check_starting
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#================================================= #=================================================
# RETRIEVE ARGUMENTS FROM THE MANIFEST # RETRIEVE ARGUMENTS FROM THE MANIFEST
#================================================= #=================================================
domain=$YNH_APP_ARG_DOMAIN allow_anonymous=false
path_url=$YNH_APP_ARG_PATH allow_anonymous_edits=false
is_public=$YNH_APP_ARG_IS_PUBLIC allow_email_registration=false
allow_free_url=false
app=$YNH_APP_INSTANCE_NAME require_free_url_authentication=false
#=================================================
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
#=================================================
ynh_script_progression --message="Validating installation parameters..." --weight=1
final_path=/var/www/$app
test ! -e "$final_path" || ynh_die --message="This path already contains a folder"
# Register (book) web path
ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url
#================================================= #=================================================
# STORE SETTINGS FROM MANIFEST # STORE SETTINGS FROM MANIFEST
#================================================= #=================================================
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=domain --value=$domain
ynh_app_setting_set --app=$app --key=path --value=$path_url ynh_app_setting_set --app=$app --key=path --value=$path_url
@ -68,75 +46,54 @@ ynh_app_setting_set --app=$app --key=port_frontend --value=$port_frontend
#================================================= #=================================================
ynh_script_progression --message="Installing dependencies..." --weight=20 ynh_script_progression --message="Installing dependencies..." --weight=20
ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
# Install Nodejs # Install Nodejs
ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
ynh_use_nodejs
# Install Yarn
ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg"
#=================================================
# CREATE DEDICATED USER
#=================================================
ynh_script_progression --message="Configuring system user..." --weight=2
# Create a system user
ynh_system_user_create --username=$app --home_dir=$final_path
#=================================================
# CREATE A POSTGRESQL DATABASE
#=================================================
ynh_script_progression --message="Creating a PostgreSQL database..." --weight=2
db_name=$(ynh_sanitize_dbid --db_name=$app)
ynh_app_setting_set --app=$app --key=db_name --value=$db_name
ynh_psql_test_if_first_run
ynh_psql_setup_db --db_user=$db_name --db_name=$db_name
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
#================================================= #=================================================
ynh_script_progression --message="Setting up source files..." --weight=2 ynh_script_progression --message="Setting up source files..." --weight=2
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
# 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=$final_path #ynh_setup_source --dest_dir=$install_dir
mkdir -p $final_path/backend mkdir -p $install_dir/backend
mkdir -p $final_path/frontend mkdir -p $install_dir/frontend
git clone --depth 1 https://github.com/hedgedoc/hedgedoc -b develop $final_path/backend git clone --depth 1 https://github.com/hedgedoc/hedgedoc -b develop $install_dir/backend
git clone --depth 1 https://github.com/hedgedoc/react-client $final_path/frontend git clone --depth 1 https://github.com/hedgedoc/react-client $install_dir/frontend
#================================================= #=================================================
# NGINX CONFIGURATION # SYSTEM CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Configuring NGINX web server..." --weight=2 ynh_script_progression --message="Adding system configurations related to $app..." --weight=1
# Create a dedicated NGINX config
ynh_add_nginx_config ynh_add_nginx_config
ynh_add_systemd_config
yunohost service add $app --description="Collaborative Markdown editor" --log="/var/log/$app/$app.log"
#================================================= #=================================================
# SPECIFIC SETUP # SPECIFIC SETUP
#============================================== #==============================================
# INSTALL HEDGEDOC # INSTALL HEDGEDOC
#============================================== #==============================================
ynh_use_nodejs
ynh_script_progression --message="Building HedgeDoc backend... (this will take some time and resources!)" --weight=20 ynh_script_progression --message="Building HedgeDoc backend... (this will take some time and resources!)" --weight=20
pushd "$final_path/backend" || ynh_die pushd "$install_dir/backend"
ynh_exec_warn_less yarn install ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH yarn install
popd || ynh_die popd
ynh_script_progression --message="Building HedgeDoc frontend... (this will take some time and resources!)" --weight=20 ynh_script_progression --message="Building HedgeDoc frontend... (this will take some time and resources!)" --weight=20
pushd "$final_path/frontend" || ynh_die pushd "$install_dir/frontend"
ynh_exec_warn_less yarn install ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH yarn install
# TODO: Fails out of memory in my tests # TODO: Fails out of memory in my tests
# Production build # Production build
# Not sure if PORT is necessary here # Not sure if PORT is necessary here
# PORT=$port_frontend REACT_APP_BACKEND_BASE_URL=http://localhost:$port_backend/ yarn build:production # PORT=$port_frontend REACT_APP_BACKEND_BASE_URL=http://localhost:$port_backend/ yarn build:production
popd || ynh_die popd
#================================================= #=================================================
# SETUP SYSTEMD # SETUP SYSTEMD
@ -155,7 +112,7 @@ ynh_add_systemd_config --service="${app}_frontend" --template="../conf/frontend.
ynh_script_progression --message="Modifying a config file..." --weight=1 ynh_script_progression --message="Modifying a config file..." --weight=1
#path=${path_url:1} #path=${path_url:1}
ynh_add_config --template="../conf/env_backend" --destination="$final_path/backend/.env" ynh_add_config --template="env_backend" --destination="$install_dir/backend/.env"
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION
@ -165,8 +122,8 @@ ynh_add_config --template="../conf/env_backend" --destination="$final_path/backe
ynh_script_progression --message="Securing files and directories..." --weight=1 ynh_script_progression --message="Securing files and directories..." --weight=1
# Set permissions to app files # Set permissions to app files
chown -R $app:$app $final_path chown -R $app:$app $install_dir
chmod o-rwx $final_path chmod o-rwx $install_dir
#================================================= #=================================================
# INTEGRATE SERVICE IN YUNOHOST # INTEGRATE SERVICE IN YUNOHOST
@ -185,26 +142,8 @@ ynh_script_progression --message="Starting a systemd service..." --weight=2
ynh_systemd_action --service_name="${app}_backend" --action=start --log_path=systemd ynh_systemd_action --service_name="${app}_backend" --action=start --log_path=systemd
ynh_systemd_action --service_name="${app}_frontend" --action=start --log_path=systemd ynh_systemd_action --service_name="${app}_frontend" --action=start --log_path=systemd
#=================================================
# SETUP SSOWAT
#=================================================
ynh_script_progression --message="Configuring permissions..." --weight=1
# Make app public if necessary or protect it
if [ $is_public -eq 1 ]
then
ynh_permission_update --permission="main" --add="visitors"
fi
#=================================================
# RELOAD NGINX
#=================================================
ynh_script_progression --message="Reloading NGINX web server..." --weight=2
ynh_systemd_action --service_name=nginx --action=reload
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Installation of HedgeDoc completed" --last ynh_script_progression --message="Installation of $app completed" --last

View file

@ -10,22 +10,11 @@ source _common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
#================================================= #=================================================
# LOAD SETTINGS # REMOVE SYSTEM CONFIGURATIONS
#================================================= #=================================================
ynh_script_progression --message="Loading installation settings..." --weight=1 # REMOVE SYSTEMD SERVICE
app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get --app=$app --key=domain)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
db_user=$db_name
#=================================================
# STANDARD REMOVE
#=================================================
# REMOVE SERVICE INTEGRATION IN YUNOHOST
#================================================= #=================================================
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`) # Remove the service from the list of services known by YunoHost (added from `yunohost service add`)
if ynh_exec_warn_less yunohost service status ${app}_backend >/dev/null if ynh_exec_warn_less yunohost service status ${app}_backend >/dev/null
@ -49,52 +38,12 @@ ynh_script_progression --message="Stopping and removing the systemd services..."
ynh_remove_systemd_config --service=${app}_backend ynh_remove_systemd_config --service=${app}_backend
ynh_remove_systemd_config --service=${app}_frontend ynh_remove_systemd_config --service=${app}_frontend
#=================================================
# REMOVE THE POSTGRESQL DATABASE
#=================================================
ynh_script_progression --message="Removing the PostgreSQL database..." --weight=2
# Remove a database if it exists, along with the associated user
ynh_psql_remove_db --db_user=$db_user --db_name=$db_name
#=================================================
# REMOVE DEPENDENCIES
#=================================================
ynh_script_progression --message="Removing dependencies..." --weight=1
# Remove metapackage and its dependencies
ynh_remove_app_dependencies
ynh_remove_nodejs ynh_remove_nodejs
#=================================================
# REMOVE APP MAIN DIR
#=================================================
ynh_script_progression --message="Removing HedgeDoc main directory..." --weight=6
# Remove the app directory securely
ynh_secure_remove --file="$final_path"
#=================================================
# REMOVE NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Removing NGINX web server configuration..." --weight=5
# Remove the dedicated NGINX config
ynh_remove_nginx_config ynh_remove_nginx_config
#=================================================
# GENERIC FINALIZATION
#=================================================
# REMOVE DEDICATED USER
#=================================================
ynh_script_progression --message="Removing the dedicated system user..." --weight=1
# Delete a system user
ynh_system_user_delete --username=$app
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Removal of HedgeDoc completed" --last ynh_script_progression --message="Removal of $app completed" --last

View file

@ -9,73 +9,15 @@
source ../settings/scripts/_common.sh source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
#=================================================
# MANAGE SCRIPT FAILURE
#=================================================
ynh_clean_setup () {
ynh_clean_check_starting
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#=================================================
# LOAD SETTINGS
#=================================================
ynh_script_progression --message="Loading settings..." --weight=1
app=$YNH_APP_INSTANCE_NAME
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)
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)
#=================================================
# CHECK IF THE APP CAN BE RESTORED
#=================================================
ynh_script_progression --message="Validating restoration parameters..." --weight=2
ynh_webpath_available --domain=$domain --path_url=$path_url \
|| ynh_die --message="Path not available: ${domain}${path_url}"
test ! -d $final_path \
|| ynh_die --message="There is already a directory: $final_path "
#=================================================
# STANDARD RESTORATION STEPS
#=================================================
# RESTORE THE NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring the NGINX configuration..." --weight=1
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# RECREATE THE DEDICATED USER
#=================================================
ynh_script_progression --message="Recreating the dedicated system user..." --weight=1
# Create the dedicated user (if not existing)
ynh_system_user_create --username=$app --home_dir=$final_path
#================================================= #=================================================
# RESTORE THE APP MAIN DIR # RESTORE THE APP MAIN DIR
#================================================= #=================================================
ynh_script_progression --message="Restoring HedgeDoc main directory..." --weight=10 ynh_script_progression --message="Restoring HedgeDoc main directory..." --weight=10
ynh_restore_file --origin_path="$final_path" ynh_restore_file --origin_path="$install_dir"
#================================================= chmod -R o-rwx "$install_dir"
# RESTORE USER RIGHTS chown -R $app:www-data "$install_dir"
#=================================================
ynh_script_progression --message="Restoring user rights..." --weight=2
# Restore permissions on app files
chown -R $app:$app $final_path
chmod o-rwx $final_path
chmod 600 $final_path/config.json
#================================================= #=================================================
# SPECIFIC RESTORATION # SPECIFIC RESTORATION
@ -84,57 +26,39 @@ chmod 600 $final_path/config.json
#================================================= #=================================================
ynh_script_progression --message="Reinstalling dependencies..." --weight=6 ynh_script_progression --message="Reinstalling dependencies..." --weight=6
# Define and install dependencies
ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
# Install Nodejs # Install Nodejs
ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
# Install Yarn
ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg"
#================================================= #=================================================
# RESTORE THE POSTGRESQL DATABASE # RESTORE THE POSTGRESQL DATABASE
#================================================= #=================================================
ynh_script_progression --message="Restoring the PostgreSQL database..." --weight=6 ynh_script_progression --message="Restoring the PostgreSQL database..." --weight=6
ynh_psql_test_if_first_run
ynh_psql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd
ynh_psql_execute_file_as_root --file="./db.sql" --database=$db_name ynh_psql_execute_file_as_root --file="./db.sql" --database=$db_name
#================================================= #=================================================
# RESTORE SYSTEMD # RESTORE SYSTEMD
#================================================= #=================================================
ynh_script_progression --message="Restoring the systemd configuration..." --weight=5 ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_restore_file --origin_path="/etc/systemd/system/$app.service" ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
systemctl enable $app.service --quiet systemctl enable $app.service --quiet
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
#=================================================
ynh_script_progression --message="Integrating service in YunoHost..." --weight=2
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"
#================================================= #=================================================
# START SYSTEMD SERVICE # RELOAD NGINX AND PHP-FPM OR THE APP SERVICE
#================================================= #=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1
ynh_systemd_action --service_name=$app --action=start --log_path=systemd --line_match="HTTP Server listening" ynh_systemd_action --service_name=$app --action=start --log_path=systemd --line_match="HTTP Server listening"
#=================================================
# GENERIC FINALIZATION
#=================================================
# RELOAD NGINX
#=================================================
ynh_script_progression --message="Reloading NGINX web server..." --weight=1
ynh_systemd_action --service_name=nginx --action=reload ynh_systemd_action --service_name=nginx --action=reload
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Restoration completed for HedgeDoc" --last ynh_script_progression --message="Restoration completed for $app" --last

View file

@ -9,53 +9,35 @@
source _common.sh source _common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
#=================================================
# LOAD SETTINGS
#=================================================
ynh_script_progression --message="Loading installation settings..." --weight=2
app=$YNH_APP_INSTANCE_NAME
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)
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)
#=================================================
# CHECK VERSION
#=================================================
ynh_script_progression --message="Checking version..." --weight=2
upgrade_type=$(ynh_check_app_version_changed)
#================================================= #=================================================
# ENSURE DOWNWARD COMPATIBILITY # ENSURE DOWNWARD COMPATIBILITY
#================================================= #=================================================
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
# Cleaning legacy permissions if [ -z "${allow_anonymous:-}" ]; then
if ynh_legacy_permissions_exists; then allow_anonymous="false"
ynh_legacy_permissions_delete_all ynh_app_setting_set --app=$app --key=allow_anonymous --value=$allow_anonymous
ynh_app_setting_delete --app=$app --key=is_public
fi fi
#================================================= if [ -z "${allow_anonymous_edits:-}" ]; then
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP allow_anonymous_edits="false"
#================================================= ynh_app_setting_set --app=$app --key=allow_anonymous_edits --value=$allow_anonymous_edits
ynh_script_progression --message="Backing up HedgeDoc before upgrading (may take a while)..." --weight=10 fi
# Backup the current version of the app if [ -z "${allow_email_registration:-}" ]; then
ynh_backup_before_upgrade allow_email_registration="false"
ynh_clean_setup () { ynh_app_setting_set --app=$app --key=allow_email_registration --value=$allow_email_registration
# restore it if the upgrade fails fi
ynh_restore_upgradebackup
} if [ -z "${allow_free_url:-}" ]; then
# Exit if an error occurs during the execution of the script allow_free_url="false"
ynh_abort_if_errors 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
#================================================= #=================================================
# STANDARD UPGRADE STEPS # STANDARD UPGRADE STEPS
@ -66,90 +48,52 @@ ynh_script_progression --message="Stopping a systemd service..." --weight=1
ynh_systemd_action --service_name=$app --action=stop --log_path=systemd ynh_systemd_action --service_name=$app --action=stop --log_path=systemd
#=================================================
# CREATE DEDICATED USER
#=================================================
ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1
# Create a dedicated user (if not existing)
ynh_system_user_create --username=$app --home_dir=$final_path
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
#================================================= #=================================================
ynh_script_progression --message="Upgrading source files..." --weight=10
if [ "$upgrade_type" == "UPGRADE_APP" ] # Download, check integrity, uncompress and patch the source from app.src
then ynh_setup_source --dest_dir=$install_dir --keep="config.json"
ynh_script_progression --message="Upgrading source files..." --weight=10
# Download, check integrity, uncompress and patch the source from app.src chmod -R o-rwx "$install_dir"
ynh_setup_source --dest_dir=$final_path --keep="$final_path/config.json" chown -R $app:www-data "$install_dir"
fi
#================================================= #=================================================
# NGINX CONFIGURATION # REAPPLY SYSTEM CONFIGURATIONS
#================================================= #=================================================
ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=2 ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1
# Create a dedicated nginx config
ynh_add_nginx_config ynh_add_nginx_config
#=================================================
# UPGRADE DEPENDENCIES
#=================================================
ynh_script_progression --message="Upgrading dependencies..." --weight=10
ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
# Install Nodejs
ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
# Install Yarn ynh_add_systemd_config
ynh_install_extra_app_dependencies --repo="deb https://dl.yarnpkg.com/debian/ stable main" --package="yarn" --key="https://dl.yarnpkg.com/debian/pubkey.gpg"
yunohost service add $app --description="Collaborative Markdown editor" --log="/var/log/$app/$app.log"
#=================================================
# SPECIFIC UPGRADE
#============================================== #==============================================
# INSTALL HEDGEDOC # INSTALL HEDGEDOC
#============================================== #==============================================
if [ "$upgrade_type" == "UPGRADE_APP" ] ynh_script_progression --message="Building $app... (this will take some time and resources!)" --weight=10
then
ynh_script_progression --message="Building HedgeDoc... (this will take some time and resources!)" --weight=20
pushd "$final_path" || ynh_die pushd "$install_dir"
ynh_use_nodejs ynh_secure_remove /usr/local/share/.cache/yarn
bin/setup ynh_use_nodejs
popd || ynh_die ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH yarn workspaces focus --production
fi ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH yarn cache clean
popd
#================================================= #=================================================
# SETUP SYSTEMD # MODIFY A CONFIG FILE
#================================================= #=================================================
ynh_script_progression --message="Configuring a systemd service..." --weight=2 ynh_script_progression --message="Modifying a config file..." --weight=1
ynh_replace_string --match_string="__ENV_PATH__" --replace_string="$PATH" --target_file="../conf/systemd.service" url_path=${path#/}
ynh_add_config --template="config.json.example" --destination="$install_dir/config.json"
# Create a dedicated systemd config chmod 600 "$install_dir/config.json"
ynh_add_systemd_config chown $app:$app "$install_dir/config.json"
#=================================================
# GENERIC FINALIZATION
#=================================================
# SECURE FILES AND DIRECTORIES
#=================================================
ynh_script_progression --message="Securing files and directories..." --weight=1
# Set permissions on app files
chown -R $app:$app $final_path
chmod o-rwx $final_path
chmod 600 $final_path/config.json
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
#=================================================
ynh_script_progression --message="Integrating service in YunoHost..." --weight=2
yunohost service add $app --description="Collaborative Markdown editor" --log="/var/log/$app/$app.log"
#================================================= #=================================================
# START SYSTEMD SERVICE # START SYSTEMD SERVICE
@ -158,15 +102,8 @@ ynh_script_progression --message="Starting a systemd service..." --weight=1
ynh_systemd_action --service_name=$app --action=start --log_path=systemd --line_match="HTTP Server listening" ynh_systemd_action --service_name=$app --action=start --log_path=systemd --line_match="HTTP Server listening"
#=================================================
# RELOAD NGINX
#=================================================
ynh_script_progression --message="Reloading NGINX web server..." --weight=1
ynh_systemd_action --service_name=nginx --action=reload
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Upgrade of HedgeDoc completed" --last ynh_script_progression --message="Upgrade of $app completed" --last

9
tests.toml Normal file
View file

@ -0,0 +1,9 @@
test_format = 1.0
[default]
# -------------------------------
# Commits to test upgrade from
# -------------------------------
test_upgrade_from.f601a56a.name = "Upgrade from 1.9.7~ynh2"