Skip to content

Commit d8a0163

Browse files
author
Jorge Muñoz
committed
Merge branch 'develop' into 6202-support-for-borg-archive-in-backups
2 parents 4cd4868 + 2b30a07 commit d8a0163

File tree

245 files changed

+1932
-631
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

245 files changed

+1932
-631
lines changed

.gitlab-ci.yml

Lines changed: 39 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ syntax:lint:
1717
- schedules
1818
- web
1919
- merge_requests
20+
- /^\d+\.\d+\.\d+$/
2021

2122
script:
2223
- echo "Syntax checking PHP files"
@@ -32,6 +33,12 @@ syntax_diff:lint:
3233
- pushes
3334
- branches
3435

36+
except:
37+
- schedules
38+
- web
39+
- merge_requests
40+
- /^\d+\.\d+\.\d+$/
41+
3542
script:
3643
- echo "Syntax checking PHP files"
3744
- bash ./.git-scripts/syntax.sh commit
@@ -52,33 +59,46 @@ syntax_diff:lint:
5259
# - vendor/bin/phplint
5360

5461

55-
test:install:
56-
stage: test
57-
image: jerob/docker-ispconfig
58-
only:
59-
- schedules
60-
- web
61-
script:
62-
- $CI_PROJECT_DIR/helper_scripts/test_install_docker.sh
63-
- apt-get update
64-
- apt-get --yes install curl
65-
- curl --insecure https://127.0.0.1:8080/login/
66-
- ps xaf
67-
62+
#test:install:
63+
# stage: test
64+
# image: jerob/docker-ispconfig
65+
# only:
66+
# - schedules
67+
# - web
68+
# - /^\d+\.\d+\.\d+$/
69+
#
70+
# script:
71+
# - $CI_PROJECT_DIR/helper_scripts/test_install_docker.sh
72+
# - apt-get update
73+
# - apt-get --yes install curl
74+
# - curl --insecure https://127.0.0.1:8080/login/
75+
# - ps xaf
76+
#
77+
# needs: ["syntax:lint"]
6878

6979
build:package:
7080
stage: build
7181
image: edbizarro/gitlab-ci-pipeline-php:7.2
7282
only:
7383
refs:
7484
- /^\d+\.\d+\.\d+$/
75-
except:
76-
- branches
77-
- merge_requests
78-
- schedules
79-
- pushes
85+
- web
86+
8087
script:
8188
- echo "Building release."
89+
- if [[ "$VER" == "" ]] ; then VER="$CI_COMMIT_TAG" ; fi
90+
- if [[ "$VER" == "" ]] ; then VER="3.2dev"$(date +%s) ; fi
91+
- if [[ "$VER" != "" ]] ; then echo "Replacing 3.2dev by $VER" ; sed -i -r 's/3\.2dev/'${VER}'/g' install/tpl/config.inc.php.master install/sql/ispconfig3.sql ; fi
92+
- RET=0
93+
- tar -cpzf ISPConfig-${VER}.tar.gz --exclude "ISPConfig-${VER}.tar.gz" --exclude ".git*" --exclude ".phplint.yml" --transform 's,^\./,ispconfig3_install/,' . || RET=$?
94+
- if [[ $RET > 1 ]] ; then exit $RET ; fi
95+
- echo "Listing tar contents for verification"
96+
- tar -tvf ISPConfig-${VER}.tar.gz
97+
- echo "Uploading file to download server"
98+
- curl -u "${DEPLOY_FTP_USER}:${DEPLOY_FTP_PASSWORD}" -T ISPConfig-${VER}.tar.gz ftp://${DEPLOY_FTP_SERVER}/web/
99+
- if [[ "$VER" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] ; then echo "Stable release ${VER}" ; curl -u "${DEPLOY_FTP_USER}:${DEPLOY_FTP_PASSWORD}" -T ISPConfig-${VER}.tar.gz ftp://${DEPLOY_FTP_SERVER}/web/ISPConfig-3-stable.tar.gz ; echo -n "${VER}" > ispconfig3_version.txt ; curl -u "${DEPLOY_FTP_USER}:${DEPLOY_FTP_PASSWORD}" -T ispconfig3_version.txt ftp://${DEPLOY_FTP_SERVER}/web/ ; else echo "Dev release ${VER}" ; fi
100+
- rm ISPConfig-${VER}.tar.gz
101+
- echo "Download url is https://download.ispconfig.org/ISPConfig-${VER}.tar.gz"
82102

83-
when: manual
103+
needs: ["syntax:lint"]
84104
allow_failure: false

helper_scripts/cert_check.sh

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
#!/bin/bash
2+
3+
chkdata() {
4+
F=$1
5+
CRT=$2
6+
KEY=$3
7+
if [[ "$CRT" != "" && "$KEY" != "" ]] ; then
8+
if [[ ! -f "$CRT" ]] ; then
9+
echo "[WARN] CERTIFICATE FILE ${CRT} MISSING FOR ${F}" ;
10+
else
11+
echo -n "Checking ${CRT}" ;
12+
CHK=$(openssl x509 -in "${CRT}" -text -noout >/dev/null 2>&1 ; echo $?);
13+
if [[ $CHK -ne 0 ]] ; then
14+
echo " FAILED!" ;
15+
else
16+
echo " OK" ;
17+
fi
18+
fi
19+
if [[ ! -f "$KEY" ]] ; then
20+
echo "[WARN] KEY FILE ${KEY} MISSING FOR ${F}" ;
21+
else
22+
echo -n "Checking ${KEY}" ;
23+
CHK=$(openssl rsa -in "${KEY}" -check -noout >/dev/null 2>&1 ; echo $?);
24+
if [[ $CHK -ne 0 ]] ; then
25+
echo " FAILED!" ;
26+
else
27+
echo " OK" ;
28+
fi
29+
fi
30+
31+
if [[ -f "$CRT" && -f "$KEY" ]] ; then
32+
echo -n "Checking that key and certificate match";
33+
MDCRT=$(openssl x509 -noout -modulus -in "${CRT}" | openssl md5) ;
34+
MDKEY=$(openssl rsa -noout -modulus -in "${KEY}" | openssl md5) ;
35+
if [[ "$MDCRT" != "$MDKEY" ]] ; then
36+
echo " FAILED!" ;
37+
else
38+
echo " OK" ;
39+
fi
40+
fi
41+
echo "---" ;
42+
elif [[ "$CRT" != "" || "$KEY" != "" ]] ; then
43+
echo "[WARN] Check SSL config of ${F}";
44+
echo "---" ;
45+
fi
46+
}
47+
48+
if [[ -d /etc/apache2/sites-enabled ]] ; then
49+
echo "Checking enabled apache vhosts" ;
50+
for FIL in /etc/apache2/sites-enabled/* ; do
51+
CRT=$(grep 'SSLCertificateFile' "${FIL}" | grep -E -v '^[[:space:]]*#' | awk '{print $2}' | head -n 1) ;
52+
KEY=$(grep 'SSLCertificateKeyFile' "${FIL}" | grep -E -v '^[[:space:]]*#' | awk '{print $2}' | head -n 1) ;
53+
chkdata "$FIL" "$CRT" "$KEY" ;
54+
done
55+
fi
56+
57+
if [[ -d /etc/nginx/sites-enabled ]] ; then
58+
echo "Checking enabled nginx vhosts" ;
59+
for FIL in /etc/nginx/sites-enabled/* ; do
60+
CRT=$(grep 'ssl_certificate' "${FIL}" | grep -E -v '^[[:space:]]*#' | awk '{print $2}' | head -n 1) ;
61+
CRT=${CRT%;}
62+
KEY=$(grep 'ssl_certificate_key' "${FIL}" | grep -E -v '^[[:space:]]*#' | awk '{print $2}' | head -n 1) ;
63+
KEY=${KEY%;}
64+
chkdata "$FIL" "$CRT" "$KEY" ;
65+
done
66+
fi
Lines changed: 239 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,239 @@
1+
<?php
2+
3+
/*
4+
Copyright (c) 2021, Till Brehm, ISPConfig UG
5+
All rights reserved.
6+
7+
Redistribution and use in source and binary forms, with or without modification,
8+
are permitted provided that the following conditions are met:
9+
10+
* Redistributions of source code must retain the above copyright notice,
11+
this list of conditions and the following disclaimer.
12+
* Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
* Neither the name of ISPConfig nor the names of its contributors
16+
may be used to endorse or promote products derived from this software without
17+
specific prior written permission.
18+
19+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
20+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22+
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
23+
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
24+
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
26+
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
28+
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29+
*/
30+
31+
//*** Debian 11 default settings
32+
33+
//* Main
34+
$conf['language'] = 'en';
35+
$conf['distname'] = 'debian110';
36+
$conf['hostname'] = 'server1.domain.tld'; // Full hostname
37+
$conf['ispconfig_install_dir'] = '/usr/local/ispconfig';
38+
$conf['ispconfig_config_dir'] = '/usr/local/ispconfig';
39+
$conf['ispconfig_log_priority'] = 2; // 0 = Debug, 1 = Warning, 2 = Error
40+
$conf['ispconfig_log_dir'] = '/var/log/ispconfig';
41+
$conf['server_id'] = 1;
42+
$conf['init_scripts'] = '/etc/init.d';
43+
$conf['runlevel'] = '/etc';
44+
$conf['shells'] = '/etc/shells';
45+
$conf['pam'] = '/etc/pam.d';
46+
47+
//* Services provided by this server, this selection will be overridden by the expert mode
48+
$conf['services']['mail'] = true;
49+
$conf['services']['web'] = true;
50+
$conf['services']['dns'] = true;
51+
$conf['services']['file'] = true;
52+
$conf['services']['db'] = true;
53+
$conf['services']['vserver'] = true;
54+
$conf['services']['proxy'] = false;
55+
$conf['services']['firewall'] = false;
56+
57+
//* MySQL
58+
$conf['mysql']['installed'] = false; // will be detected automatically during installation
59+
$conf['mysql']['init_script'] = 'mysql';
60+
$conf['mysql']['host'] = 'localhost';
61+
$conf['mysql']['ip'] = '127.0.0.1';
62+
$conf['mysql']['port'] = '3306';
63+
$conf['mysql']['database'] = 'dbispconfig';
64+
$conf['mysql']['admin_user'] = 'root';
65+
$conf['mysql']['admin_password'] = '';
66+
$conf['mysql']['charset'] = 'utf8';
67+
$conf['mysql']['ispconfig_user'] = 'ispconfig';
68+
$conf['mysql']['ispconfig_password'] = md5(uniqid(rand()));
69+
$conf['mysql']['master_slave_setup'] = 'n';
70+
$conf['mysql']['master_host'] = '';
71+
$conf['mysql']['master_database'] = 'dbispconfig';
72+
$conf['mysql']['master_admin_user'] = 'root';
73+
$conf['mysql']['master_admin_password'] = '';
74+
$conf['mysql']['master_ispconfig_user'] = '';
75+
$conf['mysql']['master_ispconfig_password'] = md5(uniqid(rand()));
76+
77+
//* Apache
78+
$conf['apache']['installed'] = false; // will be detected automatically during installation
79+
$conf['apache']['user'] = 'www-data';
80+
$conf['apache']['group'] = 'www-data';
81+
$conf['apache']['init_script'] = 'apache2';
82+
$conf['apache']['version'] = '2.4';
83+
$conf['apache']['vhost_conf_dir'] = '/etc/apache2/sites-available';
84+
$conf['apache']['vhost_conf_enabled_dir'] = '/etc/apache2/sites-enabled';
85+
$conf['apache']['vhost_port'] = '8080';
86+
$conf['apache']['php_ini_path_apache'] = '/etc/php/7.4/apache2/php.ini';
87+
$conf['apache']['php_ini_path_cgi'] = '/etc/php/7.4/cgi/php.ini';
88+
89+
//* Website base settings
90+
$conf['web']['website_basedir'] = '/var/www';
91+
$conf['web']['website_path'] = '/var/www/clients/client[client_id]/web[website_id]';
92+
$conf['web']['website_symlinks'] = '/var/www/[website_domain]/:/var/www/clients/client[client_id]/[website_domain]/';
93+
94+
//* Apps base settings
95+
$conf['web']['apps_vhost_ip'] = '_default_';
96+
$conf['web']['apps_vhost_port'] = '8081';
97+
$conf['web']['apps_vhost_servername'] = '';
98+
$conf['web']['apps_vhost_user'] = 'ispapps';
99+
$conf['web']['apps_vhost_group'] = 'ispapps';
100+
101+
//* Fastcgi
102+
$conf['fastcgi']['fastcgi_phpini_path'] = '/etc/php/7.4/cgi/';
103+
$conf['fastcgi']['fastcgi_starter_path'] = '/var/www/php-fcgi-scripts/[system_user]/';
104+
$conf['fastcgi']['fastcgi_bin'] = '/usr/bin/php-cgi';
105+
106+
//* Postfix
107+
$conf['postfix']['installed'] = false; // will be detected automatically during installation
108+
$conf['postfix']['config_dir'] = '/etc/postfix';
109+
$conf['postfix']['init_script'] = 'postfix';
110+
$conf['postfix']['user'] = 'postfix';
111+
$conf['postfix']['group'] = 'postfix';
112+
$conf['postfix']['vmail_userid'] = '5000';
113+
$conf['postfix']['vmail_username'] = 'vmail';
114+
$conf['postfix']['vmail_groupid'] = '5000';
115+
$conf['postfix']['vmail_groupname'] = 'vmail';
116+
$conf['postfix']['vmail_mailbox_base'] = '/var/vmail';
117+
118+
//* Mailman
119+
$conf['mailman']['installed'] = false; // will be detected automatically during installation
120+
$conf['mailman']['config_dir'] = '/etc/mailman';
121+
$conf['mailman']['init_script'] = 'mailman';
122+
123+
//* mlmmj
124+
$conf['mlmmj']['installed'] = false; // will be detected automatically during installation
125+
$conf['mlmmj']['config_dir'] = '/etc/mlmmj';
126+
127+
//* Getmail
128+
$conf['getmail']['installed'] = false; // will be detected automatically during installation
129+
$conf['getmail']['config_dir'] = '/etc/getmail';
130+
$conf['getmail']['program'] = '/usr/bin/getmail';
131+
132+
//* Courier
133+
$conf['courier']['installed'] = false; // will be detected automatically during installation
134+
$conf['courier']['config_dir'] = '/etc/courier';
135+
$conf['courier']['courier-authdaemon'] = 'courier-authdaemon';
136+
$conf['courier']['courier-imap'] = 'courier-imap';
137+
$conf['courier']['courier-imap-ssl'] = 'courier-imap-ssl';
138+
$conf['courier']['courier-pop'] = 'courier-pop';
139+
$conf['courier']['courier-pop-ssl'] = 'courier-pop-ssl';
140+
141+
//* Dovecot
142+
$conf['dovecot']['installed'] = false; // will be detected automatically during installation
143+
$conf['dovecot']['config_dir'] = '/etc/dovecot';
144+
$conf['dovecot']['init_script'] = 'dovecot';
145+
146+
//* SASL
147+
$conf['saslauthd']['installed'] = false; // will be detected automatically during installation
148+
$conf['saslauthd']['config'] = '/etc/default/saslauthd';
149+
$conf['saslauthd']['init_script'] = 'saslauthd';
150+
151+
//* Amavisd
152+
$conf['amavis']['installed'] = false; // will be detected automatically during installation
153+
$conf['amavis']['config_dir'] = '/etc/amavis';
154+
$conf['amavis']['init_script'] = 'amavis';
155+
156+
//* Rspamd
157+
$conf['rspamd']['installed'] = false; // will be detected automatically during installation
158+
$conf['rspamd']['config_dir'] = '/etc/rspamd';
159+
$conf['rspamd']['init_script'] = 'rspamd';
160+
161+
//* ClamAV
162+
$conf['clamav']['installed'] = false; // will be detected automatically during installation
163+
$conf['clamav']['init_script'] = 'clamav-daemon';
164+
165+
//* Pureftpd
166+
$conf['pureftpd']['installed'] = false; // will be detected automatically during installation
167+
$conf['pureftpd']['config_dir'] = '/etc/pure-ftpd';
168+
$conf['pureftpd']['init_script'] = 'pure-ftpd-mysql';
169+
170+
//* MyDNS
171+
$conf['mydns']['installed'] = false; // will be detected automatically during installation
172+
$conf['mydns']['config_dir'] = '/etc';
173+
$conf['mydns']['init_script'] = 'mydns';
174+
175+
//* PowerDNS
176+
$conf['powerdns']['installed'] = false; // will be detected automatically during installation
177+
$conf['powerdns']['database'] = 'powerdns';
178+
$conf["powerdns"]["config_dir"] = '/etc/powerdns/pdns.d';
179+
$conf['powerdns']['init_script'] = 'pdns';
180+
181+
//* BIND DNS Server
182+
$conf['bind']['installed'] = false; // will be detected automatically during installation
183+
$conf['bind']['bind_user'] = 'root';
184+
$conf['bind']['bind_group'] = 'bind';
185+
$conf['bind']['bind_zonefiles_dir'] = '/etc/bind';
186+
$conf['bind']['named_conf_path'] = '/etc/bind/named.conf';
187+
$conf['bind']['named_conf_local_path'] = '/etc/bind/named.conf.local';
188+
$conf['bind']['init_script'] = 'bind9';
189+
190+
//* Jailkit
191+
$conf['jailkit']['installed'] = false; // will be detected automatically during installation
192+
$conf['jailkit']['config_dir'] = '/etc/jailkit';
193+
$conf['jailkit']['jk_init'] = 'jk_init.ini';
194+
$conf['jailkit']['jk_chrootsh'] = 'jk_chrootsh.ini';
195+
$conf['jailkit']['jailkit_chroot_app_programs'] = '/usr/bin/groups /usr/bin/id /usr/bin/dircolors /usr/bin/lesspipe /usr/bin/basename /usr/bin/dirname /usr/bin/nano /usr/bin/pico /usr/bin/mysql /usr/bin/mysqldump /usr/bin/git /usr/bin/git-receive-pack /usr/bin/git-upload-pack /usr/bin/unzip /usr/bin/zip /bin/tar /bin/rm /usr/bin/patch';
196+
$conf['jailkit']['jailkit_chroot_cron_programs'] = '/usr/bin/php /usr/bin/perl /usr/share/perl /usr/share/php';
197+
198+
//* Squid
199+
$conf['squid']['installed'] = false; // will be detected automatically during installation
200+
$conf['squid']['config_dir'] = '/etc/squid';
201+
$conf['squid']['init_script'] = 'squid';
202+
203+
//* Nginx
204+
$conf['nginx']['installed'] = false; // will be detected automatically during installation
205+
$conf['nginx']['user'] = 'www-data';
206+
$conf['nginx']['group'] = 'www-data';
207+
$conf['nginx']['config_dir'] = '/etc/nginx';
208+
$conf['nginx']['vhost_conf_dir'] = '/etc/nginx/sites-available';
209+
$conf['nginx']['vhost_conf_enabled_dir'] = '/etc/nginx/sites-enabled';
210+
$conf['nginx']['init_script'] = 'nginx';
211+
$conf['nginx']['vhost_port'] = '8080';
212+
$conf['nginx']['cgi_socket'] = '/var/run/fcgiwrap.socket';
213+
$conf['nginx']['php_fpm_init_script'] = 'php7.4-fpm';
214+
$conf['nginx']['php_fpm_ini_path'] = '/etc/php/7.4/fpm/php.ini';
215+
$conf['nginx']['php_fpm_pool_dir'] = '/etc/php/7.4/fpm/pool.d';
216+
$conf['nginx']['php_fpm_start_port'] = 9010;
217+
$conf['nginx']['php_fpm_socket_dir'] = '/var/lib/php7.4-fpm';
218+
219+
//* OpenVZ
220+
$conf['openvz']['installed'] = false;
221+
222+
//*Bastille-Firwall
223+
$conf['bastille']['installed'] = false;
224+
$conf['bastille']['config_dir'] = '/etc/Bastille';
225+
226+
//* vlogger
227+
$conf['vlogger']['config_dir'] = '/etc';
228+
229+
//* cron
230+
$conf['cron']['init_script'] = 'cron';
231+
$conf['cron']['crontab_dir'] = '/etc/cron.d';
232+
$conf['cron']['wget'] = '/usr/bin/wget';
233+
234+
//* Metronome XMPP
235+
$conf['xmpp']['installed'] = false;
236+
$conf['xmpp']['init_script'] = 'metronome';
237+
238+
239+
?>

0 commit comments

Comments
 (0)