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

remove arch helper (#68)

* remove arch helper
This commit is contained in:
Éric Gaspar 2021-11-23 22:19:40 +01:00 committed by GitHub
parent 18885ecf4d
commit b9164a623c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 43 additions and 40 deletions

View file

@ -1,6 +0,0 @@
SOURCE_URL=https://github.com/YunoHost-Apps/galene_ynh/releases/download/v0.4.1/galene_0.4.1_Linux_arm6.tar.gz
SOURCE_SUM=4a017aa340f81494a14414485ffccc53b461b58c2e70bc178f6037c65ddf534c
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true
SOURCE_EXTRACT=true

View file

@ -1,10 +1,5 @@
location / {
# Force usage of https
if ($scheme = http) {
rewrite ^ https://$server_name$request_uri? permanent;
}
proxy_pass https://127.0.0.1:__PORT__;
proxy_redirect off;
proxy_set_header Host $host;

View file

@ -22,7 +22,7 @@
"email": ""
},
"requirements": {
"yunohost": ">= 4.2.8"
"yunohost": ">= 4.3.0"
},
"multi_instance": false,
"services": [

View file

@ -15,29 +15,3 @@
#=================================================
# FUTURE OFFICIAL HELPERS
#=================================================
# Check the architecture
#
# example: architecture=$(ynh_detect_arch)
#
# usage: ynh_detect_arch
#
# Requires YunoHost version 2.2.4 or higher.
ynh_detect_arch(){
local architecture
if [ -n "$(uname -m | grep arm64)" ] || [ -n "$(uname -m | grep aarch64)" ]; then
architecture="arm64"
elif [ -n "$(uname -m | grep 64)" ]; then
architecture="amd64"
elif [ -n "$(uname -m | grep 86)" ]; then
architecture="386"
elif [ -n "$(uname -m | grep armv7)" ]; then
architecture="arm7"
elif [ -n "$(uname -m | grep armv6)" ]; then
architecture="arm6"
else
architecture="unknown"
fi
echo $architecture
}

View file

@ -50,6 +50,12 @@ ynh_backup --src_path="$datadir" --is_big
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# BACKUP LOGROTATE
#=================================================
ynh_backup --src_path="/etc/logrotate.d/$app"
#=================================================
# BACKUP SYSTEMD
#=================================================

View file

@ -27,7 +27,7 @@ is_public=$YNH_APP_ARG_IS_PUBLIC
password=$YNH_APP_ARG_PASSWORD
group_name=$YNH_APP_ARG_GROUP_NAME
group_description=$YNH_APP_ARG_GROUP_DESCRIPTION
architecture=$(ynh_detect_arch)
architecture=$YNH_ARCH
app=$YNH_APP_INSTANCE_NAME
@ -53,6 +53,7 @@ ynh_app_setting_set --app=$app --key=admin --value=$admin
ynh_app_setting_set --app=$app --key=password --value=$password
ynh_app_setting_set --app=$app --key=group_name --value="$group_name"
ynh_app_setting_set --app=$app --key=group_description --value="$group_description"
ynh_app_setting_set --app=$app --key=architecture --value=$architecture
#=================================================
# STANDARD MODIFICATIONS
@ -149,6 +150,14 @@ ynh_add_systemd_config
# Create a group name config
ynh_add_config --template="../conf/groupname.json" --destination="$datadir/groups/$group_name.json"
#=================================================
# SETUP LOGROTATE
#=================================================
ynh_script_progression --message="Configuring log rotation..." --weight=1
# Use logrotate to manage application logfile(s)
ynh_use_logrotate
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
#=================================================

View file

@ -43,6 +43,14 @@ ynh_script_progression --message="Stopping and removing the systemd service..."
# Remove the dedicated systemd config
ynh_remove_systemd_config
#=================================================
# REMOVE LOGROTATE CONFIGURATION
#=================================================
ynh_script_progression --message="Removing logrotate configuration..." --weight=1
# Remove the app-specific logrotate config
ynh_remove_logrotate
#=================================================
# REMOVE APP MAIN DIR
#=================================================

View file

@ -87,6 +87,13 @@ ynh_script_progression --message="Restoring the systemd configuration..." --weig
ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
systemctl enable $app.service --quiet
#=================================================
# RESTORE THE LOGROTATE CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring the logrotate configuration..." --weight=1
ynh_restore_file --origin_path="/etc/logrotate.d/$app"
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
#=================================================

View file

@ -24,7 +24,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
group_name=$(ynh_app_setting_get --app=$app --key=group_name)
port=$(ynh_app_setting_get --app=$app --key=port)
turn_port=$(ynh_app_setting_get --app=$app --key=turn_port)
architecture=$(ynh_detect_arch)
architecture=$YNH_ARCH
if ynh_compare_current_package_version --comparison le --version 0.3.5~ynh3
then
@ -100,6 +100,8 @@ if [ "$upgrade_type" == "UPGRADE_APP" ]
then
ynh_script_progression --message="Upgrading source files..." --weight=2
# Remove the app directory securely
ynh_secure_remove --file=$final_path
ynh_setup_source --dest_dir="$final_path" --source_id="$architecture" #--keep="$final_path/data/config.json"
fi
@ -143,6 +145,14 @@ public_ip4="$(curl -s ip.yunohost.org)" || true
# Create a dedicated systemd config
ynh_add_systemd_config
#=================================================
# SETUP LOGROTATE
#=================================================
ynh_script_progression --message="Upgrading logrotate configuration..." --weight=1
# Use logrotate to manage app-specific logfile(s)
ynh_use_logrotate --non-append
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
#=================================================