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

Fix binary and data dir; remove log

This commit is contained in:
Maniack Crudelis 2017-11-29 22:24:05 +01:00
parent e7439b9cc4
commit e5d78cb496
7 changed files with 22 additions and 16 deletions

View file

@ -34,7 +34,7 @@
"storage": { "storage": {
"type": "file", "type": "file",
"file": "__YNH_DATA_PATH__" "path": "__YNH_DATA_PATH__"
}, },
"documents": { "documents": {

View file

@ -3,7 +3,8 @@
set -e set -e
set -u set -u
PASTE_URL="__YNH_HASTE_URL__" LOCAL_PASTE_URL="http://127.0.0.1:__PORT__"
PASTE_URL="https://__YNH_HASTE_URL__"
_die() { _die() {
printf "Error: %s\n" "$*" printf "Error: %s\n" "$*"
@ -15,7 +16,7 @@ check_dependencies() {
} }
paste_data() { paste_data() {
json=$(curl -X POST -s -d "$1" "${PASTE_URL}/documents") json=$(curl -kL -X POST -s -d "$1" "${LOCAL_PASTE_URL}/documents")
[[ -z "$json" ]] && _die "Unable to post the data to the server." [[ -z "$json" ]] && _die "Unable to post the data to the server."
key=$(echo "$json" \ key=$(echo "$json" \

View file

@ -50,7 +50,8 @@ ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf"
# BACKUP LOGROTATE # BACKUP LOGROTATE
#================================================= #=================================================
ynh_backup "/etc/logrotate.d/$app" # FIXME Currently, the log is only redirected to syslog.
# ynh_backup "/etc/logrotate.d/$app"
#================================================= #=================================================
# BACKUP DATADIR DIRECTORY # BACKUP DATADIR DIRECTORY

View file

@ -62,7 +62,6 @@ ynh_app_setting_set $app path_url "$path_url"
# Find a free port # Find a free port
port=$(ynh_find_port 7777) port=$(ynh_find_port 7777)
ynh_app_setting_set $app port $port ynh_app_setting_set $app port $port
echo "port=$port" >&2
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
@ -135,7 +134,8 @@ ynh_store_file_checksum "$final_path/config.js"
# ADD HASTE AS A BINARY FILE # ADD HASTE AS A BINARY FILE
#================================================= #=================================================
ynh_replace_string "__YNH_HASTE_URL__" "${domain}${path_url}" "../conf/haste.sh" ynh_replace_string "__YNH_HASTE_URL__" "${domain}${path_url%/}" "../conf/haste.sh"
ynh_replace_string "__PORT__" "$port" "../conf/haste.sh"
sudo cp ../conf/haste.sh /usr/bin/$app sudo cp ../conf/haste.sh /usr/bin/$app
sudo chmod +x /usr/bin/"$app" sudo chmod +x /usr/bin/"$app"
echo "Please use 'cmd | $app' to paste the output of the command to your Haste server." >&2 echo "Please use 'cmd | $app' to paste the output of the command to your Haste server." >&2
@ -154,10 +154,11 @@ chown -R $app "$data_path"
# HANDLE LOG FILES AND SETUP LOGROTATE # HANDLE LOG FILES AND SETUP LOGROTATE
#================================================= #=================================================
mkdir -p /var/log/$app # FIXME Currently, the log is only redirected to syslog.
touch /var/log/$app/$app.log # mkdir -p /var/log/$app
chown $app -R /var/log/$app # touch /var/log/$app/$app.log
ynh_use_logrotate # chown $app -R /var/log/$app
# ynh_use_logrotate
#================================================= #=================================================
# ENABLE SERVICE IN ADMIN PANEL # ENABLE SERVICE IN ADMIN PANEL

View file

@ -53,7 +53,8 @@ ynh_remove_nginx_config
# REMOVE LOGROTATE CONFIGURATION # REMOVE LOGROTATE CONFIGURATION
#================================================= #=================================================
ynh_remove_logrotate # FIXME Currently, the log is only redirected to syslog.
# ynh_remove_logrotate
#================================================= #=================================================
# SPECIFIC REMOVE # SPECIFIC REMOVE

View file

@ -68,11 +68,12 @@ ynh_system_user_create $app
# HANDLE LOG FILES AND RESTORE LOGROTATE # HANDLE LOG FILES AND RESTORE LOGROTATE
#================================================= #=================================================
mkdir -p /var/log/$app # FIXME Currently, the log is only redirected to syslog.
touch /var/log/$app/$app.log # mkdir -p /var/log/$app
chown $app -R /var/log/$app # touch /var/log/$app/$app.log
# chown $app -R /var/log/$app
ynh_restore_file "/etc/logrotate.d/$app" # ynh_restore_file "/etc/logrotate.d/$app"
#================================================= #=================================================
# INSTALL NODEJS # INSTALL NODEJS

3
scripts/upgrade Executable file → Normal file
View file

@ -105,7 +105,8 @@ npm update
# SETUP LOGROTATE # SETUP LOGROTATE
#================================================= #=================================================
ynh_use_logrotate # FIXME Currently, the log is only redirected to syslog.
# ynh_use_logrotate
#================================================= #=================================================
# SETUP SYSTEMD # SETUP SYSTEMD