1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/haste_ynh.git synced 2024-09-03 20:36:28 +02:00
* Cleaning up
This commit is contained in:
Éric Gaspar 2021-04-23 22:36:24 +02:00 committed by GitHub
parent e1a9738be5
commit b5b33ba494
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 12 additions and 28 deletions

View file

@ -39,8 +39,8 @@ Haste is an open-source pastebin software written in node.js, which is easily in
#### Supported architectures #### Supported architectures
* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/haste%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/haste/) * x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/haste.svg)](https://ci-apps.yunohost.org/ci/apps/haste/)
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/haste%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/haste/) * ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/haste.svg)](https://ci-apps-arm.yunohost.org/ci/apps/haste/)
## Limitations ## Limitations

View file

@ -39,8 +39,8 @@ Haste est un logiciel pastebin open-source écrit en node.js, facilement install
#### Architectures supportées #### Architectures supportées
* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/haste%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/haste/) * x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/haste.svg)](https://ci-apps.yunohost.org/ci/apps/haste/)
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/haste%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/haste/) * ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/haste.svg)](https://ci-apps-arm.yunohost.org/ci/apps/haste/)
## Limitations ## Limitations

View file

@ -25,7 +25,7 @@
}, },
"storage": { "storage": {
"type": "file", "type": "file",
"path": "__YNH_DATA_PATH__" "path": "__DATA_PATH__"
}, },
"documents": { "documents": {
"about": "./about.md" "about": "./about.md"

View file

@ -4,7 +4,7 @@ set -e
set -u set -u
LOCAL_PASTE_URL="http://127.0.0.1:__PORT__" LOCAL_PASTE_URL="http://127.0.0.1:__PORT__"
PASTE_URL="https://__YNH_HASTE_URL__" PASTE_URL="https://__HASTE_URL__"
_die() { _die() {
printf "Error: %s\n" "$*" printf "Error: %s\n" "$*"

View file

@ -124,13 +124,7 @@ mkdir -p "$data_path"
# CONFIGURE HASTE # CONFIGURE HASTE
#================================================= #=================================================
cp ../conf/config.js "$final_path/config.js" ynh_add_config --template="../conf/config.js" --destination="$final_path/config.js"
ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/config.js"
ynh_replace_string --match_string="__YNH_DATA_PATH__" --replace_string="$data_path" --target_file="$final_path/config.js"
# Calculate and store the config file checksum into the app settings
ynh_store_file_checksum "$final_path/config.js"
# Replace ajax.googleapis by local file # Replace ajax.googleapis by local file
cp ../sources/jquery.min.js "$final_path/static/jquery.min.js" cp ../sources/jquery.min.js "$final_path/static/jquery.min.js"
@ -141,7 +135,7 @@ ynh_replace_string --match_string="https://ajax.googleapis.com/ajax/libs/jquery/
# ADD HASTE AS A BINARY FILE # ADD HASTE AS A BINARY FILE
#================================================= #=================================================
ynh_replace_string --match_string="__YNH_HASTE_URL__" --replace_string="${domain}${path_url%/}" --target_file="../conf/haste.sh" ynh_replace_string --match_string="__HASTE_URL__" --replace_string="${domain}${path_url%/}" --target_file="../conf/haste.sh"
ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="../conf/haste.sh" ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="../conf/haste.sh"
cp ../conf/haste.sh /usr/bin/$app cp ../conf/haste.sh /usr/bin/$app

View file

@ -125,8 +125,8 @@ ynh_use_logrotate --non-append
#================================================= #=================================================
ynh_script_progression --message="Upgrading systemd configuration..." --weight=1 ynh_script_progression --message="Upgrading systemd configuration..." --weight=1
ynh_replace_string --match_string="__ENV_PATH__" --replace_string="$PATH" --target_file="../conf/systemd.service" ynh_replace_string --match_string="__ENV_PATH__" --replace_string="$PATH" --target_file="../conf/systemd.service"
ynh_replace_string --match_string="__YNH_NPM__" --replace_string="$ynh_npm" --target_file="../conf/systemd.service" ynh_replace_string --match_string="__YNH_NPM__" --replace_string="$ynh_npm" --target_file="../conf/systemd.service"
ynh_add_systemd_config ynh_add_systemd_config
@ -134,19 +134,9 @@ ynh_add_systemd_config
# UPGRADE HASTE CONFIGURATION # UPGRADE HASTE CONFIGURATION
#================================================= #=================================================
# Verify the checksum and backup the file if it's different
ynh_backup_if_checksum_is_different "$final_path/config.js"
cp ../conf/config.js "$final_path/config.js"
# Define app's data directory # Define app's data directory
data_path="/home/yunohost.app/${app}" data_path="/home/yunohost.app/$app"
ynh_add_config --template="../conf/config.js" --destination="$final_path/config.js"
ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/config.js"
ynh_replace_string --match_string="__YNH_DATA_PATH__" --replace_string="$data_path" --target_file="$final_path/config.js"
# Recalculate and store the config file checksum into the app settings
ynh_store_file_checksum "$final_path/config.js"
# Replace ajax.googleapis by local file # Replace ajax.googleapis by local file
cp ../sources/jquery.min.js "$final_path/static/jquery.min.js" cp ../sources/jquery.min.js "$final_path/static/jquery.min.js"