From e26a834b63da30904735636b0920ecfb7d0418b0 Mon Sep 17 00:00:00 2001 From: TomTurnschuh <36013390+TomTurnschuh@users.noreply.github.com> Date: Wed, 22 Aug 2018 18:21:13 +0200 Subject: Rename DDNS apps so they show up together --- changelog.md | 148 ++++++++++++++++++++----------------- etc/ncp-config.d/DDNS_duckDNS.sh | 79 ++++++++++++++++++++ etc/ncp-config.d/DDNS_freeDNS.sh | 71 ++++++++++++++++++ etc/ncp-config.d/DDNS_no-ip.sh | 127 ++++++++++++++++++++++++++++++++ etc/ncp-config.d/DDNS_spDYN.sh | 155 +++++++++++++++++++++++++++++++++++++++ etc/ncp-config.d/duckDNS.sh | 79 -------------------- etc/ncp-config.d/freeDNS.sh | 71 ------------------ etc/ncp-config.d/no-ip.sh | 127 -------------------------------- etc/ncp-config.d/spDYN.sh | 155 --------------------------------------- ncp-web/ncp-launcher.php | 2 +- ncp-web/wizard/JS/wizard.js | 4 +- update.sh | 9 ++- 12 files changed, 522 insertions(+), 505 deletions(-) create mode 100644 etc/ncp-config.d/DDNS_duckDNS.sh create mode 100644 etc/ncp-config.d/DDNS_freeDNS.sh create mode 100644 etc/ncp-config.d/DDNS_no-ip.sh create mode 100644 etc/ncp-config.d/DDNS_spDYN.sh delete mode 100644 etc/ncp-config.d/duckDNS.sh delete mode 100644 etc/ncp-config.d/freeDNS.sh delete mode 100644 etc/ncp-config.d/no-ip.sh delete mode 100644 etc/ncp-config.d/spDYN.sh diff --git a/changelog.md b/changelog.md index 75c9c98c..c06220e4 100644 --- a/changelog.md +++ b/changelog.md @@ -1,141 +1,151 @@ -[v0.59.2](https://github.com/nextcloud/nextcloudpi/commit/86aae1a) (2018-09-10) nc-format-USB: fix wrong detection of USB drives present +[v0.59.7](https://github.com/nextcloud/nextcloudpi/commit/bb2eb48) (2018-08-22) Rename DDNS apps so they show up together -[v0.59.1 ](https://github.com/nextcloud/nextcloudpi/commit/377e3b9) (2018-09-10) nc-datadir: support specifying the root of the mountpoint +[v0.59.6 ](https://github.com/nextcloud/nextcloudpi/commit/1210517) (2018-09-12) wizard: fix instructions for BTRFS -[v0.59.0](https://github.com/nextcloud/nextcloudpi/commit/3a74591) (2018-08-31) update to NC 13.0.6 +[v0.59.5 ](https://github.com/nextcloud/nextcloudpi/commit/ed96a0c) (2018-09-09) nc-limits: fix error when specifying units -[v0.58.1 ](https://github.com/nextcloud/nextcloudpi/commit/a582c52) (2018-07-25) nc-datadir: backup existing datadir after checks +[v0.59.4 ](https://github.com/nextcloud/nextcloudpi/commit/ee370f1) (2018-09-03) ncp-suggestions: fix Raspbian parsing -[v0.58.0 ](https://github.com/nextcloud/nextcloudpi/commit/32da117) (2018-07-23) update to NC 13.0.5 +[v0.59.3 ](https://github.com/nextcloud/nextcloudpi/commit/6e1a1a9) (2018-08-31) build: add imagick for gallery -[v0.57.21](https://github.com/nextcloud/nextcloudpi/commit/09598d1) (2018-07-23) Fixes #566 Remove redundant opcache configuration (#572) +[v0.59.2 ](https://github.com/nextcloud/nextcloudpi/commit/e25f5d1) (2018-09-10) nc-format-USB: fix wrong detection of USB drives present -[v0.57.20](https://github.com/nextcloud/nextcloudpi/commit/1b0182a) (2018-07-20) ncp-config: add spaces to invalid characters +[v0.59.1 ](https://github.com/nextcloud/nextcloudpi/commit/378ca60) (2018-09-10) nc-datadir: support specifying the root of the mountpoint -[v0.57.19](https://github.com/nextcloud/nextcloudpi/commit/9ffe73f) (2018-07-20) nc-backup: fix space check error message +[v0.59.0](https://github.com/nextcloud/nextcloudpi/commit/9113ab2) (2018-08-31) update to NC 13.0.6 -[v0.57.18](https://github.com/nextcloud/nextcloudpi/commit/857b0bb) (2018-07-13) fix ncc command repeating itself +[v0.58.1 ](https://github.com/nextcloud/nextcloudpi/commit/dad9900) (2018-07-25) nc-datadir: backup existing datadir after checks -[v0.57.17](https://github.com/nextcloud/nextcloudpi/commit/b5378bd) (2018-07-03) armbian: fix image tag preventing updates +[v0.58.0 ](https://github.com/nextcloud/nextcloudpi/commit/df7a277) (2018-07-23) update to NC 13.0.5 -[v0.57.16](https://github.com/nextcloud/nextcloudpi/commit/016ceeb) (2018-06-27) SSH: fix root password in Raspbian +[v0.57.21](https://github.com/nextcloud/nextcloudpi/commit/965716d) (2018-07-23) Fixes #566 Remove redundant opcache configuration (#572) -[v0.57.15](https://github.com/nextcloud/nextcloudpi/commit/985af3e) (2018-06-26) nc-automount: fix udiskie not installed in latest image +[v0.57.20](https://github.com/nextcloud/nextcloudpi/commit/bf91e4c) (2018-07-20) ncp-config: add spaces to invalid characters -[v0.57.14](https://github.com/nextcloud/nextcloudpi/commit/7ae1aad) (2018-06-26) added database dir to ncp-info (#553) +[v0.57.19](https://github.com/nextcloud/nextcloudpi/commit/baaf79a) (2018-07-20) nc-backup: fix space check error message -[v0.57.13](https://github.com/nextcloud/nextcloudpi/commit/55b0de8) (2018-06-24) nc-limits: fix units +[v0.57.18](https://github.com/nextcloud/nextcloudpi/commit/b81b3e6) (2018-07-13) fix ncc command repeating itself -[v0.57.12](https://github.com/nextcloud/nextcloudpi/commit/c228376) (2018-06-21) nc-limits: autolimits enhancements +[v0.57.17](https://github.com/nextcloud/nextcloudpi/commit/dc089bf) (2018-07-03) armbian: fix image tag preventing updates -[v0.57.11](https://github.com/nextcloud/nextcloudpi/commit/efcea4f) (2018-06-20) letsencrypt: notify of renewals +[v0.57.16](https://github.com/nextcloud/nextcloudpi/commit/2aa0e8f) (2018-06-27) SSH: fix root password in Raspbian -[v0.57.10](https://github.com/nextcloud/nextcloudpi/commit/01276a5) (2018-06-20) ncp-web: fix JS docker detection +[v0.57.15](https://github.com/nextcloud/nextcloudpi/commit/2c01a87) (2018-06-26) nc-automount: fix udiskie not installed in latest image -[v0.57.9 ](https://github.com/nextcloud/nextcloudpi/commit/e04ad59) (2018-06-21) nc-format-USB: fix when ZRAM active +[v0.57.14](https://github.com/nextcloud/nextcloudpi/commit/f1cc627) (2018-06-26) added database dir to ncp-info (#553) -[v0.57.8 ](https://github.com/nextcloud/nextcloudpi/commit/594b2c5) (2018-06-19) docker: adapt wizard +[v0.57.13](https://github.com/nextcloud/nextcloudpi/commit/fe12ff9) (2018-06-24) nc-limits: fix units -[v0.57.7 ](https://github.com/nextcloud/nextcloudpi/commit/5d9cfec) (2018-06-19) docker: fix persist ncp-web password +[v0.57.12](https://github.com/nextcloud/nextcloudpi/commit/bbb25fa) (2018-06-21) nc-limits: autolimits enhancements -[v0.57.6 ](https://github.com/nextcloud/nextcloudpi/commit/97f83a0) (2018-06-19) fix mysqld service named mysql +[v0.57.11](https://github.com/nextcloud/nextcloudpi/commit/9983b7c) (2018-06-20) letsencrypt: notify of renewals -[v0.57.5 ](https://github.com/nextcloud/nextcloudpi/commit/dfcde41) (2018-06-18) fix nextcloud-domain running before default GW is ready +[v0.57.10](https://github.com/nextcloud/nextcloudpi/commit/a0a31b4) (2018-06-20) ncp-web: fix JS docker detection -[v0.57.4 ](https://github.com/nextcloud/nextcloudpi/commit/ca5da82) (2018-06-18) letsencrypt: install from debian package +[v0.57.9 ](https://github.com/nextcloud/nextcloudpi/commit/de5d9fb) (2018-06-21) nc-format-USB: fix when ZRAM active -[v0.57.3 ](https://github.com/nextcloud/nextcloudpi/commit/386c020) (2018-06-18) armbian: default to SSH disabled +[v0.57.8 ](https://github.com/nextcloud/nextcloudpi/commit/3ee6409) (2018-06-19) docker: adapt wizard -[v0.57.2 ](https://github.com/nextcloud/nextcloudpi/commit/56b135a) (2018-06-18) nc-static-IP: autodetect default interface +[v0.57.7 ](https://github.com/nextcloud/nextcloudpi/commit/c727d65) (2018-06-19) docker: fix persist ncp-web password -[v0.57.1 ](https://github.com/nextcloud/nextcloudpi/commit/cb127d2) (2018-06-18) docker: replace systemd for service +[v0.57.6 ](https://github.com/nextcloud/nextcloudpi/commit/865ad08) (2018-06-19) fix mysqld service named mysql -[v0.57.0 ](https://github.com/nextcloud/nextcloudpi/commit/a8bf66a) (2018-06-18) update to NC 13.0.4 +[v0.57.5 ](https://github.com/nextcloud/nextcloudpi/commit/1a9a53f) (2018-06-18) fix nextcloud-domain running before default GW is ready -[v0.56.25](https://github.com/nextcloud/nextcloudpi/commit/d8de31e) (2018-06-18) nc-snapshot-sync: upgrade +[v0.57.4 ](https://github.com/nextcloud/nextcloudpi/commit/9210fb2) (2018-06-18) letsencrypt: install from debian package -[v0.56.24](https://github.com/nextcloud/nextcloudpi/commit/68fbb16) (2018-06-18) nc-datadir: make sure we have the correct permissions +[v0.57.3 ](https://github.com/nextcloud/nextcloudpi/commit/5aa071e) (2018-06-18) armbian: default to SSH disabled -[v0.56.23](https://github.com/nextcloud/nextcloudpi/commit/8e1d46a) (2018-06-18) nc-info: fix typo +[v0.57.2 ](https://github.com/nextcloud/nextcloudpi/commit/7b2737b) (2018-06-18) nc-static-IP: autodetect default interface -[v0.56.22](https://github.com/nextcloud/nextcloudpi/commit/3a5a42b) (2018-06-14) nc-restore: fix redis restart in docker +[v0.57.1 ](https://github.com/nextcloud/nextcloudpi/commit/7ac1847) (2018-06-18) docker: replace systemd for service -[v0.56.21](https://github.com/nextcloud/nextcloudpi/commit/b8bb912) (2018-06-11) docker: persist SSL certificates +[v0.57.0 ](https://github.com/nextcloud/nextcloudpi/commit/676776f) (2018-06-18) update to NC 13.0.4 -[v0.56.20](https://github.com/nextcloud/nextcloudpi/commit/ded504a) (2018-06-11) ncp-web: fix sanitization for fail2ban +[v0.56.25](https://github.com/nextcloud/nextcloudpi/commit/57852ad) (2018-06-18) nc-snapshot-sync: upgrade -[v0.56.19](https://github.com/nextcloud/nextcloudpi/commit/2e51541) (2018-06-06) add ncc command, shortcut of occ +[v0.56.24](https://github.com/nextcloud/nextcloudpi/commit/0d7ceb5) (2018-06-18) nc-datadir: make sure we have the correct permissions -[v0.56.18](https://github.com/nextcloud/nextcloudpi/commit/e365275) (2018-06-06) NFS: fix dependency with automount +[v0.56.23](https://github.com/nextcloud/nextcloudpi/commit/005ed80) (2018-06-18) nc-info: fix typo -[v0.56.17](https://github.com/nextcloud/nextcloudpi/commit/4de3e2a) (2018-06-04) ncp-web: sanitize the ref parameter +[v0.56.22](https://github.com/nextcloud/nextcloudpi/commit/cef7cb4) (2018-06-14) nc-restore: fix redis restart in docker -[v0.56.16](https://github.com/nextcloud/nextcloudpi/commit/636dd4b) (2018-05-29) build: fix cleanup armbian images +[v0.56.21](https://github.com/nextcloud/nextcloudpi/commit/598e1c8) (2018-06-11) docker: persist SSL certificates -[v0.56.15](https://github.com/nextcloud/nextcloudpi/commit/e9b4f7a) (2018-05-28) ncp-web: added chinese translations +[v0.56.20](https://github.com/nextcloud/nextcloudpi/commit/75cfd80) (2018-06-11) ncp-web: fix sanitization for fail2ban -[v0.56.14](https://github.com/nextcloud/nextcloudpi/commit/704b3a3) (2018-05-27) re-rename to NCPi +[v0.56.19](https://github.com/nextcloud/nextcloudpi/commit/b78c9e2) (2018-06-06) add ncc command, shortcut of occ -[v0.56.13](https://github.com/nextcloud/nextcloudpi/commit/70e91e4) (2018-05-28) spDYN: install curl for docker +[v0.56.18](https://github.com/nextcloud/nextcloudpi/commit/412eee2) (2018-06-06) NFS: fix dependency with automount -[v0.56.12](https://github.com/nextcloud/nextcloudpi/commit/9ca53da) (2018-05-28) nc-format-USB: fix when ZRAM active +[v0.56.17](https://github.com/nextcloud/nextcloudpi/commit/05c14ce) (2018-06-04) ncp-web: sanitize the ref parameter -[v0.56.11](https://github.com/nextcloud/nextcloudpi/commit/d2c2346) (2018-05-27) ncp-config: silence connectivity errors +[v0.56.16](https://github.com/nextcloud/nextcloudpi/commit/3862eca) (2018-05-29) build: fix cleanup armbian images -[v0.56.10](https://github.com/nextcloud/nextcloudpi/commit/54b1acd) (2018-05-25) nc-ramlogs: fix docker installation from latest upstream changes +[v0.56.15](https://github.com/nextcloud/nextcloudpi/commit/b45e68f) (2018-05-28) ncp-web: added chinese translations -[v0.56.9 ](https://github.com/nextcloud/nextcloudpi/commit/b9718ee) (2018-05-24) remove old systemd timer config in running systems +[v0.56.14](https://github.com/nextcloud/nextcloudpi/commit/a070860) (2018-05-27) re-rename to NCPi -[v0.56.8 ](https://github.com/nextcloud/nextcloudpi/commit/3c9a971) (2018-05-22) fix php cli tmpdir for running instances +[v0.56.13](https://github.com/nextcloud/nextcloudpi/commit/003c29c) (2018-05-28) spDYN: install curl for docker -[v0.56.7 ](https://github.com/nextcloud/nextcloudpi/commit/e8fe100) (2018-05-22) move NC httpd logs to /var/log +[v0.56.12](https://github.com/nextcloud/nextcloudpi/commit/ed0a368) (2018-05-28) nc-format-USB: fix when ZRAM active -[v0.56.6 ](https://github.com/nextcloud/nextcloudpi/commit/0d47f27) (2018-05-20) fix update httpd log location in virtual host after nc-datadir +[v0.56.11](https://github.com/nextcloud/nextcloudpi/commit/fae7ba2) (2018-05-27) ncp-config: silence connectivity errors -[v0.56.5 ](https://github.com/nextcloud/nextcloudpi/commit/da7b1d2) (2018-05-20) ncp-autoupdate: dont return 0 if no updates available +[v0.56.10](https://github.com/nextcloud/nextcloudpi/commit/027a2a0) (2018-05-25) nc-ramlogs: fix docker installation from latest upstream changes -[v0.56.4 ](https://github.com/nextcloud/nextcloudpi/commit/05b5a30) (2018-05-18) nc-info: change port checker providers +[v0.56.9 ](https://github.com/nextcloud/nextcloudpi/commit/438e73d) (2018-05-24) remove old systemd timer config in running systems -[v0.56.3 ](https://github.com/nextcloud/nextcloudpi/commit/f8c7bc1) (2018-05-17) nc-update-nextcloud: make sure backup syncs to disk +[v0.56.8 ](https://github.com/nextcloud/nextcloudpi/commit/9e8fc92) (2018-05-22) fix php cli tmpdir for running instances -[v0.56.2 ](https://github.com/nextcloud/nextcloudpi/commit/f4dcded) (2018-05-15) nc-restore: refuse to restore from /var/www/nextcloud +[v0.56.7 ](https://github.com/nextcloud/nextcloudpi/commit/061d2ae) (2018-05-22) move NC httpd logs to /var/log -[v0.56.1 ](https://github.com/nextcloud/nextcloudpi/commit/59ab9a1) (2018-05-15) nc-update-nextcloud: rollback in case of power cut +[v0.56.6 ](https://github.com/nextcloud/nextcloudpi/commit/fac99a6) (2018-05-20) fix update httpd log location in virtual host after nc-datadir -[v0.56.0 ](https://github.com/nextcloud/nextcloudpi/commit/46d29b7) (2018-05-15) added nc-autoupdate-nc +[v0.56.5 ](https://github.com/nextcloud/nextcloudpi/commit/c97acf8) (2018-05-20) ncp-autoupdate: dont return 0 if no updates available -[v0.55.4 ](https://github.com/nextcloud/nextcloudpi/commit/227d7eb) (2018-05-15) nc-autoupdate-ncp: fix wrong user +[v0.56.4 ](https://github.com/nextcloud/nextcloudpi/commit/cd32b30) (2018-05-18) nc-info: change port checker providers -[v0.55.3 ](https://github.com/nextcloud/nextcloudpi/commit/67e344d) (2018-05-15) nc-update-netcloud: include version in backup name +[v0.56.3 ](https://github.com/nextcloud/nextcloudpi/commit/f04de1f) (2018-05-17) nc-update-nextcloud: make sure backup syncs to disk -[v0.55.2 ](https://github.com/nextcloud/nextcloudpi/commit/c49fa0d) (2018-05-15) nc-backup: faster free space calculation. Minimize maintenance mode time +[v0.56.2 ](https://github.com/nextcloud/nextcloudpi/commit/741e79a) (2018-05-15) nc-restore: refuse to restore from /var/www/nextcloud -[v0.55.1 ](https://github.com/nextcloud/nextcloudpi/commit/85f43eb) (2018-05-14) nc-backup: exclude ncp-update-nc backups +[v0.56.1 ](https://github.com/nextcloud/nextcloudpi/commit/88dcfef) (2018-05-15) nc-update-nextcloud: rollback in case of power cut -[v0.55.0 ](https://github.com/nextcloud/nextcloudpi/commit/bf8377f) (2018-05-11) added nc-update-nextcloud +[v0.56.0 ](https://github.com/nextcloud/nextcloudpi/commit/9bd6f81) (2018-05-15) added nc-autoupdate-nc -[v0.54.14](https://github.com/nextcloud/nextcloudpi/commit/cb1570f) (2018-05-14) samba: fix permissions +[v0.55.4 ](https://github.com/nextcloud/nextcloudpi/commit/ee92111) (2018-05-15) nc-autoupdate-ncp: fix wrong user -[v0.54.13](https://github.com/nextcloud/nextcloudpi/commit/0b8a8bd) (2018-05-11) nc-nextcloud: fix upload tmp dir +[v0.55.3 ](https://github.com/nextcloud/nextcloudpi/commit/191ea16) (2018-05-15) nc-update-netcloud: include version in backup name -[v0.54.12](https://github.com/nextcloud/nextcloudpi/commit/47b73ad) (2018-05-11) nc-restore: fix tmp dirs in backups without data +[v0.55.2 ](https://github.com/nextcloud/nextcloudpi/commit/2507cc6) (2018-05-15) nc-backup: faster free space calculation. Minimize maintenance mode time -[v0.54.11](https://github.com/nextcloud/nextcloudpi/commit/6c5a308) (2018-05-11) nc-backup: make more robust to unexpected failure +[v0.55.1 ](https://github.com/nextcloud/nextcloudpi/commit/5e3da08) (2018-05-14) nc-backup: exclude ncp-update-nc backups -[v0.54.10](https://github.com/nextcloud/nextcloudpi/commit/e94d1ab) (2018-05-11) nc-restore: make more robust to unexpected failure +[v0.55.0 ](https://github.com/nextcloud/nextcloudpi/commit/8d01fc4) (2018-05-11) added nc-update-nextcloud -[v0.54.9 ](https://github.com/nextcloud/nextcloudpi/commit/0bde108) (2018-05-11) nc-restore: separate in its own executable +[v0.54.14](https://github.com/nextcloud/nextcloudpi/commit/8ef0881) (2018-05-14) samba: fix permissions -[v0.54.8 ](https://github.com/nextcloud/nextcloudpi/commit/034795d) (2018-05-10) nc-backup: better avoid duplicates +[v0.54.13](https://github.com/nextcloud/nextcloudpi/commit/b08e45f) (2018-05-11) nc-nextcloud: fix upload tmp dir -[v0.54.7 ](https://github.com/nextcloud/nextcloudpi/commit/7b554aa) (2018-05-10) armbian: fix static IP +[v0.54.12](https://github.com/nextcloud/nextcloudpi/commit/eb1cf1a) (2018-05-11) nc-restore: fix tmp dirs in backups without data -[v0.54.6 ](https://github.com/nextcloud/nextcloudpi/commit/25a143e) (2018-05-10) nc-notify-updates: fix wrong user +[v0.54.11](https://github.com/nextcloud/nextcloudpi/commit/40a8431) (2018-05-11) nc-backup: make more robust to unexpected failure -[v0.54.5 ](https://github.com/nextcloud/nextcloudpi/commit/cfc81b0) (2018-05-10) armbian: fix mDNS +[v0.54.10](https://github.com/nextcloud/nextcloudpi/commit/2ef575c) (2018-05-11) nc-restore: make more robust to unexpected failure -[v0.54.4 ](https://github.com/nextcloud/nextcloudpi/commit/bf55914) (2018-05-09) avoid temp dir vulnerabilities +[v0.54.9 ](https://github.com/nextcloud/nextcloudpi/commit/b93aec5) (2018-05-11) nc-restore: separate in its own executable + +[v0.54.8 ](https://github.com/nextcloud/nextcloudpi/commit/dbc3094) (2018-05-10) nc-backup: better avoid duplicates + +[v0.54.7 ](https://github.com/nextcloud/nextcloudpi/commit/5dca250) (2018-05-10) armbian: fix static IP + +[v0.54.6 ](https://github.com/nextcloud/nextcloudpi/commit/09741e1) (2018-05-10) nc-notify-updates: fix wrong user + +[v0.54.5 ](https://github.com/nextcloud/nextcloudpi/commit/688d6d8) (2018-05-10) armbian: fix mDNS + +[v0.54.4 ](https://github.com/nextcloud/nextcloudpi/commit/63f83da) (2018-05-09) avoid temp dir vulnerabilities [v0.54.3 ](https://github.com/nextcloud/nextcloudpi/commit/28d2332) (2018-05-03) nc-datadir: avoid using occ for faster execution diff --git a/etc/ncp-config.d/DDNS_duckDNS.sh b/etc/ncp-config.d/DDNS_duckDNS.sh new file mode 100644 index 00000000..2ff2f13b --- /dev/null +++ b/etc/ncp-config.d/DDNS_duckDNS.sh @@ -0,0 +1,79 @@ +#!/bin/bash + +# DuckDNS installation on Raspbian for NextCloudPi +# +# +# Copyleft 2017 by Courtney Hicks +# GPL licensed (see end of file) * Use at your own risk! +# + +ACTIVE_=no +DOMAIN_=mycloud.duckdns.org +TOKEN_=your-duckdns-token + +INSTALLDIR=duckdns +INSTALLPATH=/usr/local/etc/$INSTALLDIR +CRONFILE=/etc/cron.d/duckdns +DESCRIPTION="Free Dynamic DNS provider (need account from https://duckdns.org)" + +install() +{ + apt-get update + apt-get install -y --no-install-recommends curl # TODO use wget instead +} + +configure() +{ + local DOMAIN="$( sed 's|.duckdns.org||' <<<"$DOMAIN_" )" + if [[ $ACTIVE_ == "yes" ]]; then + mkdir -p "$INSTALLPATH" + + # Creates duck.sh script that checks for updates to DNS records + touch "$INSTALLPATH"/duck.sh + touch "$INSTALLPATH"/duck.log + echo -e "echo url=\"https://www.duckdns.org/update?domains=$DOMAIN&token=$TOKEN_&ip=\" | curl -k -o "$INSTALLPATH"/duck.log -K -" > "$INSTALLPATH"/duck.sh + + # Adds file to cron to run script for DNS record updates and change permissions + touch $CRONFILE + echo "*/5 * * * * root $INSTALLPATH/duck.sh >/dev/null 2>&1" > "$CRONFILE" + chmod 700 "$INSTALLPATH"/duck.sh + chmod +x "$CRONFILE" + + # First-time execution of duck script + "$INSTALLPATH"/duck.sh > /dev/null 2>&1 + + SUCCESS="$( cat $INSTALLPATH/duck.log )" + + # Checks for successful run of duck.sh + if [[ $SUCCESS == "OK" ]]; then + echo "DuckDNS is enabled" + elif [[ $SUCCESS == "KO" ]]; then + echo "DuckDNS install failed, is your information correct?" + fi + + # Removes config files and cron job if ACTIVE_ is set to no + elif [[ $ACTIVE_ == "no" ]]; then + rm -f "$CRONFILE" + rm -f "$INSTALLPATH"/duck.sh + rm -f "$INSTALLPATH"/duck.log + rmdir "$INSTALLPATH" + echo "DuckDNS is now disabled" + fi +} + +# License +# +# This script is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This script is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this script; if not, write to the +# Free Software Foundation, Inc., 59 Temple Place, Suite 330, +# Boston, MA 02111-1307 USA diff --git a/etc/ncp-config.d/DDNS_freeDNS.sh b/etc/ncp-config.d/DDNS_freeDNS.sh new file mode 100644 index 00000000..b13129e6 --- /dev/null +++ b/etc/ncp-config.d/DDNS_freeDNS.sh @@ -0,0 +1,71 @@ +#!/bin/bash + +# FreeDNS updater client installation on Raspbian +# +# Copyleft 2017 by Panteleimon Sarantos +# GPL licensed (see end of file) * Use at your own risk! +# + +ACTIVE_=no +UPDATEHASH_=abcdefghijklmnopqrstuvwxyzABCDEFGHIJK1234567 +DOMAIN_=mynextcloud.example.com +UPDATEINTERVAL_=30 +DESCRIPTION="DDNS FreeDNS client (need account)" + +UPDATEURL=https://freedns.afraid.org/dynamic/update.php +URL="${UPDATEURL}?${UPDATEHASH_}" + +install() +{ + apt-get update + apt-get install --no-install-recommends -y dnsutils +} + +configure() +{ + [[ $ACTIVE_ != "yes" ]] && { + rm /etc/cron.d/freeDNS + service cron restart + echo "FreeDNS client is disabled" + return 0 + } + + cat > /usr/local/bin/freedns.sh < /etc/cron.d/freeDNS + service cron restart + + cd /var/www/nextcloud + sudo -u www-data php occ config:system:set trusted_domains 3 --value="$DOMAIN_" + sudo -u www-data php occ config:system:set overwrite.cli.url --value=https://"$DOMAIN_" + + echo "FreeDNS client is enabled" +} + +# License +# +# This script is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This script is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this script; if not, write to the +# Free Software Foundation, Inc., 59 Temple Place, Suite 330, +# Boston, MA 02111-1307 USA diff --git a/etc/ncp-config.d/DDNS_no-ip.sh b/etc/ncp-config.d/DDNS_no-ip.sh new file mode 100644 index 00000000..58b6a444 --- /dev/null +++ b/etc/ncp-config.d/DDNS_no-ip.sh @@ -0,0 +1,127 @@ +#!/bin/bash + +# no-ip.org installation on Raspbian +# +# Copyleft 2017 by Ignacio Nunez Hernanz +# GPL licensed (see end of file) * Use at your own risk! +# +# More at https://ownyourbits.com/2017/03/05/dynamic-dns-for-raspbian-with-no-ip-org-installer/ +# + +ACTIVE_=no +USER_=my-noip-user@email.com +PASS_=noip-pass +DOMAIN_=mycloud.ownyourbits.com +TIME_=30 +DESCRIPTION="DDNS no-ip free provider (need account)" + +INFO="For this step to succeed, you need to register a noip account first. +Internet access is required for this configuration to complete." + +install() +{ + apt-get update + apt-get install --no-install-recommends -y make gcc libc-dev + + local TMPDIR="$( mktemp -d /tmp/noip.XXXXXX )" + cd "$TMPDIR" + wget -O- --content-disposition https://github.com/nachoparker/noip-DDNS/archive/master/latest.tar.gz \ + | tar -xz \ + || return 1 + cd -; cd "$OLDPWD"/noip-DDNS-master/ + make + cp noip2 /usr/local/bin/ + + cat > /etc/init.d/noip2 <<'EOF' +#! /bin/sh +# /etc/init.d/noip2 + +### BEGIN INIT INFO +# Provides: no-ip.org +# Required-Start: $local_fs $remote_fs +# Required-Stop: $local_fs $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Start no-ip.org dynamic DNS +### END INIT INFO +EOF + + cat debian.noip2.sh >> /etc/init.d/noip2 + + chmod +x /etc/init.d/noip2 + cd - + rm -r "$TMPDIR" + + update-rc.d noip2 defaults + update-rc.d noip2 disable + + mkdir -p /usr/local/etc/noip2 + + [[ "$DOCKERBUILD" == 1 ]] && { + cat > /etc/services-available.d/100noip <&1 | tee >(cat - >&2) \ + | grep -q "New configuration file .* created" || return 1 + + update-rc.d noip2 enable + service noip2 restart + cd /var/www/nextcloud + sudo -u www-data php occ config:system:set trusted_domains 3 --value="$DOMAIN_" + sudo -u www-data php occ config:system:set overwrite.cli.url --value=https://"$DOMAIN_" + echo "noip DDNS enabled" + +} + +cleanup() +{ + # this uninstalls udiskie, commented out + # udiskie with these dependencies fixed in Buster + # apt-get purge -y make gcc libc-dev + : +} + +# License +# +# This script is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This script is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this script; if not, write to the +# Free Software Foundation, Inc., 59 Temple Place, Suite 330, +# Boston, MA 02111-1307 USA + diff --git a/etc/ncp-config.d/DDNS_spDYN.sh b/etc/ncp-config.d/DDNS_spDYN.sh new file mode 100644 index 00000000..f9dcd471 --- /dev/null +++ b/etc/ncp-config.d/DDNS_spDYN.sh @@ -0,0 +1,155 @@ +#!/bin/bash + +# spDYN setup for NextCloudPi +# +# +# Copyleft 2017 by Timm Goldenstein +# https://github.com/TimmThaler/spdnsUpdater +# +# GPL licensed (see end of file) * Use at your own risk! +# + +ACTIVE_=no +DOMAIN_=mycloud.spdns.de +TOKEN_=your-spdns-token + +INSTALLDIR=spdnsupdater +INSTALLPATH=/usr/local/etc/$INSTALLDIR +CRONFILE=/etc/cron.d/spdnsupdater +DESCRIPTION="Free Dynamic DNS provider (need account from spdyn.de)" + +install() +{ + apt-get update + apt-get install -y --no-install-recommends curl # TODO use wget instead + + # Create the spdnsUpdater.sh + mkdir -p "$INSTALLPATH" + # Write the script to file + cat > "$INSTALLPATH"/spdnsUpdater.sh <<'EOF' +#!/bin/bash + +### Usage +# +# Recommended usage: ./spdnsUpdater.sh +# Alternative usage: ./spdnsUpdater.sh +# + + +### Configuration + +# Get current IP address from +get_ip_url="https://api.ipify.org/" +update_url="https://update.spdyn.de/nic/update" + + +### Update procedure +function spdnsUpdater { + # Send the current IP address to spdyn.de + # and show the response + + params=$1 + updater=$(curl -s $update_url $params) + updater=$(echo $updater | grep -o '^[a-z]*') + + case "$updater" in + abuse) echo "[$updater] Der Host kann nicht aktualisiert werden, da er aufgrund vorheriger fehlerhafter Updateversuche gesperrt ist." + ;; + badauth) echo "[$updater] Ein ungültiger Benutzername und / oder ein ungültiges Kennwort wurde eingegeben." + ;; + good) echo "[$updater] Die Hostname wurde erfolgreich auf die neue IP aktualisiert." + ;; + yours) echo "[$updater] Der angegebene Host kann nicht unter diesem Benutzer-Account verwendet werden." + ;; + notfqdn) echo "[$updater] Der angegebene Host ist kein FQDN." + ;; + numhost) echo "[$updater] Es wurde versucht, mehr als 20 Hosts in einer Anfrage zu aktualisieren." + ;; + nochg) echo "[$updater] Die IP hat sich zum letzten Update nicht geändert." + ;; + nohost) echo "[$updater] Der angegebene Host existiert nicht oder wurde gelöscht." + ;; + fatal) echo "[$updater] Der angegebene Host wurde manuell deaktiviert." + ;; + *) echo "[$updater]" + ;; + esac + +} + + +if [ $# -eq 2 ] + then + # if hostname and token + # Get current IP address + currip=$(curl -s "$get_ip_url"); + host=$1 + token=$2 + params="-d hostname=$host -d myip=$currip -d user=$host -d pass=$token" + spdnsUpdater "$params" + elif [ $# -eq 3 ] + then + # if hostname and user and passwd + # Get current IP address + currip=$(curl -s "$get_ip_url"); + host=$1 + user=$2 + pass=$3 + params="-d hostname=$host -d myip=$currip -d user=$user -d pass=$pass" + spdnsUpdater "$params" + else + echo + echo "Updater for Dynamic DNS at spdns.de" + echo "===================================" + echo + echo "Usage:" + echo "------" + echo + echo "Recommended: ./spdnsUpdater.sh " + echo "Alternative: ./spdnsUpdater.sh " + echo +fi +EOF + + chmod 700 "$INSTALLPATH"/spdnsUpdater.sh + chmod a+x "$INSTALLPATH"/spdnsUpdater.sh + +} + +configure() +{ + if [[ $ACTIVE_ == "yes" ]]; then + + # Adds file to cron to run script for DNS record updates and change permissions + touch $CRONFILE + echo "0 * * * * root $INSTALLPATH/spdnsUpdater.sh $DOMAIN_ $TOKEN_ >/dev/null 2>&1" > "$CRONFILE" + chmod +x "$CRONFILE" + + # First-time execution of update script and print response from spdns.de server + "$INSTALLPATH"/spdnsUpdater.sh "$DOMAIN_" "$TOKEN_" + + # Removes config files and cron job if ACTIVE_ is set to no + elif [[ $ACTIVE_ == "no" ]]; then + echo "... removing cronfile: $CRONFILE" + rm -f "$CRONFILE" + echo "spdnsUpdater is now disabled" + fi + service cron restart +} + +# License +# +# This script is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This script is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this script; if not, write to the +# Free Software Foundation, Inc., 59 Temple Place, Suite 330, +# Boston, MA 02111-1307 USA diff --git a/etc/ncp-config.d/duckDNS.sh b/etc/ncp-config.d/duckDNS.sh deleted file mode 100644 index 2ff2f13b..00000000 --- a/etc/ncp-config.d/duckDNS.sh +++ /dev/null @@ -1,79 +0,0 @@ -#!/bin/bash - -# DuckDNS installation on Raspbian for NextCloudPi -# -# -# Copyleft 2017 by Courtney Hicks -# GPL licensed (see end of file) * Use at your own risk! -# - -ACTIVE_=no -DOMAIN_=mycloud.duckdns.org -TOKEN_=your-duckdns-token - -INSTALLDIR=duckdns -INSTALLPATH=/usr/local/etc/$INSTALLDIR -CRONFILE=/etc/cron.d/duckdns -DESCRIPTION="Free Dynamic DNS provider (need account from https://duckdns.org)" - -install() -{ - apt-get update - apt-get install -y --no-install-recommends curl # TODO use wget instead -} - -configure() -{ - local DOMAIN="$( sed 's|.duckdns.org||' <<<"$DOMAIN_" )" - if [[ $ACTIVE_ == "yes" ]]; then - mkdir -p "$INSTALLPATH" - - # Creates duck.sh script that checks for updates to DNS records - touch "$INSTALLPATH"/duck.sh - touch "$INSTALLPATH"/duck.log - echo -e "echo url=\"https://www.duckdns.org/update?domains=$DOMAIN&token=$TOKEN_&ip=\" | curl -k -o "$INSTALLPATH"/duck.log -K -" > "$INSTALLPATH"/duck.sh - - # Adds file to cron to run script for DNS record updates and change permissions - touch $CRONFILE - echo "*/5 * * * * root $INSTALLPATH/duck.sh >/dev/null 2>&1" > "$CRONFILE" - chmod 700 "$INSTALLPATH"/duck.sh - chmod +x "$CRONFILE" - - # First-time execution of duck script - "$INSTALLPATH"/duck.sh > /dev/null 2>&1 - - SUCCESS="$( cat $INSTALLPATH/duck.log )" - - # Checks for successful run of duck.sh - if [[ $SUCCESS == "OK" ]]; then - echo "DuckDNS is enabled" - elif [[ $SUCCESS == "KO" ]]; then - echo "DuckDNS install failed, is your information correct?" - fi - - # Removes config files and cron job if ACTIVE_ is set to no - elif [[ $ACTIVE_ == "no" ]]; then - rm -f "$CRONFILE" - rm -f "$INSTALLPATH"/duck.sh - rm -f "$INSTALLPATH"/duck.log - rmdir "$INSTALLPATH" - echo "DuckDNS is now disabled" - fi -} - -# License -# -# This script is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This script is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this script; if not, write to the -# Free Software Foundation, Inc., 59 Temple Place, Suite 330, -# Boston, MA 02111-1307 USA diff --git a/etc/ncp-config.d/freeDNS.sh b/etc/ncp-config.d/freeDNS.sh deleted file mode 100644 index b13129e6..00000000 --- a/etc/ncp-config.d/freeDNS.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/bash - -# FreeDNS updater client installation on Raspbian -# -# Copyleft 2017 by Panteleimon Sarantos -# GPL licensed (see end of file) * Use at your own risk! -# - -ACTIVE_=no -UPDATEHASH_=abcdefghijklmnopqrstuvwxyzABCDEFGHIJK1234567 -DOMAIN_=mynextcloud.example.com -UPDATEINTERVAL_=30 -DESCRIPTION="DDNS FreeDNS client (need account)" - -UPDATEURL=https://freedns.afraid.org/dynamic/update.php -URL="${UPDATEURL}?${UPDATEHASH_}" - -install() -{ - apt-get update - apt-get install --no-install-recommends -y dnsutils -} - -configure() -{ - [[ $ACTIVE_ != "yes" ]] && { - rm /etc/cron.d/freeDNS - service cron restart - echo "FreeDNS client is disabled" - return 0 - } - - cat > /usr/local/bin/freedns.sh < /etc/cron.d/freeDNS - service cron restart - - cd /var/www/nextcloud - sudo -u www-data php occ config:system:set trusted_domains 3 --value="$DOMAIN_" - sudo -u www-data php occ config:system:set overwrite.cli.url --value=https://"$DOMAIN_" - - echo "FreeDNS client is enabled" -} - -# License -# -# This script is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This script is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this script; if not, write to the -# Free Software Foundation, Inc., 59 Temple Place, Suite 330, -# Boston, MA 02111-1307 USA diff --git a/etc/ncp-config.d/no-ip.sh b/etc/ncp-config.d/no-ip.sh deleted file mode 100644 index 58b6a444..00000000 --- a/etc/ncp-config.d/no-ip.sh +++ /dev/null @@ -1,127 +0,0 @@ -#!/bin/bash - -# no-ip.org installation on Raspbian -# -# Copyleft 2017 by Ignacio Nunez Hernanz -# GPL licensed (see end of file) * Use at your own risk! -# -# More at https://ownyourbits.com/2017/03/05/dynamic-dns-for-raspbian-with-no-ip-org-installer/ -# - -ACTIVE_=no -USER_=my-noip-user@email.com -PASS_=noip-pass -DOMAIN_=mycloud.ownyourbits.com -TIME_=30 -DESCRIPTION="DDNS no-ip free provider (need account)" - -INFO="For this step to succeed, you need to register a noip account first. -Internet access is required for this configuration to complete." - -install() -{ - apt-get update - apt-get install --no-install-recommends -y make gcc libc-dev - - local TMPDIR="$( mktemp -d /tmp/noip.XXXXXX )" - cd "$TMPDIR" - wget -O- --content-disposition https://github.com/nachoparker/noip-DDNS/archive/master/latest.tar.gz \ - | tar -xz \ - || return 1 - cd -; cd "$OLDPWD"/noip-DDNS-master/ - make - cp noip2 /usr/local/bin/ - - cat > /etc/init.d/noip2 <<'EOF' -#! /bin/sh -# /etc/init.d/noip2 - -### BEGIN INIT INFO -# Provides: no-ip.org -# Required-Start: $local_fs $remote_fs -# Required-Stop: $local_fs $remote_fs -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Start no-ip.org dynamic DNS -### END INIT INFO -EOF - - cat debian.noip2.sh >> /etc/init.d/noip2 - - chmod +x /etc/init.d/noip2 - cd - - rm -r "$TMPDIR" - - update-rc.d noip2 defaults - update-rc.d noip2 disable - - mkdir -p /usr/local/etc/noip2 - - [[ "$DOCKERBUILD" == 1 ]] && { - cat > /etc/services-available.d/100noip <&1 | tee >(cat - >&2) \ - | grep -q "New configuration file .* created" || return 1 - - update-rc.d noip2 enable - service noip2 restart - cd /var/www/nextcloud - sudo -u www-data php occ config:system:set trusted_domains 3 --value="$DOMAIN_" - sudo -u www-data php occ config:system:set overwrite.cli.url --value=https://"$DOMAIN_" - echo "noip DDNS enabled" - -} - -cleanup() -{ - # this uninstalls udiskie, commented out - # udiskie with these dependencies fixed in Buster - # apt-get purge -y make gcc libc-dev - : -} - -# License -# -# This script is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This script is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this script; if not, write to the -# Free Software Foundation, Inc., 59 Temple Place, Suite 330, -# Boston, MA 02111-1307 USA - diff --git a/etc/ncp-config.d/spDYN.sh b/etc/ncp-config.d/spDYN.sh deleted file mode 100644 index f9dcd471..00000000 --- a/etc/ncp-config.d/spDYN.sh +++ /dev/null @@ -1,155 +0,0 @@ -#!/bin/bash - -# spDYN setup for NextCloudPi -# -# -# Copyleft 2017 by Timm Goldenstein -# https://github.com/TimmThaler/spdnsUpdater -# -# GPL licensed (see end of file) * Use at your own risk! -# - -ACTIVE_=no -DOMAIN_=mycloud.spdns.de -TOKEN_=your-spdns-token - -INSTALLDIR=spdnsupdater -INSTALLPATH=/usr/local/etc/$INSTALLDIR -CRONFILE=/etc/cron.d/spdnsupdater -DESCRIPTION="Free Dynamic DNS provider (need account from spdyn.de)" - -install() -{ - apt-get update - apt-get install -y --no-install-recommends curl # TODO use wget instead - - # Create the spdnsUpdater.sh - mkdir -p "$INSTALLPATH" - # Write the script to file - cat > "$INSTALLPATH"/spdnsUpdater.sh <<'EOF' -#!/bin/bash - -### Usage -# -# Recommended usage: ./spdnsUpdater.sh -# Alternative usage: ./spdnsUpdater.sh -# - - -### Configuration - -# Get current IP address from -get_ip_url="https://api.ipify.org/" -update_url="https://update.spdyn.de/nic/update" - - -### Update procedure -function spdnsUpdater { - # Send the current IP address to spdyn.de - # and show the response - - params=$1 - updater=$(curl -s $update_url $params) - updater=$(echo $updater | grep -o '^[a-z]*') - - case "$updater" in - abuse) echo "[$updater] Der Host kann nicht aktualisiert werden, da er aufgrund vorheriger fehlerhafter Updateversuche gesperrt ist." - ;; - badauth) echo "[$updater] Ein ungültiger Benutzername und / oder ein ungültiges Kennwort wurde eingegeben." - ;; - good) echo "[$updater] Die Hostname wurde erfolgreich auf die neue IP aktualisiert." - ;; - yours) echo "[$updater] Der angegebene Host kann nicht unter diesem Benutzer-Account verwendet werden." - ;; - notfqdn) echo "[$updater] Der angegebene Host ist kein FQDN." - ;; - numhost) echo "[$updater] Es wurde versucht, mehr als 20 Hosts in einer Anfrage zu aktualisieren." - ;; - nochg) echo "[$updater] Die IP hat sich zum letzten Update nicht geändert." - ;; - nohost) echo "[$updater] Der angegebene Host existiert nicht oder wurde gelöscht." - ;; - fatal) echo "[$updater] Der angegebene Host wurde manuell deaktiviert." - ;; - *) echo "[$updater]" - ;; - esac - -} - - -if [ $# -eq 2 ] - then - # if hostname and token - # Get current IP address - currip=$(curl -s "$get_ip_url"); - host=$1 - token=$2 - params="-d hostname=$host -d myip=$currip -d user=$host -d pass=$token" - spdnsUpdater "$params" - elif [ $# -eq 3 ] - then - # if hostname and user and passwd - # Get current IP address - currip=$(curl -s "$get_ip_url"); - host=$1 - user=$2 - pass=$3 - params="-d hostname=$host -d myip=$currip -d user=$user -d pass=$pass" - spdnsUpdater "$params" - else - echo - echo "Updater for Dynamic DNS at spdns.de" - echo "===================================" - echo - echo "Usage:" - echo "------" - echo - echo "Recommended: ./spdnsUpdater.sh " - echo "Alternative: ./spdnsUpdater.sh " - echo -fi -EOF - - chmod 700 "$INSTALLPATH"/spdnsUpdater.sh - chmod a+x "$INSTALLPATH"/spdnsUpdater.sh - -} - -configure() -{ - if [[ $ACTIVE_ == "yes" ]]; then - - # Adds file to cron to run script for DNS record updates and change permissions - touch $CRONFILE - echo "0 * * * * root $INSTALLPATH/spdnsUpdater.sh $DOMAIN_ $TOKEN_ >/dev/null 2>&1" > "$CRONFILE" - chmod +x "$CRONFILE" - - # First-time execution of update script and print response from spdns.de server - "$INSTALLPATH"/spdnsUpdater.sh "$DOMAIN_" "$TOKEN_" - - # Removes config files and cron job if ACTIVE_ is set to no - elif [[ $ACTIVE_ == "no" ]]; then - echo "... removing cronfile: $CRONFILE" - rm -f "$CRONFILE" - echo "spdnsUpdater is now disabled" - fi - service cron restart -} - -# License -# -# This script is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This script is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this script; if not, write to the -# Free Software Foundation, Inc., 59 Temple Place, Suite 330, -# Boston, MA 02111-1307 USA diff --git a/ncp-web/ncp-launcher.php b/ncp-web/ncp-launcher.php index 35fe2f7b..9fca90c4 100644 --- a/ncp-web/ncp-launcher.php +++ b/ncp-web/ncp-launcher.php @@ -95,7 +95,7 @@ else if ( $_POST['action'] == "launch" && $_POST['config'] ) // sanity checks if ( !$_POST['ref'] ) exit( '{ "output": "Invalid request" }' ); - preg_match( '/^[0-9A-Za-z-]+$/' , $_POST['ref'] , $matches ) + preg_match( '/^[0-9A-Za-z_-]+$/' , $_POST['ref'] , $matches ) or exit( '{ "output": "Invalid input" , "token": "' . getCSRFToken() . '" }' ); // CSRF check diff --git a/ncp-web/wizard/JS/wizard.js b/ncp-web/wizard/JS/wizard.js index 8f0c4bbe..0446257c 100644 --- a/ncp-web/wizard/JS/wizard.js +++ b/ncp-web/wizard/JS/wizard.js @@ -247,7 +247,7 @@ $(document).ready(function(){ // Enable FreeDNS step $('#ddns-enable-freedns').on('click', function(){ - launch_action( 'freeDNS', + launch_action( 'DDNS_freeDNS', { "ACTIVE":"yes", "DOMAIN": $("#ddns-domain" ).val(), @@ -269,7 +269,7 @@ $(document).ready(function(){ // Enable noip step $('#ddns-enable-noip').on('click', function(){ - launch_action( 'no-ip', + launch_action( 'DDNS_no-ip', { "ACTIVE":"yes", "DOMAIN": $("#ddns-domain" ).val(), diff --git a/update.sh b/update.sh index 4bb3185f..6bd0cb98 100755 --- a/update.sh +++ b/update.sh @@ -45,6 +45,14 @@ source /usr/local/etc/library.sh mkdir -p "$CONFDIR" +# rename DDNS entries TODO temporary +[[ -f "$CONFDIR"/no-ip.sh ]] && { + mv "$CONFDIR"/no-ip.sh "$CONFDIR"/DDNS_no-ip.sh + mv "$CONFDIR"/freeDNS.sh "$CONFDIR"/DDNS_freeDNS.sh + mv "$CONFDIR"/duckDNS.sh "$CONFDIR"/DDNS_duckDNS.sh + mv "$CONFDIR"/spDYN.sh "$CONFDIR"/DDNS_spDYN.sh +} + # prevent installing some apt packages in the docker version [[ -f /.docker-image ]] && { for opt in $EXCL_DOCKER; do @@ -127,7 +135,6 @@ chmod 770 /var/www/ncp-web apt-get install -y --no-install-recommends php-imagick imagemagick-6-common } - } # end - only live updates exit 0 -- cgit v1.2.3