mirror of
https://github.com/YunoHost-Apps/haste_ynh.git
synced 2024-09-03 20:36:28 +02:00
Update install
This commit is contained in:
parent
2dc651657d
commit
6218d44ecd
1 changed files with 15 additions and 14 deletions
|
@ -75,9 +75,9 @@ ynh_system_user_create $app
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# Créer le dossier de log
|
# Créer le dossier de log
|
||||||
sudo mkdir -p /var/log/$app
|
mkdir -p /var/log/$app
|
||||||
sudo touch /var/log/$app/$app.log
|
touch /var/log/$app/$app.log
|
||||||
sudo chown $app -R /var/log/$app
|
chown $app -R /var/log/$app
|
||||||
|
|
||||||
# Setup logrotate
|
# Setup logrotate
|
||||||
ynh_use_logrotate
|
ynh_use_logrotate
|
||||||
|
@ -92,8 +92,8 @@ ynh_app_setting_set $app final_path $final_path
|
||||||
ynh_setup_source $final_path
|
ynh_setup_source $final_path
|
||||||
|
|
||||||
# Set files ownership during installation
|
# Set files ownership during installation
|
||||||
sudo chown $app: $final_path -R
|
chown $app: $final_path -R
|
||||||
sudo chmod 755 $final_path -R
|
chmod 755 $final_path -R
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# Modify Nginx configuration file and copy it to Nginx conf directory
|
# Modify Nginx configuration file and copy it to Nginx conf directory
|
||||||
|
@ -114,38 +114,39 @@ ynh_add_systemd_config
|
||||||
# INSTALL HASTEBIN
|
# INSTALL HASTEBIN
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
|
ynh_use_nodejs
|
||||||
script_dir="$PWD"
|
script_dir="$PWD"
|
||||||
pushd "$final_path"
|
pushd "$final_path"
|
||||||
sudo chown -R $app: $final_path
|
chown -R $app: $final_path
|
||||||
sudo npm install
|
npm install
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# Configure haste with config.js file
|
# Configure haste with config.js file
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
sudo cp ../conf/config.js "$DESTDIR"/config.js
|
cp ../conf/config.js "$DESTDIR"/config.js
|
||||||
sudo sed -i "s@YNH_DATA_PATH@$DATA_PATH@g" "$DESTDIR"/config.js
|
sed -i "s@YNH_DATA_PATH@$DATA_PATH@g" "$DESTDIR"/config.js
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# Add HASTE AS A BINARY FILE
|
# Add HASTE AS A BINARY FILE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_replace_string "YNH_HASTE_URL" "${DOMAIN}${path%/}" "../conf/haste.sh"
|
ynh_replace_string "YNH_HASTE_URL" "${DOMAIN}${path%/}" "../conf/haste.sh"
|
||||||
sudo cp ../conf/haste.sh /usr/bin/"$app"
|
cp ../conf/haste.sh /usr/bin/"$app"
|
||||||
sudo chmod +x /usr/bin/"$app"
|
chmod +x /usr/bin/"$app"
|
||||||
|
|
||||||
=================================================
|
=================================================
|
||||||
# ENABLE SERVICE IN ADMIN PANEL
|
# ENABLE SERVICE IN ADMIN PANEL
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# Ajoute le service au monitoring de Yunohost.
|
# Ajoute le service au monitoring de Yunohost.
|
||||||
sudo yunohost service add $app --log "/var/log/$app/$app.log"
|
yunohost service add $app --log "/var/log/$app/$app.log"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# START HASTEBIN IN BACKGROUND
|
# START HASTEBIN IN BACKGROUND
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
sudo systemctl start $app
|
systemctl start $app
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP SSOWAT
|
# SETUP SSOWAT
|
||||||
|
@ -160,4 +161,4 @@ fi
|
||||||
# RELOAD NGINX
|
# RELOAD NGINX
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
sudo systemctl reload nginx
|
systemctl reload nginx
|
||||||
|
|
Loading…
Add table
Reference in a new issue