1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/phpinfo_ynh.git synced 2024-09-03 19:56:23 +02:00
This commit is contained in:
Éric Gaspar 2023-04-05 14:13:40 +02:00
parent ae83deccee
commit 173ef648a9
12 changed files with 51 additions and 290 deletions

View file

@ -1,37 +0,0 @@
;; Test complet avec php 7.3
; Manifest
domain="domain.tld"
path="/path"
phpversion="7.4"
; Checks
pkg_linter=1
setup_sub_dir=1
setup_root=0
setup_nourl=0
setup_private=0
setup_public=0
upgrade=1
backup_restore=1
multi_instance=1
incorrect_path=0
port_already_use=0
change_url=0
;; Test avec php 7.4
; Manifest
domain="domain.tld"
path="/path"
phpversion="7.4"
; Checks
setup_sub_dir=1
backup_restore=1
;; Test avec php 8.0
; Manifest
domain="domain.tld"
path="/path"
phpversion="8.0"
; Checks
setup_sub_dir=1
backup_restore=1
;;; Options
Email=
Notification=none

4
conf/extra_php-fpm.conf Normal file
View file

@ -0,0 +1,4 @@
; Additional php.ini defines, specific to this pool of workers.
php_admin_value[upload_max_filesize] = 50M
php_admin_value[post_max_size] = 50M

View file

View file

@ -1,52 +0,0 @@
{
"name": "Phpinfo",
"id": "phpinfo",
"packaging_format": 1,
"description": {
"en": "Simple phpinfo",
"fr": "Simple phpinfo"
},
"version": "1.0~ynh4",
"url": "https://www.php.net/manual/fr/function.phpinfo.php",
"upstream": {
"license": "GPL-3.0-or-later",
"website": "https://www.php.net/manual/fr/function.phpinfo.php"
},
"license": "GPL-3.0-or-later",
"maintainer": {
"name": "Maniack Crudelis",
"email": "maniackc_dev@crudelis.fr"
},
"requirements": {
"yunohost": ">= 11.0.9"
},
"multi_instance": true,
"services": [
"nginx",
"php7.4-fpm"
],
"arguments": {
"install" : [
{
"name": "domain",
"type": "domain"
},
{
"name": "path",
"type": "path",
"example": "/phpinfo",
"default": "/phpinfo"
},
{
"name": "phpversion",
"type": "string",
"ask": {
"en": "Choose the version of PHP to use.",
"fr": "Choisissez la version de PHP à utiliser."
},
"choices": ["7.3", "7.4", "8.0", "8.1"],
"default": "7.4"
}
]
}
}

View file

@ -12,26 +12,22 @@ maintainers = ["Maniack Crudelis"]
[upstream]
license = "GPL-3.0-or-later"
website = "https://www.php.net/manual/fr/function.phpinfo.php"
cpe = "???" # FIXME: optional but recommended if relevant, this is meant to contain the Common Platform Enumeration, which is sort of a standard id for applications defined by the NIST. In particular, Yunohost may use this is in the future to easily track CVE (=security reports) related to apps. The CPE may be obtained by searching here: https://nvd.nist.gov/products/cpe/search. For example, for Nextcloud, the CPE is 'cpe:2.3:a:nextcloud:nextcloud' (no need to include the version number)
fund = "???" # FIXME: optional but recommended (or remove if irrelevant / not applicable). This is meant to be an URL where people can financially support this app, especially when its development is based on volunteers and/or financed by its community. YunoHost may later advertise it in the webadmin.
[integration]
yunohost = ">= 11.0.9"
architectures = "all" # FIXME: can be replaced by a list of supported archs using the dpkg --print-architecture nomenclature (amd64/i386/armhf/arm64), for example: ["amd64", "i386"]
yunohost = ">= 11.1.16"
architectures = "all"
multi_instance = true
ldap = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "sso" key : the "ldap" key corresponds to wether or not a user *can* login on the app using its YunoHost credentials.
sso = "?" # FIXME: replace with true, false, or "not_relevant". Not to confuse with the "ldap" key : the "sso" key corresponds to wether or not a user is *automatically logged-in* on the app when logged-in on the YunoHost portal.
disk = "50M" # FIXME: replace with an **estimate** minimum disk requirement. e.g. 20M, 400M, 1G, ...
ram.build = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ...
ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requirement. e.g. 50M, 400M, 1G, ...
ldap = false
sso = false
disk = "50M"
ram.build = "50M"
ram.runtime = "50M"
[install]
[install.domain]
# this is a generic question - ask strings are automatically handled by Yunohost's core
type = "domain"
[install.path]
# this is a generic question - ask strings are automatically handled by Yunohost's core
type = "path"
default = "/phpinfo"
@ -39,8 +35,8 @@ ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requiremen
ask.en = "Choose the version of PHP to use."
ask.fr = "Choisissez la version de PHP à utiliser."
type = "string"
choices = ["7.3", "7.4", "8.0", "8.1"]
default = "7.4"
choices = ["7.4", "8.0", "8.1", "8.2"]
default = "8.0"
[resources]
[resources.system_user]
@ -49,3 +45,8 @@ ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requiremen
[resources.permissions]
main.url = "/"
[resources.apt]
packages_from_raw_bash = """
echo "php${phpversion}-fpm"
"""

View file

@ -4,8 +4,6 @@
# COMMON VARIABLES
#=================================================
#REMOVEME? YNH_PHP_VERSION=7.4
#=================================================
# PERSONAL HELPERS
#=================================================

View file

@ -10,24 +10,6 @@
source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers
#=================================================
# MANAGE SCRIPT FAILURE
#=================================================
# Exit if an error occurs during the execution of the script
#REMOVEME? ynh_abort_if_errors
#=================================================
# LOAD SETTINGS
#=================================================
#REMOVEME? ynh_print_info --message="Loading installation settings..."
#REMOVEME? app=$YNH_APP_INSTANCE_NAME
#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir)
#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain)
#REMOVEME? phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
#=================================================
# DECLARE DATA AND CONF FILES TO BACKUP
#=================================================

View file

@ -9,51 +9,6 @@
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# MANAGE SCRIPT FAILURE
#=================================================
# Exit if an error occurs during the execution of the script
#REMOVEME? ynh_abort_if_errors
#=================================================
# RETRIEVE ARGUMENTS FROM THE MANIFEST
#=================================================
#REMOVEME? domain=$YNH_APP_ARG_DOMAIN
#REMOVEME? path=$YNH_APP_ARG_PATH
#REMOVEME? phpversion=$YNH_APP_ARG_PHPVERSION
#REMOVEME? app=$YNH_APP_INSTANCE_NAME
#=================================================
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
#=================================================
#REMOVEME? ynh_script_progression --message="Validating installation parameters..."
#REMOVEME? install_dir=/var/www/$app
#REMOVEME? test ! -e "$install_dir" || ynh_die --message="This path already contains a folder"
# Register (book) web path
#REMOVEME? ynh_webpath_register --app=$app --domain=$domain --path=$path
#=================================================
# STORE SETTINGS FROM MANIFEST
#=================================================
#REMOVEME? ynh_script_progression --message="Storing installation settings..."
#REMOVEME? ynh_app_setting_set --app=$app --key=domain --value=$domain
#REMOVEME? ynh_app_setting_set --app=$app --key=path --value=$path
ynh_app_setting_set --app=$app --key=phpversion --value=$phpversion
#=================================================
# CREATE DEDICATED USER
#=================================================
#REMOVEME? ynh_script_progression --message="Configuring system user..."
# Create a system user
#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir"
#=================================================
# STANDARD MODIFICATIONS
#=================================================
@ -61,12 +16,9 @@ ynh_app_setting_set --app=$app --key=phpversion --value=$phpversion
#=================================================
ynh_script_progression --message="Setting up source files..."
#REMOVEME? ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir
mkdir -p $install_dir
cp ../sources/index.php /$install_dir/.
chmod 750 "$install_dir"
chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir"
@ -86,13 +38,6 @@ ynh_script_progression --message="Configuring NGINX web server..."
# Create a dedicated NGINX config
ynh_add_nginx_config
#=================================================
# RELOAD NGINX
#=================================================
#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..."
#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload
#=================================================
# END OF SCRIPT
#=================================================

View file

@ -9,26 +9,6 @@
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# LOAD SETTINGS
#=================================================
#REMOVEME? ynh_script_progression --message="Loading installation settings..."
#REMOVEME? app=$YNH_APP_INSTANCE_NAME
#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain)
#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir)
#=================================================
# STANDARD REMOVE
#=================================================
# REMOVE APP MAIN DIR
#=================================================
#REMOVEME? ynh_script_progression --message="Removing app main directory..."
# Remove the app directory securely
#REMOVEME? ynh_secure_remove --file="$install_dir"
#=================================================
# REMOVE NGINX CONFIGURATION
#=================================================
@ -45,16 +25,6 @@ ynh_script_progression --message="Removing PHP-FPM configuration..."
# Remove the dedicated PHP-FPM config
ynh_remove_fpm_config
#=================================================
# GENERIC FINALIZATION
#=================================================
# REMOVE DEDICATED USER
#=================================================
#REMOVEME? ynh_script_progression --message="Removing the dedicated system user..."
# Delete a system user
#REMOVEME? ynh_system_user_delete --username=$app
#=================================================
# END OF SCRIPT
#=================================================

View file

@ -10,43 +10,6 @@
source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers
#=================================================
# MANAGE SCRIPT FAILURE
#=================================================
# Exit if an error occurs during the execution of the script
#REMOVEME? ynh_abort_if_errors
#=================================================
# LOAD SETTINGS
#=================================================
#REMOVEME? ynh_script_progression --message="Loading installation settings..."
#REMOVEME? app=$YNH_APP_INSTANCE_NAME
#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain)
#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path)
#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir)
#REMOVEME? phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
#=================================================
# CHECK IF THE APP CAN BE RESTORED
#=================================================
#REMOVEME? ynh_script_progression --message="Validating restoration parameters..."
#REMOVEME? test ! -d $install_dir \
|| ynh_die --message="There is already a directory: $install_dir "
#=================================================
# STANDARD RESTORATION STEPS
#=================================================
# RECREATE THE DEDICATED USER
#=================================================
#REMOVEME? ynh_script_progression --message="Recreating the dedicated system user..."
# Create the dedicated user (if not existing)
#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir"
#=================================================
# RESTORE THE APP MAIN DIR
#=================================================
@ -54,7 +17,6 @@ ynh_script_progression --message="Restoring the app main directory..."
ynh_restore_file --origin_path="$install_dir"
chmod 750 "$install_dir"
chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir"

View file

@ -9,49 +9,12 @@
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# LOAD SETTINGS
#=================================================
#REMOVEME? ynh_script_progression --message="Loading installation settings..."
#REMOVEME? app=$YNH_APP_INSTANCE_NAME
#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain)
#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path)
#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir)
#REMOVEME? phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
#=================================================
# CHECK VERSION
#=================================================
ynh_script_progression --message="Checking version..."
upgrade_type=$(ynh_check_app_version_changed)
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
#REMOVEME? ynh_script_progression --message="Backing up the app before upgrading (may take a while)..."
# Backup the current version of the app
#REMOVEME? ynh_backup_before_upgrade
#REMOVEME? ynh_clean_setup () {
# Restore it if the upgrade fails
#REMOVEME? ynh_restore_upgradebackup
}
# Exit if an error occurs during the execution of the script
#REMOVEME? ynh_abort_if_errors
#=================================================
# STANDARD UPGRADE STEPS
#=================================================
# CREATE DEDICATED USER
#=================================================
#REMOVEME? ynh_script_progression --message="Making sure dedicated system user exists..."
# Create a dedicated user (if not existing)
#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir"
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
@ -64,7 +27,6 @@ then
cp -f ../sources/index.php /$install_dir/.
fi
chmod 750 "$install_dir"
chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir"
@ -84,13 +46,6 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..."
# Create a dedicated NGINX config
ynh_add_nginx_config
#=================================================
# RELOAD NGINX
#=================================================
#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..."
#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload
#=================================================
# END OF SCRIPT
#=================================================

33
tests.toml Normal file
View file

@ -0,0 +1,33 @@
test_format = 1.0
[default]
# ------------
# Tests to run
# ------------
exclude = ["install.private", "change_url"] # The test IDs to be used in only/exclude statements are: install.root, install.subdir, install.nourl, install.multi, backup_restore, upgrade, upgrade.someCommitId change_url
# -------------------------------
# Default args to use for install
# -------------------------------
args.phpversion="8.0"
# -------------------------------
# Commits to test upgrade from
# -------------------------------
test_upgrade_from.00a1a6e7.name = "Upgrade from 5.4"
test_upgrade_from.00a1a6e7.args.foo = "bar"
# This is an additional test suite
[some_additional_testsuite]
# On additional tests suites, you can decide to run only specific tests
only = ["install.subdir"]
args.language = "en_GB"
args.multisite = 1