diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cb1a68e --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +debian/.debhelper/ +debian/debhelper-build-stamp +debian/files +debian/alternc*.log +debian/alternc*.substvars +debian/alternc*/ +*.gpg diff --git a/README b/README deleted file mode 100644 index 97faba0..0000000 --- a/README +++ /dev/null @@ -1,9 +0,0 @@ -HTTPPERM -======== - -an OUTGOING http/https filtering/logging interface - -for AlternC hosting control panel - - - diff --git a/README.md b/README.md new file mode 100644 index 0000000..12beb4e --- /dev/null +++ b/README.md @@ -0,0 +1,44 @@ +# HTTPPERM + +an OUTGOING http/https filtering/logging interface +for AlternC hosting control panel + + +## Configuration + +Once pacakge retrieved and installed, you need to enable iptables rules +* Check [httpperm-iptables-script.sh](httpperm-iptables-script.sh) script +* Adapt it +* Deploy it +* Enjoy + +## Get the package + +### Build own package + +You can compile this package with: + +``` + apt install build-essential debhelper git + git clone https://github.com/AlternC/alternc-httperm/ + cd alternc-httperm + dpkg-buildpackage -us -uc +``` + +### From GitHub + +You can obtain nightly and last stable package from the dedicated page : [releases page](https://github.com/AlternC/alternc-httperm/releases) + +### From our repository + +You can get package from our official repository : [debian.alternc.org](https://debian.alternc.org/) + +## Dependency + +You need an AlternC 3.3.* (only). + +## How to use + +This package supports only AlternC 3.3. +Original code was set to AlternC 3.3 and could be deployed manually + diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..7ba5f83 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,7 @@ +alternc-httpperm (0.0.1) stretch buster; urgency=medium + + * False package version + * Version created only to follow git history + * Start nightly build from a stable version + + -- Benjamin Sonntag Thu, 10 Aug 2017 10:36:00 +0200 \ No newline at end of file diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..f599e28 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +10 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..b42da69 --- /dev/null +++ b/debian/control @@ -0,0 +1,20 @@ +Source: alternc-httpperm +Section: admin +Priority: optional +Maintainer: AlternC Team +Build-Depends: debhelper (>= 8) +Standards-Version: 3.9.8 + +Package: alternc-httpperm +Priority: optional +Section: admin +Architecture: all +Depends: alternc (>= 3.1), alternc (< 3.5), apache2 (>= 2.4), iptables, ipset +Description: PHP-httpperm 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, etc. + . + This package is an optional module to manage OUTGOING http/https filtering/logging + . + More information on https://www.alternc.com/ diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..c3d591d --- /dev/null +++ b/debian/copyright @@ -0,0 +1,17 @@ +Copyright: + + 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. + + On Debian systems, the complete text of the GNU General Public + License can be found in /usr/share/common-licenses/GPL file. + diff --git a/debian/cron.d b/debian/cron.d new file mode 100644 index 0000000..e534969 --- /dev/null +++ b/debian/cron.d @@ -0,0 +1,4 @@ +SHELL=/bin/bash +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin + +* * * * * root cd /usr/lib/alternc && php httpperm_cron.php &>/dev/null \ No newline at end of file diff --git a/debian/install b/debian/install new file mode 100644 index 0000000..b961d05 --- /dev/null +++ b/debian/install @@ -0,0 +1 @@ +src/* . diff --git a/debian/postinst b/debian/postinst new file mode 100644 index 0000000..f507ec9 --- /dev/null +++ b/debian/postinst @@ -0,0 +1,26 @@ +#!/bin/bash -e + +ALTERNC_FUNCTIONS_FILE="/usr/lib/alternc/functions.sh" +HTTPPERM_SQL_FILE="/usr/share/alternc/install/httpperm.sql" + +if [ ! -r "${ALTERNC_FUNCTIONS_FILE}" ]; then + echo "Can't access ${ALTERNC_FUNCTIONS_FILE}" + exit 1 +fi + +# shellcheck source=/dev/null +. "${ALTERNC_FUNCTIONS_FILE}" + +case "$1" in + configure) + mysql_query "$(cat ${HTTPPERM_SQL_FILE})" + printf "\tDon't forget to apply httpperm iptables rules as explained on Readme\n" + ;; + + triggered) + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. +#DEBHELPER# \ No newline at end of file diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..ed58acc --- /dev/null +++ b/debian/rules @@ -0,0 +1,5 @@ +#!/usr/bin/make -f +#export DH_VERBOSE = 1 + +%: + dh $@ diff --git a/lib/httpperm_cron.php b/src/usr/lib/alternc/httpperm_cron.php old mode 100644 new mode 100755 similarity index 100% rename from lib/httpperm_cron.php rename to src/usr/lib/alternc/httpperm_cron.php diff --git a/logger/http-dns.php b/src/usr/lib/alternc/logger/http-dns.php similarity index 100% rename from logger/http-dns.php rename to src/usr/lib/alternc/logger/http-dns.php diff --git a/logger/http-ulog.php b/src/usr/lib/alternc/logger/http-ulog.php similarity index 100% rename from logger/http-ulog.php rename to src/usr/lib/alternc/logger/http-ulog.php diff --git a/logger/http-ulog.sh b/src/usr/lib/alternc/logger/http-ulog.sh similarity index 100% rename from logger/http-ulog.sh rename to src/usr/lib/alternc/logger/http-ulog.sh diff --git a/dump.sql b/src/usr/share/alternc/install/httpperm.sql similarity index 100% rename from dump.sql rename to src/usr/share/alternc/install/httpperm.sql diff --git a/panel/admin/httpperm_del.php b/src/usr/share/alternc/panel/admin/httpperm_del.php similarity index 100% rename from panel/admin/httpperm_del.php rename to src/usr/share/alternc/panel/admin/httpperm_del.php diff --git a/panel/admin/httpperm_doedit.php b/src/usr/share/alternc/panel/admin/httpperm_doedit.php similarity index 100% rename from panel/admin/httpperm_doedit.php rename to src/usr/share/alternc/panel/admin/httpperm_doedit.php diff --git a/panel/admin/httpperm_edit.php b/src/usr/share/alternc/panel/admin/httpperm_edit.php similarity index 100% rename from panel/admin/httpperm_edit.php rename to src/usr/share/alternc/panel/admin/httpperm_edit.php diff --git a/panel/admin/httpperm_list.php b/src/usr/share/alternc/panel/admin/httpperm_list.php similarity index 100% rename from panel/admin/httpperm_list.php rename to src/usr/share/alternc/panel/admin/httpperm_list.php diff --git a/panel/admin/httpperm_log.php b/src/usr/share/alternc/panel/admin/httpperm_log.php similarity index 100% rename from panel/admin/httpperm_log.php rename to src/usr/share/alternc/panel/admin/httpperm_log.php diff --git a/panel/class/m_httpperm.php b/src/usr/share/alternc/panel/class/m_httpperm.php similarity index 100% rename from panel/class/m_httpperm.php rename to src/usr/share/alternc/panel/class/m_httpperm.php diff --git a/canonicalize_test.php b/test/canonicalize_test.php similarity index 100% rename from canonicalize_test.php rename to test/canonicalize_test.php