1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/headscale_ynh.git synced 2024-09-03 19:25:53 +02:00

Merge pull request #3 from YunoHost-Apps/testing

Testing
This commit is contained in:
tituspijean 2023-09-09 19:11:11 +02:00 committed by GitHub
commit f278309033
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 50 additions and 7 deletions

View file

@ -199,7 +199,9 @@ dns_config:
# List of DNS servers to expose to clients.
nameservers:
- 1.1.1.1
- 127.0.0.1
- 89.234.141.66
- 2a00:5881:8100:1000::3
# NextDNS (see https://tailscale.com/kb/1218/nextdns/).
# "abc123" is example NextDNS ID, replace with yours.

4
conf/dnsmasq Normal file
View file

@ -0,0 +1,4 @@
# Created by __APP__
# We assume that only one tailscale installation exists on the server, replace `tailscale0` below if needed
interface=tailscale0
server=/__BASE_DOMAIN__/100.100.100.100

View file

@ -18,7 +18,7 @@ cpe = "cpe:2.3:a:tailscale:tailscale"
fund = "https://ko-fi.com/headscale"
[integration]
yunohost = ">= 11.0.0"
yunohost = ">= 11.2"
architectures = "all"
multi_instance = false
ldap = true
@ -41,10 +41,14 @@ ram.runtime = "50M"
ask.en = "Choose the path to install Dex on."
default = "/dex"
[install.init_main_permission]
type = "group"
default = "visitors"
[install.base_domain]
type = "domain"
type = "string"
ask.en = "Choose the base domain for Headscale's MagicDNS feature"
help.en = "MagicDNS will allow you to access your hosts with a domain like `myhost.username.basedomain.tld`"
help.en = "MagicDNS will allow you to access your hosts with a domain like `myhost.username.basedomain.tld`. It can be from a fake TLD, but beware of conflicts."
[resources]
[resources.sources.main]
@ -58,8 +62,8 @@ ram.runtime = "50M"
arm64.sha256 = "c36b469a30e87efc6616abd7f8df429de2a11896d311037580ac0b9c2f6b53a6"
armhf.url = "https://github.com/juanfont/headscale/releases/download/v0.22.3/headscale_0.22.3_linux_armv7"
armhf.sha256 = "4711fd03c9f5d814eb4c85be9939f167ce7aa40510cda2133c9f63810ead395d"
armel.url = "https://github.com/juanfont/headscale/releases/download/v0.22.3/headscale_0.22.3_linux_armv5"
armel.sha256 = "3a983ea320b05372b5493ece01bab1252907e0864a26f1857dbcd7307dfc463f"
#armel.url = "https://github.com/juanfont/headscale/releases/download/v0.22.3/headscale_0.22.3_linux_armv5"
#armel.sha256 = "3a983ea320b05372b5493ece01bab1252907e0864a26f1857dbcd7307dfc463f"
autoupdate.strategy = "latest_github_release"
autoupdate.asset.i386 = ".*_linux_386$"

View file

@ -41,6 +41,12 @@ ynh_backup --src_path="/etc/logrotate.d/$app"
ynh_backup --src_path="/etc/systemd/system/$app.service"
#=================================================
# BACKUP DNSMASQ CONFIG
#=================================================
ynh_backup --src_path="/etc/dnsmasq.d/$app"
#=================================================
# BACKUP THE DATABASE
#=================================================

View file

@ -75,6 +75,10 @@ ynh_add_config --template="config.yaml" --destination="$install_dir/config.yaml"
chmod 600 "$install_dir/config.yaml"
chown $app:$app "$install_dir/config.yaml"
# Add dnsmasq configuration to avoid overriding resolvconf
ynh_add_config --template="dnsmasq" --destination="/etc/dnsmasq.d/$app"
ynh_systemd_action --service_name="dnsmasq" --action="reload"
#=================================================
# SETUP SYSTEMD
#=================================================

View file

@ -73,6 +73,10 @@ ynh_script_progression --message="Removing various files..." --weight=1
# Remove the log files
ynh_secure_remove --file="/var/log/$app"
# Remove dnsmasq configuration
ynh_secure_remove --file="/etc/dnsmasq.d/$app"
ynh_systemd_action --service_name=dnsmasq --action="reload"
#=================================================
# GENERIC FINALIZATION
#=================================================

View file

@ -46,6 +46,14 @@ ynh_script_progression --message="Restoring the logrotate configuration..." --we
ynh_restore_file --origin_path="/etc/logrotate.d/$app"
#=================================================
# RESTORE THE DNSMASQ CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring the dnsmasq configuration..." --weight=1
ynh_restore_file --origin_path="/etc/dnsmasq.d/$app"
ynh_systemd_action --service_name="dnsmasq" --action="reload"
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
#=================================================

View file

@ -13,6 +13,17 @@ upgrade_type=$(ynh_check_app_version_changed)
#=================================================
# STANDARD UPGRADE STEPS
#=================================================
# ENSURE DOWNWARD COMPATIBILITY
#=================================================
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
if [ ! -f "/etc/dnsmasq.d/$app" ]; then
# Add dnsmasq configuration to avoid overriding resolvconf
ynh_add_config --template="dnsmasq" --destination="/etc/dnsmasq.d/$app"
ynh_systemd_action --service_name="dnsmasq" --action="reload"
fi
#=================================================
# STOP SYSTEMD SERVICE
#=================================================

View file

@ -6,7 +6,7 @@ test_format = 1.0
sudo yunohost domain add dex-headscale.domain.tld
"""
exclude = ["change_url"]
exclude = [ "install.private", "change_url" ]
args.domain = "sub.domain.tld"
args.dex_domain = "dex-headscale.domain.tld"