From ac5b49d8463c9aaf412b75d89b98562d96d37ab3 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sun, 10 May 2026 00:27:08 +0200 Subject: [PATCH 01/17] Upgrade sources - `main` v15.2.0: https://github.com/TechnitiumSoftware/DnsServer/releases/tag/15.2.0 --- manifest.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manifest.toml b/manifest.toml index a9c483f..db1a8f4 100644 --- a/manifest.toml +++ b/manifest.toml @@ -7,7 +7,7 @@ name = "Technitium DNS" description.en = "DNS server for privacy and security" description.fr = "Serveur DNS pour la confidentialité et la sécurité" -version = "14.3.0~ynh1" +version = "15.2.0~ynh1" maintainers = ["Navan Chauhan"] @@ -44,8 +44,8 @@ ram.runtime = "50M" [resources] [resources.sources.main] - url = "https://download.technitium.com/dns/archive/14.3.0/DnsServerPortable.tar.gz" - sha256 = "9b2deaa54378e5abef1917907876ef2d0c89e0b6d09fc494e6a799b6316adea7" + url = "https://github.com/TechnitiumSoftware/DnsServer/archive/refs/tags/v15.2.0.tar.gz" + sha256 = "9247b3c70a8f58d336741819b4550b29937815dc535d1cc0f36ffd7cedb8860c" in_subdir = false # Careful, this autoupdate does not put the right asset, it only serves as a notification! autoupdate.strategy = "latest_github_tag" From 1761677be49d60687c0a4b5d70450e6eae7ec115 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sun, 10 May 2026 00:27:09 +0200 Subject: [PATCH 02/17] Auto-update READMEs --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 01273e0..c42f3bf 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ It shall NOT be edited by hand. DNS server for privacy and security [![🌐 Official app website](https://img.shields.io/badge/Official_app_website-darkgreen?style=for-the-badge)](https://technitium.com/dns/) -[![Version: 14.3.0~ynh1](https://img.shields.io/badge/Version-14.3.0~ynh1-rgb(18,138,11)?style=for-the-badge)](https://ci-apps.yunohost.org/ci/apps/technitium-dns/) +[![Version: 15.2.0~ynh1](https://img.shields.io/badge/Version-15.2.0~ynh1-rgb(18,138,11)?style=for-the-badge)](https://ci-apps.yunohost.org/ci/apps/technitium-dns/)
From 8b4d40c8778209690bc32228d8530a966ddfeeb5 Mon Sep 17 00:00:00 2001 From: orhtej2 <2871798+orhtej2@users.noreply.github.com> Date: Mon, 11 May 2026 12:31:07 +0200 Subject: [PATCH 03/17] Use dotnet runtime 10.x --- manifest.toml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/manifest.toml b/manifest.toml index db1a8f4..8893dcd 100644 --- a/manifest.toml +++ b/manifest.toml @@ -53,12 +53,13 @@ ram.runtime = "50M" autoupdate.needs_manual_tweaks = true [resources.sources.dotnet] - amd64.url = "https://builds.dotnet.microsoft.com/dotnet/aspnetcore/Runtime/9.0.11/aspnetcore-runtime-9.0.11-linux-x64.tar.gz" - amd64.sha256 = "9c72253df8cbdbc775c76d6dcefc057aabb0bf7c978e5c3f24ab0afed839fd1f" - arm64.url = "https://builds.dotnet.microsoft.com/dotnet/aspnetcore/Runtime/9.0.11/aspnetcore-runtime-9.0.11-linux-arm64.tar.gz" - arm64.sha256 = "d039cbb3ef822aad0226857c1d89763c9c2a4bf339015bb11c99a7f6e62d3062" - armhf.url = "https://builds.dotnet.microsoft.com/dotnet/aspnetcore/Runtime/9.0.11/aspnetcore-runtime-9.0.11-linux-arm.tar.gz" - armhf.sha256 = "6ef6521e262d05302f3e52026d59b8464ae881fc983671c20e3a9e4034d7a99c" + amd64.url = "https://builds.dotnet.microsoft.com/dotnet/Runtime/10.0.7/dotnet-runtime-10.0.7-linux-x64.tar.gz" + amd64.sha256 = "825c0e34e405314c225713990601908435cb9b10cd2292fc1174eb0cde513f87" + arm64.url = "https://builds.dotnet.microsoft.com/dotnet/Runtime/10.0.7/dotnet-runtime-10.0.7-linux-arm64.tar.gz" + arm64.sha256 = "df43a2fdbb23b8692242e1838bcc2419faaeab613db950c7f1bf33f3b03cce1c" + armhf.url = "https://builds.dotnet.microsoft.com/dotnet/Runtime/10.0.7/dotnet-runtime-10.0.7-linux-arm.tar.gz" + armhf.sha256 = "022197ba766f61ca403db1210b56d47986f6d51a205afb2db34f027a27cd99c0" + in_subdir = false [resources.system_user] From ccf06c46ab8ae34524c89562e14338fd498f23ac Mon Sep 17 00:00:00 2001 From: orhtej2 <2871798+orhtej2@users.noreply.github.com> Date: Mon, 11 May 2026 13:06:13 +0200 Subject: [PATCH 04/17] Use prebuilts --- manifest.toml | 6 ++++++ scripts/install | 2 +- scripts/upgrade | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/manifest.toml b/manifest.toml index 8893dcd..6ac5c81 100644 --- a/manifest.toml +++ b/manifest.toml @@ -51,6 +51,12 @@ ram.runtime = "50M" autoupdate.strategy = "latest_github_tag" autoupdate.asset = "tarball" autoupdate.needs_manual_tweaks = true + prefetch = false + + [resources.sources.prebuilt] + url = "https://download.technitium.com/dns/archive/15.2.0/DnsServerPortable.tar.gz" + sha256 = "2e39fb8d0718475790cc025e083a1bcfd837a5e79e4a1d0ed775881bd90287ef" + in_subdir = false [resources.sources.dotnet] amd64.url = "https://builds.dotnet.microsoft.com/dotnet/Runtime/10.0.7/dotnet-runtime-10.0.7-linux-x64.tar.gz" diff --git a/scripts/install b/scripts/install index 9343b05..fbff4ad 100755 --- a/scripts/install +++ b/scripts/install @@ -12,7 +12,7 @@ source /usr/share/yunohost/helpers ynh_script_progression "Setting up source files..." # Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source --dest_dir="$install_dir/sources" +ynh_setup_source --source_id="prebuilt" --dest_dir="$install_dir/sources" ynh_setup_source --source_id="dotnet" --dest_dir="$install_dir/dotnet" #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 4e0d8e2..f4d19dc 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -30,7 +30,7 @@ fi ynh_script_progression "Upgrading source files..." # Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source --dest_dir="$install_dir/sources" --full_replace +ynh_setup_source --source_id="prebuilt" --dest_dir="$install_dir/sources" --full_replace ynh_setup_source --source_id="dotnet" --dest_dir="$install_dir/dotnet" --full_replace #================================================= From 03e90c93811767e7b3ede6f0793cb7f362bc9ae4 Mon Sep 17 00:00:00 2001 From: orhtej2 <2871798+orhtej2@users.noreply.github.com> Date: Mon, 11 May 2026 13:52:23 +0200 Subject: [PATCH 05/17] Tweak location path --- manifest.toml | 12 ++++++------ scripts/install | 2 +- scripts/restore | 2 ++ scripts/upgrade | 2 +- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/manifest.toml b/manifest.toml index 6ac5c81..19e4e68 100644 --- a/manifest.toml +++ b/manifest.toml @@ -59,12 +59,12 @@ ram.runtime = "50M" in_subdir = false [resources.sources.dotnet] - amd64.url = "https://builds.dotnet.microsoft.com/dotnet/Runtime/10.0.7/dotnet-runtime-10.0.7-linux-x64.tar.gz" - amd64.sha256 = "825c0e34e405314c225713990601908435cb9b10cd2292fc1174eb0cde513f87" - arm64.url = "https://builds.dotnet.microsoft.com/dotnet/Runtime/10.0.7/dotnet-runtime-10.0.7-linux-arm64.tar.gz" - arm64.sha256 = "df43a2fdbb23b8692242e1838bcc2419faaeab613db950c7f1bf33f3b03cce1c" - armhf.url = "https://builds.dotnet.microsoft.com/dotnet/Runtime/10.0.7/dotnet-runtime-10.0.7-linux-arm.tar.gz" - armhf.sha256 = "022197ba766f61ca403db1210b56d47986f6d51a205afb2db34f027a27cd99c0" + amd64.url = "https://builds.dotnet.microsoft.com/dotnet/aspnetcore/Runtime/10.0.7/aspnetcore-runtime-10.0.7-linux-x64.tar.gz" + amd64.sha256 = "e7371614247bbc481196434d3cc2095e187b569c1929ab5c1af056682f1ca512" + arm64.url = "https://builds.dotnet.microsoft.com/dotnet/aspnetcore/Runtime/10.0.7/aspnetcore-runtime-10.0.7-linux-arm64.tar.gz" + arm64.sha256 = "5c95e878081d8b0476f36ff141a965573cecbc37f2e0555d2374b49d67572b00" + armhf.url = "https://builds.dotnet.microsoft.com/dotnet/aspnetcore/Runtime/10.0.7/aspnetcore-runtime-10.0.7-linux-arm.tar.gz" + armhf.sha256 = "79c4f9fbc5d028c939acb8bdc3899d1e788e2bad032d9a09f22eb21c9a9b8d16" in_subdir = false [resources.system_user] diff --git a/scripts/install b/scripts/install index fbff4ad..05f23ed 100755 --- a/scripts/install +++ b/scripts/install @@ -28,7 +28,7 @@ ynh_config_add_systemd yunohost service add "$app" --description="Technitium DNS Server" --log="/var/log/$app/$app.log" --needs_exposed_ports="53" # Use logrotate to manage application logfile(s) -ynh_config_add_logrotate +ynh_config_add_logrotate /var/log/technitium/dns #================================================= # START SYSTEMD SERVICE diff --git a/scripts/restore b/scripts/restore index eae210f..212518f 100755 --- a/scripts/restore +++ b/scripts/restore @@ -32,6 +32,8 @@ systemctl enable "$app.service" --quiet yunohost service add "$app" --description="Technitium DNS Server" --log="/var/log/$app/$app.log" --needs_exposed_ports=53 ynh_restore "/etc/logrotate.d/$app" +mkdir -p /var/log/technitium/dns +chown -R $app:$app /var/log/technitium #================================================= # START SYSTEMD SERVICE diff --git a/scripts/upgrade b/scripts/upgrade index f4d19dc..79c3d94 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -46,7 +46,7 @@ ynh_config_add_systemd yunohost service add "$app" --description="Technitium DNS Server" --log="/var/log/$app/$app.log" --needs_exposed_ports=53 # Use logrotate to manage app-specific logfile(s) -ynh_config_add_logrotate +ynh_config_add_logrotate /var/log/technitium/dns #================================================= # START SYSTEMD SERVICE From c84cece0bd6fc46dab491a71d9e0e5fc3fc8e090 Mon Sep 17 00:00:00 2001 From: orhtej2 <2871798+orhtej2@users.noreply.github.com> Date: Mon, 11 May 2026 14:16:05 +0200 Subject: [PATCH 06/17] Tweaks to service start --- scripts/backup | 2 +- scripts/change_url | 4 ++-- scripts/install | 4 ++-- scripts/restore | 4 ++-- scripts/upgrade | 6 +++--- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/scripts/backup b/scripts/backup index 675405d..c7a5f5a 100755 --- a/scripts/backup +++ b/scripts/backup @@ -34,7 +34,7 @@ ynh_backup "/etc/systemd/system/$app.service" # BACKUP VARIOUS FILES #================================================= -ynh_backup "/var/log/$app/" +ynh_backup "/var/log/technitium/" #================================================= # END OF SCRIPT diff --git a/scripts/change_url b/scripts/change_url index 376c641..5882bc4 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -11,7 +11,7 @@ source /usr/share/yunohost/helpers #================================================= ynh_script_progression "Stopping $app's systemd service..." -ynh_systemctl --service="$app" --action="stop" +ynh_systemctl --service="$app" --action="stop" --wait_until="was stopped successfully" #================================================= # MODIFY URL IN NGINX CONF @@ -25,7 +25,7 @@ ynh_config_change_url_nginx #================================================= ynh_script_progression "Starting $app's systemd service..." -ynh_systemctl --service="$app" --action="start" +ynh_systemctl --service="$app" --action="start" --wait_until="in web browser to access web console." #================================================= # END OF SCRIPT diff --git a/scripts/install b/scripts/install index 05f23ed..235cb8a 100755 --- a/scripts/install +++ b/scripts/install @@ -25,7 +25,7 @@ ynh_config_add_nginx # Create a dedicated systemd config ynh_config_add_systemd -yunohost service add "$app" --description="Technitium DNS Server" --log="/var/log/$app/$app.log" --needs_exposed_ports="53" +yunohost service add "$app" --description="Technitium DNS Server" --log="/var/log/technitium/$app.log" --needs_exposed_ports="53" # Use logrotate to manage application logfile(s) ynh_config_add_logrotate /var/log/technitium/dns @@ -36,7 +36,7 @@ ynh_config_add_logrotate /var/log/technitium/dns ynh_script_progression "Starting $app's systemd service..." # Start a systemd service -ynh_systemctl --service="$app" --action="start" +ynh_systemctl --service="$app" --action="start" --wait_until="in web browser to access web console." #================================================= # END OF SCRIPT diff --git a/scripts/restore b/scripts/restore index 212518f..24d9b08 100755 --- a/scripts/restore +++ b/scripts/restore @@ -29,7 +29,7 @@ ynh_restore "/etc/nginx/conf.d/$domain.d/$app.conf" ynh_restore "/etc/systemd/system/$app.service" systemctl enable "$app.service" --quiet -yunohost service add "$app" --description="Technitium DNS Server" --log="/var/log/$app/$app.log" --needs_exposed_ports=53 +yunohost service add "$app" --description="Technitium DNS Server" --log="/var/log/technitium/$app.log" --needs_exposed_ports=53 ynh_restore "/etc/logrotate.d/$app" mkdir -p /var/log/technitium/dns @@ -40,7 +40,7 @@ chown -R $app:$app /var/log/technitium #================================================= ynh_script_progression "Starting $app's systemd service..." -ynh_systemctl --service="$app" --action="start" +ynh_systemctl --service="$app" --action="start" --wait_until="in web browser to access web console." #================================================= # RELOAD NGINX diff --git a/scripts/upgrade b/scripts/upgrade index 79c3d94..6267bb8 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -11,7 +11,7 @@ source /usr/share/yunohost/helpers #================================================= ynh_script_progression "Stopping $app's systemd service..." -ynh_systemctl --service=$app --action="stop" +ynh_systemctl --service=$app --action="stop" --wait_until="was stopped successfully" #================================================= # ENSURE DOWNWARD COMPATIBILITY @@ -43,7 +43,7 @@ ynh_config_add_nginx # Create a dedicated systemd config ynh_config_add_systemd -yunohost service add "$app" --description="Technitium DNS Server" --log="/var/log/$app/$app.log" --needs_exposed_ports=53 +yunohost service add "$app" --description="Technitium DNS Server" --log="/var/log/technitium/$app.log" --needs_exposed_ports=53 # Use logrotate to manage app-specific logfile(s) ynh_config_add_logrotate /var/log/technitium/dns @@ -53,7 +53,7 @@ ynh_config_add_logrotate /var/log/technitium/dns #================================================= ynh_script_progression "Starting $app's systemd service..." -ynh_systemctl --service="$app" --action="start" +ynh_systemctl --service="$app" --action="start" --wait_until="in web browser to access web console." #================================================= # END OF SCRIPT From 4f74409542eb12eb522f13ff475310707082e0a1 Mon Sep 17 00:00:00 2001 From: orhtej2 <2871798+orhtej2@users.noreply.github.com> Date: Mon, 11 May 2026 14:22:59 +0200 Subject: [PATCH 07/17] Update install --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 235cb8a..b96497b 100755 --- a/scripts/install +++ b/scripts/install @@ -36,7 +36,7 @@ ynh_config_add_logrotate /var/log/technitium/dns ynh_script_progression "Starting $app's systemd service..." # Start a systemd service -ynh_systemctl --service="$app" --action="start" --wait_until="in web browser to access web console." +ynh_systemctl --service="$app" --action="start" --wait_until="^.*in web browser to access web console\\.$" #================================================= # END OF SCRIPT From efee1e5c05167dac701022ae79526aa98a73ecac Mon Sep 17 00:00:00 2001 From: trendless Date: Mon, 15 Jun 2026 18:39:50 -0600 Subject: [PATCH 08/17] adjust logging for v15 changes --- conf/logsymlink.cron | 1 + conf/systemd.service | 2 +- scripts/backup | 8 +------- scripts/change_url | 4 ++-- scripts/install | 24 ++++++++++++++++-------- scripts/remove | 9 +++------ scripts/restore | 14 +++++++++----- scripts/upgrade | 24 ++++++++++++++++-------- 8 files changed, 49 insertions(+), 37 deletions(-) create mode 100644 conf/logsymlink.cron diff --git a/conf/logsymlink.cron b/conf/logsymlink.cron new file mode 100644 index 0000000..ebac0a6 --- /dev/null +++ b/conf/logsymlink.cron @@ -0,0 +1 @@ +0,15,30,45 0 * * * ln -sf $(ls -t /var/log/__APP__/dns/*.log | head -n 1) /var/log/__APP__/__APP__.log \ No newline at end of file diff --git a/conf/systemd.service b/conf/systemd.service index bd24e65..e608a57 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -9,10 +9,10 @@ Group=__APP__ WorkingDirectory=__INSTALL_DIR__/sources/ ExecStart=__INSTALL_DIR__/dotnet/dotnet __INSTALL_DIR__/sources/DnsServerApp.dll __DATA_DIR__ Restart=always -# Restart service after 10 seconds if the dotnet service crashes: RestartSec=10 KillSignal=SIGINT SyslogIdentifier=dns-server +Environment=DNS_SERVER_LOG_FOLDER_PATH=/var/log/__APP__/dns [Install] WantedBy=multi-user.target diff --git a/scripts/backup b/scripts/backup index c7a5f5a..edcfa03 100755 --- a/scripts/backup +++ b/scripts/backup @@ -11,30 +11,24 @@ ynh_print_info "Declaring files to be backed up..." #================================================= # BACKUP THE APP MAIN DIR #================================================= - ynh_backup "$install_dir" #================================================= # BACKUP THE DATA DIR #================================================= - ynh_backup "$data_dir" #================================================= # SYSTEM CONFIGURATION #================================================= - ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf" -ynh_backup "/etc/logrotate.d/$app" - ynh_backup "/etc/systemd/system/$app.service" #================================================= # BACKUP VARIOUS FILES #================================================= - -ynh_backup "/var/log/technitium/" +ynh_backup "/var/log/$app" #================================================= # END OF SCRIPT diff --git a/scripts/change_url b/scripts/change_url index 5882bc4..4c167dd 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -11,7 +11,7 @@ source /usr/share/yunohost/helpers #================================================= ynh_script_progression "Stopping $app's systemd service..." -ynh_systemctl --service="$app" --action="stop" --wait_until="was stopped successfully" +ynh_systemctl --service="$app" --action="stop" --log_path=systemd --wait_until="was stopped successfully" #================================================= # MODIFY URL IN NGINX CONF @@ -25,7 +25,7 @@ ynh_config_change_url_nginx #================================================= ynh_script_progression "Starting $app's systemd service..." -ynh_systemctl --service="$app" --action="start" --wait_until="in web browser to access web console." +ynh_systemctl --service="$app" --action="start" --log_path=systemd --wait_until="was started successfully" #================================================= # END OF SCRIPT diff --git a/scripts/install b/scripts/install index b96497b..39fe304 100755 --- a/scripts/install +++ b/scripts/install @@ -11,7 +11,6 @@ source /usr/share/yunohost/helpers #================================================= ynh_script_progression "Setting up source files..." -# Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --source_id="prebuilt" --dest_dir="$install_dir/sources" ynh_setup_source --source_id="dotnet" --dest_dir="$install_dir/dotnet" @@ -20,23 +19,32 @@ ynh_setup_source --source_id="dotnet" --dest_dir="$install_dir/dotnet" #================================================= ynh_script_progression "Adding system configurations related to $app..." -# Create a dedicated NGINX config ynh_config_add_nginx -# Create a dedicated systemd config ynh_config_add_systemd -yunohost service add "$app" --description="Technitium DNS Server" --log="/var/log/technitium/$app.log" --needs_exposed_ports="53" -# Use logrotate to manage application logfile(s) -ynh_config_add_logrotate /var/log/technitium/dns +mkdir -p "/var/log/$app/dns" +chown -R "$app:$app" "/var/log/$app" + +yunohost service add "$app" --description="Technitium DNS Server" --log="/var/log/$app/$app.log" --needs_exposed_ports="53" + +#================================================= +# ADD A CRON JOB +#================================================= +ynh_config_add --template="logsymlink.cron" --destination="/etc/cron.d/$app" +chmod 644 "/etc/cron.d/$app" #================================================= # START SYSTEMD SERVICE #================================================= ynh_script_progression "Starting $app's systemd service..." -# Start a systemd service -ynh_systemctl --service="$app" --action="start" --wait_until="^.*in web browser to access web console\\.$" +ynh_systemctl --service="$app" --action="restart" --log_path=systemd --wait_until="was started successfully" + +#================================================= +# LINK LOGS +#================================================= +ln -sf $(ls -t /var/log/$app/dns/*.log | head -n 1) /var/log/$app/$app.log #================================================= # END OF SCRIPT diff --git a/scripts/remove b/scripts/remove index 59c5469..0e8c640 100755 --- a/scripts/remove +++ b/scripts/remove @@ -16,16 +16,13 @@ if ynh_hide_warnings yunohost service status "$app" >/dev/null; then yunohost service remove "$app" fi -# Remove the dedicated systemd config ynh_config_remove_systemd -# Remove the app-specific logrotate config -ynh_config_remove_logrotate - -# Remove the dedicated NGINX config ynh_config_remove_nginx -# Remove the log files +ynh_safe_rm "/var/log/$app" + +ynh_safe_rm "/etc/cron.d/$app" #================================================= # END OF SCRIPT diff --git a/scripts/restore b/scripts/restore index 24d9b08..ff6bc9a 100755 --- a/scripts/restore +++ b/scripts/restore @@ -27,20 +27,24 @@ ynh_script_progression "Restoring system configurations related to $app..." ynh_restore "/etc/nginx/conf.d/$domain.d/$app.conf" +ynh_restore "/var/log/$app" + ynh_restore "/etc/systemd/system/$app.service" systemctl enable "$app.service" --quiet -yunohost service add "$app" --description="Technitium DNS Server" --log="/var/log/technitium/$app.log" --needs_exposed_ports=53 +yunohost service add "$app" --description="Technitium DNS Server" --log="/var/log/$app/$app.log" --needs_exposed_ports=53 -ynh_restore "/etc/logrotate.d/$app" -mkdir -p /var/log/technitium/dns -chown -R $app:$app /var/log/technitium +#================================================= +# ADD A CRON JOB +#================================================= +ynh_config_add --template="logsymlink.cron" --destination="/etc/cron.d/$app" +chmod 644 "/etc/cron.d/$app" #================================================= # START SYSTEMD SERVICE #================================================= ynh_script_progression "Starting $app's systemd service..." -ynh_systemctl --service="$app" --action="start" --wait_until="in web browser to access web console." +ynh_systemctl --service="$app" --action="start" --log_path=systemd --wait_until="was started successfully" #================================================= # RELOAD NGINX diff --git a/scripts/upgrade b/scripts/upgrade index 6267bb8..2342651 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -11,7 +11,7 @@ source /usr/share/yunohost/helpers #================================================= ynh_script_progression "Stopping $app's systemd service..." -ynh_systemctl --service=$app --action="stop" --wait_until="was stopped successfully" +ynh_systemctl --service="$app" --action="stop" --log_path=systemd --wait_until="was stopped successfully" #================================================= # ENSURE DOWNWARD COMPATIBILITY @@ -24,12 +24,19 @@ if [ ! -d "$install_dir/dotnet" ]; then ynh_safe_rm "/usr/bin/dotnet" fi +if ynh_app_upgrading_from_version_before_or_equal_to 14.3.0~ynh1; then + mkdir -p "/var/log/$app" + mv "$data_dir/logs" "/var/log/$app/dns" + chown -R "$app:$app" "/var/log/$app" + ln -sf "/var/log/$app/dns" "$data_dir/logs" + ln -sf $(ls -t /var/log/$app/dns/*.log | head -n 1) /var/log/$app/$app.log +fi + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= ynh_script_progression "Upgrading source files..." -# Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --source_id="prebuilt" --dest_dir="$install_dir/sources" --full_replace ynh_setup_source --source_id="dotnet" --dest_dir="$install_dir/dotnet" --full_replace @@ -38,22 +45,23 @@ ynh_setup_source --source_id="dotnet" --dest_dir="$install_dir/dotnet" --full_re #================================================= ynh_script_progression "Upgrading system configurations related to $app..." -# Create a dedicated NGINX config ynh_config_add_nginx -# Create a dedicated systemd config ynh_config_add_systemd -yunohost service add "$app" --description="Technitium DNS Server" --log="/var/log/technitium/$app.log" --needs_exposed_ports=53 +yunohost service add "$app" --description="Technitium DNS Server" --log="/var/log/$app/$app.log" --needs_exposed_ports=53 -# Use logrotate to manage app-specific logfile(s) -ynh_config_add_logrotate /var/log/technitium/dns +#================================================= +# ADD A CRON JOB +#================================================= +ynh_config_add --template="logsymlink.cron" --destination="/etc/cron.d/$app" +chmod 644 "/etc/cron.d/$app" #================================================= # START SYSTEMD SERVICE #================================================= ynh_script_progression "Starting $app's systemd service..." -ynh_systemctl --service="$app" --action="start" --wait_until="in web browser to access web console." +ynh_systemctl --service="$app" --action="start" --log_path=systemd --wait_until="was started successfully" #================================================= # END OF SCRIPT From 251cfb6975fbf9553ba85b561025f981f7a48ed9 Mon Sep 17 00:00:00 2001 From: trendless Date: Mon, 15 Jun 2026 18:56:47 -0600 Subject: [PATCH 09/17] remove: leave logs rm to core --- scripts/remove | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/remove b/scripts/remove index 0e8c640..1962fa5 100755 --- a/scripts/remove +++ b/scripts/remove @@ -20,8 +20,6 @@ ynh_config_remove_systemd ynh_config_remove_nginx -ynh_safe_rm "/var/log/$app" - ynh_safe_rm "/etc/cron.d/$app" #================================================= From 4f54fdaf434155c6ad6862768025a02b2e79036c Mon Sep 17 00:00:00 2001 From: trendless Date: Mon, 15 Jun 2026 19:06:15 -0600 Subject: [PATCH 10/17] dnsmasq coexistence --- conf/dnsmasq.conf | 2 ++ conf/systemd.service | 2 ++ doc/PRE_UPGRADE.d/15.2.0~ynh1.md | 1 + scripts/install | 39 +++++++++++++++++++++++++++++--- scripts/remove | 4 ++++ scripts/restore | 7 ++++++ scripts/upgrade | 3 +++ 7 files changed, 55 insertions(+), 3 deletions(-) create mode 100644 conf/dnsmasq.conf create mode 100644 doc/PRE_UPGRADE.d/15.2.0~ynh1.md diff --git a/conf/dnsmasq.conf b/conf/dnsmasq.conf new file mode 100644 index 0000000..8b5d5cf --- /dev/null +++ b/conf/dnsmasq.conf @@ -0,0 +1,2 @@ +listen-address=127.0.0.1 +bind-interfaces \ No newline at end of file diff --git a/conf/systemd.service b/conf/systemd.service index e608a57..99702d8 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -13,6 +13,8 @@ RestartSec=10 KillSignal=SIGINT SyslogIdentifier=dns-server Environment=DNS_SERVER_LOG_FOLDER_PATH=/var/log/__APP__/dns +CapabilityBoundingSet=CAP_NET_BIND_SERVICE +AmbientCapabilities=CAP_NET_BIND_SERVICE [Install] WantedBy=multi-user.target diff --git a/doc/PRE_UPGRADE.d/15.2.0~ynh1.md b/doc/PRE_UPGRADE.d/15.2.0~ynh1.md new file mode 100644 index 0000000..ecbbc9f --- /dev/null +++ b/doc/PRE_UPGRADE.d/15.2.0~ynh1.md @@ -0,0 +1 @@ +After upgrading, you must add your ynh server's local IP address(es) to `DNS Server Local End Points`: https://__DOMAIN__/#settingsTabPaneGeneral and then restart __APP__. \ No newline at end of file diff --git a/scripts/install b/scripts/install index 39fe304..64f6fb8 100755 --- a/scripts/install +++ b/scripts/install @@ -26,8 +26,14 @@ ynh_config_add_systemd mkdir -p "/var/log/$app/dns" chown -R "$app:$app" "/var/log/$app" +ynh_hide_warnings yunohost firewall allow Both 53 + yunohost service add "$app" --description="Technitium DNS Server" --log="/var/log/$app/$app.log" --needs_exposed_ports="53" +ynh_config_add --template="dnsmasq.conf" --destination="/etc/dnsmasq.d/$app.conf" + +ynh_systemctl --service="dnsmasq" --action="restart" + #================================================= # ADD A CRON JOB #================================================= @@ -37,15 +43,42 @@ chmod 644 "/etc/cron.d/$app" #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression "Starting $app's systemd service..." - -ynh_systemctl --service="$app" --action="restart" --log_path=systemd --wait_until="was started successfully" +ynh_systemctl --service="$app" --action="start" --log_path=systemd --wait_until="was started successfully" #================================================= # LINK LOGS #================================================= ln -sf $(ls -t /var/log/$app/dns/*.log | head -n 1) /var/log/$app/$app.log +#================================================= +# SET LOCAL ENDPOINT IP(S) +#================================================= +gateway_v4=$(ip -4 route show default | awk '{print $3}' | head -n1) +ipv4=$(ip -4 route get "$gateway_v4" 2>/dev/null | grep -oP 'src \K\S+') + +gateway_v6=$(ip -6 route show default | awk '{print $3}' | head -n1) +if [ -n "$gateway_v6" ]; then + ipv6=$(ip -6 route get "$gateway_v6" 2>/dev/null | grep -oP 'src \K\S+' | grep -v '^fe80') +else + ipv6="" +fi + +if [ -n "$ipv6" ]; then + endpoints="$ipv4:53,[$ipv6]:53" +else + endpoints="$ipv4:53" +fi + +mytoken1=$(curl -s "http://127.0.0.1:5380/api/user/createToken?user=admin&pass=admin&tokenName=mytoken1" | jq -r '.token') +curl -s "http://localhost:5380/api/settings/set?dnsServerLocalEndPoints=$endpoints&Token=$mytoken1" + +#================================================= +# RESTART SYSTEMD SERVICE +#================================================= +ynh_script_progression "Starting $app's systemd service..." + +ynh_systemctl --service="$app" --action="restart" --log_path=systemd --wait_until="was started successfully" + #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/remove b/scripts/remove index 0e8c640..639c656 100755 --- a/scripts/remove +++ b/scripts/remove @@ -16,6 +16,8 @@ if ynh_hide_warnings yunohost service status "$app" >/dev/null; then yunohost service remove "$app" fi +ynh_hide_warnings yunohost firewall disallow Both 53 + ynh_config_remove_systemd ynh_config_remove_nginx @@ -24,6 +26,8 @@ ynh_safe_rm "/var/log/$app" ynh_safe_rm "/etc/cron.d/$app" +ynh_safe_rm "/etc/dnsmasq.d/$app.conf" + #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/restore b/scripts/restore index ff6bc9a..c7b6282 100755 --- a/scripts/restore +++ b/scripts/restore @@ -29,14 +29,21 @@ ynh_restore "/etc/nginx/conf.d/$domain.d/$app.conf" ynh_restore "/var/log/$app" +ynh_hide_warnings yunohost firewall allow Both 53 + ynh_restore "/etc/systemd/system/$app.service" systemctl enable "$app.service" --quiet yunohost service add "$app" --description="Technitium DNS Server" --log="/var/log/$app/$app.log" --needs_exposed_ports=53 +ynh_config_add --template="dnsmasq.conf" --destination="/etc/dnsmasq.d/$app.conf" + +ynh_systemctl --service="dnsmasq" --action="restart" + #================================================= # ADD A CRON JOB #================================================= ynh_config_add --template="logsymlink.cron" --destination="/etc/cron.d/$app" +chown root: "/etc/cron.d/$app" chmod 644 "/etc/cron.d/$app" #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 2342651..5f436ef 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -30,6 +30,9 @@ if ynh_app_upgrading_from_version_before_or_equal_to 14.3.0~ynh1; then chown -R "$app:$app" "/var/log/$app" ln -sf "/var/log/$app/dns" "$data_dir/logs" ln -sf $(ls -t /var/log/$app/dns/*.log | head -n 1) /var/log/$app/$app.log + ynh_config_add --template="dnsmasq.conf" --destination="/etc/dnsmasq.d/$app.conf" + ynh_systemctl --service="dnsmasq" --action="restart" + ynh_hide_warnings yunohost firewall allow Both 53 fi #================================================= From 84c3f7ab1a797f96c13053455011c52785e49b09 Mon Sep 17 00:00:00 2001 From: trendless Date: Mon, 15 Jun 2026 19:22:01 -0600 Subject: [PATCH 11/17] ipv6 tweak --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 64f6fb8..d1fb0ed 100755 --- a/scripts/install +++ b/scripts/install @@ -58,7 +58,7 @@ ipv4=$(ip -4 route get "$gateway_v4" 2>/dev/null | grep -oP 'src \K\S+') gateway_v6=$(ip -6 route show default | awk '{print $3}' | head -n1) if [ -n "$gateway_v6" ]; then - ipv6=$(ip -6 route get "$gateway_v6" 2>/dev/null | grep -oP 'src \K\S+' | grep -v '^fe80') + ipv6=$(ip -6 route get "$gateway_v6" 2>/dev/null | grep -oP 'src \K\S+' | grep -v '^fe80' || true) else ipv6="" fi From 1d625c7a0c4da2f3326cf447238df7496f532714 Mon Sep 17 00:00:00 2001 From: trendless Date: Mon, 15 Jun 2026 19:23:11 -0600 Subject: [PATCH 12/17] update remove --- scripts/remove | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/remove b/scripts/remove index 639c656..b9133e5 100755 --- a/scripts/remove +++ b/scripts/remove @@ -22,8 +22,6 @@ ynh_config_remove_systemd ynh_config_remove_nginx -ynh_safe_rm "/var/log/$app" - ynh_safe_rm "/etc/cron.d/$app" ynh_safe_rm "/etc/dnsmasq.d/$app.conf" From 76a5fcc951bd47f95f29fad13fab6efb91e8c2a6 Mon Sep 17 00:00:00 2001 From: trendless Date: Mon, 15 Jun 2026 19:39:46 -0600 Subject: [PATCH 13/17] update testing to upgrade from 14.3.0_ynh` --- tests.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests.toml b/tests.toml index df10a1f..c424b68 100644 --- a/tests.toml +++ b/tests.toml @@ -16,4 +16,5 @@ test_format = 1.0 # Commits to test upgrade from # ------------------------------- - test_upgrade_from.f20d6449b36f1a891c5c7ab058691c836aa18833.name = "Upgrade from 13.4.1~ynh1" + #test_upgrade_from.f20d6449b36f1a891c5c7ab058691c836aa18833.name = "Upgrade from 13.4.1~ynh1" + test_upgrade_from.8567147.name = "Upgrade from 14.3.0~ynh1" \ No newline at end of file From 082d01d5dd3d39473c9dfcaa8988423c7377700e Mon Sep 17 00:00:00 2001 From: trendless Date: Mon, 15 Jun 2026 19:52:50 -0600 Subject: [PATCH 14/17] update instructions to post_upgrade --- doc/POST_UPGRADE.d/15.2.0~ynh1.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 doc/POST_UPGRADE.d/15.2.0~ynh1.md diff --git a/doc/POST_UPGRADE.d/15.2.0~ynh1.md b/doc/POST_UPGRADE.d/15.2.0~ynh1.md new file mode 100644 index 0000000..f1b41d9 --- /dev/null +++ b/doc/POST_UPGRADE.d/15.2.0~ynh1.md @@ -0,0 +1,7 @@ +After upgrading, in `Settings` > `General` you must set `DNS Server Local End Points` to your ynh server's IP address(es) and then scroll to the bottom and `Save Settings` to restart the DNS server. + +eg: +``` +192.168.0.88:53 +[2981:2cb2:8e86:91f6:4dab:cc4b:2fba:463b]:53 +``` \ No newline at end of file From c81dbef6fe466d8ca3ee741195661956a8bfbe1a Mon Sep 17 00:00:00 2001 From: trendless Date: Mon, 15 Jun 2026 19:53:09 -0600 Subject: [PATCH 15/17] rm pre_upgrade --- doc/PRE_UPGRADE.d/15.2.0~ynh1.md | 1 - 1 file changed, 1 deletion(-) delete mode 100644 doc/PRE_UPGRADE.d/15.2.0~ynh1.md diff --git a/doc/PRE_UPGRADE.d/15.2.0~ynh1.md b/doc/PRE_UPGRADE.d/15.2.0~ynh1.md deleted file mode 100644 index ecbbc9f..0000000 --- a/doc/PRE_UPGRADE.d/15.2.0~ynh1.md +++ /dev/null @@ -1 +0,0 @@ -After upgrading, you must add your ynh server's local IP address(es) to `DNS Server Local End Points`: https://__DOMAIN__/#settingsTabPaneGeneral and then restart __APP__. \ No newline at end of file From 2a365886e21a82940d143a70c6cd0328196a635b Mon Sep 17 00:00:00 2001 From: trendless Date: Mon, 15 Jun 2026 19:56:40 -0600 Subject: [PATCH 16/17] clarify instructions re IPv6 --- doc/POST_UPGRADE.d/15.2.0~ynh1.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/POST_UPGRADE.d/15.2.0~ynh1.md b/doc/POST_UPGRADE.d/15.2.0~ynh1.md index f1b41d9..2b620fe 100644 --- a/doc/POST_UPGRADE.d/15.2.0~ynh1.md +++ b/doc/POST_UPGRADE.d/15.2.0~ynh1.md @@ -4,4 +4,6 @@ eg: ``` 192.168.0.88:53 [2981:2cb2:8e86:91f6:4dab:cc4b:2fba:463b]:53 -``` \ No newline at end of file +``` + +If your server does not have an IPv6 address, you only need to enter the IPv4 address. \ No newline at end of file From 38bac532aa4a0e26f5e2d3b171704361592c8f8d Mon Sep 17 00:00:00 2001 From: trendless Date: Mon, 15 Jun 2026 19:59:58 -0600 Subject: [PATCH 17/17] Update logsymlink.cron 00:05 only --- conf/logsymlink.cron | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/logsymlink.cron b/conf/logsymlink.cron index ebac0a6..f36cf33 100644 --- a/conf/logsymlink.cron +++ b/conf/logsymlink.cron @@ -1 +1 @@ -0,15,30,45 0 * * * ln -sf $(ls -t /var/log/__APP__/dns/*.log | head -n 1) /var/log/__APP__/__APP__.log \ No newline at end of file +5 0 * * * ln -sf $(ls -t /var/log/__APP__/dns/*.log | head -n 1) /var/log/__APP__/__APP__.log