From 290c9cf89b07f4d873bc098f2160ae6008b4bab0 Mon Sep 17 00:00:00 2001 From: Stefan Schantl Date: Mon, 14 Oct 2013 19:07:18 +0200 Subject: [PATCH 1/7] DDNS: Add support for udmedia.de. This commit adds support for the dynamic dns service provider udmedia.de and was requested by a user on the forum. Details can be found here: http://forum.ipfire.org/index.php?topic=9097.0 Fixes #10432. --- html/cgi-bin/ddns.cgi | 2 ++ src/scripts/setddns.pl | 37 ++++++++++++++++++++++++++++++++++++- 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/html/cgi-bin/ddns.cgi b/html/cgi-bin/ddns.cgi index 88847a050..553d5d7c6 100644 --- a/html/cgi-bin/ddns.cgi +++ b/html/cgi-bin/ddns.cgi @@ -256,6 +256,7 @@ $checked{'SERVICE'}{'selfhost.de'} = ''; $checked{'SERVICE'}{'strato.com'} = ''; $checked{'SERVICE'}{'tzo.com'} = ''; $checked{'SERVICE'}{'zoneedit.com'} = ''; +$checked{'SERVICE'}{'udmedia.de'} = ''; $checked{'SERVICE'}{$settings{'SERVICE'}} = "selected='selected'"; $checked{'BEHINDROUTER'}{'RED_IP'} = ''; @@ -352,6 +353,7 @@ print <strato.com + $Lang::tr{'hostname'}: * diff --git a/src/scripts/setddns.pl b/src/scripts/setddns.pl index f943ac83e..12c0f1df5 100644 --- a/src/scripts/setddns.pl +++ b/src/scripts/setddns.pl @@ -637,7 +637,42 @@ if ($ip ne $ipcache) { } else { &General::log("Dynamic DNS ip-update for $settings{'HOSTDOMAIN'} : failure (could not connect to server)"); } - } else { + } + elsif ($settings{'SERVICE'} eq 'udmedia.de') { + # use proxy ? + my %proxysettings; + &General::readhash("${General::swroot}/proxy/settings", \%proxysettings); + if ($_=$proxysettings{'UPSTREAM_PROXY'}) { + my ($peer, $peerport) = (/^(?:[a-zA-Z ]+\:\/\/)?(?:[A-Za-z0-9\_\.\-]*?(?:\:[A-Za-z0-9\_\.\-]*?)?\@)?([a-zA-Z0-9\.\_\-]*?)(?:\:([0-9]{1,5}))?(?:\/.*?)?$/); + Net::SSLeay::set_proxy($peer,$peerport,$proxysettings{'UPSTREAM_USER'},$proxysettings{'UPSTREAM_PASSWORD'} ); + } + + if ($settings{'HOSTNAME'} eq '') { + $settings{'HOSTDOMAIN'} = $settings{'DOMAIN'}; + } else { + $settings{'HOSTDOMAIN'} = "$settings{'HOSTNAME'}.$settings{'DOMAIN'}"; + } + + my ($out, $response) = Net::SSLeay::get_https( 'www.udmedia.de', + 443, + "/nic/update?myip=$ip&username=$settings{'HOSTDOMAIN'}&password=$settings{'PASSWORD'}", + Net::SSLeay::make_headers('User-Agent' => 'IPFire', + 'Authorization' => 'Basic ' . encode_base64("$settings{'LOGIN'}:$settings{'PASSWORD'}")) ); + + # Valid response are 'ok' 'nochange' + if ($response =~ m%HTTP/1\.. 200 OK%) { + if ( $out !~ m/^(ok|nochg)/ ) { + $out =~ s/\n/ /g; + &General::log("Dynamic DNS ip-update for $settings{'HOSTDOMAIN'} : failure ($out)"); + } else { + &General::log("Dynamic DNS ip-update for $settings{'HOSTDOMAIN'} : success"); + $success++; + } + } else { + &General::log("Dynamic DNS ip-update for $settings{'HOSTDOMAIN'} : failure (could not connect to server, check your credentials---$out-$response--)"); + } + } + else { if ($settings{'WILDCARDS'} eq 'on') { $settings{'WILDCARDS'} = '-w'; } else { From afe4656c72c71715bb264ef63849826e3bc0a399 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Tue, 15 Oct 2013 11:50:48 +0200 Subject: [PATCH 2/7] DDNS: Sort providers alphabetically. --- html/cgi-bin/ddns.cgi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html/cgi-bin/ddns.cgi b/html/cgi-bin/ddns.cgi index 553d5d7c6..ae4de6cd5 100644 --- a/html/cgi-bin/ddns.cgi +++ b/html/cgi-bin/ddns.cgi @@ -352,8 +352,8 @@ print <selfhost.de - + $Lang::tr{'hostname'}: * From f99356520c523e101d4010be6cd3d07f4cb34cbf Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Tue, 15 Oct 2013 16:46:15 +0200 Subject: [PATCH 3/7] jquery: Add extra jquery package. Because this is easier to keep up to date. --- config/rootfiles/common/jquery | 1 + lfs/jquery | 76 ++++++++++++++++++++++++++++++++++ make.sh | 1 + 3 files changed, 78 insertions(+) create mode 100644 config/rootfiles/common/jquery create mode 100644 lfs/jquery diff --git a/config/rootfiles/common/jquery b/config/rootfiles/common/jquery new file mode 100644 index 000000000..cb5528892 --- /dev/null +++ b/config/rootfiles/common/jquery @@ -0,0 +1 @@ +srv/web/ipfire/html/include/jquery.js diff --git a/lfs/jquery b/lfs/jquery new file mode 100644 index 000000000..7856ce01e --- /dev/null +++ b/lfs/jquery @@ -0,0 +1,76 @@ +############################################################################### +# # +# IPFire.org - A linux based firewall # +# Copyright (C) 2007-2013 IPFire Team # +# # +# This program 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 3 of the License, or # +# (at your option) any later version. # +# # +# This program 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 program. If not, see . # +# # +############################################################################### + +############################################################################### +# Definitions +############################################################################### + +include Config + +VER = 1.10.2 + +THISAPP = jquery-$(VER) +DL_FILE = $(THISAPP).min.js +DL_FROM = $(URL_IPFIRE) +DIR_APP = $(DIR_SRC)/$(THISAPP) +TARGET = $(DIR_INFO)/$(THISAPP) + +############################################################################### +# Top-level Rules +############################################################################### + +objects = $(DL_FILE) + +$(DL_FILE) = $(DL_FROM)/$(DL_FILE) + +$(DL_FILE)_MD5 = 628072e7212db1e8cdacb22b21752cda + +install : $(TARGET) + +check : $(patsubst %,$(DIR_CHK)/%,$(objects)) + +download :$(patsubst %,$(DIR_DL)/%,$(objects)) + +md5 : $(subst %,%_MD5,$(objects)) + +############################################################################### +# Downloading, checking, md5sum +############################################################################### + +$(patsubst %,$(DIR_CHK)/%,$(objects)) : + @$(CHECK) + +$(patsubst %,$(DIR_DL)/%,$(objects)) : + @$(LOAD) + +$(subst %,%_MD5,$(objects)) : + @$(MD5) + +############################################################################### +# Installation Details +############################################################################### + +$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) + @$(PREBUILD) + + -mkdir -pv /srv/web/ipfire/html/include + install -v -m 644 $(DIR_DL)/$(DL_FILE) /srv/web/ipfire/html/include/jquery.js + + @$(POSTBUILD) diff --git a/make.sh b/make.sh index 9619ad33b..61308921c 100755 --- a/make.sh +++ b/make.sh @@ -493,6 +493,7 @@ buildipfire() { ipfiremake apache2 ipfiremake php ipfiremake apache2 PASS=C + ipfiremake jquery ipfiremake arping ipfiremake beep ipfiremake dvdrtools From 0b1b223aa097c3de563c67b36cc84d8ad6dca6da Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Tue, 15 Oct 2013 16:48:10 +0200 Subject: [PATCH 4/7] webif: Use new version of jquery. --- html/html/themes/ipfire/include/functions.pl | 2 +- html/html/themes/maniac/include/functions.pl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/html/html/themes/ipfire/include/functions.pl b/html/html/themes/ipfire/include/functions.pl index c557e8b17..2707593db 100644 --- a/html/html/themes/ipfire/include/functions.pl +++ b/html/html/themes/ipfire/include/functions.pl @@ -177,7 +177,7 @@ END ; if ($settings{'SPEED'} ne 'off') { print < + +