From ca6b1cf4d9bb4f0c9028c1cecba4064ae3fddc0e Mon Sep 17 00:00:00 2001
From: Benjamin Sonntag
Date: Sat, 7 Oct 2017 15:12:18 +0200
Subject: [PATCH] [enh] removing the unmaintained upnp package
---
DEBIAN_COMPLIANCE | 3 -
Makefile | 5 +-
bureau/class/m_admin.php | 14 ---
bureau/class/m_dom.php | 13 ---
bureau/class/m_ftp.php | 12 --
bureau/class/m_mail.php | 18 ---
debian/alternc-upnp.dirs | 6 -
debian/control | 32 ------
debian/rules | 1 -
upnp/Makefile | 32 ------
upnp/adminmenu_upnp.php | 1 -
upnp/m_upnp.php | 238 ---------------------------------------
upnp/update_upnp.sh | 31 -----
upnp/upnp-cron | 3 -
upnp/upnp-install | 2 -
upnp/upnp.sql | 16 ---
upnp/upnp_change.php | 46 --------
upnp/upnp_list.php | 97 ----------------
18 files changed, 1 insertion(+), 569 deletions(-)
delete mode 100644 debian/alternc-upnp.dirs
delete mode 100644 upnp/Makefile
delete mode 100644 upnp/adminmenu_upnp.php
delete mode 100644 upnp/m_upnp.php
delete mode 100644 upnp/update_upnp.sh
delete mode 100644 upnp/upnp-cron
delete mode 100644 upnp/upnp-install
delete mode 100644 upnp/upnp.sql
delete mode 100644 upnp/upnp_change.php
delete mode 100644 upnp/upnp_list.php
diff --git a/DEBIAN_COMPLIANCE b/DEBIAN_COMPLIANCE
index 28684bfb..b7de2dab 100644
--- a/DEBIAN_COMPLIANCE
+++ b/DEBIAN_COMPLIANCE
@@ -29,8 +29,6 @@ E: alternc: dir-or-file-in-var-run var/run/alternc/
W: alternc: binary-without-manpage usr/bin/alternc_get_path
W: alternc: binary-without-manpage usr/bin/alternc_reload
W: alternc: maintainer-script-ignores-errors prerm
-E: alternc-upnp: php-script-but-no-phpX-cli-dep usr/lib/alternc/update_upnp.sh
-W: alternc-upnp: executable-not-elf-or-script usr/lib/alternc/install.d/upnp-install
W: alternc-awstats: possible-debconf-note-abuse preinst:13 alternc-awstats/errorinstall
E: alternc: duplicate-conffile etc/cron.d/alternc
@@ -67,7 +65,6 @@ W: alternc: script-not-executable usr/lib/alternc/functions_dns.sh
W: alternc: script-not-executable usr/lib/alternc/functions_hosting.sh
W: alternc: script-not-executable var/alternc/bureau/class/export_account.php
-W: alternc source: debhelper-but-no-misc-depends alternc-upnp
W: alternc source: debhelper-but-no-misc-depends alternc-slave
W: alternc source: debhelper-but-no-misc-depends alternc-roundcube
W: alternc source: debhelper-but-no-misc-depends alternc-squirrelmail
diff --git a/Makefile b/Makefile
index 77115cf3..47b6dd4b 100644
--- a/Makefile
+++ b/Makefile
@@ -28,7 +28,7 @@ build:
# gettext are built at runtime, to be able to MERGE them from CORE + MODULES before msgfmt
install:
-#install-alternc install-squirrelmail install-roundcube install-upnp install-awstats
+#install-alternc install-squirrelmail install-roundcube install-awstats
# install AlternC files common between ALTERNC and ALTERNC-SLAVE
install-common:
@@ -84,9 +84,6 @@ install-roundcube:
install-squirrelmail:
make -C squirrelmail install DESTDIR=$(DESTDIR)
-install-upnp:
- make -C upnp install DESTDIR=$(DESTDIR)
-
install-api:
make -C api install DESTDIR=$(DESTDIR)
diff --git a/bureau/class/m_admin.php b/bureau/class/m_admin.php
index c44b0ace..b947b260 100644
--- a/bureau/class/m_admin.php
+++ b/bureau/class/m_admin.php
@@ -1528,20 +1528,6 @@ class m_admin {
return true; // congratulations !
}
- /**
- * hook function called by AlternC-upnp to know which open
- * tcp or udp ports this class requires or suggests
- *
- * @access private
- * @return array a key => value list of port protocol name mandatory values
- */
- function hook_upnp_list() {
- return array(
- "http" => array("port" => 80, "protocol" => "tcp", "mandatory" => 1),
- "https" => array("port" => 443, "protocol" => "tcp", "mandatory" => 0),
- "ssh" => array("port" => 22, "protocol" => "tcp", "mandatory" => 0),
- );
- }
}
diff --git a/bureau/class/m_dom.php b/bureau/class/m_dom.php
index bfadf16b..006f766c 100644
--- a/bureau/class/m_dom.php
+++ b/bureau/class/m_dom.php
@@ -2175,19 +2175,6 @@ class m_dom {
}
- /** hook function called by AlternC-upnp to know which open
- * tcp or udp ports this class requires or suggests
- * @return array a key => value list of port protocol name mandatory values
- * @access private
- */
- function hook_upnp_list() {
- return array(
- "dns-tcp" => array("port" => 53, "protocol" => "tcp", "mandatory" => 1),
- "dns-udp" => array("port" => 53, "protocol" => "udp", "mandatory" => 1),
- );
- }
-
-
/**
* List if there is problems in the domains.
* Problems can appear when editing domains type properties
diff --git a/bureau/class/m_ftp.php b/bureau/class/m_ftp.php
index 521f99d9..3ad6fb0b 100644
--- a/bureau/class/m_ftp.php
+++ b/bureau/class/m_ftp.php
@@ -498,17 +498,5 @@ class m_ftp {
}
- /**
- * hook function called by AlternC-upnp to know which open
- * tcp or udp ports this class requires or suggests
- * @return array a key => value list of port protocol name mandatory values
- * @access private
- */
- function hook_upnp_list() {
- return array(
- "ftp" => array("port" => 21, "protocol" => "tcp", "mandatory" => 1),
- );
- }
-
} /* Class m_ftp */
diff --git a/bureau/class/m_mail.php b/bureau/class/m_mail.php
index b5f38926..1ec7ebfa 100644
--- a/bureau/class/m_mail.php
+++ b/bureau/class/m_mail.php
@@ -1062,23 +1062,5 @@ ORDER BY
}
- /**
- * hook function called by AlternC-upnp to know which open
- * tcp or udp ports this class requires or suggests
- * @return array a key => value list of port protocol name mandatory values
- * @access private
- */
- function hook_upnp_list() {
- return array(
- "imap" => array("port" => 143, "protocol" => "tcp", "mandatory" => 1),
- "imaps" => array("port" => 993, "protocol" => "tcp", "mandatory" => 1),
- "pop" => array("port" => 110, "protocol" => "tcp", "mandatory" => 1),
- "pops" => array("port" => 995, "protocol" => "tcp", "mandatory" => 1),
- "smtp" => array("port" => 25, "protocol" => "tcp", "mandatory" => 1),
- "sieve" => array("port" => 2000, "protocol" => "tcp", "mandatory" => 1),
- "submission" => array("port" => 587, "protocol" => "tcp", "mandatory" => 0),
- );
- }
-
} /* Class m_mail */
diff --git a/debian/alternc-upnp.dirs b/debian/alternc-upnp.dirs
deleted file mode 100644
index fa36b7dc..00000000
--- a/debian/alternc-upnp.dirs
+++ /dev/null
@@ -1,6 +0,0 @@
-etc/cron.d
-usr/share/alternc/panel/class/
-usr/share/alternc/panel/admin/
-usr/lib/alternc/
-usr/lib/alternc/install.d
-usr/share/alternc/install/
diff --git a/debian/control b/debian/control
index e561c928..462e9a58 100644
--- a/debian/control
+++ b/debian/control
@@ -275,38 +275,6 @@ Description: Awstats statistics module for AlternC
.
More information on http://www.alternc.com/.
-Package: alternc-upnp
-Architecture: all
-Pre-depends: debconf (>= 0.5.00) | debconf-2.0
-Depends: debianutils (>= 1.13.1)
- , alternc (>= 3.0~rc1)
- , miniupnpc
- , php5-cli
- , ${misc:Depends}
-Description: UPnP client for AlternC
- AlternC is a mutualized hosting software manager for Linux.
- It allows you to manage your websites, domains, ftp, emails, aliases,
- web statistics, mailing-lists, jabber accounts, etc.
- .
- This extension to AlternC is installing a UPnP IGD client and make it so
- that your router required tcp and udp port are forwarded to AlternC.
- You need that only if your AlternC's server is behind a NAT router.
- .
- More information at http://www.alternc.com/
-Homepage: http://www.alternc.com/
-Description-fr.UTF-8: Client UPnP pour AlternC
- AlternC est un logiciel d'hébergement mutualisé pour serveur Linux.
- Il permet de gérer les sites web, domaines, ftp, emails, alias,
- statistiques web, listes de discussions, comptes jabber, etc.
- .
- Cette extension d'AlternC installe un client UPnP IGD et fait de telle
- sorte que les ports udp et tcp nécessaire au fonctionnement de votre
- serveur sous AlternC soient transmis depuis votre routeur.
- Vous n'avez besoin de cette extension que si votre serveur AlternC est
- situé derrière un routeur NAT.
- .
- Pour plus d'informations, consultez http://www.alternc.com/
-
Package: alternc-api
Architecture: all
Pre-depends: debconf (>= 0.5.00) | debconf-2.0
diff --git a/debian/rules b/debian/rules
index e83bf462..0d85457e 100755
--- a/debian/rules
+++ b/debian/rules
@@ -13,7 +13,6 @@ override_dh_install:
$(MAKE) install-alternc DESTDIR=$(CURDIR)/debian/alternc
$(MAKE) install-squirrelmail DESTDIR=$(CURDIR)/debian/alternc-squirrelmail
$(MAKE) install-roundcube DESTDIR=$(CURDIR)/debian/alternc-roundcube
- $(MAKE) install-upnp DESTDIR=$(CURDIR)/debian/alternc-upnp
$(MAKE) install-awstats DESTDIR=$(CURDIR)/debian/alternc-awstats
$(MAKE) install-slave DESTDIR=$(CURDIR)/debian/alternc-slave
$(MAKE) install-api DESTDIR=$(CURDIR)/debian/alternc-api
diff --git a/upnp/Makefile b/upnp/Makefile
deleted file mode 100644
index 79fc263e..00000000
--- a/upnp/Makefile
+++ /dev/null
@@ -1,32 +0,0 @@
-# ----------------------------------------------------------------------
-# AlternC - Web Hosting System
-# Copyright (C) 2000-2012 by the AlternC Development Team.
-# https://alternc.org/
-# ----------------------------------------------------------------------
-# LICENSE
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License (GPL)
-# as published by the Free Software Foundation; either version 2
-# 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.
-#
-# To read the license please visit http://www.gnu.org/copyleft/gpl.html
-# ----------------------------------------------------------------------
-# Purpose of file: Install the files of alternc-upnp packages
-# ----------------------------------------------------------------------
-
-install:
-# Desktop files
- install -m 644 m_upnp.php $(DESTDIR)/usr/share/alternc/panel/class/
- install -m 644 upnp_list.php upnp_change.php $(DESTDIR)/usr/share/alternc/panel/admin/
- install -m 644 adminmenu_upnp.php $(DESTDIR)/usr/share/alternc/panel/admin/
-# Cron
- install -m 755 update_upnp.sh $(DESTDIR)/usr/lib/alternc/
-# Install script
- install -m 644 upnp.sql $(DESTDIR)/usr/share/alternc/install/
- install -m 755 upnp-install $(DESTDIR)/usr/lib/alternc/install.d
diff --git a/upnp/adminmenu_upnp.php b/upnp/adminmenu_upnp.php
deleted file mode 100644
index 325e29a3..00000000
--- a/upnp/adminmenu_upnp.php
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/upnp/m_upnp.php b/upnp/m_upnp.php
deleted file mode 100644
index 0c67afed..00000000
--- a/upnp/m_upnp.php
+++ /dev/null
@@ -1,238 +0,0 @@
-log("upnp","get_forward_list");
- $db->query("SELECT * FROM upnp");
- $res=array();
- while ($db->next_record()) {
- $res[]=$db->Record;
- }
- return $res;
- }
-
-
- /* ----------------------------------------------------------------- */
- /** enable a upnp port in the upnp table
- * @param integer the id of the port to enable
- * @return boolean TRUE if the port has been properly forwarded
- * FALSE if an error occurred
- */
- function enable_port($id) {
- global $db,$err;
- $id=intval($id);
- $err->log("upnp","enable_port($id)");
- $db->query("SELECT enabled FROM upnp WHERE id=$id;");
- if (!$db->next_record()) {
- $err->raise("upnp",_("The required port is not currently defined"));
- return false;
- }
- if (!$db->f("enabled")) {
- $db->query("UPDATE upnp SET enabled=1 WHERE id=$id;");
- $err->raise("upnp",_("The specified upnp port is now enabled"));
- return true;
- }
- $err->raise("upnp",_("The specified upnp port is already enabled"));
- return true;
- }
-
-
- /* ----------------------------------------------------------------- */
- /** disable a upnp port in the upnp table
- * @param integer the id of the port to disable
- * @return boolean TRUE if the port has been properly forwarded
- * FALSE if an error occurred
- */
- function disable_port($id) {
- global $db,$err;
- $id=intval($id);
- $err->log("upnp","disable_port($id)");
- $db->query("SELECT enabled,mandatory FROM upnp WHERE id=$id;");
- if (!$db->next_record()) {
- $err->raise("upnp",_("The required port is not currently defined"));
- return false;
- }
- if ($db->f("mandatory")) {
- $err->raise("upnp",_("You can't disable that mandatory port forward"));
- return false;
- }
- if ($db->f("enabled")) {
- $db->query("UPDATE upnp SET enabled=0 WHERE id=$id;");
- $err->raise("upnp",_("The specified upnp port is now disabled"));
- return true;
- }
- $err->raise("upnp",_("The specified upnp port is already disabled"));
- return true;
- }
-
-
- /* ----------------------------------------------------------------- */
- /** cron launched every minute to check the status of UPnP forwarding
- */
- function cron() {
- global $hooks,$db,$L_INTERNAL_IP,$PUBLIC_IP;
- // if we check anything less than 5 minutes ago, or if the upnp table is empty, let's make a check...
- $db->query("SELECT UNIX_TIMESTAMP(lastcheck) AS lc, * FROM upnp ORDER BY lastcheck ASC;");
- $forwards=array();
- $bigcheck=false;
- if (!$db->next_record()) {
- $bigcheck=true;
- } else {
- if ($db->f("lc")+600