1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/yourls_ynh.git synced 2024-09-03 20:35:59 +02:00

Merge pull request #17 from YunoHost-Apps/testing

Testing
This commit is contained in:
Éric Gaspar 2021-05-07 09:05:03 +02:00 committed by GitHub
commit 455317a9e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 49 additions and 49 deletions

View file

@ -1,7 +1,7 @@
# YOURLS for YunoHost # YOURLS for YunoHost
[![Integration level](https://dash.yunohost.org/integration/yourls.svg)](https://dash.yunohost.org/appci/app/yourls) ![](https://ci-apps.yunohost.org/ci/badges/yourls.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/yourls.maintain.svg) [![Integration level](https://dash.yunohost.org/integration/yourls.svg)](https://dash.yunohost.org/appci/app/yourls) ![](https://ci-apps.yunohost.org/ci/badges/yourls.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/yourls.maintain.svg)
[![Install YOURLS with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=yourls) [![Install YOURLS with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=yourls)
*[Lire ce readme en français.](./README_fr.md)* *[Lire ce readme en français.](./README_fr.md)*
@ -11,7 +11,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in
## Overview ## Overview
YOURLS stands for Your Own URL Shortener. It is a small set of PHP scripts that will allow you to run your own URL shortening service (a la TinyURL or bitly). YOURLS stands for Your Own URL Shortener. It is a small set of PHP scripts that will allow you to run your own URL shortening service (a la TinyURL or bitly).
**Shipped version:** 1.7.9 **Shipped version:** 1.8.1
## Screenshots ## Screenshots

View file

@ -1,7 +1,7 @@
# YOURLS pour YunoHost # YOURLS pour YunoHost
[![Niveau d'intégration](https://dash.yunohost.org/integration/yourls.svg)](https://dash.yunohost.org/appci/app/yourls) ![](https://ci-apps.yunohost.org/ci/badges/yourls.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/yourls.maintain.svg) [![Niveau d'intégration](https://dash.yunohost.org/integration/yourls.svg)](https://dash.yunohost.org/appci/app/yourls) ![](https://ci-apps.yunohost.org/ci/badges/yourls.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/yourls.maintain.svg)
[![Installer YOURLS avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=yourls) [![Installer YOURLS avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=yourls)
*[Read this readme in english.](./README.md)* *[Read this readme in english.](./README.md)*
@ -11,7 +11,7 @@ Si vous n'avez pas YunoHost, consultez [le guide](https://yunohost.org/#/install
## Vue d'ensemble ## Vue d'ensemble
YOURLS signifie Your Own URL Shortener. C'est un petit ensemble de scripts PHP qui vous permettront d'exécuter votre propre service de raccourcissement d'URL (à la TinyURL ou bitly). YOURLS signifie Your Own URL Shortener. C'est un petit ensemble de scripts PHP qui vous permettront d'exécuter votre propre service de raccourcissement d'URL (à la TinyURL ou bitly).
**Version incluse :** 1.7.9 **Version incluse :** 1.8.1
## Captures d'écran ## Captures d'écran

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://github.com/YOURLS/YOURLS/archive/1.7.9.zip SOURCE_URL=https://github.com/YOURLS/YOURLS/archive/1.8.1.zip
SOURCE_SUM=1cc4ecd97e4c143ca85d684d9a5ce0a79c4b359d85b76c7ca58f1babed8a5cfe SOURCE_SUM=c67eb7bf717de677d8a03d8be2cc0a505810252a75bcc00c3d6717c4d0ad7123
SOURCE_SUM_PRG=sha256sum SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=zip SOURCE_FORMAT=zip
SOURCE_IN_SUBDIR=true SOURCE_IN_SUBDIR=true

View file

@ -8,20 +8,20 @@
*/ */
/** MySQL database username */ /** MySQL database username */
define( 'YOURLS_DB_USER', '__DB_NAME__' ); define('YOURLS_DB_USER', '__DB_NAME__');
/** MySQL database password */ /** MySQL database password */
define( 'YOURLS_DB_PASS', '__DB_PASSWORD__' ); define('YOURLS_DB_PASS', '__DB_PWD__');
/** The name of the database for YOURLS */ /** The name of the database for YOURLS */
define( 'YOURLS_DB_NAME', '__DB_NAME__' ); define('YOURLS_DB_NAME', '__DB_NAME__');
/** MySQL hostname. /** MySQL hostname.
** If using a non standard port, specify it like 'hostname:port', eg. 'localhost:9999' or '127.0.0.1:666' */ ** If using a non standard port, specify it like 'hostname:port', eg. 'localhost:9999' or '127.0.0.1:666' */
define( 'YOURLS_DB_HOST', 'localhost' ); define('YOURLS_DB_HOST', 'localhost');
/** MySQL tables prefix */ /** MySQL tables prefix */
define( 'YOURLS_DB_PREFIX', '__DB_NAME___' ); define('YOURLS_DB_PREFIX', '__DB_NAME___');
/* /*
** Site options ** Site options
@ -29,46 +29,45 @@ define( 'YOURLS_DB_PREFIX', '__DB_NAME___' );
/** YOURLS installation URL -- all lowercase and with no trailing slash. /** YOURLS installation URL -- all lowercase and with no trailing slash.
** If you define it to "http://site.com", don't use "http://www.site.com" in your browser (and vice-versa) */ ** If you define it to "http://site.com", don't use "http://www.site.com" in your browser (and vice-versa) */
define( 'YOURLS_SITE', 'https://__DOMAIN____PATH__' ); define('YOURLS_SITE', 'https://__DOMAIN____PATH__');
/** Timezone GMT offset */ /** Timezone GMT offset */
define( 'YOURLS_HOURS_OFFSET', 0 ); define('YOURLS_HOURS_OFFSET', 0);
/** YOURLS language or "locale". /** YOURLS language or "locale".
** Change this setting to "localize" YOURLS (use a translation instead of the default English). A corresponding .mo file ** Change this setting to "localize" YOURLS (use a translation instead of the default English). A corresponding .mo file
** must be installed in the user/language directory. ** must be installed in the user/language directory.
** See http://yourls.org/translations for more information */ ** See http://yourls.org/translations for more information */
define( 'YOURLS_LANG', '' ); define('YOURLS_LANG', '');
/** Allow multiple short URLs for a same long URL /** Allow multiple short URLs for a same long URL
** Set to true to have only one pair of shortURL/longURL (default YOURLS behavior) ** Set to true to have only one pair of shortURL/longURL (default YOURLS behavior)
** Set to false to allow multiple short URLs pointing to the same long URL (bit.ly behavior) */ ** Set to false to allow multiple short URLs pointing to the same long URL (bit.ly behavior) */
define( 'YOURLS_UNIQUE_URLS', true ); define('YOURLS_UNIQUE_URLS', true);
/** Private means the Admin area will be protected with login/pass as defined below. /** Private means the Admin area will be protected with login/pass as defined below.
** Set to false for public usage (eg on a restricted intranet or for test setups) ** Set to false for public usage (eg on a restricted intranet or for test setups)
** Read http://yourls.org/privatepublic for more details if you're unsure */ ** Read http://yourls.org/privatepublic for more details if you're unsure */
define( 'YOURLS_PRIVATE', false ); define('YOURLS_PRIVATE', false);
/** A random secret hash used to encrypt cookies. You don't have to remember it, make it long and complicated. Hint: copy from http://yourls.org/cookie **/ /** A random secret hash used to encrypt cookies. You don't have to remember it, make it long and complicated. Hint: copy from http://yourls.org/cookie **/
define( 'YOURLS_COOKIEKEY', '__RANDOM__' ); define('YOURLS_COOKIEKEY', '__RANDOM__');
/** Username(s) and password(s) allowed to access the site. Passwords either in plain text or as encrypted hashes /** Username(s) and password(s) allowed to access the site. Passwords either in plain text or as encrypted hashes
** YOURLS will auto encrypt plain text passwords in this file ** YOURLS will auto encrypt plain text passwords in this file
** Read http://yourls.org/userpassword for more information */ ** Read http://yourls.org/userpassword for more information */
$yourls_user_passwords = array( $yourls_user_passwords = array();
);
/** Debug mode to output some internal information /** Debug mode to output some internal information
** Default is false for live site. Enable when coding or before submitting a new issue */ ** Default is false for live site. Enable when coding or before submitting a new issue */
define( 'YOURLS_DEBUG', false ); define('YOURLS_DEBUG', false);
/* /*
** URL Shortening settings ** URL Shortening settings
*/ */
/** URL shortening method: 36 or 62 */ /** URL shortening method: 36 or 62 */
define( 'YOURLS_URL_CONVERT', 36 ); define('YOURLS_URL_CONVERT', 36);
/* /*
* 36: generates all lowercase keywords (ie: 13jkm) * 36: generates all lowercase keywords (ie: 13jkm)
* 62: generates mixed case keywords (ie: 13jKm or 13JKm) * 62: generates mixed case keywords (ie: 13jKm or 13JKm)
@ -76,9 +75,9 @@ define( 'YOURLS_URL_CONVERT', 36 );
*/ */
/** /**
* Reserved keywords (so that generated URLs won't match them) * Reserved keywords (so that generated URLs won't match them)
* Define here negative, unwanted or potentially misleading keywords. * Define here negative, unwanted or potentially misleading keywords.
*/ */
$yourls_reserved_URL = array( $yourls_reserved_URL = array(
'porn', 'faggot', 'sex', 'nigger', 'fuck', 'cunt', 'dick', 'gay', 'porn', 'faggot', 'sex', 'nigger', 'fuck', 'cunt', 'dick', 'gay',
); );
@ -91,3 +90,4 @@ $yourls_reserved_URL = array(
//define( 'LDAPAUTH_PORT', '389' ); //define( 'LDAPAUTH_PORT', '389' );
//define( 'LDAPAUTH_BASE', 'dc=yunohost,dc=org' ); //define( 'LDAPAUTH_BASE', 'dc=yunohost,dc=org' );
//define( 'LDAPAUTH_USERNAME_FIELD', 'uid'); //define( 'LDAPAUTH_USERNAME_FIELD', 'uid');
require_once(dirname(__DIR__) . '/includes/functions-auth.php');

View file

@ -6,7 +6,7 @@
"en": "URL shortening service", "en": "URL shortening service",
"fr": "Service de raccourcisseur d'URL" "fr": "Service de raccourcisseur d'URL"
}, },
"version": "1.7.9~ynh1", "version": "1.8.1~ynh1",
"url": "https://github.com/YOURLS/YOURLS", "url": "https://github.com/YOURLS/YOURLS",
"license": "MIT", "license": "MIT",
"maintainer": { "maintainer": {
@ -15,8 +15,8 @@
"url": "" "url": ""
}, },
"requirements": { "requirements": {
"yunohost": ">= 3.8.1" "yunohost": ">= 4.1.7"
}, },
"previous_maintainers": { "previous_maintainers": {
"name": "courgette", "name": "courgette",
"email": "courgette@farcie.fr", "email": "courgette@farcie.fr",
@ -25,7 +25,7 @@
"multi_instance": true, "multi_instance": true,
"services": [ "services": [
"nginx", "nginx",
"php7.0-fpm", "php7.3-fpm",
"mysql" "mysql"
], ],
"arguments": { "arguments": {
@ -33,29 +33,17 @@
{ {
"name": "domain", "name": "domain",
"type": "domain", "type": "domain",
"ask": {
"en": "Choose a domain for YOURLS",
"fr": "Choisissez un domaine pour YOURLS"
},
"example": "domain.org" "example": "domain.org"
}, },
{ {
"name": "path", "name": "path",
"type": "path", "type": "path",
"ask": {
"en": "Choose a path for YOURLS",
"fr": "Choisissez un chemin pour YOURLS"
},
"example": "/yourls", "example": "/yourls",
"default": "/yourls" "default": "/yourls"
}, },
{ {
"name": "admin", "name": "admin",
"type": "user", "type": "user",
"ask": {
"en": "Choose an admin user",
"fr": "Choisissez l'administrateur"
},
"example": "johndoe" "example": "johndoe"
} }
] ]

View file

@ -32,7 +32,6 @@ 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..." --weight=1 ynh_script_progression --message="Validating installation parameters..." --weight=1
final_path=/var/www/$app final_path=/var/www/$app
@ -90,7 +89,7 @@ ynh_system_user_create --username=$app
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 --phpversion=$YNH_PHP_VERSION --package="$extra_php_dependencies" ynh_add_fpm_config --package="$extra_php_dependencies"
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
# copy index file # copy index file
@ -103,7 +102,7 @@ cp ../conf/index.php $final_path/
cp ../conf/config.php $final_path/user/config.php cp ../conf/config.php $final_path/user/config.php
ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$final_path/user/config.php" ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$final_path/user/config.php"
ynh_replace_string --match_string="__DB_PASSWORD__" --replace_string="$db_pwd" --target_file="$final_path/user/config.php" ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$final_path/user/config.php"
ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/user/config.php" ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/user/config.php"
ynh_replace_string --match_string="__PATH__" --replace_string="${path_url%/}" --target_file="$final_path/user/config.php" ynh_replace_string --match_string="__PATH__" --replace_string="${path_url%/}" --target_file="$final_path/user/config.php"
ynh_replace_string --match_string="__RANDOM__" --replace_string="$(ynh_string_random 24)" --target_file="$final_path/user/config.php" ynh_replace_string --match_string="__RANDOM__" --replace_string="$(ynh_string_random 24)" --target_file="$final_path/user/config.php"
@ -116,11 +115,15 @@ ynh_store_file_checksum "$final_path/user/config.php"
#================================================= #=================================================
chown -R $app: $final_path chown -R $app: $final_path
chmod 600 $final_path/user/config.php
# Reload Nginx and regenerate SSOwat conf #=================================================
# SETUP SSOWAT
#=================================================
ynh_script_progression --message="Configuring permissions..." --time --weight=1
# unprotected_uris allows SSO credentials to be passed anyway. # unprotected_uris allows SSO credentials to be passed anyway.
ynh_app_setting_set --app=$app --key=unprotected_uris --value="/" ynh_permission_update --permission="main" --add="visitors"
#================================================= #=================================================
# RELOAD NGINX # RELOAD NGINX

View file

@ -43,7 +43,6 @@ ynh_script_progression --message="Removing YOURLS main directory..." --weight=4
# Remove the app directory securely # Remove the app directory securely
ynh_secure_remove --file="$final_path" ynh_secure_remove --file="$final_path"
#================================================= #=================================================
# REMOVE NGINX CONFIGURATION # REMOVE NGINX CONFIGURATION
#================================================= #=================================================

View file

@ -72,6 +72,7 @@ ynh_system_user_create --username=$app
# Restore permissions on app files # Restore permissions on app files
chown -R $app: $final_path chown -R $app: $final_path
chmod 600 $final_path/user/config.php
#================================================= #=================================================
# RESTORE THE PHP-FPM CONFIGURATION # RESTORE THE PHP-FPM CONFIGURATION

View file

@ -44,6 +44,14 @@ if [ -z "$final_path" ]; then
final_path=/var/www/$app final_path=/var/www/$app
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
# Cleaning legacy permissions
if ynh_legacy_permissions_exists; then
ynh_legacy_permissions_delete_all
ynh_app_setting_delete --app=$app --key=is_public
fi
#================================================= #=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#================================================= #=================================================
@ -108,7 +116,7 @@ ynh_system_user_create --username=$app
ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=4 ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=4
# Create a dedicated PHP-FPM config # Create a dedicated PHP-FPM config
ynh_add_fpm_config --phpversion=$YNH_PHP_VERSION --package="$extra_php_dependencies" ynh_add_fpm_config --package="$extra_php_dependencies"
#================================================= #=================================================
# MODIFY A CONFIG FILE # MODIFY A CONFIG FILE
@ -118,10 +126,10 @@ ynh_script_progression --message="Modifying a config file..." --weight=2
# Verify the checksum and backup the file if it's different # Verify the checksum and backup the file if it's different
ynh_backup_if_checksum_is_different --file="$final_path/user/config.php" ynh_backup_if_checksum_is_different --file="$final_path/user/config.php"
sudo cp ../conf/config.php $final_path/user/config.php cp ../conf/config.php $final_path/user/config.php
ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$final_path/user/config.php" ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$final_path/user/config.php"
ynh_replace_string --match_string="__DB_PASSWORD__" --replace_string="$db_pwd" --target_file="$final_path/user/config.php" ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$final_path/user/config.php"
ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/user/config.php" ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/user/config.php"
ynh_replace_string --match_string="__PATH__" --replace_string="${path_url%/}" --target_file="$final_path/user/config.php" ynh_replace_string --match_string="__PATH__" --replace_string="${path_url%/}" --target_file="$final_path/user/config.php"
ynh_replace_string --match_string="__RANDOM__" --replace_string="$(ynh_string_random 24)" --target_file="$final_path/user/config.php" ynh_replace_string --match_string="__RANDOM__" --replace_string="$(ynh_string_random 24)" --target_file="$final_path/user/config.php"
@ -135,6 +143,7 @@ ynh_store_file_checksum --file="$final_path/user/config.php"
# Restore permissions on app files # Restore permissions on app files
chown -R $app: $final_path chown -R $app: $final_path
chmod 600 $final_path/user/config.php
#================================================= #=================================================
# RELOAD NGINX # RELOAD NGINX