1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/phpmyadmin_ynh.git synced 2024-09-03 19:56:46 +02:00

Merge pull request #76 from YunoHost-Apps/testing

Testing
This commit is contained in:
JimboJoe 2018-06-23 09:17:14 +02:00 committed by GitHub
commit b5a6736827
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 101 additions and 6 deletions

View file

@ -11,6 +11,7 @@
setup_private=0
setup_public=0
upgrade=1
upgrade=1 from_commit=09ad01673cdfb9f893c138d92fce3bc965f5f8ed
backup_restore=1
multi_instance=0
incorrect_path=1
@ -31,3 +32,7 @@
;;; Options
Email=
Notification=none
;;; Upgrade options
; commit=09ad01673cdfb9f893c138d92fce3bc965f5f8ed
name=Force php5 for composer
manifest_arg=domain=DOMAIN&path=PATH&admin=USER&

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://github.com/phpmyadmin/phpmyadmin/archive/RELEASE_4_7_7.tar.gz
SOURCE_SUM=f8af08bb9e90c4c18b634626e6ab525d066d8e1a6fcf6a19cb0e14b29344adc8
SOURCE_URL=https://github.com/phpmyadmin/phpmyadmin/archive/RELEASE_4_8_0_1.tar.gz
SOURCE_SUM=0014d662093e032916286bbd90bf587d112a3b13d6cb7d52b31b567c34474c01
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true

View file

@ -28,8 +28,8 @@ $i = 0;
$i++;
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'YNH_MYSQL_ROOT_PASSWORD';
$cfg['Servers'][$i]['user'] = 'YNH_PMA_ADMIN_USER';
$cfg['Servers'][$i]['password'] = 'YNH_PMA_ADMIN_PASSWORD';
/* Server parameters */
/*
$cfg['Servers'][$i]['host'] = 'localhost';

View file

@ -6,9 +6,9 @@
"en": "Manage MySQL databases over the web",
"fr": "Application web de gestion des bases de données MySQL"
},
"version": "4.7.7",
"version": "4.8.0.1~ynh1",
"url": "http://www.phpmyadmin.net",
"license": "GPL-2",
"license": "GPL-2.0-only",
"maintainer": {
"name": "julien",
"email": "julien.malik@paraiso.me"

25
pull_request_template.md Normal file
View file

@ -0,0 +1,25 @@
## 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-dev.yunohost.org/jenkins/job/phpmyadmin_ynh%20-BRANCH-%20(Official)/badge/icon)](https://ci-apps-dev.yunohost.org/jenkins/job/phpmyadmin_ynh%20-BRANCH-%20(Official)/) *Please replace '-BRANCH-' in this link for a PR from a local branch.*
or
[![Build Status](https://ci-apps-dev.yunohost.org/jenkins/job/phpmyadmin_ynh%20PR-NUM-%20(Official_fork)/badge/icon)](https://ci-apps-dev.yunohost.org/jenkins/job/phpmyadmin_ynh%20PR-NUM-%20(Official_fork)/) *Replace '-NUM-' by the PR number in this link for a PR from a forked repository.*
When the PR is marked as ready to merge, you have to wait for 3 days before really merging it.

View file

@ -21,6 +21,13 @@ set -eu
# source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# MANAGE SCRIPT FAILURE
#=================================================
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#=================================================
# LOAD SETTINGS
#=================================================

View file

@ -59,6 +59,17 @@ db_name=$(ynh_sanitize_dbid $app)
ynh_app_setting_set $app db_name $db_name
ynh_mysql_setup_db $db_name $db_name
# Setup a privileged user for phpmyadmin (to prevent using MySQL root user)
db_admin_user="${app}_root"
ynh_app_setting_set $app db_admin_user $db_admin_user
db_admin_pwd="$(ynh_string_random)"
ynh_app_setting_set $app db_admin_pwd $db_admin_pwd
if ! ynh_mysql_user_exists "$db_admin_user" ; then
ynh_mysql_create_user "$db_admin_user" "$db_admin_pwd"
ynh_mysql_execute_as_root "GRANT ALL PRIVILEGES ON *.* TO '$db_admin_user'@'localhost' IDENTIFIED BY '$db_admin_pwd' WITH GRANT OPTION;
FLUSH PRIVILEGES;" mysql
fi
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
@ -106,6 +117,8 @@ ynh_mysql_connect_as "$db_name" "$db_pwd" "$db_name" \
#=================================================
ynh_replace_string "YNH_DOMAIN" "$domain" ../conf/config.inc.php
ynh_replace_string "YNH_PMA_ADMIN_USER" "$db_admin_user" ../conf/config.inc.php
ynh_replace_string "YNH_PMA_ADMIN_PASSWORD" "$db_admin_pwd" ../conf/config.inc.php
ynh_replace_string "YNH_PMA_USER" "$db_name" ../conf/config.inc.php
ynh_replace_string "YNH_PMA_PASSWORD" "$db_pwd" ../conf/config.inc.php
ynh_replace_string "YNH_MYSQL_ROOT_PASSWORD" "$(cat $MYSQL_ROOT_PWD_FILE)" ../conf/config.inc.php
@ -135,6 +148,9 @@ 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
mkdir -p $final_path/tmp
chown $app: $final_path/tmp
#=================================================
# SETUP SSOWAT

View file

@ -18,6 +18,7 @@ app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get $app domain)
db_name=$(ynh_app_setting_get $app db_name)
final_path=$(ynh_app_setting_get $app final_path)
db_admin_user=$(ynh_app_setting_get $app db_admin_user)
#=================================================
# STANDARD REMOVE
@ -28,6 +29,9 @@ final_path=$(ynh_app_setting_get $app final_path)
# Remove a database if it exists, along with the associated user
ynh_mysql_remove_db $db_name $db_name
# Remove phpmyadmin MySQL admin user
ynh_mysql_drop_user $db_admin_user
#=================================================
# REMOVE APP MAIN DIR
#=================================================

View file

@ -21,6 +21,13 @@ set -eu
# source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# MANAGE SCRIPT FAILURE
#=================================================
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#=================================================
# LOAD SETTINGS
#=================================================
@ -64,6 +71,15 @@ db_pwd=$(ynh_app_setting_get $app mysqlpwd)
ynh_mysql_setup_db $db_name $db_name $db_pwd
ynh_mysql_connect_as $db_name $db_pwd $db_name < ./db.sql
# Setup a privileged user for phpmyadmin (to prevent using MySQL root user)
db_admin_user=$(ynh_app_setting_get $app db_admin_user)
db_admin_pwd=$(ynh_app_setting_get $app db_admin_pwd)
if ! ynh_mysql_user_exists "$db_admin_user" ; then
ynh_mysql_create_user "$db_admin_user" "$db_admin_pwd"
ynh_mysql_execute_as_root "GRANT ALL PRIVILEGES ON *.* TO '$db_admin_user'@'localhost' IDENTIFIED BY '$db_admin_pwd' WITH GRANT OPTION;
FLUSH PRIVILEGES;" mysql
fi
#=================================================
# RECREATE THE DEDICATED USER
#=================================================

View file

@ -20,6 +20,8 @@ path_url=$(ynh_app_setting_get $app path)
admin=$(ynh_app_setting_get $app admin)
final_path=$(ynh_app_setting_get $app final_path)
db_name=$(ynh_app_setting_get $app db_name)
db_admin_user=$(ynh_app_setting_get $app db_admin_user)
db_admin_pwd=$(ynh_app_setting_get $app db_admin_pwd)
#=================================================
# ENSURE DOWNWARD COMPATIBILITY
@ -45,6 +47,21 @@ if [ -z $admin ]; then
ynh_app_setting_delete $app admin_user
fi
# If db_admin_user doesn't exist, create it
if [ -z $db_admin_user ]; then
# Setup a privileged user for phpmyadmin (to prevent using MySQL root user)
db_admin_user="${app}_root"
ynh_app_setting_set $app db_admin_user $db_admin_user
db_admin_pwd="$(ynh_string_random)"
ynh_app_setting_set $app db_admin_pwd $db_admin_pwd
if ! ynh_mysql_user_exists "$db_admin_user" ; then
ynh_mysql_create_user "$db_admin_user" "$db_admin_pwd"
ynh_mysql_execute_as_root "GRANT ALL PRIVILEGES ON *.* TO '$db_admin_user'@'localhost' IDENTIFIED BY '$db_admin_pwd' WITH GRANT OPTION;
FLUSH PRIVILEGES;" mysql
fi
fi
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
@ -122,6 +139,8 @@ ynh_mysql_connect_as "$db_name" "$db_pwd" "$db_name" \
ynh_backup_if_checksum_is_different "$final_path/config.inc.php"
ynh_replace_string "YNH_DOMAIN" "$domain" ../conf/config.inc.php
ynh_replace_string "YNH_PMA_ADMIN_USER" "$db_admin_user" ../conf/config.inc.php
ynh_replace_string "YNH_PMA_ADMIN_PASSWORD" "$db_admin_pwd" ../conf/config.inc.php
ynh_replace_string "YNH_PMA_USER" "$db_name" ../conf/config.inc.php
ynh_replace_string "YNH_PMA_PASSWORD" "$db_pwd" ../conf/config.inc.php
ynh_replace_string "YNH_MYSQL_ROOT_PASSWORD" "$(cat $MYSQL_ROOT_PWD_FILE)" ../conf/config.inc.php
@ -151,6 +170,9 @@ 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
mkdir -p $final_path/tmp
chown $app: $final_path/tmp
#=================================================
# SETUP SSOWAT