1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/phpmyadmin_ynh.git synced 2024-09-03 19:56:46 +02:00
* 5.1.1
This commit is contained in:
Éric Gaspar 2021-07-14 14:25:42 +02:00 committed by GitHub
parent e8bcf5f9e6
commit 209c11b5d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 254 additions and 295 deletions

55
.github/ISSUE_TEMPLATE.md vendored Normal file
View file

@ -0,0 +1,55 @@
---
name: Bug report
about: When creating a bug report, please use the following template to provide all the relevant information and help debugging efficiently.
---
**How to post a meaningful bug report**
1. *Read this whole template first.*
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!*
- *Otherwise, the issue may be due to the app itself. Refer to its documentation or repository for help.*
- *When in doubt, post here and we will figure it out together.*
3. *Delete the italic comments as you write over them below, and remove this guide.*
---
### Describe the bug
*A clear and concise description of what the bug is.*
### Context
- Hardware: *VPS bought online / Old laptop or computer / Raspberry Pi at home / Internet Cube with VPN / Other ARM board / ...*
- YunoHost version: x.x.x
- I have access to my server: *Through SSH | through the webadmin | direct access via keyboard / screen | ...*
- Are you in a special context or did you perform some particular tweaking on your YunoHost instance?: *no / yes*
- If yes, please explain:
- Using, or trying to install package version/branch:
- If upgrading, current package version: *can be found in the admin, or with `yunohost app info $app_id`*
### Steps to reproduce
- *If you performed a command from the CLI, the command itself is enough. For example:*
```sh
sudo yunohost app install the_app
```
- *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:*
1. *Go to '...'*
2. *Click on '...'*
3. *Scroll down to '...'*
4. *See error*
### Expected behavior
*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.*
### Logs
*When an operation fails, YunoHost provides a simple way to share the logs.*
- *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.*
- *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`.*
*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...)*
*If applicable and useful, add screenshots to help explain your problem.*

16
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View 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)

View file

@ -1,3 +1,8 @@
<!--
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.
-->
# phpMyAdmin for YunoHost # phpMyAdmin for YunoHost
[![Integration level](https://dash.yunohost.org/integration/phpmyadmin.svg)](https://dash.yunohost.org/appci/app/phpmyadmin) ![](https://ci-apps.yunohost.org/ci/badges/phpmyadmin.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/phpmyadmin.maintain.svg) [![Integration level](https://dash.yunohost.org/integration/phpmyadmin.svg)](https://dash.yunohost.org/appci/app/phpmyadmin) ![](https://ci-apps.yunohost.org/ci/badges/phpmyadmin.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/phpmyadmin.maintain.svg)
@ -5,56 +10,38 @@
*[Lire ce readme en français.](./README_fr.md)* *[Lire ce readme en français.](./README_fr.md)*
> *This package allow you to install phpMyAdmin quickly and simply on a YunoHost server. > *This package allows you to install phpMyAdmin 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
Manage MySQL databases over the web
**Shipped version:** 5.1.1~ynh1
**Demo:** https://demo.phpmyadmin.net/master-config
## Screenshots
![](./doc/screenshots/68747470733a2f2f7777772e7068706d7961646d696e2e6e65742f7374617469632f696d616765732f73637265656e73686f74732f7374727563747572652e706e67.png)
## Disclaimers / important information
## Overview ## Overview
phpMyAdmin is a free software tool written in PHP, intended to handle the administration of MySQL over the Web. phpMyAdmin supports a wide range of operations on MySQL and MariaDB. Frequently used operations (managing databases, tables, columns, relations, indexes, users, permissions, etc) can be performed via the user interface, while you still have the ability to directly execute any SQL statement. phpMyAdmin is a free software tool written in PHP, intended to handle the administration of MySQL over the Web. phpMyAdmin supports a wide range of operations on MySQL and MariaDB. Frequently used operations (managing databases, tables, columns, relations, indexes, users, permissions, etc) can be performed via the user interface, while you still have the ability to directly execute any SQL statement.
## Documentation and resources
**Shipped version:** 5.0.4 * Official app website: http://www.phpmyadmin.net
* Official user documentation: https://yunohost.org/en/app_phpmyadmin
## Screenshots * Official admin documentation: https://www.phpmyadmin.net/docs/
* Upstream app code repository: https://github.com/phpmyadmin/phpmyadmin
![](https://www.phpmyadmin.net/static/images/screenshots/structure.png) * YunoHost documentation for this app: https://yunohost.org/app_phpmyadmin
## Demo
* [YunoHost demo](https://demo.yunohost.org/phpmyadmin/)
* [Official demo](https://demo.phpmyadmin.net/master-config/)
## Configuration
## Documentation
* Official documentation: https://www.phpmyadmin.net/docs/
* YunoHost documentation: https://yunohost.org/#/app_phpmyadmin
## YunoHost specific features
#### Multi-users support
#### Supported architectures
* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/phpmyadmin%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/phpmyadmin/)
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/phpmyadmin%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/phpmyadmin/)
## Limitations
## Additionnal informations
## Links
* Report a bug: https://github.com/YunoHost-Apps/phpmyadmin_ynh/issues * Report a bug: https://github.com/YunoHost-Apps/phpmyadmin_ynh/issues
* phpMyAdmin website: https://www.phpmyadmin.net/
* phpMyAdmin repository: https://github.com/phpmyadmin/phpmyadmin
* YunoHost website: https://yunohost.org/
--- ## Developer info
## Developers infos Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/phpmyadmin_ynh/tree/testing).
Please do your pull request to the [testing branch](https://github.com/YunoHost-Apps/phpmyadmin_ynh/tree/testing).
To try the testing branch, please proceed like that. To try the testing branch, please proceed like that.
``` ```
@ -62,3 +49,5 @@ sudo yunohost app install https://github.com/YunoHost-Apps/phpmyadmin_ynh/tree/t
or or
sudo yunohost app upgrade phpmyadmin -u https://github.com/YunoHost-Apps/phpmyadmin_ynh/tree/testing --debug sudo yunohost app upgrade phpmyadmin -u https://github.com/YunoHost-Apps/phpmyadmin_ynh/tree/testing --debug
``` ```
**More info regarding app packaging:** https://yunohost.org/packaging_apps

View file

@ -1,64 +1,49 @@
# phpMyAdmin avec YunoHost # phpMyAdmin pour YunoHost
[![Niveau d'intégration](https://dash.yunohost.org/integration/phpmyadmin.svg)](https://dash.yunohost.org/appci/app/phpmyadmin) ![](https://ci-apps.yunohost.org/ci/badges/phpmyadmin.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/phpmyadmin.maintain.svg) [![Niveau d'intégration](https://dash.yunohost.org/integration/phpmyadmin.svg)](https://dash.yunohost.org/appci/app/phpmyadmin) ![](https://ci-apps.yunohost.org/ci/badges/phpmyadmin.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/phpmyadmin.maintain.svg)
[![Installer phpMyAdmin avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=phpmyadmin) [![Installer phpMyAdmin avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=phpmyadmin)
*[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 phpMyAdmin rapidement et simplement sur un serveur YunoHost. > *Ce package vous permet d'installer phpMyAdmin 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.* Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.*
## Vue d'ensemble
Application web de gestion des bases de données MySQL
**Version incluse :** 5.1.1~ynh1
**Démo :** https://demo.phpmyadmin.net/master-config
## Captures d'écran
![](./doc/screenshots/68747470733a2f2f7777772e7068706d7961646d696e2e6e65742f7374617469632f696d616765732f73637265656e73686f74732f7374727563747572652e706e67.png)
## Avertissements / informations importantes
## Vue d'ensemble ## Vue d'ensemble
phpMyAdmin est un outil logiciel libre écrit en PHP, destiné à gérer l'administration de MySQL sur le Web. phpMyAdmin prend en charge un large éventail d'opérations sur MySQL et MariaDB. Les opérations fréquemment utilisées (gestion des bases de données, des tables, des colonnes, des relations, des index, des utilisateurs, des autorisations, etc.) peuvent être effectuées via l'interface utilisateur, tandis que vous avez toujours la possibilité d'exécuter directement les instructions SQL. phpMyAdmin est un outil logiciel libre écrit en PHP, destiné à gérer l'administration de MySQL sur le Web. phpMyAdmin prend en charge un large éventail d'opérations sur MySQL et MariaDB. Les opérations fréquemment utilisées (gestion des bases de données, des tables, des colonnes, des relations, des index, des utilisateurs, des autorisations, etc.) peuvent être effectuées via l'interface utilisateur, tandis que vous avez toujours la possibilité d'exécuter directement les instructions SQL.
## Documentations et ressources
**Version incluse :** 5.0.4 * Site officiel de l'app : http://www.phpmyadmin.net
* Documentation officielle utilisateur : https://yunohost.org/en/app_phpmyadmin
* Documentation officielle de l'admin : https://www.phpmyadmin.net/docs/
* Dépôt de code officiel de l'app : https://github.com/phpmyadmin/phpmyadmin
* Documentation YunoHost pour cette app : https://yunohost.org/app_phpmyadmin
* Signaler un bug : https://github.com/YunoHost-Apps/phpmyadmin_ynh/issues
## Captures d'écran ## Informations pour les développeurs
![](https://www.phpmyadmin.net/static/images/screenshots/structure.png) Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/phpmyadmin_ynh/tree/testing).
## Démo Pour essayer la branche testing, procédez comme suit.
* [Démo YunoHost](https://demo.yunohost.org/phpmyadmin/)
* [Démo officielle](https://demo.phpmyadmin.net/master-config/)
## Configuration
## Documentation
* Documentation officielle : https://www.phpmyadmin.net/docs/
* Documentation YunoHost : https://yunohost.org/#/app_phpmyadmin_fr
## Caractéristiques spécifiques YunoHost
#### Support multi-utilisateur
#### Architectures supportées
* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/phpmyadmin%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/phpmyadmin/)
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/phpmyadmin%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/phpmyadmin/)
## Limitations
## Informations additionnelles
## Liens
* Signaler un bug : https://github.com/YunoHost-Apps/phpmyadmin_ynh/issues
* Site de l'application : https://www.phpmyadmin.net/
* Dépôt de l'application principale : https://github.com/phpmyadmin/phpmyadmin
* Site web YunoHost : https://yunohost.org/
---
## Developers infos
Please do your pull request to the [testing branch](https://github.com/YunoHost-Apps/phpmyadmin_ynh/tree/testing).
To try the testing branch, please proceed like that.
``` ```
sudo yunohost app install https://github.com/YunoHost-Apps/phpmyadmin_ynh/tree/testing --debug sudo yunohost app install https://github.com/YunoHost-Apps/phpmyadmin_ynh/tree/testing --debug
or ou
sudo yunohost app upgrade phpmyadmin -u https://github.com/YunoHost-Apps/phpmyadmin_ynh/tree/testing --debug sudo yunohost app upgrade phpmyadmin -u https://github.com/YunoHost-Apps/phpmyadmin_ynh/tree/testing --debug
``` ```
**Plus d'infos sur le packaging d'applications :** https://yunohost.org/packaging_apps

View file

@ -1,8 +1,8 @@
;; Test complet ;; Test complet
; Manifest ; Manifest
domain="domain.tld" (DOMAIN) domain="domain.tld"
path="/path" (PATH) path="/path"
admin="john" (USER) admin="john"
; Checks ; Checks
pkg_linter=1 pkg_linter=1
setup_sub_dir=1 setup_sub_dir=1
@ -11,15 +11,14 @@
setup_private=0 setup_private=0
setup_public=0 setup_public=0
upgrade=1 upgrade=1
upgrade=1 from_commit=09ad01673cdfb9f893c138d92fce3bc965f5f8ed upgrade=1 from_commit=e8bcf5f9e61621256fa62f8813ba161443dd488b
backup_restore=1 backup_restore=1
multi_instance=0 multi_instance=0
port_already_use=0
change_url=1 change_url=1
;;; Options ;;; Options
Email= Email=
Notification=none Notification=none
;;; Upgrade options ;;; Upgrade options
; commit=09ad01673cdfb9f893c138d92fce3bc965f5f8ed ; commit=e8bcf5f9e61621256fa62f8813ba161443dd488b
name=Force php5 for composer name=Testing (#106)
manifest_arg=domain=DOMAIN&path=PATH&admin=USER& manifest_arg=domain=DOMAIN&path=PATH&admin=USER&

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://files.phpmyadmin.net/phpMyAdmin/5.0.4/phpMyAdmin-5.0.4-all-languages.tar.gz SOURCE_URL=https://files.phpmyadmin.net/phpMyAdmin/5.1.1/phpMyAdmin-5.1.1-all-languages.tar.gz
SOURCE_SUM=fbb993b74a7c29ce2fcdb6b6be22b0b6c58bff8df3292ab42f6280871450c316 SOURCE_SUM=8264b57aeaa1f91c6d859331777c71e80d26088bef7cdcd5f9431119747ed1c1
SOURCE_SUM_PRG=sha256sum SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.gz SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true SOURCE_IN_SUBDIR=true

View file

@ -28,8 +28,8 @@ $i = 0;
$i++; $i++;
/* Authentication type */ /* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'config'; $cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = '__YNH_PMA_ADMIN_USER__'; $cfg['Servers'][$i]['user'] = '__DB_ADMIN_USER__';
$cfg['Servers'][$i]['password'] = '__YNH_PMA_ADMIN_PASSWORD__'; $cfg['Servers'][$i]['password'] = '__DB_ADMIN_PWD__';
/* Server parameters */ /* Server parameters */
/* /*
$cfg['Servers'][$i]['host'] = 'localhost'; $cfg['Servers'][$i]['host'] = 'localhost';
@ -49,11 +49,11 @@ $cfg['Servers'][$i]['AllowNoPassword'] = false;
/* User used to manipulate with storage */ /* User used to manipulate with storage */
// $cfg['Servers'][$i]['controlhost'] = ''; // $cfg['Servers'][$i]['controlhost'] = '';
// $cfg['Servers'][$i]['controlport'] = ''; // $cfg['Servers'][$i]['controlport'] = '';
$cfg['Servers'][$i]['controluser'] = '__YNH_PMA_USER__'; $cfg['Servers'][$i]['controluser'] = '__DB_USER__';
$cfg['Servers'][$i]['controlpass'] = '__YNH_PMA_PASSWORD__'; $cfg['Servers'][$i]['controlpass'] = '__DB_PWD__';
/* Storage database and tables */ /* Storage database and tables */
$cfg['Servers'][$i]['pmadb'] = '__YNH_PMA_USER__'; $cfg['Servers'][$i]['pmadb'] = '__DB_USER__';
$cfg['Servers'][$i]['bookmarktable'] = 'pma__bookmark'; $cfg['Servers'][$i]['bookmarktable'] = 'pma__bookmark';
$cfg['Servers'][$i]['relation'] = 'pma__relation'; $cfg['Servers'][$i]['relation'] = 'pma__relation';
$cfg['Servers'][$i]['table_info'] = 'pma__table_info'; $cfg['Servers'][$i]['table_info'] = 'pma__table_info';

View file

@ -14,14 +14,14 @@
-- -------------------------------------------------------- -- --------------------------------------------------------
DROP DATABASE `__YNH_PMA_USER__`; DROP DATABASE `__DB_USER__`;
-- --
-- Database : `__YNH_PMA_USER__` -- Database : `__DB_USER__`
-- --
CREATE DATABASE IF NOT EXISTS `__YNH_PMA_USER__` CREATE DATABASE IF NOT EXISTS `__DB_USER__`
DEFAULT CHARACTER SET utf8 COLLATE utf8_bin; DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
USE __YNH_PMA_USER__; USE __DB_USER__;
GRANT SELECT, INSERT, DELETE, UPDATE ON `__YNH_PMA_USER__`.* TO GRANT SELECT, INSERT, DELETE, UPDATE ON `__DB_USER__`.* TO
'__YNH_PMA_USER__'@localhost; '__DB_USER__'@localhost;

BIN
doc/.DS_Store vendored Normal file

Binary file not shown.

3
doc/DISCLAIMER.md Normal file
View file

@ -0,0 +1,3 @@
## Overview
phpMyAdmin is a free software tool written in PHP, intended to handle the administration of MySQL over the Web. phpMyAdmin supports a wide range of operations on MySQL and MariaDB. Frequently used operations (managing databases, tables, columns, relations, indexes, users, permissions, etc) can be performed via the user interface, while you still have the ability to directly execute any SQL statement.

3
doc/DISCLAIMER_fr.md Normal file
View file

@ -0,0 +1,3 @@
## Vue d'ensemble
phpMyAdmin est un outil logiciel libre écrit en PHP, destiné à gérer l'administration de MySQL sur le Web. phpMyAdmin prend en charge un large éventail d'opérations sur MySQL et MariaDB. Les opérations fréquemment utilisées (gestion des bases de données, des tables, des colonnes, des relations, des index, des utilisateurs, des autorisations, etc.) peuvent être effectuées via l'interface utilisateur, tandis que vous avez toujours la possibilité d'exécuter directement les instructions SQL.

View file

@ -6,20 +6,28 @@
"en": "Manage MySQL databases over the web", "en": "Manage MySQL databases over the web",
"fr": "Application web de gestion des bases de données MySQL" "fr": "Application web de gestion des bases de données MySQL"
}, },
"version": "5.0.4~ynh1", "version": "5.1.1~ynh1",
"url": "http://www.phpmyadmin.net", "url": "http://www.phpmyadmin.net",
"upstream": {
"license": "GPL-2.0-only",
"website": "http://www.phpmyadmin.net",
"demo": "https://demo.phpmyadmin.net/master-config",
"admindoc": "https://www.phpmyadmin.net/docs/",
"userdoc": "https://yunohost.org/en/app_phpmyadmin",
"code": "https://github.com/phpmyadmin/phpmyadmin"
},
"license": "GPL-2.0-only", "license": "GPL-2.0-only",
"maintainer": { "maintainer": {
"name": "julien", "name": "julien",
"email": "julien.malik@paraiso.me" "email": "julien.malik@paraiso.me"
}, },
"requirements": { "requirements": {
"yunohost": ">= 3.8.1" "yunohost": ">= 4.2.0"
}, },
"multi_instance": false, "multi_instance": false,
"services": [ "services": [
"nginx", "nginx",
"php7.0-fpm", "php7.3-fpm",
"mysql" "mysql"
], ],
"arguments": { "arguments": {
@ -27,29 +35,17 @@
{ {
"name": "domain", "name": "domain",
"type": "domain", "type": "domain",
"ask": {
"en": "Choose a domain for phpMyAdmin",
"fr": "Choisissez un domaine pour phpMyAdmin"
},
"example": "domain.org" "example": "domain.org"
}, },
{ {
"name": "path", "name": "path",
"type": "path", "type": "path",
"ask": {
"en": "Choose a path for phpMyAdmin",
"fr": "Choisissez un chemin pour phpMyAdmin"
},
"example": "/phpmyadmin", "example": "/phpmyadmin",
"default": "/phpmyadmin" "default": "/phpmyadmin"
}, },
{ {
"name": "admin", "name": "admin",
"type": "user", "type": "user",
"ask": {
"en": "Choose the only allowed admin user",
"fr": "Choisissez l'unique utilisateur autorisé"
},
"example": "johndoe" "example": "johndoe"
} }
] ]

View file

@ -1,24 +0,0 @@
## Problem
- *Description of why you made this PR*
## Solution
- *And how you fix that*
## PR Status
- [ ] Code finished.
- [ ] Tested with Package_check.
- [ ] Fix or enhancement tested.
- [ ] Upgrade from last version tested.
- [ ] Can be reviewed and tested.
## Validation
---
*Minor decision*
- **Upgrade previous version** :
- [ ] **Code review** :
- [ ] **Approval (LGTM)** :
- [ ] **Approval (LGTM)** :
- **CI succeeded** :
[![Build Status](https://ci-apps-hq.yunohost.org/jenkins/job/phpmyadmin_ynh%20PR-NUM-/badge/icon)](https://ci-apps-hq.yunohost.org/jenkins/job/phpmyadmin_ynh%20PR-NUM-/)
*Please replace '-NUM-' in this link by the PR number.*
When the PR is marked as ready to merge, you have to wait for 3 days before really merging it.

View file

@ -5,74 +5,19 @@
#================================================= #=================================================
YNH_PHP_VERSION="7.3" YNH_PHP_VERSION="7.3"
extra_php_dependencies="php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-mbstring" extra_php_dependencies="php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-mbstring"
YNH_COMPOSER_VERSION=2.0.14
#=================================================
# PERSONAL HELPERS
#=================================================
#================================================= #=================================================
# EXPERIMENTAL HELPERS # EXPERIMENTAL HELPERS
#================================================= #=================================================
# Execute a command as another user #=================================================
# usage: exec_as USER COMMAND [ARG ...] # FUTURE OFFICIAL HELPERS
ynh_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: -v, --phpversion - PHP version to use with composer
# | 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:-$YNH_PHP_VERSION}"
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] [--install_args="--optimize-autoloader"]
# | arg: -v, --phpversion - PHP version to use with composer
# | arg: -w, --workdir - The directory from where the command will be executed. Default $final_path.
# | arg: -a, --install_args - Additional arguments provided to the composer install. Argument --no-dev already include
ynh_install_composer () {
# Declare an array to define the options of this helper.
local legacy_args=vwa
declare -Ar args_array=( [v]=phpversion= [w]=workdir= [a]=install_args=)
local phpversion
local workdir
local install_args
# Manage arguments with getopts
ynh_handle_getopts_args "$@"
workdir="${workdir:-$final_path}"
phpversion="${phpversion:-$YNH_PHP_VERSION}"
install_args="${install_args:-}"
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 $install_args" \
|| ynh_die "Unable to update core dependencies with Composer."
}

View file

@ -29,6 +29,23 @@ ynh_script_progression --message="Loading installation settings..."
# Needed for helper "ynh_add_nginx_config" # Needed for helper "ynh_add_nginx_config"
final_path=$(ynh_app_setting_get --app=$app --key=final_path) final_path=$(ynh_app_setting_get --app=$app --key=final_path)
#=================================================
# BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP
#=================================================
ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --weight=1
# Backup the current version of the app
ynh_backup_before_upgrade
ynh_clean_setup () {
# Remove the new domain config file, the remove script won't do it as it doesn't know yet its location.
ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf"
# Restore it if the upgrade fails
ynh_restore_upgradebackup
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#================================================= #=================================================
# CHECK WHICH PARTS SHOULD BE CHANGED # CHECK WHICH PARTS SHOULD BE CHANGED
#================================================= #=================================================
@ -89,4 +106,4 @@ ynh_systemd_action --service_name=nginx --action=reload
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Change of URL completed for phpMyAdmin" --last ynh_script_progression --message="Change of URL completed for $app" --last

View file

@ -54,6 +54,7 @@ ynh_app_setting_set --app=$app --key=admin --value=$admin
ynh_script_progression --message="Creating a MySQL database..." ynh_script_progression --message="Creating a MySQL database..."
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
@ -70,6 +71,14 @@ then
FLUSH PRIVILEGES;" --database=mysql FLUSH PRIVILEGES;" --database=mysql
fi fi
#=================================================
# CREATE DEDICATED USER
#=================================================
ynh_script_progression --message="Configuring system user..." --weight=3
# Create a system user
ynh_system_user_create --username=$app --home_dir="$final_path"
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
#================================================= #=================================================
@ -79,6 +88,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
#================================================= #=================================================
@ -87,14 +100,6 @@ ynh_script_progression --message="Configuring NGINX web server..." --weight=3
# 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=3
# Create a system user
ynh_system_user_create --username=$app
#================================================= #=================================================
# PHP-FPM CONFIGURATION # PHP-FPM CONFIGURATION
#================================================= #=================================================
@ -110,7 +115,7 @@ ynh_add_fpm_config --package="$extra_php_dependencies"
#================================================= #=================================================
ynh_script_progression --message="Filling database..." --weight=3 ynh_script_progression --message="Filling database..." --weight=3
ynh_replace_string --match_string="__YNH_PMA_USER__" --replace_string="$db_name" --target_file=../conf/create_db.sql ynh_replace_string --match_string="__DB_USER__" --replace_string="$db_user" --target_file=../conf/create_db.sql
ynh_mysql_connect_as --user="$db_name" --password="$db_pwd" --database="$db_name" \ ynh_mysql_connect_as --user="$db_name" --password="$db_pwd" --database="$db_name" \
< ../conf/create_db.sql < ../conf/create_db.sql
ynh_replace_string --match_string="phpmyadmin" --replace_string="$db_name" --target_file=$final_path/sql/create_tables.sql ynh_replace_string --match_string="phpmyadmin" --replace_string="$db_name" --target_file=$final_path/sql/create_tables.sql
@ -122,15 +127,10 @@ ynh_mysql_connect_as --user="$db_name" --password="$db_pwd" --database="$db_name
#================================================= #=================================================
ynh_script_progression --message="Configuring phpMyAdmin..." ynh_script_progression --message="Configuring phpMyAdmin..."
ynh_replace_string --match_string="__YNH_PMA_ADMIN_USER__" --replace_string="$db_admin_user" --target_file=../conf/config.inc.php ynh_add_config --template="../conf/config.inc.php" --destination="$final_path/config.inc.php"
ynh_replace_string --match_string="__YNH_PMA_ADMIN_PASSWORD__" --replace_string="$db_admin_pwd" --target_file=../conf/config.inc.php # config.inc.php contains sensitive data, restrict its access
ynh_replace_string --match_string="__YNH_PMA_USER__" --replace_string="$db_name" --target_file=../conf/config.inc.php chown $app: $final_path/config.inc.php
ynh_replace_string --match_string="__YNH_PMA_PASSWORD__" --replace_string="$db_pwd" --target_file=../conf/config.inc.php chmod 640 $final_path/config.inc.php
cp ../conf/config.inc.php $final_path
# Calculate and store the config file checksum into the app settings
ynh_store_file_checksum --file="$final_path/config.inc.php"
#================================================= #=================================================
# INSTALL DEPENDENCIES WITH COMPOSER # INSTALL DEPENDENCIES WITH COMPOSER
@ -150,11 +150,6 @@ ynh_composer_exec --commands="update --no-dev"
# SECURE FILES AND DIRECTORIES # SECURE FILES AND DIRECTORIES
#================================================= #=================================================
# Set permissions to app files
chown -R root: $final_path
# config.inc.php contains sensitive data, restrict its access
chown root:$app $final_path/config.inc.php
chmod 640 $final_path/config.inc.php
# Setup phpMyAdmin temporary folder # Setup phpMyAdmin temporary folder
mkdir -p $final_path/tmp mkdir -p $final_path/tmp
chown $app: $final_path/tmp chown $app: $final_path/tmp
@ -162,10 +157,10 @@ chown $app: $final_path/tmp
#================================================= #=================================================
# SETUP SSOWAT # SETUP SSOWAT
#================================================= #=================================================
ynh_script_progression --message="Configuring SSOwat..." --weight=3 ynh_script_progression --message="Configuring permissions..." --weight=3
# Restrict access to admin only # Restrict access to admin only
yunohost app addaccess --users=$admin $app ynh_permission_update --permission="main" --remove="all_users" --add=$admin
#================================================= #=================================================
# RELOAD NGINX # RELOAD NGINX
@ -178,4 +173,4 @@ ynh_systemd_action --service_name=nginx --action=reload
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Installation of phpMyAdmin completed" --last ynh_script_progression --message="Installation of $app completed" --last

View file

@ -72,4 +72,4 @@ ynh_system_user_delete --username=$app
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Removal of phpMyAdmin completed" --last ynh_script_progression --message="Removal of $app completed" --last

View file

@ -47,6 +47,14 @@ test ! -d $final_path \
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"
#=================================================
# RECREATE THE DEDICATED USER
#=================================================
ynh_script_progression --message="Recreating the dedicated system user..." --weight=2
# Create the dedicated user (if not existing)
ynh_system_user_create --username=$app --home_dir="$final_path"
#================================================= #=================================================
# RESTORE THE APP MAIN DIR # RESTORE THE APP MAIN DIR
#================================================= #=================================================
@ -54,6 +62,10 @@ ynh_script_progression --message="Restoring phpMyAdmin main directory..."
ynh_restore_file --origin_path="$final_path" 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 THE MYSQL DATABASE # RESTORE THE MYSQL DATABASE
#================================================= #=================================================
@ -74,21 +86,10 @@ then
FLUSH PRIVILEGES;" --database=mysql FLUSH PRIVILEGES;" --database=mysql
fi fi
#=================================================
# RECREATE THE DEDICATED USER
#=================================================
ynh_script_progression --message="Recreating the dedicated system user..." --weight=2
# Create the dedicated user (if not existing)
ynh_system_user_create --username=$app
#================================================= #=================================================
# RESTORE USER RIGHTS # RESTORE USER RIGHTS
#================================================= #=================================================
# config.inc.php contains sensitive data, restrict its access
chown root:$app $final_path/config.inc.php
chown $app: $final_path/tmp chown $app: $final_path/tmp
#================================================= #=================================================
@ -116,4 +117,4 @@ ynh_systemd_action --service_name=nginx --action=reload
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Restoration completed for phpMyAdmin" --last ynh_script_progression --message="Restoration completed for $app" --last

View file

@ -21,6 +21,7 @@ path_url=$(ynh_app_setting_get --app=$app --key=path)
admin=$(ynh_app_setting_get --app=$app --key=admin) admin=$(ynh_app_setting_get --app=$app --key=admin)
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)
db_user=$db_name
db_admin_user=$(ynh_app_setting_get --app=$app --key=db_admin_user) db_admin_user=$(ynh_app_setting_get --app=$app --key=db_admin_user)
db_admin_pwd=$(ynh_app_setting_get --app=$app --key=db_admin_pwd) db_admin_pwd=$(ynh_app_setting_get --app=$app --key=db_admin_pwd)
@ -71,6 +72,11 @@ if [ -z "$db_admin_user" ]; then
fi fi
fi fi
if ! ynh_permission_exists --permission="admin"; then
# Create the required permissions
ynh_permission_create --permission="admin" --allowed=$admin
fi
#================================================= #=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#================================================= #=================================================
@ -85,6 +91,14 @@ ynh_clean_setup () {
# Exit if an error occurs during the execution of the script # Exit if an error occurs during the execution of the script
ynh_abort_if_errors ynh_abort_if_errors
#=================================================
# 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 --home_dir="$final_path"
#================================================= #=================================================
# STANDARD UPGRADE STEPS # STANDARD UPGRADE STEPS
#================================================= #=================================================
@ -96,9 +110,13 @@ then
ynh_script_progression --message="Upgrading source files..." --weight=5 ynh_script_progression --message="Upgrading source files..." --weight=5
# 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" --keep="$final_path/config.inc.php"
fi fi
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path"
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION
#================================================= #=================================================
@ -107,14 +125,6 @@ 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
#=================================================
# 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
#================================================= #=================================================
@ -151,35 +161,12 @@ then
< $final_path/sql/create_tables.sql < $final_path/sql/create_tables.sql
fi fi
#=================================================
# CONFIGURE PHPMYADMIN
#=================================================
ynh_script_progression --message="Reconfiguring phpMyAdmin..."
# Verify the checksum and backup the file if it's different
ynh_backup_if_checksum_is_different --file="$final_path/config.inc.php"
ynh_replace_string --match_string="__YNH_PMA_ADMIN_USER__" --replace_string="$db_admin_user" --target_file=../conf/config.inc.php
ynh_replace_string --match_string="__YNH_PMA_ADMIN_PASSWORD__" --replace_string="$db_admin_pwd" --target_file=../conf/config.inc.php
ynh_replace_string --match_string="__YNH_PMA_USER__" --replace_string="$db_name" --target_file=../conf/config.inc.php
ynh_replace_string --match_string="__YNH_PMA_PASSWORD__" --replace_string="$db_pwd" --target_file=../conf/config.inc.php
cp ../conf/config.inc.php $final_path
# Recalculate and store the config file checksum into the app settings
ynh_store_file_checksum --file="$final_path/config.inc.php"
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION
#================================================= #=================================================
# SECURE FILES AND DIRECTORIES # SECURE FILES AND DIRECTORIES
#================================================= #=================================================
# Set permissions to app files
chown -R root: $final_path
# config.inc.php contains sensitive data, restrict its access
chown root:$app $final_path/config.inc.php
chmod 640 $final_path/config.inc.php
# Setup phpMyAdmin temporary folder # Setup phpMyAdmin temporary folder
mkdir -p $final_path/tmp mkdir -p $final_path/tmp
chown -R $app: $final_path/tmp chown -R $app: $final_path/tmp
@ -199,14 +186,6 @@ then
ynh_exec_warn_less ynh_composer_exec --commands=\"update --no-dev\" ynh_exec_warn_less ynh_composer_exec --commands=\"update --no-dev\"
fi fi
#=================================================
# SETUP SSOWAT
#=================================================
ynh_script_progression --message="Upgrading SSOwat configuration..."
# Restrict access to admin only
yunohost app addaccess --users=$admin $app
#================================================= #=================================================
# RELOAD NGINX # RELOAD NGINX
#================================================= #=================================================
@ -218,4 +197,4 @@ ynh_systemd_action --service_name=nginx --action=reload
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================
ynh_script_progression --message="Upgrade of phpMyAdmin completed" --last ynh_script_progression --message="Upgrade of $app completed" --last