-
Notifications
You must be signed in to change notification settings - Fork 17
/
index.php
153 lines (140 loc) · 5.14 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
<?php
declare(strict_types=1);
// index.php 20150101 - 20230627
// Copyright (C) 2015-2023 Mark Constable <markc@renta.net> (AGPL-3.0)
const DS = DIRECTORY_SEPARATOR;
const INC = __DIR__ . DS . 'lib' . DS . 'php' . DS;
const DBG = true;
spl_autoload_register(function ($c): void {
$f = INC . str_replace(['\\', '_'], [DS, DS], strtolower($c)) . '.php';
if (file_exists($f)) {
include $f;
if (DBG) {
error_log("include $f");
}
} else {
error_log("!!! {$f} does not exist");
}
});
echo new Init(new class()
{
public object $t; // theme object
public array $cfg = [
'email' => 'markc@renta.net',
'file' => __DIR__ . DS . 'lib' . DS . '.ht_conf.php', // this config override
'hash' => 'SHA512-CRYPT',
'host' => '',
'perp' => 25,
'self' => '/',
];
public array $in = [
'a' => '', // API (apiusr:apikey)
'd' => '', // Domain (current)
'g' => null, // Group/Category
'i' => null, // Item or ID
'l' => '', // Log (message)
'm' => 'list', // Method (action)
'o' => 'home', // Object (content)
'r' => 'local', // Remote Server (local)
't' => 'bootstrap', // Theme (bootstrap(5))
'x' => '', // XHR (request)
];
public array $out = [
'doc' => 'NetServa',
'css' => '',
'log' => '',
'nav1' => '',
'nav2' => '',
'nav3' => '',
'head' => 'NetServa HCP',
'main' => 'Error: missing page!',
'foot' => 'Copyright (C) 2015-2023 Mark Constable (AGPL-3.0)',
'js' => '',
'end' => '',
];
public array $db = [
'host' => '127.0.0.1', // DB site
'name' => 'sysadm', // DB name
'pass' => 'lib' . DS . '.ht_pw', // MySQL password override
'path' => 'sqlite/sysadm/sysadm.db', // SQLite DB
'port' => '3306', // DB port
'sock' => '', // '/run/mysqld/mysqld.sock',
'type' => 'sqlite', // mysql | sqlite
'user' => 'sysadm', // DB user
];
public array $nav1 = [
'non' => [
['Webmail', 'webmail/', 'bi bi-envelope-fill'],
['Phpmyadmin', 'phpmyadmin/', 'bi bi-globe'],
],
'usr' => [
['Webmail', 'webmail/', 'bi bi-envelope-fill'],
['Phpmyadmin', 'phpmyadmin/', 'bi bi-globe'],
],
'adm' => [
['Manage', [
['Accounts', '?o=accounts', 'bi bi-people-fill'],
['SSH Manager', '?o=sshm', 'bi bi-key'],
['Vhosts', '?o=vhosts', 'bi bi-globe2'],
['Mailboxes', '?o=vmails', 'bi bi-envelope-fill'],
['Aliases', '?o=valias', 'bi bi-envelope-paper-fill'],
['DKIM', '?o=dkim', 'bi bi-person-vcard-fill'],
['Domains', '?o=domains', 'bi bi-globe-americas'],
], 'bi bi-stack'],
['Stats', [
['Sys Info', '?o=infosys', 'bi bi-speedometer2'],
['Processes', '?o=processes', 'bi bi-bezier2'],
['Mail Info', '?o=infomail', 'bi bi-envelope-open'],
['Mail Graph', '?o=mailgraph', 'bi bi-bar-chart'],
], 'bi bi-graph-up-arrow'],
['Links', [
['Webmail', 'webmail/', 'bi bi-envelope-fill'],
['Phpmyadmin', 'phpmyadmin/', 'bi bi-globe'],
], 'bi bi-list'],
['Sites', [
['local', '?r=local', 'bi bi-globe', 'r'],
['mgo', '?r=mgo', 'bi bi-globe', 'r'],
['vmd1', '?r=vmd1', 'bi bi-globe', 'r'],
], 'bi bi-globe'],
],
];
public array $nav2 = [
['local', '?r=local', 'bi bi-globe'],
['mgo', '?r=mgo', 'bi bi-globe'],
['vmd1', '?r=vmd1', 'bi bi-globe'],
];
public array $dns = [
'a' => '127.0.0.1',
'mx' => '',
'ns1' => 'ns1.',
'ns2' => 'ns2.',
'prio' => 0,
'ttl' => 300,
'soa' => [
'primary' => 'ns1.',
'email' => 'admin.',
'refresh' => 7200,
'retry' => 540,
'expire' => 604800,
'ttl' => 3600,
],
'db' => [
'host' => '127.0.0.1', // Alt DNS DB site
'name' => 'pdns', // Alt DNS DB name
'pass' => 'lib' . DS . '.ht_dns_pw', // MySQL DNS password override
'path' => 'sqlite/sysadm/pdns.db', // DNS SQLite DB
'port' => '3306', // Alt DNS DB port
'sock' => '', // '/run/mysqld/mysqld.sock',
'type' => 'sqlite', // mysql | sqlite | '' to disable
'user' => 'sysadm', // Alt DNS DB user
],
];
public array $acl = [
0 => 'SuperAdmin',
1 => 'Administrator',
2 => 'User',
3 => 'Suspended',
9 => 'Anonymous',
];
});
//echo new Init();