mirror of
https://github.com/YunoHost-Apps/opensondage_ynh.git
synced 2024-09-03 19:46:28 +02:00
commit
61398d8e49
19 changed files with 217 additions and 353 deletions
12
issue_template.md → .github/ISSUE_TEMPLATE.md
vendored
12
issue_template.md → .github/ISSUE_TEMPLATE.md
vendored
|
@ -6,11 +6,11 @@ about: When creating a bug report, please use the following template to provide
|
||||||
|
|
||||||
**How to post a meaningful bug report**
|
**How to post a meaningful bug report**
|
||||||
1. *Read this whole template first.*
|
1. *Read this whole template first.*
|
||||||
2. *Make sure you are on the right place:*
|
2. *Determine if you are on the right place:*
|
||||||
- *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!*
|
- *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!*
|
||||||
- *Otherwise, the issue may be due to the app itself. Refer to its documentation or repository for help.*
|
- *Otherwise, the issue may be due to the app itself. Refer to its documentation or repository for help.*
|
||||||
- *In doubt, ask here and we will figure it out together.*
|
- *When in doubt, post here and we will figure it out together.*
|
||||||
3. *Delete these italic comments as you write over them below, and remove this guide.*
|
3. *Delete the italic comments as you write over them below, and remove this guide.*
|
||||||
---
|
---
|
||||||
|
|
||||||
### Describe the bug
|
### Describe the bug
|
||||||
|
@ -25,13 +25,13 @@ about: When creating a bug report, please use the following template to provide
|
||||||
- Are you in a special context or did you perform some particular tweaking on your YunoHost instance?: *no / yes*
|
- Are you in a special context or did you perform some particular tweaking on your YunoHost instance?: *no / yes*
|
||||||
- If yes, please explain:
|
- If yes, please explain:
|
||||||
- Using, or trying to install package version/branch:
|
- Using, or trying to install package version/branch:
|
||||||
- If upgrading, current package version: *can be found in the admin, or with `yunohost app info opensondage`*
|
- If upgrading, current package version: *can be found in the admin, or with `yunohost app info $app_id`*
|
||||||
|
|
||||||
### Steps to reproduce
|
### Steps to reproduce
|
||||||
|
|
||||||
- *If you performed a command from the CLI, the command itself is enough. For example:*
|
- *If you performed a command from the CLI, the command itself is enough. For example:*
|
||||||
```sh
|
```sh
|
||||||
sudo yunohost app install opensondage
|
sudo yunohost app install the_app
|
||||||
```
|
```
|
||||||
- *If you used the webadmin, please perform the equivalent command from the CLI first.*
|
- *If you used the webadmin, please perform the equivalent command from the CLI first.*
|
||||||
- *If the error occurs in your browser, explain what you did:*
|
- *If the error occurs in your browser, explain what you did:*
|
16
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
16
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
## Problem
|
||||||
|
|
||||||
|
- *Description of why you made this PR*
|
||||||
|
|
||||||
|
## Solution
|
||||||
|
|
||||||
|
- *And how do you fix that problem*
|
||||||
|
|
||||||
|
## PR Status
|
||||||
|
|
||||||
|
- [ ] Code finished and ready to be reviewed/tested
|
||||||
|
- [ ] The fix/enhancement were manually tested (if applicable)
|
||||||
|
|
||||||
|
## Automatic tests
|
||||||
|
|
||||||
|
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)
|
60
README.md
60
README.md
|
@ -1,43 +1,31 @@
|
||||||
|
<!--
|
||||||
|
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.
|
||||||
|
-->
|
||||||
|
|
||||||
# OpenSondage for YunoHost
|
# OpenSondage for YunoHost
|
||||||
|
|
||||||
[](https://dash.yunohost.org/appci/app/opensondage)  
|
[](https://dash.yunohost.org/appci/app/opensondage)  
|
||||||
[](https://install-app.yunohost.org/?app=opensondage)
|
[](https://install-app.yunohost.org/?app=opensondage)
|
||||||
|
|
||||||
*[Lire ce readme en français.](./README_fr.md)*
|
*[Lire ce readme en français.](./README_fr.md)*
|
||||||
|
|
||||||
> *This package allow you to install OpenSondage quickly and simply on a YunoHost server.
|
> *This package allows you to install OpenSondage quickly and simply on a YunoHost server.
|
||||||
If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to know how to install and enjoy it.*
|
If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.*
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
OpenSondage is an online service for planning an appointment or making a decision quickly and easily. It's a community free/libre software alternative to Doodle.
|
Service for planning an appointment or making a decision quickly and easily
|
||||||
|
|
||||||
**Shipped version:** 1.1.10
|
**Shipped version:** 1.1.16~ynh1
|
||||||
|
|
||||||
|
**Demo:** https://framadate.org/
|
||||||
|
|
||||||
## Screenshots
|
## Screenshots
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## Demo
|
## Disclaimers / important information
|
||||||
|
|
||||||
* [YunoHost demo](https://demo.yunohost.org/date/)
|
|
||||||
* [Official demo](https://framadate.org/)
|
|
||||||
|
|
||||||
## Configuration
|
|
||||||
|
|
||||||
## Documentation
|
|
||||||
|
|
||||||
* Official documentation: https://framagit.org/framasoft/framadate/framadate/wikis/home
|
|
||||||
* YunoHost documentation: https://yunohost.org/#/app_opensondage
|
|
||||||
|
|
||||||
## YunoHost specific features
|
|
||||||
|
|
||||||
#### Multi-users support
|
|
||||||
|
|
||||||
#### Supported architectures
|
|
||||||
|
|
||||||
* x86-64 - [](https://ci-apps.yunohost.org/ci/apps/opensondage/)
|
|
||||||
* ARMv8-A - [](https://ci-apps-arm.yunohost.org/ci/apps/opensondage/)
|
|
||||||
|
|
||||||
## Limitations
|
## Limitations
|
||||||
|
|
||||||
|
@ -48,18 +36,18 @@ OpenSondage is an online service for planning an appointment or making a decisio
|
||||||
|
|
||||||
* This package contains a custom version of Framadate (fork of OpenSondage and Studs), the sources are here: https://git.framasoft.org/framasoft/framadate/.
|
* This package contains a custom version of Framadate (fork of OpenSondage and Studs), the sources are here: https://git.framasoft.org/framasoft/framadate/.
|
||||||
|
|
||||||
## Links
|
## Documentation and resources
|
||||||
|
|
||||||
* Report a bug: https://github.com/YunoHost-Apps/opensondage_ynh/issues
|
* Official app website: https://framadate.org/
|
||||||
* OpenSondage website: https://git.framasoft.org/framasoft/framadate/framadate
|
* Official user documentation: https://yunohost.org/#/app_opensondage
|
||||||
* OpenSondage repository: https://git.framasoft.org/framasoft/framadate/framadate
|
* Official admin documentation: https://framagit.org/framasoft/framadate/framadate/wikis/home
|
||||||
* YunoHost website: https://yunohost.org/
|
* Upstream app code repository: https://git.framasoft.org/framasoft/framadate
|
||||||
|
* YunoHost documentation for this app: https://yunohost.org/app_opensondage
|
||||||
|
* Report a bug: https://github.com/YunoHost-Apps/opensondage_ynh/issues
|
||||||
|
|
||||||
---
|
## Developer info
|
||||||
|
|
||||||
## Developers info
|
Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/opensondage_ynh/tree/testing).
|
||||||
|
|
||||||
Please do your pull request to the [testing branch](https://github.com/YunoHost-Apps/opensondage_ynh/tree/testing).
|
|
||||||
|
|
||||||
To try the testing branch, please proceed like that.
|
To try the testing branch, please proceed like that.
|
||||||
```
|
```
|
||||||
|
@ -67,3 +55,5 @@ sudo yunohost app install https://github.com/YunoHost-Apps/opensondage_ynh/tree/
|
||||||
or
|
or
|
||||||
sudo yunohost app upgrade opensondage -u https://github.com/YunoHost-Apps/opensondage_ynh/tree/testing --debug
|
sudo yunohost app upgrade opensondage -u https://github.com/YunoHost-Apps/opensondage_ynh/tree/testing --debug
|
||||||
```
|
```
|
||||||
|
|
||||||
|
**More info regarding app packaging:** https://yunohost.org/packaging_apps
|
59
README_fr.md
59
README_fr.md
|
@ -1,44 +1,27 @@
|
||||||
# OpenSondage pour YunoHost
|
# OpenSondage pour YunoHost
|
||||||
|
|
||||||
[](https://dash.yunohost.org/appci/app/opensondage)  
|
[](https://dash.yunohost.org/appci/app/opensondage)  
|
||||||
[](https://install-app.yunohost.org/?app=opensondage)
|
[](https://install-app.yunohost.org/?app=opensondage)
|
||||||
|
|
||||||
*[Read this readme in english.](./README.md)*
|
*[Read this readme in english.](./README.md)*
|
||||||
|
*[Lire ce readme en français.](./README_fr.md)*
|
||||||
> *Ce package vous permet d'installer OpenSondage rapidement et simplement sur un serveur YunoHost.
|
|
||||||
Si vous n'avez pas YunoHost, consultez [le guide](https://yunohost.org/#/install) pour apprendre comment l'installer.*
|
|
||||||
|
|
||||||
|
> *Ce package vous permet d'installer OpenSondage rapidement et simplement sur un serveur YunoHost.
|
||||||
|
Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.*
|
||||||
|
|
||||||
## Vue d'ensemble
|
## Vue d'ensemble
|
||||||
|
|
||||||
OpenSondage est un service en ligne permettant de planifier un rendez-vous ou de prendre une décision rapidement et facilement. C'est une alternative logicielle libre et communautaire à Doodle.
|
Service pour planifier un rendez-vous ou prendre une décision rapidement et facilement
|
||||||
|
|
||||||
**Version incluse :** 1.1.10
|
**Version incluse :** 1.1.16~ynh1
|
||||||
|
|
||||||
|
**Démo :** https://framadate.org/
|
||||||
|
|
||||||
## Captures d'écran
|
## Captures d'écran
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## Démo
|
## Avertissements / informations importantes
|
||||||
|
|
||||||
* [Démo YunoHost](https://demo.yunohost.org/date/)
|
|
||||||
* [Démo officielle](https://framadate.org/)
|
|
||||||
|
|
||||||
## Configuration
|
|
||||||
|
|
||||||
## Documentation
|
|
||||||
|
|
||||||
* Documentation officielle : https://framagit.org/framasoft/framadate/framadate/wikis/home
|
|
||||||
* Documentation YunoHost : https://yunohost.org/#/app_opensondage_fr
|
|
||||||
|
|
||||||
## Caractéristiques spécifiques YunoHost
|
|
||||||
|
|
||||||
#### Support multi-utilisateur
|
|
||||||
|
|
||||||
#### Architectures supportées
|
|
||||||
|
|
||||||
* x86-64 - [](https://ci-apps.yunohost.org/ci/apps/opensondage/)
|
|
||||||
* ARMv8-A - [](https://ci-apps-arm.yunohost.org/ci/apps/opensondage/)
|
|
||||||
|
|
||||||
## Limitations
|
## Limitations
|
||||||
|
|
||||||
|
@ -49,14 +32,14 @@ OpenSondage est un service en ligne permettant de planifier un rendez-vous ou de
|
||||||
|
|
||||||
* Ce paquet contient une version personnalisée de Framadate (fork d'OpenSondage et Studs), les sources sont ici : https://git.framasoft.org/framasoft/framadate/.
|
* Ce paquet contient une version personnalisée de Framadate (fork d'OpenSondage et Studs), les sources sont ici : https://git.framasoft.org/framasoft/framadate/.
|
||||||
|
|
||||||
## Liens
|
## Documentations et ressources
|
||||||
|
|
||||||
* Signaler un bug : https://github.com/YunoHost-Apps/opensondage_ynh/issues
|
* Site officiel de l'app : https://framadate.org/
|
||||||
* Site de l'application OpenSondage : https://git.framasoft.org/framasoft/framadate/framadate
|
* Documentation officielle utilisateur : https://yunohost.org/#/app_opensondage
|
||||||
* Dépôt de l'application principale : https://git.framasoft.org/framasoft/framadate/framadate
|
* Documentation officielle de l'admin : https://framagit.org/framasoft/framadate/framadate/wikis/home
|
||||||
* Site web YunoHost : https://yunohost.org/
|
* Dépôt de code officiel de l'app : https://git.framasoft.org/framasoft/framadate
|
||||||
|
* Documentation YunoHost pour cette app : https://yunohost.org/app_opensondage
|
||||||
---
|
* Signaler un bug : https://github.com/YunoHost-Apps/opensondage_ynh/issues
|
||||||
|
|
||||||
## Informations pour les développeurs
|
## Informations pour les développeurs
|
||||||
|
|
||||||
|
@ -65,6 +48,8 @@ Merci de faire vos pull request sur la [branche testing](https://github.com/Yuno
|
||||||
Pour essayer la branche testing, procédez comme suit.
|
Pour essayer la branche testing, procédez comme suit.
|
||||||
```
|
```
|
||||||
sudo yunohost app install https://github.com/YunoHost-Apps/opensondage_ynh/tree/testing --debug
|
sudo yunohost app install https://github.com/YunoHost-Apps/opensondage_ynh/tree/testing --debug
|
||||||
or
|
ou
|
||||||
sudo yunohost app upgrade opensondage -u https://github.com/YunoHost-Apps/opensondage_ynh/tree/testing --debug
|
sudo yunohost app upgrade opensondage -u https://github.com/YunoHost-Apps/opensondage_ynh/tree/testing --debug
|
||||||
```
|
```
|
||||||
|
|
||||||
|
**Plus d'infos sur le packaging d'applications :** https://yunohost.org/packaging_apps
|
|
@ -1,10 +1,10 @@
|
||||||
;; Test complet
|
;; Test complet
|
||||||
; Manifest
|
; Manifest
|
||||||
domain="domain.tld" (DOMAIN)
|
domain="domain.tld"
|
||||||
path="/path" (PATH)
|
path="/path"
|
||||||
admin="john" (USER)
|
admin="john"
|
||||||
language="fr"
|
language="fr"
|
||||||
is_public=1 (PUBLIC|public=1|private=0)
|
is_public=1
|
||||||
; Checks
|
; Checks
|
||||||
pkg_linter=1
|
pkg_linter=1
|
||||||
setup_sub_dir=1
|
setup_sub_dir=1
|
||||||
|
@ -13,15 +13,11 @@
|
||||||
setup_private=1
|
setup_private=1
|
||||||
setup_public=1
|
setup_public=1
|
||||||
upgrade=1
|
upgrade=1
|
||||||
upgrade=1 from_commit=eb508660841801995fe2c66e5bf3259cdbea5922
|
upgrade=1 from_commit=02f2cd7e656ebae74643e969746b23d8912c7798
|
||||||
backup_restore=1
|
backup_restore=1
|
||||||
multi_instance=1
|
multi_instance=1
|
||||||
incorrect_path=1
|
|
||||||
port_already_use=0
|
|
||||||
change_url=1
|
change_url=1
|
||||||
;;; Levels
|
|
||||||
Level 5=auto
|
|
||||||
;;; Upgrade options
|
;;; Upgrade options
|
||||||
; commit=eb508660841801995fe2c66e5bf3259cdbea5922
|
; commit=02f2cd7e656ebae74643e969746b23d8912c7798
|
||||||
name=Remove Framasoft signature
|
name=Merge pull request #70 from YunoHost-Apps/testing
|
||||||
manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr_FR&is_public=1&
|
manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr_FR&is_public=1&
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
SOURCE_URL=https://framagit.org/framasoft/framadate/framadate/-/archive/1.1.10/framadate-1.1.10.tar.gz
|
SOURCE_URL=https://framagit.org/framasoft/framadate/framadate/-/archive/1.1.16/framadate-1.1.16.tar.gz
|
||||||
SOURCE_SUM=ea9ab8bd713da17dc7e5d6ddd782ce704184a3189888ed837ba8e59ee7b6fa5f
|
SOURCE_SUM=89da42a915c912a91ae1ba44fd32a61ec8fa5f59c517ee3f5d74335ddee77c7d
|
||||||
SOURCE_SUM_PRG=sha256sum
|
SOURCE_SUM_PRG=sha256sum
|
||||||
SOURCE_FORMAT=tar.gz
|
SOURCE_FORMAT=tar.gz
|
||||||
SOURCE_IN_SUBDIR=true
|
SOURCE_IN_SUBDIR=true
|
||||||
SOURCE_FILENAME=opensondage-1-1-10.tar.gz
|
SOURCE_FILENAME=opensondage-1-1-16.tar.gz
|
||||||
|
|
|
@ -26,19 +26,19 @@ const APP_URL = '__DOMAIN__';
|
||||||
const NOMAPPLICATION = 'OpenSondage';
|
const NOMAPPLICATION = 'OpenSondage';
|
||||||
|
|
||||||
// Database administrator email
|
// Database administrator email
|
||||||
const ADRESSEMAILADMIN = '__ADMINMAIL__';
|
const ADRESSEMAILADMIN = '__EMAIL__';
|
||||||
|
|
||||||
// Email for automatic responses (you should set it to "no-reply")
|
// Email for automatic responses (you should set it to "no-reply")
|
||||||
const ADRESSEMAILREPONSEAUTO = '<no-reply@__DOMAIN__>';
|
const ADRESSEMAILREPONSEAUTO = '<no-reply@__DOMAIN__>';
|
||||||
|
|
||||||
// Database user
|
// Database user
|
||||||
const DB_USER= '__DBUSER__';
|
const DB_USER= '__DB_USER__';
|
||||||
|
|
||||||
// Database password
|
// Database password
|
||||||
const DB_PASSWORD = '__DBPWD__';
|
const DB_PASSWORD = '__DB_PWD__';
|
||||||
|
|
||||||
// Database server name, leave empty to use a socket
|
// Database server name, leave empty to use a socket
|
||||||
const DB_CONNECTION_STRING = 'mysql:host=localhost;dbname=__DBNAME__;port=3306';
|
const DB_CONNECTION_STRING = 'mysql:host=localhost;dbname=__DB_NAME__;port=3306';
|
||||||
|
|
||||||
// Name of the table that store migration script already executed
|
// Name of the table that store migration script already executed
|
||||||
const MIGRATION_TABLE = 'framadate_migration';
|
const MIGRATION_TABLE = 'framadate_migration';
|
||||||
|
|
|
@ -1,30 +1,39 @@
|
||||||
#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent;
|
#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent;
|
||||||
location __PATH__/ {
|
location __PATH__/ {
|
||||||
|
|
||||||
# Path to source
|
# Path to source
|
||||||
alias __FINALPATH__/;
|
alias __FINALPATH__/;
|
||||||
|
|
||||||
# Force usage of https
|
# Force usage of https
|
||||||
if ($scheme = http) {
|
if ($scheme = http) {
|
||||||
rewrite ^ https://$server_name$request_uri? permanent;
|
rewrite ^ https://$server_name$request_uri? permanent;
|
||||||
}
|
}
|
||||||
|
|
||||||
index index.php;
|
rewrite "^__PATH__/([a-zA-Z0-9-]+)$" "__PATH__/studs.php?poll=$1";
|
||||||
try_files $uri $uri/ /index.php;
|
rewrite "^__PATH__/([a-zA-Z0-9-]+)/action/([a-zA-Z_-]+)/(.+)$" "__PATH__/studs.php?poll=$1&$2=$3";
|
||||||
location ~ [^/]\.php(/|$) {
|
rewrite "^__PATH__/([a-zA-Z0-9-]+)/vote/([a-zA-Z0-9]{16})$" "__PATH__/studs.php?poll=$1&vote=$2";
|
||||||
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
|
|
||||||
fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock;
|
|
||||||
include fastcgi_params;
|
|
||||||
fastcgi_param REMOTE_USER $remote_user;
|
|
||||||
fastcgi_param PATH_INFO $fastcgi_path_info;
|
|
||||||
fastcgi_param SCRIPT_FILENAME $request_filename;
|
|
||||||
fastcgi_param HTTPS on;
|
|
||||||
}
|
|
||||||
|
|
||||||
# Include SSOWAT user panel.
|
# Admin requires the private poll ID, 24-char long
|
||||||
include conf.d/yunohost_panel.conf.inc;
|
rewrite "^__PATH__/([a-zA-Z0-9-]{24})/admin$" "__PATH__/adminstuds.php?poll=$1";
|
||||||
|
rewrite "^__PATH__/([a-zA-Z0-9-]{24})/admin/vote/([a-zA-Z0-9]{16})$" "__PATH__/adminstuds.php?poll=$1&vote=$2";
|
||||||
|
rewrite "^__PATH__/([a-zA-Z0-9-]{24})/admin/action/([a-zA-Z_-]+)(/(.+))?$" "__PATH__/adminstuds.php?poll=$1&$2=$4";
|
||||||
|
|
||||||
|
index index.php;
|
||||||
|
try_files $uri $uri/ /index.php;
|
||||||
|
location ~ [^/]\.php(/|$) {
|
||||||
|
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
|
||||||
|
fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock;
|
||||||
|
include fastcgi_params;
|
||||||
|
fastcgi_param REMOTE_USER $remote_user;
|
||||||
|
fastcgi_param PATH_INFO $fastcgi_path_info;
|
||||||
|
fastcgi_param SCRIPT_FILENAME $request_filename;
|
||||||
|
fastcgi_param HTTPS on;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Include SSOWAT user panel.
|
||||||
|
include conf.d/yunohost_panel.conf.inc;
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ ^__PATH__/(data|config|\.ht|db_structure\.xml|README) {
|
location ~ ^__PATH__/(data|config|\.ht|db_structure\.xml|README) {
|
||||||
deny all;
|
deny all;
|
||||||
}
|
}
|
||||||
|
|
|
@ -431,3 +431,6 @@ chdir = __FINALPATH__
|
||||||
|
|
||||||
php_admin_value[upload_max_filesize] = 10G
|
php_admin_value[upload_max_filesize] = 10G
|
||||||
php_admin_value[post_max_size] = 10G
|
php_admin_value[post_max_size] = 10G
|
||||||
|
|
||||||
|
php_admin_value[session.cookie_httponly] = 1
|
||||||
|
php_admin_value[date.timezone] = __TIMEZONE__
|
||||||
|
|
8
doc/DISCLAIMER.md
Normal file
8
doc/DISCLAIMER.md
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
## Limitations
|
||||||
|
|
||||||
|
* There is no way to configure mail, either with smtp or with sendmail. See https://framagit.org/framasoft/framadate/merge_requests/184
|
||||||
|
* There is no way to use SSOWAT to identify current user. See https://framagit.org/framasoft/framadate/issues/177
|
||||||
|
|
||||||
|
## Additional information
|
||||||
|
|
||||||
|
* This package contains a custom version of Framadate (fork of OpenSondage and Studs), the sources are here: https://git.framasoft.org/framasoft/framadate/.
|
8
doc/DISCLAIMER_fr.md
Normal file
8
doc/DISCLAIMER_fr.md
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
## Limitations
|
||||||
|
|
||||||
|
* Impossible de configurer le courrier, que ce soit avec smtp ou avec sendmail. Voir https://framagit.org/framasoft/framadate/merge_requests/184
|
||||||
|
* Impossible d'utiliser SSOWAT pour identifier l'utilisateur actuel. Voir https://framagit.org/framasoft/framadate/issues/177
|
||||||
|
|
||||||
|
## Additional information
|
||||||
|
|
||||||
|
* Ce paquet contient une version personnalisée de Framadate (fork d'OpenSondage et Studs), les sources sont ici : https://git.framasoft.org/framasoft/framadate/.
|
BIN
doc/screenshots/screenshots.jpg
Normal file
BIN
doc/screenshots/screenshots.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 23 KiB |
|
@ -3,12 +3,20 @@
|
||||||
"id": "opensondage",
|
"id": "opensondage",
|
||||||
"packaging_format": 1,
|
"packaging_format": 1,
|
||||||
"description": {
|
"description": {
|
||||||
"en": "Service for planning an appointment or making a decision quickly and easily.",
|
"en": "Service for planning an appointment or making a decision quickly and easily",
|
||||||
"fr": "Service pour planifier un rendez-vous ou prendre une décision rapidement et facilement.",
|
"fr": "Service pour planifier un rendez-vous ou prendre une décision rapidement et facilement",
|
||||||
"de": "Service zur schnellen und einfachen Planung eines Termins oder zur Entscheidungsfindung."
|
"de": "Service zur schnellen und einfachen Planung eines Termins oder zur Entscheidungsfindung"
|
||||||
},
|
},
|
||||||
"version": "1.1.10~ynh2",
|
"version": "1.1.16~ynh1",
|
||||||
"url": "https://git.framasoft.org/framasoft/framadate",
|
"url": "https://git.framasoft.org/framasoft/framadate",
|
||||||
|
"upstream": {
|
||||||
|
"license": "CECILL-B",
|
||||||
|
"website": "https://framadate.org/",
|
||||||
|
"demo": "https://framadate.org/",
|
||||||
|
"admindoc": "https://framagit.org/framasoft/framadate/framadate/wikis/home",
|
||||||
|
"userdoc": "https://yunohost.org/#/app_opensondage",
|
||||||
|
"code": "https://git.framasoft.org/framasoft/framadate"
|
||||||
|
},
|
||||||
"license": "CECILL-B",
|
"license": "CECILL-B",
|
||||||
"maintainer": {
|
"maintainer": {
|
||||||
"name": "",
|
"name": "",
|
||||||
|
@ -19,12 +27,12 @@
|
||||||
"email": "ljf+opensondage_ynh@grimaud.me"
|
"email": "ljf+opensondage_ynh@grimaud.me"
|
||||||
}],
|
}],
|
||||||
"requirements": {
|
"requirements": {
|
||||||
"yunohost": ">= 3.8.1"
|
"yunohost": ">= 4.2.0"
|
||||||
},
|
},
|
||||||
"multi_instance": true,
|
"multi_instance": true,
|
||||||
"services": [
|
"services": [
|
||||||
"nginx",
|
"nginx",
|
||||||
"php7.0-fpm",
|
"php7.3-fpm",
|
||||||
"mysql"
|
"mysql"
|
||||||
],
|
],
|
||||||
"arguments": {
|
"arguments": {
|
||||||
|
@ -32,32 +40,17 @@
|
||||||
{
|
{
|
||||||
"name": "domain",
|
"name": "domain",
|
||||||
"type": "domain",
|
"type": "domain",
|
||||||
"ask": {
|
|
||||||
"en": "Choose a domain for OpenSondage",
|
|
||||||
"fr": "Choisissez un nom de domaine pour OpenSondage",
|
|
||||||
"de": "Wählen Sie bitte einen Domain für OpenSondage"
|
|
||||||
},
|
|
||||||
"example": "domain.org"
|
"example": "domain.org"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "path",
|
"name": "path",
|
||||||
"type": "path",
|
"type": "path",
|
||||||
"ask": {
|
|
||||||
"en": "Choose a path for OpenSondage",
|
|
||||||
"fr": "Choisissez l'adresse pour OpenSondage",
|
|
||||||
"de": "Tragen Sie bitte den Pfad für OpenSondage ein"
|
|
||||||
},
|
|
||||||
"example": "/date",
|
"example": "/date",
|
||||||
"default": "/date"
|
"default": "/date"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "admin",
|
"name": "admin",
|
||||||
"type": "user",
|
"type": "user",
|
||||||
"ask": {
|
|
||||||
"en": "Choose the OpenSondage administrator (must be an existing YunoHost user)",
|
|
||||||
"fr": "Choisissez l'administrateur d'OpenSondage (doit être un utilisateur YunoHost)",
|
|
||||||
"de": "Wählen Sie bitte den OpenSondageadministrator (muss ein vorhandener YunoHost Nutzer sein)"
|
|
||||||
},
|
|
||||||
"example": "johndoe"
|
"example": "johndoe"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -68,17 +61,12 @@
|
||||||
"fr": "Choisissez la langue par défault d'OpenSondage",
|
"fr": "Choisissez la langue par défault d'OpenSondage",
|
||||||
"de": "Wählen Sie bitte die Standardsprache für OpenSondage."
|
"de": "Wählen Sie bitte die Standardsprache für OpenSondage."
|
||||||
},
|
},
|
||||||
"choices": ["fr","en", "oc", "es", "de", "nl", "it", "br"],
|
"choices": ["br", "de", "en", "es", "fr", "it", "nl", "oc"],
|
||||||
"default": "en"
|
"default": "en"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "is_public",
|
"name": "is_public",
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"ask": {
|
|
||||||
"en": "Can non-members create a poll?",
|
|
||||||
"fr": "Une personne non membre peut elle créer un sondage ?",
|
|
||||||
"de": "Kann einen nicht eingeloggter Nutzer einen Umfrage erstellen?"
|
|
||||||
},
|
|
||||||
"default": true
|
"default": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
|
@ -1,18 +0,0 @@
|
||||||
## Problem
|
|
||||||
- *Description of why you made this PR*
|
|
||||||
|
|
||||||
## Solution
|
|
||||||
- *And how do you fix that problem*
|
|
||||||
|
|
||||||
## PR Status
|
|
||||||
- [ ] Code finished.
|
|
||||||
- [ ] Tested with Package_check.
|
|
||||||
- [ ] Fix or enhancement tested.
|
|
||||||
- [ ] Upgrade from last version tested.
|
|
||||||
- [ ] Can be reviewed and tested.
|
|
||||||
|
|
||||||
## Package_check results
|
|
||||||
---
|
|
||||||
*If you have access to [App Continuous Integration for packagers](https://yunohost.org/#/packaging_apps_ci) you can provide a link to the package_check results like below, replacing '-NUM-' in this link by the PR number and USERNAME by your username on the ci-apps-dev. Or you provide a screenshot or a pastebin of the results*
|
|
||||||
|
|
||||||
[/badge/icon)](https://ci-apps-dev.yunohost.org/jenkins/job/opensondage_ynh%20PR-NUM-%20(USERNAME)/)
|
|
|
@ -6,8 +6,8 @@
|
||||||
|
|
||||||
# dependencies used by the app
|
# dependencies used by the app
|
||||||
YNH_PHP_VERSION="7.3"
|
YNH_PHP_VERSION="7.3"
|
||||||
|
YNH_COMPOSER_VERSION=2.1.1
|
||||||
pkg_dependencies="php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-cli"
|
extra_php_dependencies="php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-cli"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# PERSONAL HELPERS
|
# PERSONAL HELPERS
|
||||||
|
@ -20,63 +20,3 @@ pkg_dependencies="php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-intl php$
|
||||||
#=================================================
|
#=================================================
|
||||||
# EXPERIMENTAL HELPERS
|
# EXPERIMENTAL HELPERS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# Execute a command as another user
|
|
||||||
# usage: exec_as USER COMMAND [ARG ...]
|
|
||||||
exec_as() {
|
|
||||||
local USER=$1
|
|
||||||
shift 1
|
|
||||||
|
|
||||||
if [[ $USER = $(whoami) ]]; then
|
|
||||||
eval "$@"
|
|
||||||
else
|
|
||||||
sudo -u "$USER" "$@"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Execute a command with Composer
|
|
||||||
#
|
|
||||||
# usage: ynh_composer_exec --phpversion=phpversion [--workdir=$final_path] --commands="commands"
|
|
||||||
# | arg: -w, --workdir - The directory from where the command will be executed. Default $final_path.
|
|
||||||
# | arg: -c, --commands - Commands to execute.
|
|
||||||
ynh_composer_exec () {
|
|
||||||
# Declare an array to define the options of this helper.
|
|
||||||
local legacy_args=vwc
|
|
||||||
declare -Ar args_array=( [v]=phpversion= [w]=workdir= [c]=commands= )
|
|
||||||
local phpversion
|
|
||||||
local workdir
|
|
||||||
local commands
|
|
||||||
# Manage arguments with getopts
|
|
||||||
ynh_handle_getopts_args "$@"
|
|
||||||
workdir="${workdir:-$final_path}"
|
|
||||||
phpversion="${phpversion:-7.0}"
|
|
||||||
|
|
||||||
COMPOSER_HOME="$workdir/.composer" \
|
|
||||||
php${phpversion} "$workdir/composer.phar" $commands \
|
|
||||||
-d "$workdir" --quiet --no-interaction
|
|
||||||
}
|
|
||||||
|
|
||||||
# Install and initialize Composer in the given directory
|
|
||||||
#
|
|
||||||
# usage: ynh_install_composer --phpversion=phpversion [--workdir=$final_path]
|
|
||||||
# | arg: -w, --workdir - The directory from where the command will be executed. Default $final_path.
|
|
||||||
ynh_install_composer () {
|
|
||||||
# Declare an array to define the options of this helper.
|
|
||||||
local legacy_args=vw
|
|
||||||
declare -Ar args_array=( [v]=phpversion= [w]=workdir= )
|
|
||||||
local phpversion
|
|
||||||
local workdir
|
|
||||||
# Manage arguments with getopts
|
|
||||||
ynh_handle_getopts_args "$@"
|
|
||||||
workdir="${workdir:-$final_path}"
|
|
||||||
phpversion="${phpversion:-7.0}"
|
|
||||||
|
|
||||||
curl -sS https://getcomposer.org/installer \
|
|
||||||
| COMPOSER_HOME="$workdir/.composer" \
|
|
||||||
php${phpversion} -- --quiet --install-dir="$workdir" \
|
|
||||||
|| ynh_die "Unable to install Composer."
|
|
||||||
|
|
||||||
# update dependencies to create composer.lock
|
|
||||||
ynh_composer_exec --phpversion="${phpversion}" --workdir="$workdir" --commands="install --no-dev" \
|
|
||||||
|| ynh_die "Unable to update core dependencies with Composer."
|
|
||||||
}
|
|
||||||
|
|
|
@ -24,13 +24,15 @@ path_url=$YNH_APP_ARG_PATH
|
||||||
admin=$YNH_APP_ARG_ADMIN
|
admin=$YNH_APP_ARG_ADMIN
|
||||||
language=$YNH_APP_ARG_LANGUAGE
|
language=$YNH_APP_ARG_LANGUAGE
|
||||||
is_public=$YNH_APP_ARG_IS_PUBLIC
|
is_public=$YNH_APP_ARG_IS_PUBLIC
|
||||||
|
email=$(ynh_user_get_info --username=$admin --key=mail)
|
||||||
|
timezone="$(cat /etc/timezone)"
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
|
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Validating installation parameters..."
|
ynh_script_progression --message="Validating installation parameters..." --weight=1
|
||||||
|
|
||||||
final_path=/var/www/$app
|
final_path=/var/www/$app
|
||||||
test ! -e "$final_path" || ynh_die --message="This path already contains a folder"
|
test ! -e "$final_path" || ynh_die --message="This path already contains a folder"
|
||||||
|
@ -47,16 +49,15 @@ 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
|
||||||
ynh_app_setting_set --app=$app --key=admin --value=$admin
|
ynh_app_setting_set --app=$app --key=admin --value=$admin
|
||||||
ynh_app_setting_set --app=$app --key=language --value=$language
|
ynh_app_setting_set --app=$app --key=language --value=$language
|
||||||
ynh_app_setting_set --app=$app --key=is_public --value=$is_public
|
ynh_app_setting_set --app=$app --key=email --value=$email
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD MODIFICATIONS
|
# CREATE DEDICATED USER
|
||||||
#=================================================
|
#=================================================
|
||||||
# INSTALL DEPENDENCIES
|
ynh_script_progression --message="Configuring system user..." --weight=2
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Installing dependencies..." --weight=3
|
|
||||||
|
|
||||||
ynh_install_app_dependencies $pkg_dependencies
|
# Create a system user
|
||||||
|
ynh_system_user_create --username=$app --home_dir=$final_path
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CREATE A MYSQL DATABASE
|
# CREATE A MYSQL DATABASE
|
||||||
|
@ -64,6 +65,7 @@ ynh_install_app_dependencies $pkg_dependencies
|
||||||
ynh_script_progression --message="Creating a MySQL database..." --weight=2
|
ynh_script_progression --message="Creating a MySQL database..." --weight=2
|
||||||
|
|
||||||
db_name=$(ynh_sanitize_dbid --db_name=$app)
|
db_name=$(ynh_sanitize_dbid --db_name=$app)
|
||||||
|
db_user=$db_name
|
||||||
ynh_app_setting_set --app=$app --key=db_name --value=$db_name
|
ynh_app_setting_set --app=$app --key=db_name --value=$db_name
|
||||||
ynh_mysql_setup_db --db_user=$db_name --db_name=$db_name
|
ynh_mysql_setup_db --db_user=$db_name --db_name=$db_name
|
||||||
|
|
||||||
|
@ -76,6 +78,10 @@ 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="$final_path"
|
||||||
|
|
||||||
|
chmod 750 "$final_path"
|
||||||
|
chmod -R o-rwx "$final_path"
|
||||||
|
chown -R $app:www-data "$final_path"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# NGINX CONFIGURATION
|
# NGINX CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -84,21 +90,14 @@ ynh_script_progression --message="Configuring NGINX web server..." --weight=2
|
||||||
# Create a dedicated nginx config
|
# Create a dedicated nginx config
|
||||||
ynh_add_nginx_config
|
ynh_add_nginx_config
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# CREATE DEDICATED USER
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Configuring system user..." --weight=2
|
|
||||||
|
|
||||||
# Create a system user
|
|
||||||
ynh_system_user_create --username=$app
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# PHP-FPM CONFIGURATION
|
# PHP-FPM CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Configuring PHP-FPM..." --weight=2
|
ynh_script_progression --message="Configuring PHP-FPM..." --weight=2
|
||||||
|
|
||||||
# Create a dedicated PHP-FPM config
|
# Create a dedicated PHP-FPM config
|
||||||
ynh_add_fpm_config
|
ynh_add_fpm_config --package="$extra_php_dependencies"
|
||||||
|
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC SETUP
|
# SPECIFIC SETUP
|
||||||
|
@ -107,23 +106,7 @@ ynh_add_fpm_config
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Configuring $app..." --weight=2
|
ynh_script_progression --message="Configuring $app..." --weight=2
|
||||||
|
|
||||||
config="$final_path/app/inc/config.php"
|
ynh_add_config --template="../conf/config.php" --destination="$final_path/app/inc/config.php"
|
||||||
|
|
||||||
admin_mail=$(ynh_user_get_info --username=$admin --key=mail)
|
|
||||||
|
|
||||||
cp ../conf/config.php "$config"
|
|
||||||
|
|
||||||
# Change variables in configuration
|
|
||||||
ynh_replace_string --match_string="__DBUSER__" --replace_string=$db_name --target_file="$config"
|
|
||||||
ynh_replace_string --match_string="__DBPWD__" --replace_string="$db_pwd" --target_file="$config"
|
|
||||||
ynh_replace_string --match_string="__DBNAME__" --replace_string=$db_name --target_file="$config"
|
|
||||||
ynh_replace_string --match_string="__ADMINMAIL__" --replace_string=$admin_mail --target_file="$config"
|
|
||||||
ynh_replace_string --match_string="__LANGUAGE__" --replace_string=$language --target_file="$config"
|
|
||||||
ynh_replace_string --match_string="__DOMAIN__" --replace_string=$domain --target_file="$config"
|
|
||||||
ynh_replace_string --match_string="__PATH__" --replace_string=$path_url --target_file="$config"
|
|
||||||
|
|
||||||
# Calculate and store the config file checksum into the app settings
|
|
||||||
ynh_store_file_checksum --file="$config"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# REPLACE LOGO IMAGE (DEFAULT IS FRAMADATE)
|
# REPLACE LOGO IMAGE (DEFAULT IS FRAMADATE)
|
||||||
|
@ -145,7 +128,7 @@ ynh_script_progression --message="Initializing database..." --weight=2
|
||||||
# Install composer
|
# Install composer
|
||||||
ynh_install_composer
|
ynh_install_composer
|
||||||
|
|
||||||
ynh_exec_warn_less php$YNH_PHP_VERSION "$final_path/admin/migration.php"
|
ynh_exec_warn_less php$phpversion "$final_path/admin/migration.php"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# GENERIC FINALIZATION
|
||||||
|
@ -153,18 +136,17 @@ ynh_exec_warn_less php$YNH_PHP_VERSION "$final_path/admin/migration.php"
|
||||||
# SECURE FILES AND DIRECTORIES
|
# SECURE FILES AND DIRECTORIES
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
chown -R root: "$final_path"
|
|
||||||
chown -R $app: "$final_path/"{tpl_c,admin/stdout.log}
|
chown -R $app: "$final_path/"{tpl_c,admin/stdout.log}
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP SSOWAT
|
# SETUP SSOWAT
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Configuring SSOwat..."
|
ynh_script_progression --message="Configuring permissions..." --weight=1
|
||||||
|
|
||||||
# Make app public if necessary
|
# Make app public if necessary
|
||||||
if [ $is_public -eq 1 ]
|
if [ $is_public -eq 1 ]
|
||||||
then
|
then
|
||||||
ynh_app_setting_set --app=$app --key=skipped_uris --value="/"
|
ynh_permission_update --permission="main" --add="visitors"
|
||||||
|
|
||||||
# Keep /admin private
|
# Keep /admin private
|
||||||
if [ "$path_url" == "/" ]; then
|
if [ "$path_url" == "/" ]; then
|
||||||
|
|
|
@ -12,7 +12,7 @@ source /usr/share/yunohost/helpers
|
||||||
#=================================================
|
#=================================================
|
||||||
# LOAD SETTINGS
|
# LOAD SETTINGS
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Loading installation settings..."
|
ynh_script_progression --message="Loading installation settings..." --weight=1
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
|
@ -20,16 +20,6 @@ domain=$(ynh_app_setting_get --app=$app --key=domain)
|
||||||
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# STANDARD REMOVE
|
|
||||||
#=================================================
|
|
||||||
# REMOVE DEPENDENCIES
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Removing dependencies..." --weight=3
|
|
||||||
|
|
||||||
# Remove metapackage and its dependencies
|
|
||||||
ynh_remove_app_dependencies
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE THE MYSQL DATABASE
|
# REMOVE THE MYSQL DATABASE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -67,7 +57,7 @@ ynh_remove_fpm_config
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE DEDICATED USER
|
# REMOVE DEDICATED USER
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Removing the dedicated system user..."
|
ynh_script_progression --message="Removing the dedicated system user..." --weight=1
|
||||||
|
|
||||||
# Delete a system user
|
# Delete a system user
|
||||||
ynh_system_user_delete --username=$app
|
ynh_system_user_delete --username=$app
|
||||||
|
|
|
@ -19,7 +19,7 @@ ynh_abort_if_errors
|
||||||
#=================================================
|
#=================================================
|
||||||
# LOAD SETTINGS
|
# LOAD SETTINGS
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Loading settings..." --weight=2
|
ynh_script_progression --message="Loading installation settings..." --weight=1
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
|
@ -28,11 +28,12 @@ path_url=$(ynh_app_setting_get --app=$app --key=path)
|
||||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||||
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
||||||
|
timezone="$(cat /etc/timezone)"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK IF THE APP CAN BE RESTORED
|
# CHECK IF THE APP CAN BE RESTORED
|
||||||
#================================================
|
#================================================
|
||||||
ynh_script_progression --message="Validating restoration parameters..."
|
ynh_script_progression --message="Validating restoration parameters..." --weight=1
|
||||||
|
|
||||||
ynh_webpath_available --domain=$domain --path_url=$path_url \
|
ynh_webpath_available --domain=$domain --path_url=$path_url \
|
||||||
|| ynh_die --message="Path not available: ${domain}${path_url}"
|
|| ynh_die --message="Path not available: ${domain}${path_url}"
|
||||||
|
@ -44,23 +45,28 @@ test ! -d $final_path \
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE THE NGINX CONFIGURATION
|
# 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"
|
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# RESTORE THE APP MAIN DIR
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Restoring the app main directory..."
|
|
||||||
|
|
||||||
ynh_restore_file --origin_path="$final_path"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RECREATE THE DEDICATED USER
|
# RECREATE THE DEDICATED USER
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Recreating the dedicated system user..." --weight=2
|
ynh_script_progression --message="Recreating the dedicated system user..." --weight=2
|
||||||
|
|
||||||
# Create the dedicated user (if not existing)
|
# Create the dedicated user (if not existing)
|
||||||
ynh_system_user_create --username=$app
|
ynh_system_user_create --username=$app --home_dir=$final_path
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# RESTORE THE APP MAIN DIR
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Restoring the app main directory..." --weight=1
|
||||||
|
|
||||||
|
ynh_restore_file --origin_path="$final_path"
|
||||||
|
|
||||||
|
chmod 750 "$final_path"
|
||||||
|
chmod -R o-rwx "$final_path"
|
||||||
|
chown -R $app:www-data "$final_path"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE USER RIGHTS
|
# RESTORE USER RIGHTS
|
||||||
|
@ -72,9 +78,12 @@ chown -R $app: "$final_path/"{tpl_c,admin/stdout.log}
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE THE PHP-FPM CONFIGURATION
|
# RESTORE THE PHP-FPM CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_script_progression --message="Restoring the PHP-FPM configuration..." --weight=5
|
||||||
|
|
||||||
ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
|
ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
|
||||||
|
|
||||||
|
ynh_add_fpm_config --package="$extra_php_dependencies"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE THE MYSQL DATABASE
|
# RESTORE THE MYSQL DATABASE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -84,16 +93,6 @@ db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
|
||||||
ynh_mysql_setup_db --db_user=$db_name --db_name=$db_name --db_pwd=$db_pwd
|
ynh_mysql_setup_db --db_user=$db_name --db_name=$db_name --db_pwd=$db_pwd
|
||||||
ynh_mysql_connect_as --user=$db_name --password=$db_pwd --database=$db_name < ./db.sql
|
ynh_mysql_connect_as --user=$db_name --password=$db_pwd --database=$db_name < ./db.sql
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# SPECIFIC RESTORATION
|
|
||||||
#=================================================
|
|
||||||
# REINSTALL DEPENDENCIES
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Reinstalling dependencies..." --weight=9
|
|
||||||
|
|
||||||
# Define and install dependencies
|
|
||||||
ynh_install_app_dependencies $pkg_dependencies
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# GENERIC FINALIZATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -23,7 +23,11 @@ is_public=$(ynh_app_setting_get --app=$app --key=is_public)
|
||||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
language=$(ynh_app_setting_get --app=$app --key=language)
|
language=$(ynh_app_setting_get --app=$app --key=language)
|
||||||
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||||
|
db_user=$db_name
|
||||||
phpversion=$(ynh_app_setting_get --app="$app" --key=phpversion)
|
phpversion=$(ynh_app_setting_get --app="$app" --key=phpversion)
|
||||||
|
db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
|
||||||
|
email=$(ynh_app_setting_get --app=$app --key=email)
|
||||||
|
timezone="$(cat /etc/timezone)"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK VERSION
|
# CHECK VERSION
|
||||||
|
@ -34,24 +38,14 @@ upgrade_type=$(ynh_check_app_version_changed)
|
||||||
#=================================================
|
#=================================================
|
||||||
# ENSURE DOWNWARD COMPATIBILITY
|
# ENSURE DOWNWARD COMPATIBILITY
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Ensuring downward compatibility..."
|
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
|
||||||
|
|
||||||
if [ -z "$is_public" ]
|
if [ -z "$is_public" ]; then
|
||||||
then
|
|
||||||
is_public=$(ynh_app_setting_get --app=$app --key=public_site)
|
is_public=$(ynh_app_setting_get --app=$app --key=public_site)
|
||||||
ynh_app_setting_set --app=$app --key=is_public --value=$is_public
|
ynh_app_setting_set --app=$app --key=is_public --value=$is_public
|
||||||
ynh_app_setting_delete --app=$app --key=public_site
|
ynh_app_setting_delete --app=$app --key=public_site
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Fix is_public as a boolean value
|
|
||||||
if [ "$is_public" = "Yes" ]; then
|
|
||||||
ynh_app_setting_set --app=$app --key=is_public --value=1
|
|
||||||
is_public=1
|
|
||||||
elif [ "$is_public" = "No" ]; then
|
|
||||||
ynh_app_setting_set --app=$app --key=is_public --value=0
|
|
||||||
is_public=0
|
|
||||||
fi
|
|
||||||
|
|
||||||
# If db_name doesn't exist, create it
|
# If db_name doesn't exist, create it
|
||||||
if [ -z "$db_name" ]; then
|
if [ -z "$db_name" ]; then
|
||||||
db_name=$(ynh_sanitize_dbid --db_name=$app)
|
db_name=$(ynh_sanitize_dbid --db_name=$app)
|
||||||
|
@ -64,15 +58,18 @@ if [ -z "$final_path" ]; then
|
||||||
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
|
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# If email doesn't exist, create it
|
||||||
|
if [ -z "$email" ]; then
|
||||||
|
email=$(ynh_user_get_info --username=$admin --key=mail)
|
||||||
|
fi
|
||||||
|
|
||||||
# Make sure default language is set
|
# Make sure default language is set
|
||||||
if [ -z "$language" ]
|
if [ -z "$language" ]; then
|
||||||
then
|
language=en
|
||||||
language=$(grep LANGUE "/var/www/$app/variables.php" | grep -Po "'.*?'" | cut -d"'" -f2)
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Use path instead of path_url in settings.yml...
|
# Use path instead of path_url in settings.yml...
|
||||||
if [ -z "$path_url" ]
|
if [ -z "$path_url" ]; then
|
||||||
then
|
|
||||||
path_url=$(ynh_app_setting_get --app=$app --key=path_url)
|
path_url=$(ynh_app_setting_get --app=$app --key=path_url)
|
||||||
ynh_app_setting_set --app=$app --key=path --value=$path_url
|
ynh_app_setting_set --app=$app --key=path --value=$path_url
|
||||||
ynh_app_setting_delete --app=$app --key=path_url
|
ynh_app_setting_delete --app=$app --key=path_url
|
||||||
|
@ -93,11 +90,12 @@ ynh_clean_setup () {
|
||||||
ynh_abort_if_errors
|
ynh_abort_if_errors
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK THE PATH
|
# CREATE DEDICATED USER
|
||||||
#=================================================
|
#=================================================
|
||||||
|
ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1
|
||||||
|
|
||||||
# Normalize the URL path syntax
|
# Create a dedicated user (if not existing)
|
||||||
path_url=$(ynh_normalize_url_path --path_url=$path_url)
|
ynh_system_user_create --username=$app --home_dir="$final_path"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD UPGRADE STEPS
|
# STANDARD UPGRADE STEPS
|
||||||
|
@ -113,6 +111,10 @@ then
|
||||||
ynh_setup_source --dest_dir="$final_path"
|
ynh_setup_source --dest_dir="$final_path"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
chmod 750 "$final_path"
|
||||||
|
chmod -R o-rwx "$final_path"
|
||||||
|
chown -R $app:www-data "$final_path"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# NGINX CONFIGURATION
|
# NGINX CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -121,28 +123,13 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." -
|
||||||
# Create a dedicated nginx config
|
# Create a dedicated nginx config
|
||||||
ynh_add_nginx_config
|
ynh_add_nginx_config
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# UPGRADE DEPENDENCIES
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Upgrading dependencies..." --weight=7
|
|
||||||
|
|
||||||
ynh_install_app_dependencies $pkg_dependencies
|
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# CREATE DEDICATED USER
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Making sure dedicated system user exists..."
|
|
||||||
|
|
||||||
# Create a dedicated user (if not existing)
|
|
||||||
ynh_system_user_create --username=$app
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# PHP-FPM CONFIGURATION
|
# PHP-FPM CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=3
|
ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=3
|
||||||
|
|
||||||
# Create a dedicated PHP-FPM config
|
# Create a dedicated PHP-FPM config
|
||||||
ynh_add_fpm_config
|
ynh_add_fpm_config --package="$extra_php_dependencies"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC UPGRADE
|
# SPECIFIC UPGRADE
|
||||||
|
@ -154,27 +141,9 @@ if [ "$upgrade_type" == "UPGRADE_APP" ]
|
||||||
then
|
then
|
||||||
ynh_script_progression --message="Reconfiguring $app..." --weight=2
|
ynh_script_progression --message="Reconfiguring $app..." --weight=2
|
||||||
|
|
||||||
config="$final_path/app/inc/config.php"
|
ynh_add_config --template="../conf/config.php" --destination="$final_path/app/inc/config.php"
|
||||||
|
chmod 400 "$final_path/app/inc/config.php"
|
||||||
# Verify the checksum and backup the file if it's different
|
chown $app:$app "$final_path/app/inc/config.php"
|
||||||
ynh_backup_if_checksum_is_different --file="$config"
|
|
||||||
|
|
||||||
admin_mail=$(ynh_user_get_info --username=$admin --key=mail)
|
|
||||||
|
|
||||||
cp ../conf/config.php "$config"
|
|
||||||
|
|
||||||
# Change variables in configuration
|
|
||||||
ynh_replace_string --match_string="__DBUSER__" --replace_string=$db_name --target_file="$config"
|
|
||||||
db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
|
|
||||||
ynh_replace_string --match_string="__DBPWD__" --replace_string="$db_pwd" --target_file="$config"
|
|
||||||
ynh_replace_string --match_string="__DBNAME__" --replace_string=$db_name --target_file="$config"
|
|
||||||
ynh_replace_string --match_string="__ADMINMAIL__" --replace_string=$admin_mail --target_file="$config"
|
|
||||||
ynh_replace_string --match_string="__LANGUAGE__" --replace_string=$language --target_file="$config"
|
|
||||||
ynh_replace_string --match_string="__DOMAIN__" --replace_string=$domain --target_file="$config"
|
|
||||||
ynh_replace_string --match_string="__PATH__" --replace_string=$path_url --target_file="$config"
|
|
||||||
|
|
||||||
# Calculate and store the config file checksum into the app settings
|
|
||||||
ynh_store_file_checksum --file="$config"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -200,7 +169,7 @@ then
|
||||||
# Install composer
|
# Install composer
|
||||||
ynh_install_composer
|
ynh_install_composer
|
||||||
|
|
||||||
ynh_exec_warn_less php "$final_path/admin/migration.php"
|
ynh_exec_warn_less php$phpversion "$final_path/admin/migration.php"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -209,13 +178,12 @@ fi
|
||||||
# SECURE FILES AND DIRECTORIES
|
# SECURE FILES AND DIRECTORIES
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
chown -R root: "$final_path"
|
|
||||||
chown -R $app: "$final_path/"{tpl_c,admin/stdout.log}
|
chown -R $app: "$final_path/"{tpl_c,admin/stdout.log}
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP SSOWAT
|
# SETUP SSOWAT
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Upgrading SSOwat configuration..."
|
ynh_script_progression --message="Upgrading SSOwat configuration..." --weight=1
|
||||||
|
|
||||||
# Make app public if necessary
|
# Make app public if necessary
|
||||||
if [ $is_public -eq 1 ]
|
if [ $is_public -eq 1 ]
|
||||||
|
@ -235,7 +203,7 @@ fi
|
||||||
#=================================================
|
#=================================================
|
||||||
# RELOAD NGINX
|
# RELOAD NGINX
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Reloading NGINX web server..."
|
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
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue