Skip to content

Commit 838c874

Browse files
committed
- Added more redirect options.
- Made jailkit programs configurable per linux distribution in the installer.
1 parent 42b3854 commit 838c874

File tree

11 files changed

+161
-144
lines changed

11 files changed

+161
-144
lines changed

install/dist/conf/centos52.conf.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,5 +137,6 @@
137137
$conf['jailkit']['config_dir'] = '/etc/jailkit';
138138
$conf['jailkit']['jk_init'] = 'jk_init.ini';
139139
$conf['jailkit']['jk_chrootsh'] = 'jk_chrootsh.ini';
140+
$conf['jailkit']['jailkit_chroot_app_programs'] = '/usr/bin/groups /usr/bin/id /usr/bin/dircolors /bin/basename /usr/bin/dirname /usr/bin/nano';
140141

141142
?>

install/dist/conf/debian40.conf.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,5 +137,7 @@
137137
$conf['jailkit']['config_dir'] = '/etc/jailkit';
138138
$conf['jailkit']['jk_init'] = 'jk_init.ini';
139139
$conf['jailkit']['jk_chrootsh'] = 'jk_chrootsh.ini';
140+
$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';
141+
140142

141143
?>

install/dist/conf/fedora9.conf.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,5 +137,7 @@
137137
$conf['jailkit']['config_dir'] = '/etc/jailkit';
138138
$conf['jailkit']['jk_init'] = 'jk_init.ini';
139139
$conf['jailkit']['jk_chrootsh'] = 'jk_chrootsh.ini';
140+
$conf['jailkit']['jailkit_chroot_app_programs'] = '/usr/bin/groups /usr/bin/id /usr/bin/dircolors /bin/basename /usr/bin/dirname /usr/bin/nano';
141+
140142

141143
?>

install/dist/conf/gentoo.conf.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,5 +95,7 @@
9595
$conf['jailkit']['config_dir'] = '/etc/jailkit';
9696
$conf['jailkit']['jk_init'] = 'jk_init.ini';
9797
$conf['jailkit']['jk_chrootsh'] = 'jk_chrootsh.ini';
98+
$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';
99+
98100

99101
?>

install/dist/conf/opensuse110.conf.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,5 +137,7 @@
137137
$conf['jailkit']['config_dir'] = '/etc/jailkit';
138138
$conf['jailkit']['jk_init'] = 'jk_init.ini';
139139
$conf['jailkit']['jk_chrootsh'] = 'jk_chrootsh.ini';
140+
$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';
141+
140142

141143
?>

install/lib/installer_base.lib.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,8 @@ public function add_database_server_record() {
202202
// TODO: Update further distribution specific parameters for server config here
203203
$tpl_ini_array['web']['vhost_conf_dir'] = $conf['apache']['vhost_conf_dir'];
204204
$tpl_ini_array['web']['vhost_conf_enabled_dir'] = $conf['apache']['vhost_conf_enabled_dir'];
205+
$tpl_ini_array['web']['jailkit_chroot_app_programs'] = $conf['jailkit']['jailkit_chroot_app_programs'];
206+
205207

206208
$server_ini_content = array_to_ini($tpl_ini_array);
207209
$server_ini_content = mysql_real_escape_string($server_ini_content);
@@ -908,6 +910,12 @@ public function install_ispconfig()
908910
$file_server_enabled = ($conf['services']['file'])?1:0;
909911
$db_server_enabled = ($conf['services']['db'])?1:0;
910912
$vserver_server_enabled = ($conf['services']['vserver'])?1:0;
913+
914+
915+
916+
917+
918+
911919
$sql = "UPDATE `server` SET mail_server = '$mail_server_enabled', web_server = '$web_server_enabled', dns_server = '$dns_server_enabled', file_server = '$file_server_enabled', db_server = '$db_server_enabled', vserver_server = '$vserver_server_enabled' WHERE server_id = ".intval($conf['server_id']);
912920

913921
if($conf['mysql']['master_slave_setup'] == 'y') {
Lines changed: 137 additions & 137 deletions
Original file line numberDiff line numberDiff line change
@@ -1,138 +1,138 @@
1-
<?php
2-
3-
/*
4-
Form Definition
5-
6-
Tabledefinition
7-
8-
Datatypes:
9-
- INTEGER (Forces the input to Int)
10-
- DOUBLE
11-
- CURRENCY (Formats the values to currency notation)
12-
- VARCHAR (no format check, maxlength: 255)
13-
- TEXT (no format check)
14-
- DATE (Dateformat, automatic conversion to timestamps)
15-
16-
Formtype:
17-
- TEXT (Textfield)
18-
- TEXTAREA (Textarea)
19-
- PASSWORD (Password textfield, input is not shown when edited)
20-
- SELECT (Select option field)
21-
- RADIO
22-
- CHECKBOX
23-
- CHECKBOXARRAY
24-
- FILE
25-
26-
VALUE:
27-
- Wert oder Array
28-
29-
Hint:
30-
The ID field of the database table is not part of the datafield definition.
31-
The ID field must be always auto incement (int or bigint).
32-
33-
34-
*/
35-
36-
$form["title"] = "Web Aliasdomain";
37-
$form["description"] = "";
38-
$form["name"] = "web_domain";
39-
$form["action"] = "web_aliasdomain_edit.php";
40-
$form["db_table"] = "web_domain";
41-
$form["db_table_idx"] = "domain_id";
42-
$form["db_history"] = "yes";
43-
$form["tab_default"] = "domain";
44-
$form["list_default"] = "web_aliasdomain_list.php";
45-
$form["auth"] = 'yes'; // yes / no
46-
47-
$form["auth_preset"]["userid"] = 0; // 0 = id of the user, > 0 id must match with id of current user
48-
$form["auth_preset"]["groupid"] = 0; // 0 = default groupid of the user, > 0 id must match with groupid of current user
49-
$form["auth_preset"]["perm_user"] = 'riud'; //r = read, i = insert, u = update, d = delete
50-
$form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update, d = delete
51-
$form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete
52-
53-
$form["tabs"]['domain'] = array (
54-
'title' => "Domain",
55-
'width' => 100,
56-
'template' => "templates/web_aliasdomain_edit.htm",
57-
'fields' => array (
58-
##################################
59-
# Begin Datatable fields
60-
##################################
61-
'server_id' => array (
62-
'datatype' => 'INTEGER',
63-
'formtype' => 'SELECT',
64-
'default' => '',
65-
'datasource' => array ( 'type' => 'SQL',
66-
'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} ORDER BY server_name',
67-
'keyfield'=> 'server_id',
68-
'valuefield'=> 'server_name'
69-
),
70-
'value' => ''
71-
),
72-
'domain' => array (
73-
'datatype' => 'VARCHAR',
74-
'formtype' => 'TEXT',
75-
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
76-
'errmsg'=> 'domain_error_empty'),
77-
1 => array ( 'type' => 'UNIQUE',
78-
'errmsg'=> 'domain_error_unique'),
79-
2 => array ( 'type' => 'REGEX',
80-
'regex' => '/^[\w\.\-]{2,64}\.[a-zA-Z]{2,10}$/',
81-
'errmsg'=> 'domain_error_regex'),
82-
),
83-
'default' => '',
84-
'value' => '',
85-
'width' => '30',
86-
'maxlength' => '255'
87-
),
88-
'type' => array (
89-
'datatype' => 'VARCHAR',
90-
'formtype' => 'SELECT',
91-
'default' => 'y',
92-
'value' => array('vhost' => 'Site', 'alias' => 'Alias', 'subdomain' => 'Subdomain')
93-
),
94-
'parent_domain_id' => array (
95-
'datatype' => 'INTEGER',
96-
'formtype' => 'SELECT',
97-
'default' => '',
98-
'datasource' => array ( 'type' => 'SQL',
99-
'querystring' => "SELECT domain_id,domain FROM web_domain WHERE type = 'vhost' AND {AUTHSQL} ORDER BY domain",
100-
'keyfield'=> 'domain_id',
101-
'valuefield'=> 'domain'
102-
),
103-
'value' => ''
104-
),
105-
'redirect_type' => array (
106-
'datatype' => 'VARCHAR',
107-
'formtype' => 'SELECT',
108-
'default' => 'y',
109-
'value' => array('' => 'No redirect', 'R' => 'R', 'L' => 'L')
110-
),
111-
'redirect_path' => array (
112-
'datatype' => 'VARCHAR',
113-
'formtype' => 'TEXT',
114-
'default' => '',
115-
'value' => '',
116-
'width' => '30',
117-
'maxlength' => '255'
118-
),
119-
'subdomain' => array (
120-
'datatype' => 'VARCHAR',
121-
'formtype' => 'SELECT',
122-
'default' => 'y',
123-
'value' => array('none' => 'none', 'www' => 'www.', '*' => '*.')
124-
),
125-
'active' => array (
126-
'datatype' => 'VARCHAR',
127-
'formtype' => 'CHECKBOX',
128-
'default' => 'y',
129-
'value' => array(0 => 'n',1 => 'y')
130-
),
131-
##################################
132-
# ENDE Datatable fields
133-
##################################
134-
)
135-
);
136-
137-
1+
<?php
2+
3+
/*
4+
Form Definition
5+
6+
Tabledefinition
7+
8+
Datatypes:
9+
- INTEGER (Forces the input to Int)
10+
- DOUBLE
11+
- CURRENCY (Formats the values to currency notation)
12+
- VARCHAR (no format check, maxlength: 255)
13+
- TEXT (no format check)
14+
- DATE (Dateformat, automatic conversion to timestamps)
15+
16+
Formtype:
17+
- TEXT (Textfield)
18+
- TEXTAREA (Textarea)
19+
- PASSWORD (Password textfield, input is not shown when edited)
20+
- SELECT (Select option field)
21+
- RADIO
22+
- CHECKBOX
23+
- CHECKBOXARRAY
24+
- FILE
25+
26+
VALUE:
27+
- Wert oder Array
28+
29+
Hint:
30+
The ID field of the database table is not part of the datafield definition.
31+
The ID field must be always auto incement (int or bigint).
32+
33+
34+
*/
35+
36+
$form["title"] = "Web Aliasdomain";
37+
$form["description"] = "";
38+
$form["name"] = "web_domain";
39+
$form["action"] = "web_aliasdomain_edit.php";
40+
$form["db_table"] = "web_domain";
41+
$form["db_table_idx"] = "domain_id";
42+
$form["db_history"] = "yes";
43+
$form["tab_default"] = "domain";
44+
$form["list_default"] = "web_aliasdomain_list.php";
45+
$form["auth"] = 'yes'; // yes / no
46+
47+
$form["auth_preset"]["userid"] = 0; // 0 = id of the user, > 0 id must match with id of current user
48+
$form["auth_preset"]["groupid"] = 0; // 0 = default groupid of the user, > 0 id must match with groupid of current user
49+
$form["auth_preset"]["perm_user"] = 'riud'; //r = read, i = insert, u = update, d = delete
50+
$form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update, d = delete
51+
$form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete
52+
53+
$form["tabs"]['domain'] = array (
54+
'title' => "Domain",
55+
'width' => 100,
56+
'template' => "templates/web_aliasdomain_edit.htm",
57+
'fields' => array (
58+
##################################
59+
# Begin Datatable fields
60+
##################################
61+
'server_id' => array (
62+
'datatype' => 'INTEGER',
63+
'formtype' => 'SELECT',
64+
'default' => '',
65+
'datasource' => array ( 'type' => 'SQL',
66+
'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} ORDER BY server_name',
67+
'keyfield'=> 'server_id',
68+
'valuefield'=> 'server_name'
69+
),
70+
'value' => ''
71+
),
72+
'domain' => array (
73+
'datatype' => 'VARCHAR',
74+
'formtype' => 'TEXT',
75+
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
76+
'errmsg'=> 'domain_error_empty'),
77+
1 => array ( 'type' => 'UNIQUE',
78+
'errmsg'=> 'domain_error_unique'),
79+
2 => array ( 'type' => 'REGEX',
80+
'regex' => '/^[\w\.\-]{2,64}\.[a-zA-Z]{2,10}$/',
81+
'errmsg'=> 'domain_error_regex'),
82+
),
83+
'default' => '',
84+
'value' => '',
85+
'width' => '30',
86+
'maxlength' => '255'
87+
),
88+
'type' => array (
89+
'datatype' => 'VARCHAR',
90+
'formtype' => 'SELECT',
91+
'default' => 'y',
92+
'value' => array('vhost' => 'Site', 'alias' => 'Alias', 'subdomain' => 'Subdomain')
93+
),
94+
'parent_domain_id' => array (
95+
'datatype' => 'INTEGER',
96+
'formtype' => 'SELECT',
97+
'default' => '',
98+
'datasource' => array ( 'type' => 'SQL',
99+
'querystring' => "SELECT domain_id,domain FROM web_domain WHERE type = 'vhost' AND {AUTHSQL} ORDER BY domain",
100+
'keyfield'=> 'domain_id',
101+
'valuefield'=> 'domain'
102+
),
103+
'value' => ''
104+
),
105+
'redirect_type' => array (
106+
'datatype' => 'VARCHAR',
107+
'formtype' => 'SELECT',
108+
'default' => 'y',
109+
'value' => array('' => 'No redirect', 'no' => 'No flag', 'R' => 'R', 'L' => 'L', 'R,L' => 'R,L')
110+
),
111+
'redirect_path' => array (
112+
'datatype' => 'VARCHAR',
113+
'formtype' => 'TEXT',
114+
'default' => '',
115+
'value' => '',
116+
'width' => '30',
117+
'maxlength' => '255'
118+
),
119+
'subdomain' => array (
120+
'datatype' => 'VARCHAR',
121+
'formtype' => 'SELECT',
122+
'default' => 'y',
123+
'value' => array('none' => 'none', 'www' => 'www.', '*' => '*.')
124+
),
125+
'active' => array (
126+
'datatype' => 'VARCHAR',
127+
'formtype' => 'CHECKBOX',
128+
'default' => 'y',
129+
'value' => array(0 => 'n',1 => 'y')
130+
),
131+
##################################
132+
# ENDE Datatable fields
133+
##################################
134+
)
135+
);
136+
137+
138138
?>

interface/web/sites/form/web_domain.tform.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@
221221
'datatype' => 'VARCHAR',
222222
'formtype' => 'SELECT',
223223
'default' => '',
224-
'value' => array('' => 'No redirect', 'R' => 'R', 'L' => 'L')
224+
'value' => array('' => 'No redirect', 'no' => 'No flag', 'R' => 'R', 'L' => 'L', 'R,L' => 'R,L')
225225
),
226226
'redirect_path' => array (
227227
'datatype' => 'VARCHAR',

interface/web/sites/form/web_subdomain.tform.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106
'datatype' => 'VARCHAR',
107107
'formtype' => 'SELECT',
108108
'default' => 'y',
109-
'value' => array('' => 'No redirect', 'R' => 'R', 'L' => 'L')
109+
'value' => array('' => 'No redirect', 'no' => 'No flag', 'R' => 'R', 'L' => 'L', 'R,L' => 'R,L')
110110
),
111111
'redirect_path' => array (
112112
'datatype' => 'VARCHAR',

server/conf/vhost.conf.master

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124
RewriteEngine on
125125
<tmpl_loop name="redirects">
126126
RewriteCond %{HTTP_HOST} ^<tmpl_var name='rewrite_domain'> [NC]
127-
RewriteRule ^/(.*)$ <tmpl_var name='rewrite_target'>$1 [<tmpl_var name='rewrite_type'>]
127+
RewriteRule ^/(.*)$ <tmpl_var name='rewrite_target'>$1 <tmpl_var name='rewrite_type'>
128128
</tmpl_loop>
129129
</tmpl_if>
130130

0 commit comments

Comments
 (0)