mirror of
https://github.com/YunoHost-Apps/chuwiki_ynh.git
synced 2024-09-03 18:16:18 +02:00
commit
582b28cb18
10 changed files with 62 additions and 8 deletions
|
@ -2,6 +2,8 @@
|
||||||
; Manifest
|
; Manifest
|
||||||
domain="domain.tld"
|
domain="domain.tld"
|
||||||
path="/path"
|
path="/path"
|
||||||
|
title="ChuWiki"
|
||||||
|
language="en"
|
||||||
is_public=1
|
is_public=1
|
||||||
; Checks
|
; Checks
|
||||||
pkg_linter=1
|
pkg_linter=1
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
; Titre de votre wiki
|
; Titre de votre wiki
|
||||||
Title = ChuWiki For YunoHost
|
Title = __TITLE__
|
||||||
|
|
||||||
; Permet de ne pas utiliser le PathInfo
|
; Permet de ne pas utiliser le PathInfo
|
||||||
; Si votre PHP fonctionne en mode CGI, vous devrez passez
|
; Si votre PHP fonctionne en mode CGI, vous devrez passez
|
||||||
|
@ -10,7 +10,7 @@ UsePathInfo = false
|
||||||
; Vous devez posséder le droit d'écriture sur ce répertoire
|
; Vous devez posséder le droit d'écriture sur ce répertoire
|
||||||
; S'il n'existe pas, il sera créé par ChuWiki mais devrez dans ce cas
|
; S'il n'existe pas, il sera créé par ChuWiki mais devrez dans ce cas
|
||||||
; avoir les droits d'écriture dans le répertoire
|
; avoir les droits d'écriture dans le répertoire
|
||||||
PagePath = pages
|
PagePath = __CONTENT_PATH__/pages
|
||||||
|
|
||||||
; Noms des scripts
|
; Noms des scripts
|
||||||
; Vous devrez peut-être ajouter ".php" si votre serveur ne gère pas MultiViews
|
; Vous devrez peut-être ajouter ".php" si votre serveur ne gère pas MultiViews
|
||||||
|
@ -24,4 +24,4 @@ Renderer = wiki2xhtml
|
||||||
; Smileys, thème et langue à utiliser
|
; Smileys, thème et langue à utiliser
|
||||||
SmileyPath = smileys/dkmsn
|
SmileyPath = smileys/dkmsn
|
||||||
ThemePath = theme/default
|
ThemePath = theme/default
|
||||||
LanguagePath = lang/en
|
LanguagePath = lang/__LANGUAGE__
|
||||||
|
|
|
@ -10,6 +10,7 @@ location __PATH__/ {
|
||||||
}
|
}
|
||||||
|
|
||||||
index index.php;
|
index index.php;
|
||||||
|
client_max_body_size 128M;
|
||||||
|
|
||||||
try_files $uri $uri/ index.php;
|
try_files $uri $uri/ index.php;
|
||||||
location ~ [^/]\.php(/|$) {
|
location ~ [^/]\.php(/|$) {
|
||||||
|
|
|
@ -419,8 +419,8 @@ chdir = __FINALPATH__
|
||||||
;php_admin_value[memory_limit] = 32M
|
;php_admin_value[memory_limit] = 32M
|
||||||
|
|
||||||
; Common values to change to increase file upload limit
|
; Common values to change to increase file upload limit
|
||||||
; php_admin_value[upload_max_filesize] = 50M
|
php_admin_value[upload_max_filesize] = 128M
|
||||||
; php_admin_value[post_max_size] = 50M
|
php_admin_value[post_max_size] = 128M
|
||||||
; php_admin_flag[mail.add_x_header] = Off
|
; php_admin_flag[mail.add_x_header] = Off
|
||||||
|
|
||||||
; Other common parameters
|
; Other common parameters
|
||||||
|
|
|
@ -42,6 +42,26 @@
|
||||||
"type": "path",
|
"type": "path",
|
||||||
"example": "/chuwiki",
|
"example": "/chuwiki",
|
||||||
"default": "/chuwiki"
|
"default": "/chuwiki"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "title",
|
||||||
|
"type": "string",
|
||||||
|
"ask": {
|
||||||
|
"en": "Choose a title for the wiki you want to create",
|
||||||
|
"fr": "Choisissez un titre pour le wiki que vous souhaitez créer"
|
||||||
|
},
|
||||||
|
"example": "ChuWiki",
|
||||||
|
"default": "ChuWiki"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "language",
|
||||||
|
"type": "string",
|
||||||
|
"ask": {
|
||||||
|
"en": "Choose the application language",
|
||||||
|
"fr": "Choisissez la langue de l'application"
|
||||||
|
},
|
||||||
|
"choices": ["en", "es", "fr", "zh"],
|
||||||
|
"default": "en"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "is_public",
|
"name": "is_public",
|
||||||
|
|
|
@ -39,6 +39,12 @@ ynh_print_info --message="Declaring files to be backed up..."
|
||||||
|
|
||||||
ynh_backup --src_path="$final_path"
|
ynh_backup --src_path="$final_path"
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# BACKUP CONTENT DIR
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
ynh_backup --src_path="/home/yunohost.app/$app"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP THE NGINX CONFIGURATION
|
# BACKUP THE NGINX CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -23,6 +23,8 @@ ynh_abort_if_errors
|
||||||
domain=$YNH_APP_ARG_DOMAIN
|
domain=$YNH_APP_ARG_DOMAIN
|
||||||
path_url=$YNH_APP_ARG_PATH
|
path_url=$YNH_APP_ARG_PATH
|
||||||
is_public=$YNH_APP_ARG_IS_PUBLIC
|
is_public=$YNH_APP_ARG_IS_PUBLIC
|
||||||
|
title=$YNH_APP_ARG_TITLE
|
||||||
|
language=$YNH_APP_ARG_LANGUAGE
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
|
@ -44,6 +46,8 @@ ynh_script_progression --message="Storing installation settings..." --weight=1
|
||||||
|
|
||||||
ynh_app_setting_set --app=$app --key=domain --value=$domain
|
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=title --value=$title
|
||||||
|
#ynh_app_setting_set --app=$app --key=language --value=$language
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CREATE DEDICATED USER
|
# CREATE DEDICATED USER
|
||||||
|
@ -84,6 +88,16 @@ ynh_script_progression --message="Configuring PHP-FPM..." --weight=1
|
||||||
# Create a dedicated PHP-FPM config
|
# Create a dedicated PHP-FPM config
|
||||||
ynh_add_fpm_config
|
ynh_add_fpm_config
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# CONTENT PATH CONFIGURATION
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
content_path=/home/yunohost.app/$app
|
||||||
|
mkdir -p $content_path
|
||||||
|
ynh_app_setting_set --app=$app --key=content_path --value=$content_path
|
||||||
|
chmod -R 750 $content_path
|
||||||
|
chown -R $app $content_path
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# ADD A CONFIGURATION
|
# ADD A CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -92,7 +106,7 @@ ynh_script_progression --message="Adding a configuration file..." --weight=1
|
||||||
ynh_add_config --template="../conf/configuration.ini" --destination="$final_path/configuration.ini"
|
ynh_add_config --template="../conf/configuration.ini" --destination="$final_path/configuration.ini"
|
||||||
|
|
||||||
chmod 400 "$final_path/configuration.ini"
|
chmod 400 "$final_path/configuration.ini"
|
||||||
chown $app: "$final_path/configuration.ini"
|
chown $app "$final_path/configuration.ini"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP SSOWAT
|
# SETUP SSOWAT
|
||||||
|
|
|
@ -27,6 +27,9 @@ ynh_script_progression --message="Removing app main directory..." --weight=1
|
||||||
# Remove the app directory securely
|
# Remove the app directory securely
|
||||||
ynh_secure_remove --file="$final_path"
|
ynh_secure_remove --file="$final_path"
|
||||||
|
|
||||||
|
# Remove the content directory securely
|
||||||
|
#ynh_secure_remove --file="/home/yunohost.app/$app"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE NGINX CONFIGURATION
|
# REMOVE NGINX CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -66,6 +66,14 @@ chmod 750 "$final_path"
|
||||||
chmod -R o-rwx "$final_path"
|
chmod -R o-rwx "$final_path"
|
||||||
chown -R $app:www-data "$final_path"
|
chown -R $app:www-data "$final_path"
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# RESTORE CONTENT DIR
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
ynh_restore_file --origin_path="/home/yunohost.app/$app"
|
||||||
|
chmod -R 750 "/home/yunohost.app/$app"
|
||||||
|
chown -R $app "/home/yunohost.app/$app"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE THE PHP-FPM CONFIGURATION
|
# RESTORE THE PHP-FPM CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -73,8 +73,8 @@ then
|
||||||
cp -a "$final_path/configuration.ini" "$tmpdir/configuration.ini"
|
cp -a "$final_path/configuration.ini" "$tmpdir/configuration.ini"
|
||||||
|
|
||||||
ynh_secure_remove --file="$final_path"
|
ynh_secure_remove --file="$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" #--keep="$final_path/configuration.ini"
|
||||||
|
|
||||||
# Copy the admin saved settings from tmp directory to final config path
|
# Copy the admin saved settings from tmp directory to final config path
|
||||||
cp -a "$tmpdir/configuration.ini" "$final_path/configuration.ini"
|
cp -a "$tmpdir/configuration.ini" "$final_path/configuration.ini"
|
||||||
|
|
Loading…
Add table
Reference in a new issue