├── .gitattributes ├── .github ├── ISSUE_TEMPLATE.md └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── ALL_README.md ├── LICENSE ├── README.md ├── README_es.md ├── README_eu.md ├── README_fr.md ├── README_gl.md ├── README_id.md ├── README_it.md ├── README_nl.md ├── README_pl.md ├── README_ru.md ├── README_zh_Hans.md ├── conf ├── configuration.yml ├── extra_php-fpm.conf ├── ldap.sql.template ├── mail.sql.template └── nginx.conf ├── doc ├── ADMIN.md ├── ADMIN_fr.md ├── DESCRIPTION.md ├── DESCRIPTION_fr.md ├── POST_INSTALL.md ├── POST_INSTALL_fr.md ├── PRE_INSTALL.md ├── PRE_INSTALL_fr.md └── screenshots │ └── beta16.jpg ├── manifest.toml ├── scripts ├── _common.sh ├── backup ├── change_url ├── experimental_helpers │ └── ynh_add_swap ├── install ├── remove ├── restore └── upgrade └── tests.toml /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: When creating a bug report, please use the following template to provide all the relevant information and help debugging efficiently. 4 | 5 | --- 6 | 7 | **How to post a meaningful bug report** 8 | 1. *Read this whole template first.* 9 | 2. *Determine if you are on the right place:* 10 | - *If you were performing an action on the app from the webadmin or the CLI (install, update, backup, restore, change_url...), you are on the right place!* 11 | - *Otherwise, the issue may be due to the app itself. Refer to its documentation or repository for help.* 12 | - *When in doubt, post here and we will figure it out together.* 13 | 3. *Delete the italic comments as you write over them below, and remove this guide.* 14 | --- 15 | 16 | ### Describe the bug 17 | 18 | *A clear and concise description of what the bug is.* 19 | 20 | ### Context 21 | 22 | - Hardware: *VPS bought online / Old laptop or computer / Raspberry Pi at home / Internet Cube with VPN / Other ARM board / ...* 23 | - YunoHost version: x.x.x 24 | - I have access to my server: *Through SSH | through the webadmin | direct access via keyboard / screen | ...* 25 | - Are you in a special context or did you perform some particular tweaking on your YunoHost instance?: *no / yes* 26 | - If yes, please explain: 27 | - Using, or trying to install package version/branch: 28 | - If upgrading, current package version: *can be found in the admin, or with `yunohost app info $app_id`* 29 | 30 | ### Steps to reproduce 31 | 32 | - *If you performed a command from the CLI, the command itself is enough. For example:* 33 | ```sh 34 | sudo yunohost app install the_app 35 | ``` 36 | - *If you used the webadmin, please perform the equivalent command from the CLI first.* 37 | - *If the error occurs in your browser, explain what you did:* 38 | 1. *Go to '...'* 39 | 2. *Click on '...'* 40 | 3. *Scroll down to '...'* 41 | 4. *See error* 42 | 43 | ### Expected behavior 44 | 45 | *A clear and concise description of what you expected to happen. You can remove this section if the command above is enough to understand your intent.* 46 | 47 | ### Logs 48 | 49 | *When an operation fails, YunoHost provides a simple way to share the logs.* 50 | - *In the webadmin, the error message contains a link to the relevant log page. On that page, you will be able to 'Share with Yunopaste'. If you missed it, the logs of previous operations are also available under Tools > Logs.* 51 | - *In command line, the command to share the logs is displayed at the end of the operation and looks like `yunohost log display [log name] --share`. If you missed it, you can find the log ID of a previous operation using `yunohost log list`.* 52 | 53 | *After sharing the log, please copypaste directly the link provided by YunoHost (to help readability, no need to copypaste the entire content of the log here, just the link is enough...)* 54 | 55 | *If applicable and useful, add screenshots to help explain your problem.* 56 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## Problem 2 | 3 | - *Description of why you made this PR* 4 | 5 | ## Solution 6 | 7 | - *And how do you fix that problem* 8 | 9 | ## PR Status 10 | 11 | - [ ] Code finished and ready to be reviewed/tested 12 | - [ ] The fix/enhancement were manually tested (if applicable) 13 | 14 | ## Automatic tests 15 | 16 | Automatic tests can be triggered on https://ci-apps-dev.yunohost.org/ *after creating the PR*, by commenting "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!". (N.B. : for this to work you need to be a member of the Yunohost-Apps organization) 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | *.sw[op] 3 | -------------------------------------------------------------------------------- /ALL_README.md: -------------------------------------------------------------------------------- 1 | # All available README files by language 2 | 3 | - [Read the README in English](README.md) 4 | - [Lea el README en español](README_es.md) 5 | - [Irakurri README euskaraz](README_eu.md) 6 | - [Lire le README en français](README_fr.md) 7 | - [Le o README en galego](README_gl.md) 8 | - [Baca README dalam bahasa bahasa Indonesia](README_id.md) 9 | - [Lees de README in het Nederlands](README_nl.md) 10 | - [Przeczytaj README w języku polski](README_pl.md) 11 | - [Прочитать README на русский](README_ru.md) 12 | - [阅读中文(简体)的 README](README_zh_Hans.md) 13 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Titus PiJean 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 5 | 6 | # Flarum for YunoHost 7 | 8 | [![Integration level](https://apps.yunohost.org/badge/integration/flarum)](https://ci-apps.yunohost.org/ci/apps/flarum/) 9 | ![Working status](https://apps.yunohost.org/badge/state/flarum) 10 | ![Maintenance status](https://apps.yunohost.org/badge/maintained/flarum) 11 | 12 | [![Install Flarum with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=flarum) 13 | 14 | *[Read this README in other languages.](./ALL_README.md)* 15 | 16 | > *This package allows you to install Flarum quickly and simply on a YunoHost server.* 17 | > *If you don't have YunoHost, please consult [the guide](https://yunohost.org/install) to learn how to install it.* 18 | 19 | ## Overview 20 | 21 | Flarum is a simple discussion platform for your website. It's fast and easy to use, with all the features you need to run a successful community. 22 | 23 | **Shipped version:** 1.8.10~ynh1 24 | 25 | **Demo:** 26 | 27 | ## Screenshots 28 | 29 | ![Screenshot of Flarum](./doc/screenshots/beta16.jpg) 30 | 31 | ## Documentation and resources 32 | 33 | - Official app website: 34 | - Official admin documentation: 35 | - Upstream app code repository: 36 | - YunoHost Store: 37 | - Report a bug: 38 | 39 | ## Developer info 40 | 41 | Please send your pull request to the [`testing` branch](https://github.com/YunoHost-Apps/flarum_ynh/tree/testing). 42 | 43 | To try the `testing` branch, please proceed like that: 44 | 45 | ```bash 46 | sudo yunohost app install https://github.com/YunoHost-Apps/flarum_ynh/tree/testing --debug 47 | or 48 | sudo yunohost app upgrade flarum -u https://github.com/YunoHost-Apps/flarum_ynh/tree/testing --debug 49 | ``` 50 | 51 | **More info regarding app packaging:** 52 | -------------------------------------------------------------------------------- /README_es.md: -------------------------------------------------------------------------------- 1 | 5 | 6 | # Flarum para Yunohost 7 | 8 | [![Nivel de integración](https://apps.yunohost.org/badge/integration/flarum)](https://ci-apps.yunohost.org/ci/apps/flarum/) 9 | ![Estado funcional](https://apps.yunohost.org/badge/state/flarum) 10 | ![Estado En Mantención](https://apps.yunohost.org/badge/maintained/flarum) 11 | 12 | [![Instalar Flarum con Yunhost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=flarum) 13 | 14 | *[Leer este README en otros idiomas.](./ALL_README.md)* 15 | 16 | > *Este paquete le permite instalarFlarum rapidamente y simplement en un servidor YunoHost.* 17 | > *Si no tiene YunoHost, visita [the guide](https://yunohost.org/install) para aprender como instalarla.* 18 | 19 | ## Descripción general 20 | 21 | Flarum is a simple discussion platform for your website. It's fast and easy to use, with all the features you need to run a successful community. 22 | 23 | **Versión actual:** 1.8.10~ynh1 24 | 25 | **Demo:** 26 | 27 | ## Capturas 28 | 29 | ![Captura de Flarum](./doc/screenshots/beta16.jpg) 30 | 31 | ## Documentaciones y recursos 32 | 33 | - Sitio web oficial: 34 | - Documentación administrador oficial: 35 | - Repositorio del código fuente oficial de la aplicación : 36 | - Catálogo YunoHost: 37 | - Reportar un error: 38 | 39 | ## Información para desarrolladores 40 | 41 | Por favor enviar sus correcciones a la [rama `testing`](https://github.com/YunoHost-Apps/flarum_ynh/tree/testing). 42 | 43 | Para probar la rama `testing`, sigue asÍ: 44 | 45 | ```bash 46 | sudo yunohost app install https://github.com/YunoHost-Apps/flarum_ynh/tree/testing --debug 47 | o 48 | sudo yunohost app upgrade flarum -u https://github.com/YunoHost-Apps/flarum_ynh/tree/testing --debug 49 | ``` 50 | 51 | **Mas informaciones sobre el empaquetado de aplicaciones:** 52 | -------------------------------------------------------------------------------- /README_eu.md: -------------------------------------------------------------------------------- 1 | 5 | 6 | # Flarum YunoHost-erako 7 | 8 | [![Integrazio maila](https://apps.yunohost.org/badge/integration/flarum)](https://ci-apps.yunohost.org/ci/apps/flarum/) 9 | ![Funtzionamendu egoera](https://apps.yunohost.org/badge/state/flarum) 10 | ![Mantentze egoera](https://apps.yunohost.org/badge/maintained/flarum) 11 | 12 | [![Instalatu Flarum YunoHost-ekin](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=flarum) 13 | 14 | *[Irakurri README hau beste hizkuntzatan.](./ALL_README.md)* 15 | 16 | > *Pakete honek Flarum YunoHost zerbitzari batean azkar eta zailtasunik gabe instalatzea ahalbidetzen dizu.* 17 | > *YunoHost ez baduzu, kontsultatu [gida](https://yunohost.org/install) nola instalatu ikasteko.* 18 | 19 | ## Aurreikuspena 20 | 21 | Flarum is a simple discussion platform for your website. It's fast and easy to use, with all the features you need to run a successful community. 22 | 23 | **Paketatutako bertsioa:** 1.8.10~ynh1 24 | 25 | **Demoa:** 26 | 27 | ## Pantaila-argazkiak 28 | 29 | ![Flarum(r)en pantaila-argazkia](./doc/screenshots/beta16.jpg) 30 | 31 | ## Dokumentazioa eta baliabideak 32 | 33 | - Aplikazioaren webgune ofiziala: 34 | - Administratzaileen dokumentazio ofiziala: 35 | - Jatorrizko aplikazioaren kode-gordailua: 36 | - YunoHost Denda: 37 | - Eman errore baten berri: 38 | 39 | ## Garatzaileentzako informazioa 40 | 41 | Bidali `pull request`a [`testing` abarrera](https://github.com/YunoHost-Apps/flarum_ynh/tree/testing). 42 | 43 | `testing` abarra probatzeko, ondorengoa egin: 44 | 45 | ```bash 46 | sudo yunohost app install https://github.com/YunoHost-Apps/flarum_ynh/tree/testing --debug 47 | edo 48 | sudo yunohost app upgrade flarum -u https://github.com/YunoHost-Apps/flarum_ynh/tree/testing --debug 49 | ``` 50 | 51 | **Informazio gehiago aplikazioaren paketatzeari buruz:** 52 | -------------------------------------------------------------------------------- /README_fr.md: -------------------------------------------------------------------------------- 1 | 5 | 6 | # Flarum pour YunoHost 7 | 8 | [![Niveau d’intégration](https://apps.yunohost.org/badge/integration/flarum)](https://ci-apps.yunohost.org/ci/apps/flarum/) 9 | ![Statut du fonctionnement](https://apps.yunohost.org/badge/state/flarum) 10 | ![Statut de maintenance](https://apps.yunohost.org/badge/maintained/flarum) 11 | 12 | [![Installer Flarum avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=flarum) 13 | 14 | *[Lire le README dans d'autres langues.](./ALL_README.md)* 15 | 16 | > *Ce package vous permet d’installer Flarum rapidement et simplement sur un serveur YunoHost.* 17 | > *Si vous n’avez pas YunoHost, consultez [ce guide](https://yunohost.org/install) pour savoir comment l’installer et en profiter.* 18 | 19 | ## Vue d’ensemble 20 | 21 | Flarum est une plate-forme de discussion simple pour votre site Web. C'est rapide et facile à utiliser, avec toutes les fonctionnalités dont vous avez besoin pour gérer une communauté. 22 | 23 | **Version incluse :** 1.8.10~ynh1 24 | 25 | **Démo :** 26 | 27 | ## Captures d’écran 28 | 29 | ![Capture d’écran de Flarum](./doc/screenshots/beta16.jpg) 30 | 31 | ## Documentations et ressources 32 | 33 | - Site officiel de l’app : 34 | - Documentation officielle de l’admin : 35 | - Dépôt de code officiel de l’app : 36 | - YunoHost Store : 37 | - Signaler un bug : 38 | 39 | ## Informations pour les développeurs 40 | 41 | Merci de faire vos pull request sur la [branche `testing`](https://github.com/YunoHost-Apps/flarum_ynh/tree/testing). 42 | 43 | Pour essayer la branche `testing`, procédez comme suit : 44 | 45 | ```bash 46 | sudo yunohost app install https://github.com/YunoHost-Apps/flarum_ynh/tree/testing --debug 47 | ou 48 | sudo yunohost app upgrade flarum -u https://github.com/YunoHost-Apps/flarum_ynh/tree/testing --debug 49 | ``` 50 | 51 | **Plus d’infos sur le packaging d’applications :** 52 | -------------------------------------------------------------------------------- /README_gl.md: -------------------------------------------------------------------------------- 1 | 5 | 6 | # Flarum para YunoHost 7 | 8 | [![Nivel de integración](https://apps.yunohost.org/badge/integration/flarum)](https://ci-apps.yunohost.org/ci/apps/flarum/) 9 | ![Estado de funcionamento](https://apps.yunohost.org/badge/state/flarum) 10 | ![Estado de mantemento](https://apps.yunohost.org/badge/maintained/flarum) 11 | 12 | [![Instalar Flarum con YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=flarum) 13 | 14 | *[Le este README en outros idiomas.](./ALL_README.md)* 15 | 16 | > *Este paquete permíteche instalar Flarum de xeito rápido e doado nun servidor YunoHost.* 17 | > *Se non usas YunoHost, le a [documentación](https://yunohost.org/install) para saber como instalalo.* 18 | 19 | ## Vista xeral 20 | 21 | Flarum is a simple discussion platform for your website. It's fast and easy to use, with all the features you need to run a successful community. 22 | 23 | **Versión proporcionada:** 1.8.10~ynh1 24 | 25 | **Demo:** 26 | 27 | ## Capturas de pantalla 28 | 29 | ![Captura de pantalla de Flarum](./doc/screenshots/beta16.jpg) 30 | 31 | ## Documentación e recursos 32 | 33 | - Web oficial da app: 34 | - Documentación oficial para admin: 35 | - Repositorio de orixe do código: 36 | - Tenda YunoHost: 37 | - Informar dun problema: 38 | 39 | ## Info de desenvolvemento 40 | 41 | Envía a túa colaboración á [rama `testing`](https://github.com/YunoHost-Apps/flarum_ynh/tree/testing). 42 | 43 | Para probar a rama `testing`, procede deste xeito: 44 | 45 | ```bash 46 | sudo yunohost app install https://github.com/YunoHost-Apps/flarum_ynh/tree/testing --debug 47 | ou 48 | sudo yunohost app upgrade flarum -u https://github.com/YunoHost-Apps/flarum_ynh/tree/testing --debug 49 | ``` 50 | 51 | **Máis info sobre o empaquetado da app:** 52 | -------------------------------------------------------------------------------- /README_id.md: -------------------------------------------------------------------------------- 1 | 5 | 6 | # Flarum untuk YunoHost 7 | 8 | [![Tingkat integrasi](https://apps.yunohost.org/badge/integration/flarum)](https://ci-apps.yunohost.org/ci/apps/flarum/) 9 | ![Status kerja](https://apps.yunohost.org/badge/state/flarum) 10 | ![Status pemeliharaan](https://apps.yunohost.org/badge/maintained/flarum) 11 | 12 | [![Pasang Flarum dengan YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=flarum) 13 | 14 | *[Baca README ini dengan bahasa yang lain.](./ALL_README.md)* 15 | 16 | > *Paket ini memperbolehkan Anda untuk memasang Flarum secara cepat dan mudah pada server YunoHost.* 17 | > *Bila Anda tidak mempunyai YunoHost, silakan berkonsultasi dengan [panduan](https://yunohost.org/install) untuk mempelajari bagaimana untuk memasangnya.* 18 | 19 | ## Ringkasan 20 | 21 | Flarum is a simple discussion platform for your website. It's fast and easy to use, with all the features you need to run a successful community. 22 | 23 | **Versi terkirim:** 1.8.10~ynh1 24 | 25 | **Demo:** 26 | 27 | ## Tangkapan Layar 28 | 29 | ![Tangkapan Layar pada Flarum](./doc/screenshots/beta16.jpg) 30 | 31 | ## Dokumentasi dan sumber daya 32 | 33 | - Website aplikasi resmi: 34 | - Dokumentasi admin resmi: 35 | - Depot kode aplikasi hulu: 36 | - Gudang YunoHost: 37 | - Laporkan bug: 38 | 39 | ## Info developer 40 | 41 | Silakan kirim pull request ke [`testing` branch](https://github.com/YunoHost-Apps/flarum_ynh/tree/testing). 42 | 43 | Untuk mencoba branch `testing`, silakan dilanjutkan seperti: 44 | 45 | ```bash 46 | sudo yunohost app install https://github.com/YunoHost-Apps/flarum_ynh/tree/testing --debug 47 | atau 48 | sudo yunohost app upgrade flarum -u https://github.com/YunoHost-Apps/flarum_ynh/tree/testing --debug 49 | ``` 50 | 51 | **Info lebih lanjut mengenai pemaketan aplikasi:** 52 | -------------------------------------------------------------------------------- /README_it.md: -------------------------------------------------------------------------------- 1 | 5 | 6 | # Flarum per YunoHost 7 | 8 | [![Livello di integrazione](https://dash.yunohost.org/integration/flarum.svg)](https://dash.yunohost.org/appci/app/flarum) ![Stato di funzionamento](https://ci-apps.yunohost.org/ci/badges/flarum.status.svg) ![Stato di manutenzione](https://ci-apps.yunohost.org/ci/badges/flarum.maintain.svg) 9 | 10 | [![Installa Flarum con YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=flarum) 11 | 12 | *[Leggi questo README in altre lingue.](./ALL_README.md)* 13 | 14 | > *Questo pacchetto ti permette di installare Flarum su un server YunoHost in modo semplice e veloce.* 15 | > *Se non hai YunoHost, consulta [la guida](https://yunohost.org/install) per imparare a installarlo.* 16 | 17 | ## Panoramica 18 | 19 | Flarum is a simple discussion platform for your website. It's fast and easy to use, with all the features you need to run a successful community. 20 | 21 | **Versione pubblicata:** 1.8.2~ynh1 22 | 23 | **Prova:** 24 | 25 | ## Screenshot 26 | 27 | ![Screenshot di Flarum](./doc/screenshots/beta16.jpg) 28 | 29 | ## Documentazione e risorse 30 | 31 | - Sito web ufficiale dell’app: 32 | - Documentazione ufficiale per gli amministratori: 33 | - Repository upstream del codice dell’app: 34 | - Store di YunoHost: 35 | - Segnala un problema: 36 | 37 | ## Informazioni per sviluppatori 38 | 39 | Si prega di inviare la tua pull request alla [branch di `testing`](https://github.com/YunoHost-Apps/flarum_ynh/tree/testing). 40 | 41 | Per provare la branch di `testing`, si prega di procedere in questo modo: 42 | 43 | ```bash 44 | sudo yunohost app install https://github.com/YunoHost-Apps/flarum_ynh/tree/testing --debug 45 | o 46 | sudo yunohost app upgrade flarum -u https://github.com/YunoHost-Apps/flarum_ynh/tree/testing --debug 47 | ``` 48 | 49 | **Maggiori informazioni riguardo il pacchetto di quest’app:** 50 | -------------------------------------------------------------------------------- /README_nl.md: -------------------------------------------------------------------------------- 1 | 5 | 6 | # Flarum voor Yunohost 7 | 8 | [![Integratieniveau](https://apps.yunohost.org/badge/integration/flarum)](https://ci-apps.yunohost.org/ci/apps/flarum/) 9 | ![Mate van functioneren](https://apps.yunohost.org/badge/state/flarum) 10 | ![Onderhoudsstatus](https://apps.yunohost.org/badge/maintained/flarum) 11 | 12 | [![Flarum met Yunohost installeren](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=flarum) 13 | 14 | *[Deze README in een andere taal lezen.](./ALL_README.md)* 15 | 16 | > *Met dit pakket kun je Flarum snel en eenvoudig op een YunoHost-server installeren.* 17 | > *Als je nog geen YunoHost hebt, lees dan [de installatiehandleiding](https://yunohost.org/install), om te zien hoe je 'm installeert.* 18 | 19 | ## Overzicht 20 | 21 | Flarum is a simple discussion platform for your website. It's fast and easy to use, with all the features you need to run a successful community. 22 | 23 | **Geleverde versie:** 1.8.10~ynh1 24 | 25 | **Demo:** 26 | 27 | ## Schermafdrukken 28 | 29 | ![Schermafdrukken van Flarum](./doc/screenshots/beta16.jpg) 30 | 31 | ## Documentatie en bronnen 32 | 33 | - Officiele website van de app: 34 | - Officiele beheerdersdocumentatie: 35 | - Upstream app codedepot: 36 | - YunoHost-store: 37 | - Meld een bug: 38 | 39 | ## Ontwikkelaarsinformatie 40 | 41 | Stuur je pull request alsjeblieft naar de [`testing`-branch](https://github.com/YunoHost-Apps/flarum_ynh/tree/testing). 42 | 43 | Om de `testing`-branch uit te proberen, ga als volgt te werk: 44 | 45 | ```bash 46 | sudo yunohost app install https://github.com/YunoHost-Apps/flarum_ynh/tree/testing --debug 47 | of 48 | sudo yunohost app upgrade flarum -u https://github.com/YunoHost-Apps/flarum_ynh/tree/testing --debug 49 | ``` 50 | 51 | **Verdere informatie over app-packaging:** 52 | -------------------------------------------------------------------------------- /README_pl.md: -------------------------------------------------------------------------------- 1 | 5 | 6 | # Flarum dla YunoHost 7 | 8 | [![Poziom integracji](https://apps.yunohost.org/badge/integration/flarum)](https://ci-apps.yunohost.org/ci/apps/flarum/) 9 | ![Status działania](https://apps.yunohost.org/badge/state/flarum) 10 | ![Status utrzymania](https://apps.yunohost.org/badge/maintained/flarum) 11 | 12 | [![Zainstaluj Flarum z YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=flarum) 13 | 14 | *[Przeczytaj plik README w innym języku.](./ALL_README.md)* 15 | 16 | > *Ta aplikacja pozwala na szybką i prostą instalację Flarum na serwerze YunoHost.* 17 | > *Jeżeli nie masz YunoHost zapoznaj się z [poradnikiem](https://yunohost.org/install) instalacji.* 18 | 19 | ## Przegląd 20 | 21 | Flarum is a simple discussion platform for your website. It's fast and easy to use, with all the features you need to run a successful community. 22 | 23 | **Dostarczona wersja:** 1.8.10~ynh1 24 | 25 | **Demo:** 26 | 27 | ## Zrzuty ekranu 28 | 29 | ![Zrzut ekranu z Flarum](./doc/screenshots/beta16.jpg) 30 | 31 | ## Dokumentacja i zasoby 32 | 33 | - Oficjalna strona aplikacji: 34 | - Oficjalna dokumentacja dla administratora: 35 | - Repozytorium z kodem źródłowym: 36 | - Sklep YunoHost: 37 | - Zgłaszanie błędów: 38 | 39 | ## Informacje od twórców 40 | 41 | Wyślij swój pull request do [gałęzi `testing`](https://github.com/YunoHost-Apps/flarum_ynh/tree/testing). 42 | 43 | Aby wypróbować gałąź `testing` postępuj zgodnie z instrukcjami: 44 | 45 | ```bash 46 | sudo yunohost app install https://github.com/YunoHost-Apps/flarum_ynh/tree/testing --debug 47 | lub 48 | sudo yunohost app upgrade flarum -u https://github.com/YunoHost-Apps/flarum_ynh/tree/testing --debug 49 | ``` 50 | 51 | **Więcej informacji o tworzeniu paczek aplikacji:** 52 | -------------------------------------------------------------------------------- /README_ru.md: -------------------------------------------------------------------------------- 1 | 5 | 6 | # Flarum для YunoHost 7 | 8 | [![Уровень интеграции](https://apps.yunohost.org/badge/integration/flarum)](https://ci-apps.yunohost.org/ci/apps/flarum/) 9 | ![Состояние работы](https://apps.yunohost.org/badge/state/flarum) 10 | ![Состояние сопровождения](https://apps.yunohost.org/badge/maintained/flarum) 11 | 12 | [![Установите Flarum с YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=flarum) 13 | 14 | *[Прочтите этот README на других языках.](./ALL_README.md)* 15 | 16 | > *Этот пакет позволяет Вам установить Flarum быстро и просто на YunoHost-сервер.* 17 | > *Если у Вас нет YunoHost, пожалуйста, посмотрите [инструкцию](https://yunohost.org/install), чтобы узнать, как установить его.* 18 | 19 | ## Обзор 20 | 21 | Flarum is a simple discussion platform for your website. It's fast and easy to use, with all the features you need to run a successful community. 22 | 23 | **Поставляемая версия:** 1.8.10~ynh1 24 | 25 | **Демо-версия:** 26 | 27 | ## Снимки экрана 28 | 29 | ![Снимок экрана Flarum](./doc/screenshots/beta16.jpg) 30 | 31 | ## Документация и ресурсы 32 | 33 | - Официальный веб-сайт приложения: 34 | - Официальная документация администратора: 35 | - Репозиторий кода главной ветки приложения: 36 | - Магазин YunoHost: 37 | - Сообщите об ошибке: 38 | 39 | ## Информация для разработчиков 40 | 41 | Пришлите Ваш запрос на слияние в [ветку `testing`](https://github.com/YunoHost-Apps/flarum_ynh/tree/testing). 42 | 43 | Чтобы попробовать ветку `testing`, пожалуйста, сделайте что-то вроде этого: 44 | 45 | ```bash 46 | sudo yunohost app install https://github.com/YunoHost-Apps/flarum_ynh/tree/testing --debug 47 | или 48 | sudo yunohost app upgrade flarum -u https://github.com/YunoHost-Apps/flarum_ynh/tree/testing --debug 49 | ``` 50 | 51 | **Больше информации о пакетировании приложений:** 52 | -------------------------------------------------------------------------------- /README_zh_Hans.md: -------------------------------------------------------------------------------- 1 | 5 | 6 | # YunoHost 上的 Flarum 7 | 8 | [![集成程度](https://apps.yunohost.org/badge/integration/flarum)](https://ci-apps.yunohost.org/ci/apps/flarum/) 9 | ![工作状态](https://apps.yunohost.org/badge/state/flarum) 10 | ![维护状态](https://apps.yunohost.org/badge/maintained/flarum) 11 | 12 | [![使用 YunoHost 安装 Flarum](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=flarum) 13 | 14 | *[阅读此 README 的其它语言版本。](./ALL_README.md)* 15 | 16 | > *通过此软件包,您可以在 YunoHost 服务器上快速、简单地安装 Flarum。* 17 | > *如果您还没有 YunoHost,请参阅[指南](https://yunohost.org/install)了解如何安装它。* 18 | 19 | ## 概况 20 | 21 | Flarum is a simple discussion platform for your website. It's fast and easy to use, with all the features you need to run a successful community. 22 | 23 | **分发版本:** 1.8.10~ynh1 24 | 25 | **演示:** 26 | 27 | ## 截图 28 | 29 | ![Flarum 的截图](./doc/screenshots/beta16.jpg) 30 | 31 | ## 文档与资源 32 | 33 | - 官方应用网站: 34 | - 官方管理文档: 35 | - 上游应用代码库: 36 | - YunoHost 商店: 37 | - 报告 bug: 38 | 39 | ## 开发者信息 40 | 41 | 请向 [`testing` 分支](https://github.com/YunoHost-Apps/flarum_ynh/tree/testing) 发送拉取请求。 42 | 43 | 如要尝试 `testing` 分支,请这样操作: 44 | 45 | ```bash 46 | sudo yunohost app install https://github.com/YunoHost-Apps/flarum_ynh/tree/testing --debug 47 | 或 48 | sudo yunohost app upgrade flarum -u https://github.com/YunoHost-Apps/flarum_ynh/tree/testing --debug 49 | ``` 50 | 51 | **有关应用打包的更多信息:** 52 | -------------------------------------------------------------------------------- /conf/configuration.yml: -------------------------------------------------------------------------------- 1 | baseUrl : "https://__DOMAIN____PATH__" 2 | databaseConfiguration : 3 | host : "localhost" 4 | database : "__DB_NAME__" 5 | username : "__DB_USER__" 6 | password : "__DB_PWD__" 7 | adminUser : 8 | username : "__ADMIN__" 9 | password : "__PASSWORD__" 10 | password_confirmation : "__PASSWORD__" 11 | email : "__ADMIN_MAIL__" 12 | settings : 13 | forum_title : "__TITLE__" 14 | -------------------------------------------------------------------------------- /conf/extra_php-fpm.conf: -------------------------------------------------------------------------------- 1 | php_admin_value[upload_max_filesize] = 100M 2 | php_admin_value[post_max_size] = 100M 3 | env[COMPOSER_HOME] = __INSTALL_DIR__/.composer 4 | -------------------------------------------------------------------------------- /conf/ldap.sql.template: -------------------------------------------------------------------------------- 1 | INSERT INTO `settings` (`key`, `value`) VALUES 2 | ('tituspijean-auth-ldap.admin_dn', ''), 3 | ('tituspijean-auth-ldap.admin_password', ''), 4 | ('tituspijean-auth-ldap.base_dn', 'ou=users,dc=yunohost,dc=org'), 5 | ('tituspijean-auth-ldap.filter', '(&(objectClass=posixAccount)(permission=cn=__APP__.main,ou=permission,dc=yunohost,dc=org))'), 6 | ('tituspijean-auth-ldap.follow_referrals', '0'), 7 | ('tituspijean-auth-ldap.hosts', 'localhost'), 8 | ('tituspijean-auth-ldap.method_name', 'YunoHost'), 9 | ('tituspijean-auth-ldap.onlyUse', '0'), 10 | ('tituspijean-auth-ldap.port', '389'), 11 | ('tituspijean-auth-ldap.search_user_fields', 'uid,mail'), 12 | ('tituspijean-auth-ldap.use_ssl', ''), 13 | ('tituspijean-auth-ldap.use_tls', ''), 14 | ('tituspijean-auth-ldap.user_mail', 'mail'), 15 | ('tituspijean-auth-ldap.user_username', 'uid') 16 | ON DUPLICATE KEY UPDATE value = VALUES(value); 17 | -------------------------------------------------------------------------------- /conf/mail.sql.template: -------------------------------------------------------------------------------- 1 | INSERT INTO `settings` (`key`, `value`) VALUES 2 | ('mail_driver', 'mail'), 3 | ('mail_encryption', 'ssl'), 4 | ('mail_from', '__APP__@__DOMAIN__'), 5 | ('mail_host', 'localhost'), 6 | ('mail_port', '587') 7 | ON DUPLICATE KEY UPDATE value = VALUES(value); 8 | -------------------------------------------------------------------------------- /conf/nginx.conf: -------------------------------------------------------------------------------- 1 | #sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; 2 | location __PATH__/ { 3 | 4 | # Path to source 5 | alias __INSTALL_DIR__/public/; 6 | 7 | index index.php; 8 | 9 | # Bug in Nginx with locations and aliases (see http://stackoverflow.com/a/35102259 ) 10 | try_files $uri $uri/ __PATH__/__PATH__/index.php?$query_string; 11 | 12 | location ~* \.php$ { 13 | fastcgi_split_path_info ^(.+.php)(/.+)$; 14 | fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock; 15 | include fastcgi_params; 16 | fastcgi_param SCRIPT_FILENAME $request_filename; 17 | fastcgi_param HTTP_PROXY ""; # Fix for https://httpoxy.org/ vulnerability 18 | fastcgi_index index.php; 19 | fastcgi_read_timeout 600; 20 | } 21 | 22 | # Expire rules for static content 23 | location ~* \.(?:manifest|appcache|html?|xml|json)$ { 24 | more_set_headers "Cache-Control: max-age=0"; 25 | } 26 | 27 | location ~* \.(?:rss|atom)$ { 28 | more_set_headers "Cache-Control: max-age=3600"; 29 | } 30 | 31 | location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|mp4|ogg|ogv|webm|htc)$ { 32 | more_set_headers "Cache-Control: max-age=2592000"; 33 | access_log off; 34 | } 35 | 36 | location ~* \.(?:css|js)$ { 37 | more_set_headers "Cache-Control: max-age=31536000"; 38 | access_log off; 39 | } 40 | 41 | location ~* \.(?:ttf|ttc|otf|eot|woff|woff2)$ { 42 | more_set_headers "Cache-Control: max-age=2592000"; 43 | access_log off; 44 | } 45 | 46 | # Gzip compression 47 | gzip on; 48 | gzip_comp_level 5; 49 | gzip_min_length 256; 50 | gzip_proxied any; 51 | gzip_vary on; 52 | gzip_types 53 | application/atom+xml 54 | application/javascript 55 | application/json 56 | application/ld+json 57 | application/manifest+json 58 | application/rss+xml 59 | application/vnd.geo+json 60 | application/vnd.ms-fontobject 61 | application/x-font-ttf 62 | application/x-web-app-manifest+json 63 | application/xhtml+xml 64 | application/xml 65 | font/opentype 66 | image/bmp 67 | image/svg+xml 68 | image/x-icon 69 | text/cache-manifest 70 | text/css 71 | text/plain 72 | text/vcard 73 | text/vnd.rim.location.xloc 74 | text/vtt 75 | text/x-component 76 | text/x-cross-domain-policy; 77 | 78 | # Allows file upload, e.g. fof/upload. 79 | client_max_body_size 100M; 80 | 81 | # Include SSOWAT user panel. 82 | # include conf.d/yunohost_panel.conf.inc; 83 | } 84 | -------------------------------------------------------------------------------- /doc/ADMIN.md: -------------------------------------------------------------------------------- 1 | ## Login 2 | 3 | This app allows your YunoHost users to log in with a [dedicated LDAP extension](https://github.com/tituspijean/flarum-ext-auth-ldap). By default, the standard logging method is hidden. 4 | To allow non-YunoHost users to log in, tune the LDAP extension setting in Flarum's admin panel. 5 | 6 | ### Upgrading 7 | 8 | Note that, for the moment, all third-party extensions are removed upon upgrading. 9 | Their data and parameters remain in Flarum's database, they only require to be reinstalled. 10 | 11 | ### Adding extensions 12 | 13 | Flarum does not offer to install extensions from its admin panel yet, so you need to use the command line. 14 | 15 | Replace `vendor/extension` with the appropriate names. Read the extension documentation if it requires additional steps. 16 | 17 | ```bash 18 | sudo su 19 | app=__ID__ 20 | cd /var/www/$app 21 | sudo -u $app php__PHPVERSION__ composer.phar require vendor/extension 22 | ``` 23 | 24 | #### Troubleshooting 25 | 26 | ##### `Timeout` errors 27 | Some users have reported a successful installation, but get a blank page due to a `timeout` on a PHP script that prepares the forum assests (`Minify.php`, notably). 28 | 29 | In `/etc/php/__PHPVERSION__/fpm/pool.d/__ID__.conf`, you can increase the `max_execution_time` and `max_input_time` limits (both values are in seconds if nothing is specified). 30 | 31 | Reload PHP-FPM with `sudo service php__PHPVERSION__-fpm reload`. 32 | 33 | ##### Upload limit 34 | If you are facing an error while uploading large files into the forum, PHP may be limiting file upload. 35 | 36 | In `/etc/php/__PHPVERSION__/fpm/pool.d/__ID__.conf`, you can uncomment (remove `;` at the beginning of the line) and increase the values of `upload_max_filesize` and `post_max_size` (both values are in bytes). 37 | 38 | Reload PHP-FPM with `sudo service php__PHP_VERSION__-fpm reload`. 39 | -------------------------------------------------------------------------------- /doc/ADMIN_fr.md: -------------------------------------------------------------------------------- 1 | ### Connexion 2 | 3 | Cette app permet à vos utilisateurs enregistrés dans YunoHost de se connecter avec une [extension LDAP dédiée](https://github.com/tituspijean/flarum-ext-auth-ldap). Par défaut, la méthode de connexion standard est cachée. 4 | Pour permettre à des utilisateurs non-YunoHost de se connecter, référez-vous au menu de configuration de l'extension LDAP dans le panneau d'administration de Flarum. 5 | 6 | ### Mise à jour 7 | 8 | Notez que, pour le moment, toute extension tierce est désinstallée lors d'une mise à jour. 9 | Leurs données et paramètres restent dans la base de donnée de Flarum, seule une réinstallation est nécessaire. 10 | 11 | ### Ajouter des extensions 12 | 13 | Flarum ne permet pas encore d'installer des extensions depuis son interface d'administration ; vous devrez donc utiliser la ligne de commande. 14 | 15 | Remplacez `vendor/extension` par les noms adéquats. Référez-vous à la documentation de l'extension pour vérifier qu'elle ne nécessite pas de configuration supplémentaire. 16 | 17 | ```bash 18 | sudo su 19 | app=__ID__ 20 | cd /var/www/$app 21 | sudo -u $app php__PHPVERSION__ composer.phar require vendor/extension 22 | ``` 23 | 24 | #### Dépannage 25 | 26 | ##### Erreurs de `timeout` 27 | Quelques utilisateurs rapportent qu'ils font fassent à une page blanche due à une erreur de `timeout` dans un script PHP qui prépare le cache (`Minify.php`, notamment). 28 | 29 | Dans `/etc/php/__PHPVERSION__/fpm/pool.d/__ID__.conf`, vous pouvez augmenter les limites `max_execution_time` et `max_input_time` (les deux valeurs sont en secondes si vous ne précisez pas d'unité). 30 | 31 | Rechargez PHP-FPM avec `sudo service php__PHPVERSION__-fpm reload`. 32 | 33 | ##### Limite de téléversement 34 | Si vous avez une erreur lors du chargement de gros fichiers dans le forum, PHP pourrait être en train de limiter les téléversements. 35 | 36 | Dans `/etc/php/__PHPVERSION__/fpm/pool.d/__ID__.conf`, vous pouvez décommenter (enlevez `;` au début de la ligne) et augmenter les valeurs de `upload_max_filesize` de `post_max_size` (les deux valeurs sont en octets). 37 | 38 | Rechargez PHP-FPM avec `sudo service php__PHPVERSION__-fpm reload`. 39 | -------------------------------------------------------------------------------- /doc/DESCRIPTION.md: -------------------------------------------------------------------------------- 1 | Flarum is a simple discussion platform for your website. It's fast and easy to use, with all the features you need to run a successful community. -------------------------------------------------------------------------------- /doc/DESCRIPTION_fr.md: -------------------------------------------------------------------------------- 1 | Flarum est une plate-forme de discussion simple pour votre site Web. C'est rapide et facile à utiliser, avec toutes les fonctionnalités dont vous avez besoin pour gérer une communauté. -------------------------------------------------------------------------------- /doc/POST_INSTALL.md: -------------------------------------------------------------------------------- 1 | You can now open your browser to Flarum's page. 2 | 3 | First loading may be a bit longer, as assets are generated. 4 | -------------------------------------------------------------------------------- /doc/POST_INSTALL_fr.md: -------------------------------------------------------------------------------- 1 | Vous pouvez maintenant ouvrir votre navigateur à la page de Flarum. 2 | 3 | Le premier chargement peut être un peu retardé par la génération du cache. 4 | -------------------------------------------------------------------------------- /doc/PRE_INSTALL.md: -------------------------------------------------------------------------------- 1 | - The installation requires at least 1GB of free memory. A swap file of this size will be created if needed. 2 | - You can select the default language (among English `en` by default, French `fr`, and German `de`). Other languages can be added after installation like any other extension. 3 | -------------------------------------------------------------------------------- /doc/PRE_INSTALL_fr.md: -------------------------------------------------------------------------------- 1 | - L'installation nécessite au moins 1 Go de mémoire vive libre. Un fichier *swap* de cette taille sera créé si nécessaire. 2 | - Vous pouvez sélectionner la langue par défaut dans les paramètres d'installation (parmi l'anglais `en`, le français `fr` et l'allemand `de`). Les autres langues sont installables comme n'importe quelle autre extension. 3 | -------------------------------------------------------------------------------- /doc/screenshots/beta16.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YunoHost-Apps/flarum_ynh/597a28094a1d7257d687d7e6bee176f20c468bb1/doc/screenshots/beta16.jpg -------------------------------------------------------------------------------- /manifest.toml: -------------------------------------------------------------------------------- 1 | packaging_format = 2 2 | 3 | id = "flarum" 4 | name = "Flarum" 5 | description.en = "Next-generation forum made simple" 6 | description.fr = "Forum de nouvelle génération, simplement" 7 | description.de = "Forum der nächsten Generation leicht gemacht" 8 | 9 | version = "1.8.10~ynh1" 10 | 11 | maintainers = ["tituspijean"] 12 | 13 | [upstream] 14 | license = "MIT" 15 | website = "https://flarum.org" 16 | demo = "https://discuss.flarum.org/d/21101-demos-come-to-flarum" 17 | admindoc = "https://docs.flarum.org" 18 | code = "https://github.com/flarum/framework" 19 | cpe = "cpe:2.3:a:flarum:flarum" 20 | fund = "https://flarum.org/donate/" 21 | 22 | [integration] 23 | yunohost = ">= 11.2" 24 | architectures = "all" 25 | multi_instance = true 26 | ldap = true 27 | sso = false 28 | disk = "80M" 29 | ram.build = "400M" 30 | ram.runtime = "50M" 31 | 32 | [install] 33 | 34 | [install.domain] 35 | type = "domain" 36 | 37 | [install.path] 38 | type = "path" 39 | default = "/flarum" 40 | 41 | [install.admin] 42 | type = "user" 43 | 44 | [install.password] 45 | help.en = "Choose your password. It will be useful if logging in from YunoHost fails or is disrupted." 46 | help.fr = "Choisissez votre mot de passe. Il sera utile si la connexion via YunoHost échoue ou est perturbée." 47 | type = "password" 48 | 49 | [install.title] 50 | ask.en = "Choose a title for your forum" 51 | ask.fr = "Choisissez un titre pour votre forum" 52 | ask.de = "Wählen einen Titel für eure Internetforum" 53 | type = "string" 54 | example = "My forum" 55 | default = "My forum" 56 | 57 | [install.init_main_permission] 58 | help.en = "If set to 'visitors', it will be open to all visitors like any forum. If private, only the YunoHost server users can access it." 59 | help.fr = "Si défini sur 'visiteurs', le forum sera accessible à tous, comme pour tout forum. Si privé, seuls les utilisateurs du serveur YunoHost pourront y accéder." 60 | type = "group" 61 | default = "visitors" 62 | 63 | [install.language] 64 | ask.en = "Choose the application language" 65 | ask.fr = "Choisissez la langue de l'application" 66 | ask.de = "Wählen Sie eine Sprache" 67 | type = "select" 68 | choices = ["fr", "en", "de"] 69 | default = "en" 70 | 71 | [resources] 72 | 73 | # The main source is only used to auto-update the package 74 | [resources.sources.main] 75 | prefetch = false 76 | url = "https://github.com/flarum/framework/archive/refs/tags/v1.8.10.tar.gz" 77 | sha256 = "3163169071a0cb710af219adc012cd91da5ce4336fcb287e69de661099ecb99e" 78 | autoupdate.upstream = "https://github.com/flarum/framework" 79 | autoupdate.strategy = "latest_github_tag" 80 | 81 | # The flarum source is the one actually being installed 82 | [resources.sources.flarum] 83 | url = "https://github.com/flarum/flarum/archive/refs/tags/v1.8.1.tar.gz" 84 | sha256 = "25ab0e3f44944ab478dd1076d4ada60a4f1a6255cb291423011d35b341f32570" 85 | autoupdate.upstream = "https://github.com/flarum/flarum" 86 | autoupdate.strategy = "latest_github_tag" 87 | 88 | [resources.system_user] 89 | 90 | [resources.install_dir] 91 | 92 | [resources.permissions] 93 | main.url = "/" 94 | 95 | [resources.apt] 96 | packages = "mariadb-server, php8.2-curl, php8.2-dom, php8.2-gd, php8.2-mbstring, php8.2-pdo-mysql, php8.2-tokenizer, php8.2-zip, php8.2-ldap" 97 | 98 | [resources.database] 99 | type = "mysql" 100 | -------------------------------------------------------------------------------- /scripts/_common.sh: -------------------------------------------------------------------------------- 1 | #================================================= 2 | # COMMON VARIABLES 3 | #================================================= 4 | 5 | swap_needed=1024 6 | 7 | # PHP 8 | YNH_COMPOSER_VERSION="2.0.13" 9 | 10 | # Version numbers 11 | project_version="1.8.0" 12 | #core_version is now retrieved from the manifest 13 | ldap_version="*" 14 | 15 | #================================================= 16 | # PERSONAL HELPERS 17 | #================================================= 18 | 19 | # Activate extension in Flarum's database 20 | # usage: activate_flarum_extension $db_name $extension $short_extension 21 | # $short_extension is the extension name written in database, how it is shortened is still a mystery 22 | activate_flarum_extension() { 23 | # Declare an array to define the options of this helper. 24 | local legacy_args=ds 25 | declare -Ar args_array=( [d]=database= [s]=short_extension ) 26 | local database 27 | local short_extension 28 | # Manage arguments with getopts 29 | ynh_handle_getopts_args "$@" 30 | database="${database:-$db_name}" 31 | 32 | local sql_command 33 | local old_extensions_enabled 34 | local addition 35 | local new_extensions_enabled 36 | 37 | # Retrieve current extensions 38 | sql_command="SELECT \`value\` FROM settings WHERE \`key\` = 'extensions_enabled'" 39 | old_extensions_enabled=$(ynh_mysql_execute_as_root "$sql_command" $database | tail -1) 40 | 41 | # Use jq to test presence of the extension in the list of enabled extensions 42 | # if not, then add it. 43 | new_extensions_enabled=$(jq -jrc --arg short_extension $short_extension '. + [ $short_extension ] | unique' <<< $old_extensions_enabled) 44 | 45 | # Update activated extensions list 46 | sql_command="UPDATE \`settings\` SET \`value\`='$new_extensions_enabled' WHERE \`key\`='extensions_enabled';" 47 | ynh_mysql_execute_as_root "$sql_command" $database 48 | } 49 | 50 | #================================================= 51 | # EXPERIMENTAL HELPERS 52 | #================================================= 53 | 54 | # See ynh_* scripts 55 | -------------------------------------------------------------------------------- /scripts/backup: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #================================================= 4 | # GENERIC START 5 | #================================================= 6 | # IMPORT GENERIC HELPERS 7 | #================================================= 8 | 9 | # Keep this path for calling _common.sh inside the execution's context of backup and restore scripts 10 | source ../settings/scripts/_common.sh 11 | source /usr/share/yunohost/helpers 12 | 13 | #================================================= 14 | # DECLARE DATA AND CONF FILES TO BACKUP 15 | #================================================= 16 | ynh_print_info --message="Declaring files to be backed up..." 17 | 18 | #================================================= 19 | # BACKUP THE APP MAIN DIR 20 | #================================================= 21 | 22 | ynh_backup --src_path="$install_dir" 23 | 24 | #================================================= 25 | # BACKUP THE NGINX CONFIGURATION 26 | #================================================= 27 | 28 | ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" 29 | 30 | #================================================= 31 | # BACKUP THE PHP-FPM CONFIGURATION 32 | #================================================= 33 | 34 | ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" 35 | 36 | #================================================= 37 | # SPECIFIC BACKUP 38 | #================================================= 39 | # BACKUP LOGROTATE 40 | #================================================= 41 | 42 | ynh_backup --src_path="/etc/logrotate.d/$app" 43 | 44 | #================================================= 45 | # BACKUP THE MYSQL DATABASE 46 | #================================================= 47 | ynh_print_info --message="Backing up the MySQL database..." 48 | 49 | ynh_mysql_dump_db --database="$db_name" > db.sql 50 | 51 | #================================================= 52 | # END OF SCRIPT 53 | #================================================= 54 | 55 | ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." 56 | -------------------------------------------------------------------------------- /scripts/change_url: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #================================================= 4 | # GENERIC STARTING 5 | #================================================= 6 | # IMPORT GENERIC HELPERS 7 | #================================================= 8 | 9 | source _common.sh 10 | source /usr/share/yunohost/helpers 11 | 12 | #================================================= 13 | # RETRIEVE ARGUMENTS 14 | #================================================= 15 | 16 | old_domain=$YNH_APP_OLD_DOMAIN 17 | old_path=$YNH_APP_OLD_PATH 18 | 19 | new_domain=$YNH_APP_NEW_DOMAIN 20 | new_path=$YNH_APP_NEW_PATH 21 | 22 | app=$YNH_APP_INSTANCE_NAME 23 | 24 | #================================================= 25 | # LOAD SETTINGS 26 | #================================================= 27 | ynh_script_progression --message="Loading installation settings..." --weight=1 28 | 29 | # Needed for helper "ynh_add_nginx_config" 30 | install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) 31 | 32 | #================================================= 33 | # BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP 34 | #================================================= 35 | ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." 36 | 37 | # Backup the current version of the app 38 | ynh_backup_before_upgrade 39 | ynh_clean_setup () { 40 | # Remove the new domain config file, the remove script won't do it as it doesn't know yet its location. 41 | ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" 42 | 43 | # Restore it if the upgrade fails 44 | ynh_restore_upgradebackup 45 | } 46 | # Exit if an error occurs during the execution of the script 47 | ynh_abort_if_errors 48 | 49 | #================================================= 50 | # CHECK WHICH PARTS SHOULD BE CHANGED 51 | #================================================= 52 | 53 | change_domain=0 54 | if [ "$old_domain" != "$new_domain" ] 55 | then 56 | change_domain=1 57 | fi 58 | 59 | change_path=0 60 | if [ "$old_path" != "$new_path" ] 61 | then 62 | change_path=1 63 | fi 64 | 65 | #================================================= 66 | # STANDARD MODIFICATIONS 67 | #================================================= 68 | # MODIFY URL IN NGINX CONF 69 | #================================================= 70 | ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1 71 | 72 | nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf 73 | 74 | # Change the path in the NGINX config file 75 | if [ $change_path -eq 1 ] 76 | then 77 | # Make a backup of the original NGINX config file if modified 78 | ynh_backup_if_checksum_is_different --file="$nginx_conf_path" 79 | # Set global variables for NGINX helper 80 | domain="$old_domain" 81 | path_url="$new_path" 82 | # Create a dedicated NGINX config 83 | ynh_add_nginx_config 84 | fi 85 | 86 | # Change the domain for NGINX 87 | if [ $change_domain -eq 1 ] 88 | then 89 | # Delete file checksum for the old conf file location 90 | ynh_delete_file_checksum --file="$nginx_conf_path" 91 | mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf 92 | # Store file checksum for the new config file location 93 | ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" 94 | fi 95 | 96 | #================================================= 97 | # SPECIFIC MODIFICATIONS 98 | #================================================= 99 | # ... 100 | #================================================= 101 | if [ $new_path = "/" ]; then 102 | if [ $old_path = "/" ]; then 103 | ynh_replace_string "://$old_domain" "://$new_domain" "$install_dir/config.php" 104 | else 105 | ynh_replace_string "://$old_domain$old_path" "://$new_domain" "$install_dir/config.php" 106 | fi 107 | else 108 | if [ $old_path = "/" ]; then 109 | ynh_replace_string "://$old_domain" "://$new_domain$new_path" "$install_dir/config.php" 110 | else 111 | ynh_replace_string "://$old_domain$old_path" "://$new_domain$new_path" "$install_dir/config.php" 112 | fi 113 | fi 114 | 115 | #================================================= 116 | # GENERIC FINALISATION 117 | #================================================= 118 | # RELOAD NGINX 119 | #================================================= 120 | ynh_script_progression --message="Reloading NGINX web server..." --weight=1 121 | 122 | ynh_systemd_action --service_name=nginx --action=reload 123 | 124 | #================================================= 125 | # END OF SCRIPT 126 | #================================================= 127 | 128 | ynh_script_progression --message="Change of URL completed for $app" --last 129 | -------------------------------------------------------------------------------- /scripts/experimental_helpers/ynh_add_swap: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Add swap 4 | # 5 | # usage: ynh_add_swap --size=SWAP in Mb 6 | # | arg: -s, --size= - Amount of SWAP to add in Mb. 7 | ynh_add_swap () { 8 | # Declare an array to define the options of this helper. 9 | declare -Ar args_array=( [s]=size= ) 10 | local size 11 | # Manage arguments with getopts 12 | ynh_handle_getopts_args "$@" 13 | 14 | local swap_max_size=$(( $size * 1024 )) 15 | 16 | local free_space=$(df --output=avail / | sed 1d) 17 | # Because we don't want to fill the disk with a swap file, divide by 2 the available space. 18 | local usable_space=$(( $free_space / 2 )) 19 | 20 | SD_CARD_CAN_SWAP=${SD_CARD_CAN_SWAP:-0} 21 | 22 | # Swap on SD card only if it's is specified 23 | if ynh_is_main_device_a_sd_card && [ "$SD_CARD_CAN_SWAP" == "0" ] 24 | then 25 | ynh_print_warn --message="The main mountpoint of your system '/' is on an SD card, swap will not be added to prevent some damage of this one, but that can cause troubles for the app $app. If you still want activate the swap, you can relaunch the command preceded by 'SD_CARD_CAN_SWAP=1'" 26 | return 27 | fi 28 | 29 | # Compare the available space with the size of the swap. 30 | # And set a acceptable size from the request 31 | if [ $usable_space -ge $swap_max_size ] 32 | then 33 | local swap_size=$swap_max_size 34 | elif [ $usable_space -ge $(( $swap_max_size / 2 )) ] 35 | then 36 | local swap_size=$(( $swap_max_size / 2 )) 37 | elif [ $usable_space -ge $(( $swap_max_size / 3 )) ] 38 | then 39 | local swap_size=$(( $swap_max_size / 3 )) 40 | elif [ $usable_space -ge $(( $swap_max_size / 4 )) ] 41 | then 42 | local swap_size=$(( $swap_max_size / 4 )) 43 | else 44 | echo "Not enough space left for a swap file" >&2 45 | local swap_size=0 46 | fi 47 | 48 | # If there's enough space for a swap, and no existing swap here 49 | if [ $swap_size -ne 0 ] && [ ! -e /swap_$app ] 50 | then 51 | # Preallocate space for the swap file, fallocate may sometime not be used, use dd instead in this case 52 | if ! fallocate -l ${swap_size}K /swap_$app 53 | then 54 | dd if=/dev/zero of=/swap_$app bs=1024 count=${swap_size} 55 | fi 56 | chmod 0600 /swap_$app 57 | # Create the swap 58 | mkswap /swap_$app 59 | # And activate it 60 | swapon /swap_$app 61 | # Then add an entry in fstab to load this swap at each boot. 62 | echo -e "/swap_$app swap swap defaults 0 0 #Swap added by $app" >> /etc/fstab 63 | fi 64 | } 65 | 66 | ynh_del_swap () { 67 | # If there a swap at this place 68 | if [ -e /swap_$app ] 69 | then 70 | # Clean the fstab 71 | sed -i "/#Swap added by $app/d" /etc/fstab 72 | # Desactive the swap file 73 | swapoff /swap_$app 74 | # And remove it 75 | rm /swap_$app 76 | fi 77 | } 78 | 79 | # Check if the device of the main mountpoint "/" is an SD card 80 | # 81 | # [internal] 82 | # 83 | # return 0 if it's an SD card, else 1 84 | ynh_is_main_device_a_sd_card () { 85 | local main_device=$(lsblk --output PKNAME --noheadings $(findmnt / --nofsroot --uniq --output source --noheadings --first-only)) 86 | 87 | if echo $main_device | grep --quiet "mmc" && [ $(tail -n1 /sys/block/$main_device/queue/rotational) == "0" ] 88 | then 89 | return 0 90 | else 91 | return 1 92 | fi 93 | } 94 | -------------------------------------------------------------------------------- /scripts/install: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #================================================= 4 | # GENERIC START 5 | #================================================= 6 | # IMPORT GENERIC HELPERS 7 | #================================================= 8 | 9 | source _common.sh 10 | source experimental_helpers/ynh_add_swap 11 | source /usr/share/yunohost/helpers 12 | 13 | #================================================= 14 | # RETRIEVE ARGUMENTS FROM THE MANIFEST 15 | #================================================= 16 | 17 | core_version=$(ynh_app_upstream_version) 18 | 19 | admin_mail=$(ynh_user_get_info --username=$admin --key=mail) 20 | 21 | #================================================= 22 | # STORE SETTINGS FROM MANIFEST 23 | #================================================= 24 | ynh_app_setting_set --app=$app --key=language --value="$language" 25 | ynh_app_setting_set --app=$app --key=project_version --value="$project_version" 26 | ynh_app_setting_set --app=$app --key=core_version --value="$core_version" 27 | ynh_app_setting_set --app=$app --key=ldap_version --value="$ldap_version" 28 | 29 | #================================================= 30 | # STANDARD MODIFICATIONS 31 | #================================================= 32 | 33 | #================================================= 34 | # DOWNLOAD, CHECK AND UNPACK SOURCE 35 | #================================================= 36 | ynh_script_progression --message="Setting up source files..." --weight=3 37 | 38 | # Download, check integrity, uncompress and patch the source from app.src 39 | ynh_setup_source --dest_dir="$install_dir" --source_id="flarum" 40 | 41 | chmod -R o-rwx "$install_dir" 42 | chown -R $app:www-data "$install_dir" 43 | 44 | #================================================= 45 | # SYSTEM CONFIGURATION 46 | #================================================= 47 | ynh_script_progression --message="Adding system configurations related to $app..." --weight=1 48 | 49 | # Create a dedicated PHP-FPM config 50 | ynh_add_fpm_config 51 | 52 | # Create a dedicated NGINX config 53 | ynh_add_nginx_config 54 | 55 | # Use logrotate to manage application logfile(s) 56 | ynh_use_logrotate 57 | 58 | #================================================= 59 | # SPECIFIC SETUP 60 | #================================================= 61 | # ADD SWAP 62 | #================================================= 63 | ynh_print_info --message="Adding swap..." 64 | 65 | if [ ${PACKAGE_CHECK_EXEC:-0} -eq 0 ]; then 66 | ynh_add_swap --size=$swap_needed 67 | fi 68 | 69 | #================================================= 70 | # INSTALL COMPOSER DEPENDENCIES 71 | #================================================= 72 | ynh_script_progression --message="Installing composer dependencies..." --weight=5 73 | 74 | ynh_exec_warn_less ynh_install_composer --phpversion="$phpversion" --workdir="$install_dir" 75 | 76 | # Set Flarum version 77 | ynh_exec_warn_less ynh_composer_exec --phpversion=$phpversion --workdir=$install_dir --commands="require flarum/core:$core_version --prefer-lowest --no-update" 78 | 79 | # Require LDAP extension 80 | ynh_exec_warn_less ynh_composer_exec --phpversion=$phpversion --workdir=$install_dir --commands="require tituspijean/flarum-ext-auth-ldap:$ldap_version --no-update" 81 | 82 | # Update and download dependencies 83 | ynh_exec_warn_less ynh_composer_exec --phpversion=$phpversion --workdir=$install_dir --commands="update" 84 | 85 | #================================================= 86 | # FLARUM POST-INSTALL 87 | #================================================= 88 | ynh_script_progression --message="Configuring Flarum..." --weight=2 89 | 90 | # Copy and populate configuration.yml to working directory 91 | ynh_add_config --template="../conf/configuration.yml" --destination="$install_dir/configuration.yml" 92 | 93 | # Execute post-installation 94 | pushd $install_dir 95 | ynh_exec_as $app php$phpversion -d $install_dir -d memory_limit=-1 flarum install -f configuration.yml 96 | # Delete configuration.yml as it contains sensitive data 97 | ynh_secure_remove --file="$install_dir/configuration.yml" 98 | popd 99 | 100 | # Email setup 101 | ynh_add_config --template="../conf/mail.sql.template" --destination="../conf/mail.sql" 102 | ynh_mysql_connect_as --user=$app --password="$db_pwd" --database=$db_name < ../conf/mail.sql 103 | 104 | # Enable and set up the LDAP auth extension 105 | ynh_script_progression --message="Enabling and configuring LDAP extension..." --weight=2 106 | activate_flarum_extension $db_name "tituspijean-auth-ldap" 107 | ynh_add_config --template="../conf/ldap.sql.template" --destination="../conf/ldap.sql" 108 | ynh_mysql_connect_as --user=$app --password="$db_pwd" --database=$db_name < ../conf/ldap.sql 109 | 110 | # Install, activate and set language extensions 111 | case $language in 112 | fr) 113 | ynh_script_progression --message="Installing French extension..." --weight=2 114 | ynh_exec_warn_less ynh_composer_exec --phpversion=$phpversion --workdir=$install_dir --commands="require qiaeru/lang-french:*" 115 | activate_flarum_extension $db_name "qiaeru-lang-french" 116 | sql_command="UPDATE \`settings\` SET \`value\` = 'fr' WHERE \`settings\`.\`key\` = 'default_locale'" 117 | ynh_mysql_execute_as_root --sql="$sql_command" --database=$db_name 118 | ;; 119 | de) 120 | ynh_script_progression --message="Installing German extension..." --weight=2 121 | ynh_exec_warn_less ynh_composer_exec --phpversion=$phpversion --workdir=$install_dir --commands="require kakifrucht/flarum-de:*" 122 | activate_flarum_extension $db_name "kakifrucht-de" 123 | sql_command="UPDATE \`settings\` SET \`value\` = 'de' WHERE \`settings\`.\`key\` = 'default_locale'" 124 | ynh_mysql_execute_as_root --sql="$sql_command" --database=$db_name 125 | ;; 126 | esac 127 | 128 | # Set files and directories permissions 129 | chmod 750 "$install_dir" 130 | chmod -R o-rwx "$install_dir" 131 | chown -R $app:www-data "$install_dir" 132 | 133 | #================================================= 134 | # END OF SCRIPT 135 | #================================================= 136 | 137 | ynh_script_progression --message="Installation of $app completed" 138 | -------------------------------------------------------------------------------- /scripts/remove: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #================================================= 4 | # GENERIC START 5 | #================================================= 6 | # IMPORT GENERIC HELPERS 7 | #================================================= 8 | 9 | source _common.sh 10 | source experimental_helpers/ynh_add_swap 11 | source /usr/share/yunohost/helpers 12 | 13 | #================================================= 14 | # REMOVE SYSTEM CONFIGURATIONS 15 | #================================================= 16 | # REMOVE SYSTEMD SERVICE 17 | #================================================= 18 | ynh_script_progression --message="Removing system configurations related to $app..." --weight=1 19 | 20 | ynh_remove_nginx_config 21 | 22 | ynh_remove_fpm_config 23 | 24 | ynh_remove_logrotate 25 | 26 | ynh_del_swap 27 | 28 | #================================================= 29 | # END OF SCRIPT 30 | #================================================= 31 | 32 | ynh_script_progression --message="Removal of $app completed" --last 33 | -------------------------------------------------------------------------------- /scripts/restore: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #================================================= 4 | # GENERIC START 5 | #================================================= 6 | # IMPORT GENERIC HELPERS 7 | #================================================= 8 | 9 | # Keep this path for calling _common.sh inside the execution's context of backup and restore scripts 10 | source ../settings/scripts/_common.sh 11 | source ../settings/scripts/experimental_helpers/ynh_add_swap 12 | source /usr/share/yunohost/helpers 13 | 14 | #================================================= 15 | # STANDARD RESTORATION STEPS 16 | #================================================= 17 | # RESTORE THE APP MAIN DIR 18 | #================================================= 19 | ynh_script_progression --message="Restoring the app main directory..." --weight=1 20 | 21 | ynh_restore_file --origin_path="$install_dir" 22 | 23 | chmod -R o-rwx "$install_dir" 24 | chown -R $app:www-data "$install_dir" 25 | 26 | #================================================= 27 | # RESTORE THE MYSQL DATABASE 28 | #================================================= 29 | ynh_script_progression --message="Restoring the MySQL database..." 30 | 31 | ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql 32 | 33 | #================================================= 34 | # RESTORE SYSTEM CONFIGURATIONS 35 | #================================================= 36 | # RESTORE THE PHP-FPM CONFIGURATION 37 | #================================================= 38 | ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1 39 | 40 | ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" 41 | 42 | ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" 43 | 44 | ynh_restore_file --origin_path="/etc/logrotate.d/$app" 45 | 46 | #================================================= 47 | # ADD SWAP 48 | #================================================= 49 | ynh_script_progression --message="Adding swap..." 50 | 51 | if [ ${PACKAGE_CHECK_EXEC:-0} -eq 0 ]; then 52 | ynh_add_swap --size=$swap_needed 53 | fi 54 | 55 | #================================================= 56 | # GENERIC FINALIZATION 57 | #================================================= 58 | # RELOAD NGINX AND PHP-FPM 59 | #================================================= 60 | ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..." --weight=1 61 | 62 | ynh_systemd_action --service_name=php$phpversion-fpm --action=reload 63 | ynh_systemd_action --service_name=nginx --action=reload 64 | 65 | #================================================= 66 | # END OF SCRIPT 67 | #================================================= 68 | 69 | ynh_script_progression --message="Restoration completed for $app" --last 70 | -------------------------------------------------------------------------------- /scripts/upgrade: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #================================================= 4 | # GENERIC START 5 | #================================================= 6 | # IMPORT GENERIC HELPERS 7 | #================================================= 8 | 9 | source _common.sh 10 | source experimental_helpers/ynh_add_swap 11 | source /usr/share/yunohost/helpers 12 | 13 | #================================================= 14 | # LOAD SETTINGS 15 | #================================================= 16 | ynh_script_progression --message="Loading installation settings..." --weight=1 17 | 18 | old_core_version=$(ynh_app_setting_get --app=$app --key=core_version) 19 | core_version=$(ynh_app_upstream_version) 20 | 21 | #================================================= 22 | # CHECK VERSION 23 | #================================================= 24 | ynh_script_progression --message="Checking version..." 25 | 26 | upgrade_type=$(ynh_check_app_version_changed) 27 | 28 | #================================================= 29 | # STANDARD UPGRADE STEPS 30 | #================================================= 31 | # ENSURE DOWNWARD COMPATIBILITY 32 | #================================================= 33 | ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 34 | 35 | # Remove bazaar_extension if it exists 36 | bazaar_extension=$(ynh_app_setting_get --app=$app --key=bazaar_extension) 37 | if [ ! -z "$bazaar_extension" ]; then 38 | ynh_app_setting_delete --app=$app --key=bazaar_extension 39 | fi 40 | 41 | # Remove SSOwat extension if it exists 42 | ssowat_extension=$(ynh_app_setting_get --app=$app --key=ssowat_extension) 43 | if [ ! -z "$ssowat_extension" ]; then 44 | ynh_exec_warn_less ynh_composer_exec --phpversion=$phpversion --workdir=$install_dir --commands="remove tituspijean/flarum-ext-auth-ssowat" 45 | ynh_app_setting_delete --app=$app --key=ssowat_extension 46 | fi 47 | 48 | #================================================= 49 | # DOWNLOAD, CHECK AND UNPACK SOURCE 50 | #================================================= 51 | 52 | if [ "$upgrade_type" == "UPGRADE_APP" ] && ynh_compare_current_package_version --comparison lt --version 1.0~ynh1 53 | then 54 | ynh_script_progression --message="Upgrading source files..." 55 | 56 | # Create a temporary directory 57 | tmpdir="$(mktemp -d)" 58 | cp -R $install_dir/* $tmpdir 59 | 60 | # Deleting current app directory 61 | ynh_secure_remove --file="$install_dir" 62 | 63 | # Download, check integrity, uncompress and patch the source from app.src 64 | ynh_setup_source --dest_dir="$install_dir" --source_id="flarum" 65 | 66 | # Copy config.php back into Flarum 67 | cp -f $tmpdir/config.php $install_dir 68 | 69 | # Copy assets from old app version. Can be either in root folder or in "public" folder 70 | if [ -d $tmpdir/assets ]; then 71 | cp -Rf $tmpdir/assets $install_dir/public 72 | fi 73 | if [ -d $tmpdir/public/assets ]; then 74 | cp -Rf $tmpdir/public/assets $install_dir/public 75 | fi 76 | 77 | # Clean temp directory 78 | ynh_secure_remove --file="$tmpdir" 79 | fi 80 | 81 | chmod 750 "$install_dir" 82 | chmod -R o-rwx "$install_dir" 83 | chown -R $app:www-data "$install_dir" 84 | 85 | #================================================= 86 | # PHP-FPM CONFIGURATION 87 | #================================================= 88 | ynh_script_progression --message="Upgrading php-fpm configuration..." --weight=1 89 | 90 | # Create a dedicated php-fpm config 91 | ynh_add_fpm_config 92 | 93 | # Create a dedicated NGINX config 94 | ynh_add_nginx_config 95 | 96 | #================================================= 97 | # SPECIFIC UPGRADE 98 | #================================================= 99 | # ADD SWAP 100 | #================================================= 101 | ynh_script_progression --message="Adding swap..." 102 | 103 | if [ ${PACKAGE_CHECK_EXEC:-0} -eq 0 ]; then 104 | ynh_add_swap --size=$swap_needed 105 | fi 106 | 107 | #================================================= 108 | # COMPOSER AND FLARUM UPGRADE 109 | #================================================= 110 | 111 | if [ "$upgrade_type" == "UPGRADE_APP" ] 112 | then 113 | ynh_script_progression --message="Installing composer dependencies..." --weight=5 114 | 115 | # Set right permissions 116 | chown -R $app:www-data $install_dir 117 | 118 | if ynh_compare_current_package_version --comparison lt --version 1.1.0~ynh1 119 | then 120 | # Starting 1.0 (implemented for 1.1 in the package), version requirement is "*" for extensions 121 | # ... except for flarum/core, but that's handled in the next block. 122 | jq '.require | .[] = "*"' $install_dir/composer.json 123 | fi 124 | 125 | # Perform migrations and clear cache 126 | pushd $install_dir 127 | ynh_script_progression --message="Upgrading Flarum and its extensions..." --weight=1 128 | ynh_exec_warn_less ynh_composer_exec --phpversion=$phpversion --workdir=$install_dir --commands="require tituspijean/flarum-ext-auth-ldap:$ldap_version --no-update" 129 | ynh_exec_warn_less ynh_composer_exec --phpversion=$phpversion --workdir=$install_dir --commands="require flarum/core:$core_version --prefer-dist --update-no-dev -a --update-with-all-dependencies" 130 | ynh_exec_as $app php$phpversion flarum migrate 131 | ynh_exec_as $app php$phpversion flarum cache:clear 132 | popd 133 | fi 134 | 135 | ynh_app_setting_set $app core_version "$core_version" 136 | 137 | #================================================= 138 | # FLARUM EXTENSIONS 139 | #================================================= 140 | 141 | if ! ynh_exec_as $app php$phpversion flarum info | grep -q "tituspijean-auth-ldap" | grep -q $ldap_version; 142 | then 143 | # Install and activate the LDAP auth extension 144 | activate_flarum_extension $db_name "tituspijean-auth-ldap" 145 | # Configure LDAP auth extension 146 | ynh_add_config --template="../conf/ldap.sql.template" --destination="../conf/ldap.sql" 147 | ynh_mysql_connect_as --user=$app --password="$db_pwd" --database=$db_name < ../conf/ldap.sql 148 | fi 149 | 150 | # Install, activate and set language extensions 151 | case $language in 152 | fr) 153 | ynh_script_progression --message="Installing French extension..." --weight=2 154 | ynh_exec_warn_less ynh_composer_exec --phpversion=$phpversion --workdir=$install_dir --commands="require qiaeru/lang-french:*" 155 | activate_flarum_extension $db_name "qiaeru-lang-french" 156 | sql_command="UPDATE \`settings\` SET \`value\` = 'fr' WHERE \`settings\`.\`key\` = 'default_locale'" 157 | ynh_mysql_execute_as_root --sql="$sql_command" --database=$db_name 158 | ;; 159 | de) 160 | ynh_script_progression --message="Installing German extension..." --weight=2 161 | ynh_exec_warn_less ynh_composer_exec --phpversion=$phpversion --workdir=$install_dir --commands="require kakifrucht/flarum-de:*" 162 | activate_flarum_extension $db_name "kakifrucht-de" 163 | sql_command="UPDATE \`settings\` SET \`value\` = 'de' WHERE \`settings\`.\`key\` = 'default_locale'" 164 | ynh_mysql_execute_as_root --sql="$sql_command" --database=$db_name 165 | ;; 166 | esac 167 | 168 | ynh_print_info "You may need to manually enable your language extension in Flarum's admin panel." 169 | 170 | # Clear cache 171 | pushd $install_dir 172 | ynh_exec_as $app php$phpversion flarum cache:clear 173 | popd 174 | 175 | # Set files and directories permissions 176 | chmod 750 "$install_dir" 177 | chmod -R o-rwx "$install_dir" 178 | chown -R $app:www-data "$install_dir" 179 | 180 | #================================================= 181 | # GENERIC FINALIZATION 182 | #================================================= 183 | # SETUP LOGROTATE 184 | #================================================= 185 | ynh_script_progression --message="Upgrading logrotate configuration..." --weight=1 186 | 187 | # Use logrotate to manage app-specific logfile(s) 188 | ynh_use_logrotate --non-append 189 | 190 | #================================================= 191 | # END OF SCRIPT 192 | #================================================= 193 | 194 | ynh_script_progression --message="Upgrade of $app completed" --last 195 | -------------------------------------------------------------------------------- /tests.toml: -------------------------------------------------------------------------------- 1 | test_format = 1.0 2 | 3 | [default] 4 | 5 | args.password = "Passw0rd!" 6 | args.language = "fr" 7 | 8 | test_upgrade_from.a10de288c1846116fa18d3261be39e089175eceb.name = "Upgrade from 1.8.1~ynh1" 9 | --------------------------------------------------------------------------------