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

Cleaning up

This commit is contained in:
ericgaspar 2021-03-15 13:29:53 +01:00
parent f4e46f289c
commit 1723550d1d
No known key found for this signature in database
GPG key ID: 574F281483054D44
6 changed files with 23 additions and 42 deletions

View file

@ -28,7 +28,7 @@ Wiki.js is a copylefted libre software, modern and powerful wiki app built on No
## Documentation
* Official documentation: https://docs-beta.requarks.io/
* YunoHost documentation: https://yunohost.org/#/app_wikijs
* YunoHost documentation: https://yunohost.org/en/app_wikijs
## YunoHost specific features

View file

@ -13,7 +13,7 @@
"name": "yalh76"
},
"requirements": {
"yunohost": ">= 3.8.1"
"yunohost": ">= 4.1.7"
},
"multi_instance": true,
"services": [
@ -24,19 +24,11 @@
{
"name": "domain",
"type": "domain",
"ask": {
"en": "Choose a domain name for Wiki.js",
"fr": "Choisissez un nom de domaine pour Wiki.js"
},
"example": "example.com"
},
{
"name": "is_public",
"type": "boolean",
"ask": {
"en": "Is it a public application?",
"fr": "Est-ce une application publique ?"
},
"default": true
}
]

View file

@ -13,6 +13,4 @@
## Package_check results
---
*If you have access to [App Continuous Integration for packagers](https://yunohost.org/#/packaging_apps_ci) you can provide a link to the package_check results like below, replacing '-NUM-' in this link by the PR number and USERNAME by your username on the ci-apps-dev. Or you provide a screenshot or a pastebin of the results*
[![Build Status](https://ci-apps-dev.yunohost.org/jenkins/job/wikijs_ynh%20PR-NUM-%20(USERNAME)/badge/icon)](https://ci-apps-dev.yunohost.org/jenkins/job/wikijs_ynh%20PR-NUM-%20(USERNAME)/)
* An automatic package_check will be launch at https://ci-apps-dev.yunohost.org/, when you add a specific comment to your Pull Request: "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!"*

View file

@ -51,7 +51,6 @@ ynh_script_progression --message="Storing installation settings..."
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=is_public --value=$is_public
ynh_app_setting_set --app=$app --key=ldap_user --value=$ldap_user
ynh_app_setting_set --app=$app --key=ldap_password --value=$ldap_password
@ -136,12 +135,14 @@ ynh_add_systemd_config --others_var="ynh_node ynh_node_load_PATH"
#=================================================
ynh_script_progression --message="Modifying a config file..."
config_file="$final_path/config.yml"
cp -f ../conf/config.sample.yml $config_file
# config_file="$final_path/config.yml"
# cp -f ../conf/config.sample.yml $config_file
ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$config_file"
ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$config_file"
ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$config_file"
# ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$config_file"
# ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$config_file"
# ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$config_file"
ynh_add_config --template="../conf/config.sample.yml" --destination="$final_path/config.yml"
#=================================================
# STORE THE CONFIG FILE CHECKSUM
@ -159,7 +160,7 @@ ynh_store_file_checksum --file="$config_file"
ynh_script_progression --message="Securing files and directories..."
# Set permissions to app files
chown -R "$app":"$app" "$final_path"
chown -R $app: $final_path
#=================================================
# INTEGRATE SERVICE IN YUNOHOST

View file

@ -76,7 +76,7 @@ ynh_system_user_create --username=$app --home_dir="$final_path"
ynh_script_progression --message="Restoring user rights..."
# Restore permissions on app files
chown -R $app: "$final_path"
chown -R $app: $final_path
#=================================================
# SPECIFIC RESTORATION

View file

@ -19,10 +19,7 @@ app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get --app=$app --key=domain)
path_url=$(ynh_app_setting_get --app=$app --key=path)
is_public=$(ynh_app_setting_get --app=$app --key=is_public)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd)
port=$(ynh_app_setting_get --app=$app --key=port)
@ -41,15 +38,6 @@ upgrade_type=$(ynh_check_app_version_changed)
#=================================================
ynh_script_progression --message="Ensuring downward compatibility..."
# Fix is_public as a boolean value
if [ "$is_public" = "Yes" ]; then
ynh_app_setting_set --app=$app --key=is_public --value=1
is_public=1
elif [ "$is_public" = "No" ]; then
ynh_app_setting_set --app=$app --key=is_public --value=0
is_public=0
fi
# If db_name doesn't exist, create it
if [ -z "$db_name" ]; then
db_name=$(ynh_sanitize_dbid --db_name=$app)
@ -183,16 +171,18 @@ ynh_system_user_create --username=$app --home_dir="$final_path"
#=================================================
ynh_script_progression --message="Modifying a config file..."
config_file="$final_path/config.yml"
ynh_backup_if_checksum_is_different --file=$config_file
cp -f ../conf/config.sample.yml $config_file
# config_file="$final_path/config.yml"
# ynh_backup_if_checksum_is_different --file=$config_file
# cp -f ../conf/config.sample.yml $config_file
ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$config_file"
ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$config_file"
ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$config_file"
# ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$config_file"
# ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$config_file"
# ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$config_file"
# Recalculate and store the checksum of the file for the next upgrade.
ynh_store_file_checksum --file="$config_file"
# # Recalculate and store the checksum of the file for the next upgrade.
# ynh_store_file_checksum --file="$config_file"
ynh_add_config --template="../conf/config.sample.yml" --destination="$final_path/config.yml"
#=================================================
# SETUP SYSTEMD
@ -210,7 +200,7 @@ ynh_add_systemd_config --others_var="ynh_node ynh_node_load_PATH"
ynh_script_progression --message="Securing files and directories..."
# Set permissions on app files
chown -R $app: "$final_path"
chown -R $app: $final_path
#=================================================
# INTEGRATE SERVICE IN YUNOHOST