Skip to content

Commit a62112f

Browse files
committed
Merge branch 'develop' into 6202-support-for-borg-archive-in-backups
2 parents d8a0163 + f973496 commit a62112f

File tree

14 files changed

+292
-99
lines changed

14 files changed

+292
-99
lines changed

.gitlab-ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ syntax:lint:
1717
- schedules
1818
- web
1919
- merge_requests
20-
- /^\d+\.\d+\.\d+$/
20+
- /^\d+\.\d+\.\d+(p\d+)?$/
2121

2222
script:
2323
- echo "Syntax checking PHP files"
@@ -37,7 +37,7 @@ syntax_diff:lint:
3737
- schedules
3838
- web
3939
- merge_requests
40-
- /^\d+\.\d+\.\d+$/
40+
- /^\d+\.\d+\.\d+(p\d+)?$/
4141

4242
script:
4343
- echo "Syntax checking PHP files"
@@ -81,7 +81,7 @@ build:package:
8181
image: edbizarro/gitlab-ci-pipeline-php:7.2
8282
only:
8383
refs:
84-
- /^\d+\.\d+\.\d+$/
84+
- /^\d+\.\d+\.\d+(p\d+)?$/
8585
- web
8686

8787
script:
@@ -96,7 +96,7 @@ build:package:
9696
- tar -tvf ISPConfig-${VER}.tar.gz
9797
- echo "Uploading file to download server"
9898
- 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
99+
- if [[ "$VER" =~ ^[0-9]+\.[0-9]+\.[0-9]+(p[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
100100
- rm ISPConfig-${VER}.tar.gz
101101
- echo "Download url is https://download.ispconfig.org/ISPConfig-${VER}.tar.gz"
102102

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Development branch: [![pipeline status](https://git.ispconfig.org/ispconfig/ispc
2626
[^1]: not actively tested
2727

2828
## Supported operating systems
29-
- Debian 9, 10, and testing
29+
- Debian 9 - 11, and testing
3030
- Ubuntu 16.04 - 20.04
3131
- CentOS 7 and 8
3232

install/lib/installer_base.lib.php

Lines changed: 60 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ private function install_acme() {
5252
}
5353

5454
public function update_acme() {
55-
$acme = explode("\n", shell_exec('which /usr/local/ispconfig/server/scripts/acme.sh /root/.acme.sh/acme.sh'));
55+
$acme = explode("\n", shell_exec('which acme.sh /usr/local/ispconfig/server/scripts/acme.sh /root/.acme.sh/acme.sh'));
5656
$acme = reset($acme);
5757
$val = 0;
5858

@@ -1659,6 +1659,7 @@ public function configure_amavis() {
16591659
$content = str_replace('{mysql_server_ip}', $conf['mysql']['ip'], $content);
16601660
wf($conf['amavis']['config_dir'].'/conf.d/50-user', $content);
16611661
chmod($conf['amavis']['config_dir'].'/conf.d/50-user', 0640);
1662+
chgrp($conf['amavis']['config_dir'].'/conf.d/50-user', 'amavis');
16621663

16631664
// TODO: chmod and chown on the config file
16641665

@@ -2965,15 +2966,15 @@ public function make_ispconfig_ssl_cert() {
29652966
$le_client = reset($le_client);
29662967

29672968
// Check for Neilpang acme.sh as well
2968-
$acme = explode("\n", shell_exec('which /usr/local/ispconfig/server/scripts/acme.sh /root/.acme.sh/acme.sh'));
2969+
$acme = explode("\n", shell_exec('which acme.sh /usr/local/ispconfig/server/scripts/acme.sh /root/.acme.sh/acme.sh'));
29692970
$acme = reset($acme);
29702971

29712972
if((!$acme || !is_executable($acme)) && (!$le_client || !is_executable($le_client))) {
29722973
$success = $this->install_acme();
29732974
if(!$success) {
29742975
swriteln('Failed installing acme.sh. Will not be able to issue certificate during install.');
29752976
} else {
2976-
$acme = explode("\n", shell_exec('which /usr/local/ispconfig/server/scripts/acme.sh /root/.acme.sh/acme.sh'));
2977+
$acme = explode("\n", shell_exec('which acme.sh /usr/local/ispconfig/server/scripts/acme.sh /root/.acme.sh/acme.sh'));
29772978
$acme = reset($acme);
29782979
if($acme && is_executable($acme)) {
29792980
swriteln('Installed acme.sh and using it for certificate creation during install.');
@@ -3016,14 +3017,30 @@ public function make_ispconfig_ssl_cert() {
30163017
$issued_successfully = false;
30173018

30183019
// Backup existing ispserver ssl files
3019-
if(file_exists($ssl_crt_file) || is_link($ssl_crt_file)) {
3020-
copy($ssl_crt_file, $ssl_crt_file . '-temporary.bak');
3021-
}
3022-
if(file_exists($ssl_key_file) || is_link($ssl_key_file)) {
3023-
copy($ssl_key_file, $ssl_key_file . '-temporary.bak');
3024-
}
3025-
if(file_exists($ssl_pem_file) || is_link($ssl_pem_file)) {
3026-
copy($ssl_pem_file, $ssl_pem_file . '-temporary.bak');
3020+
//
3021+
// We may find valid or broken symlinks or actual files here.
3022+
//
3023+
// - dangling links are broken and get perm renamed (should just delete?).
3024+
// possibly web server can't start because vhost file points to non-existing cert files,
3025+
// we're not trying to catch or fix that (and not making it worse)
3026+
//
3027+
// - link to valid file is tmp renamed, and file copied to original name.
3028+
// if cert request is successful, remove the old symlink;
3029+
// if cert request fails, remove file copy and rename symlink to original name
3030+
//
3031+
// - actual file copied to tmp name.
3032+
// if cert request is successful, rename tmp copy to perm rename;
3033+
// if cert request fails, delete tmp copy
3034+
$cert_files = array( $ssl_crt_file, $ssl_key_file, $ssl_pem_file );
3035+
foreach ($cert_files as $f) {
3036+
if (is_link($f) && ! file_exists($f)) {
3037+
rename($f, $f.'-'.$date->format('YmdHis').'.bak');
3038+
} elseif (is_link($f)) {
3039+
rename($f, $f.'-temporary.bak');
3040+
copy($f.'-temporary.bak', $f);
3041+
} elseif(file_exists($f)) {
3042+
copy($f, $f.'-temporary.bak');
3043+
}
30273044
}
30283045

30293046
// Attempt to use Neilpang acme.sh first, as it is now the preferred LE client
@@ -3062,26 +3079,28 @@ public function make_ispconfig_ssl_cert() {
30623079
umask($old_umask);
30633080

30643081
// Make temporary backup of self-signed certs permanent
3065-
if(file_exists($ssl_crt_file.'-temporary.bak') || is_link($ssl_crt_file.'-temporary.bak'))
3066-
rename($ssl_crt_file.'-temporary.bak', $ssl_crt_file.'-'.$date->format('YmdHis').'.bak');
3067-
if(file_exists($ssl_key_file.'-temporary.bak') || is_link($ssl_key_file.'-temporary.bak'))
3068-
rename($ssl_key_file.'-temporary.bak', $ssl_key_file.'-'.$date->format('YmdHis').'.bak');
3069-
if(file_exists($ssl_pem_file.'-temporary.bak') || is_link($ssl_pem_file.'-temporary.bak'))
3070-
rename($ssl_pem_file.'-temporary.bak', $ssl_pem_file.'-'.$date->format('YmdHis').'.bak');
3082+
foreach ($cert_files as $f) {
3083+
if (is_link($f.'-temporary.bak')) {
3084+
unlink($f.'-temporary.bak');
3085+
} elseif(file_exists($f.'-temporary.bak')) {
3086+
rename($f.'-temporary.bak', $f.'-'.$date->format('YmdHis').'.bak');
3087+
}
3088+
}
30713089

30723090
} else {
30733091
swriteln('Issuing certificate via acme.sh failed. Please check that your hostname can be verified by letsencrypt');
30743092

30753093
umask($old_umask);
30763094

3077-
// Restore temporary backup of self-signed certs
3078-
if(file_exists($ssl_crt_file.'-temporary.bak') || is_link($ssl_crt_file.'-temporary.bak'))
3079-
rename($ssl_crt_file.'-temporary.bak', $ssl_crt_file);
3080-
if(file_exists($ssl_key_file.'-temporary.bak') || is_link($ssl_key_file.'-temporary.bak'))
3081-
rename($ssl_key_file.'-temporary.bak', $ssl_key_file);
3082-
if(file_exists($ssl_pem_file.'-temporary.bak') || is_link($ssl_pem_file.'-temporary.bak'))
3083-
rename($ssl_pem_file.'-temporary.bak', $ssl_pem_file);
3084-
3095+
// Restore/cleanup temporary backup of self-signed certs
3096+
foreach ($cert_files as $f) {
3097+
if (is_link($f.'-temporary.bak')) {
3098+
@unlink($f);
3099+
rename($f.'-temporary.bak', $f);
3100+
} elseif(file_exists($f.'-temporary.bak')) {
3101+
unlink($f.'-temporary.bak');
3102+
}
3103+
}
30853104
}
30863105
// Else, we attempt to use the official LE certbot client certbot
30873106
} else {
@@ -3120,23 +3139,26 @@ public function make_ispconfig_ssl_cert() {
31203139
$issued_successfully = true;
31213140

31223141
// Make temporary backup of self-signed certs permanent
3123-
if(file_exists($ssl_crt_file.'-temporary.bak') || is_link($ssl_crt_file.'-temporary.bak'))
3124-
rename($ssl_crt_file.'-temporary.bak', $ssl_crt_file.'-'.$date->format('YmdHis').'.bak');
3125-
if(file_exists($ssl_key_file.'-temporary.bak') || is_link($ssl_key_file.'-temporary.bak'))
3126-
rename($ssl_key_file.'-temporary.bak', $ssl_key_file.'-'.$date->format('YmdHis').'.bak');
3127-
if(file_exists($ssl_pem_file.'-temporary.bak') || is_link($ssl_pem_file.'-temporary.bak'))
3128-
rename($ssl_pem_file.'-temporary.bak', $ssl_pem_file.'-'.$date->format('YmdHis').'.bak');
3142+
foreach ($cert_files as $f) {
3143+
if (is_link($f.'-temporary.bak')) {
3144+
unlink($f.'-temporary.bak');
3145+
} elseif(file_exists($f.'-temporary.bak')) {
3146+
rename($f.'-temporary.bak', $f.'-'.$date->format('YmdHis').'.bak');
3147+
}
3148+
}
31293149

31303150
} else {
31313151
swriteln('Issuing certificate via certbot failed. Please check log files and make sure that your hostname can be verified by letsencrypt');
31323152

3133-
// Restore temporary backup of self-signed certs
3134-
if(file_exists($ssl_crt_file.'-temporary.bak') || is_link($ssl_crt_file.'-temporary.bak'))
3135-
rename($ssl_crt_file.'-temporary.bak', $ssl_crt_file);
3136-
if(file_exists($ssl_key_file.'-temporary.bak') || is_link($ssl_key_file.'-temporary.bak'))
3137-
rename($ssl_key_file.'-temporary.bak', $ssl_key_file);
3138-
if(file_exists($ssl_pem_file.'-temporary.bak') || is_link($ssl_pem_file.'-temporary.bak'))
3139-
rename($ssl_pem_file.'-temporary.bak', $ssl_pem_file);
3153+
// Restore/cleanup temporary backup of self-signed certs
3154+
foreach ($cert_files as $f) {
3155+
if (is_link($f.'-temporary.bak')) {
3156+
@unlink($f);
3157+
rename($f.'-temporary.bak', $f);
3158+
} elseif(file_exists($f.'-temporary.bak')) {
3159+
unlink($f.'-temporary.bak');
3160+
}
3161+
}
31403162

31413163
}
31423164
} else {
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ALTER TABLE `remote_session` ADD `remote_ip` VARCHAR(39) NOT NULL DEFAULT '' AFTER `tstamp`;

install/sql/ispconfig3.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1317,6 +1317,7 @@ CREATE TABLE `remote_session` (
13171317
`remote_functions` text,
13181318
`client_login` tinyint(1) unsigned NOT NULL default '0',
13191319
`tstamp` int(10) unsigned NOT NULL DEFAULT '0',
1320+
`remote_ip` varchar(39) NOT NULL DEFAULT '',
13201321
PRIMARY KEY (`remote_session`)
13211322
) DEFAULT CHARSET=utf8 ;
13221323

0 commit comments

Comments
 (0)