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

Merge pull request #27 from YunoHost-Apps/testing

Fix installation on RPi and fix permissions
This commit is contained in:
tituspijean 2021-07-04 22:05:05 +02:00 committed by GitHub
commit 47093d1874
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 34 additions and 16 deletions

View file

@ -17,7 +17,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in
Virtual Private Networks (VPN) via WireGuard, with a web UI to ease configuration Virtual Private Networks (VPN) via WireGuard, with a web UI to ease configuration
**Shipped version:** 0.2.7~ynh6 **Shipped version:** 0.2.7~ynh7

View file

@ -13,7 +13,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour
Réseaux Privés Virtuels (VPN) via WireGuard, avec une web UI pour faciliter sa configuration Réseaux Privés Virtuels (VPN) via WireGuard, avec une web UI pour faciliter sa configuration
**Version incluse :** 0.2.7~ynh6 **Version incluse :** 0.2.7~ynh7

View file

@ -6,7 +6,7 @@
"en": "Virtual Private Networks (VPN) via WireGuard, with a web UI to ease configuration", "en": "Virtual Private Networks (VPN) via WireGuard, with a web UI to ease configuration",
"fr": "Réseaux Privés Virtuels (VPN) via WireGuard, avec une web UI pour faciliter sa configuration" "fr": "Réseaux Privés Virtuels (VPN) via WireGuard, avec une web UI pour faciliter sa configuration"
}, },
"version": "0.2.7~ynh6", "version": "0.2.7~ynh7",
"url": "https://github.com/ngoduykhanh/wireguard-ui", "url": "https://github.com/ngoduykhanh/wireguard-ui",
"upstream": { "upstream": {
"license": "MIT", "license": "MIT",

View file

@ -5,7 +5,14 @@
#================================================= #=================================================
# dependencies used by the app # dependencies used by the app
pkg_dependencies="linux-headers-$(uname -r) wireguard-dkms wireguard" if grep "Raspberry Pi" /proc/device-tree/model; then
pkg_headers="raspberrypi-kernel-headers"
else
pkg_headers="linux-headers-$(uname -r)"
fi
# dependencies used by the app
pkg_dependencies="$pkg_headers wireguard-dkms wireguard"
#================================================= #=================================================
# PERSONAL HELPERS # PERSONAL HELPERS

View file

@ -64,7 +64,7 @@ ynh_backup --src_path="/etc/sudoers.d/${app}_ynh"
#================================================= #=================================================
# Backup the wireguard interface config # Backup the wireguard interface config
ynh_backup --src_path=$(jq -r ".config_file_path" $final_path/db/server/global_settings.json) ynh_backup --src_path="/etc/wireguard"
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT

View file

@ -162,11 +162,13 @@ ynh_add_systemd_config --service=wireguard_ui_conf --template=wireguard_ui_conf.
#================================================= #=================================================
# Set permissions to app files # Set permissions to app files
chown -R root: $final_path chmod 750 "$final_path"
chown -R $app: $final_path/db chmod -R o-rwx "$final_path"
chmod -R 750 $final_path/db chown -R $app: "$final_path"
chown -R $app:$app /etc/wireguard chmod 750 /etc/wireguard
chmod -R o-rwx /etc/wireguard
chown -R $app: /etc/wireguard
#================================================= #=================================================
# INTEGRATE SERVICE IN YUNOHOST # INTEGRATE SERVICE IN YUNOHOST

View file

@ -58,6 +58,7 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_script_progression --message="Restoring the app main directory..." --weight=1 ynh_script_progression --message="Restoring the app main directory..." --weight=1
ynh_restore_file --origin_path="$final_path" ynh_restore_file --origin_path="$final_path"
ynh_restore_file --origin_path="/etc/wireguard"
#================================================= #=================================================
# RECREATE THE DEDICATED USER # RECREATE THE DEDICATED USER
@ -75,9 +76,13 @@ ynh_restore_file --origin_path="/etc/sudoers.d/${app}_ynh"
#================================================= #=================================================
# Restore permissions on app files # Restore permissions on app files
chown -R root: $final_path chmod 750 "$final_path"
chown -R $app: $final_path/db chmod -R o-rwx "$final_path"
chmod -R 750 $final_path/db chown -R $app: "$final_path"
chmod 750 /etc/wireguard
chmod -R o-rwx /etc/wireguard
chown -R $app: /etc/wireguard
#================================================= #=================================================
# SPECIFIC RESTORATION # SPECIFIC RESTORATION

View file

@ -199,10 +199,14 @@ ynh_replace_string --match_string="__PORT_WG__" --replace_string="$port_wg" --ta
# SECURE FILES AND DIRECTORIES # SECURE FILES AND DIRECTORIES
#================================================= #=================================================
# Set permissions on app files # Set permissions to app files
chown -R root: $final_path chmod 750 "$final_path"
chown -R $app: $final_path/db chmod -R o-rwx "$final_path"
chmod -R 750 $final_path/db chown -R $app: "$final_path"
chmod 750 /etc/wireguard
chmod -R o-rwx /etc/wireguard
chown -R $app: /etc/wireguard
#================================================= #=================================================
# INTEGRATE SERVICE IN YUNOHOST # INTEGRATE SERVICE IN YUNOHOST