-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
128 lines (124 loc) · 4.5 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
<?php
// index.php 20150101 - 20240910
// Copyright (C) 2015-2024 Mark Constable <markc@renta.net> (AGPL-3.0)
const DS = DIRECTORY_SEPARATOR;
const INC = __DIR__ . DS . 'lib' . DS . 'php' . DS;
const DBG = false;
spl_autoload_register(function ($c) {
$f = INC . str_replace(['\\', '_'], [DS, DS], strtolower($c)) . '.php';
if (file_exists($f)) include $f;
else error_log("!!! $f does not exist");
});
echo new Init(new class
{
public
$cfg = [
'email' => '',
'admpw' => '',
'file' => __DIR__ . DS . 'lib' . DS . '.ht_conf.php', // settings override
'hash' => 'SHA512-CRYPT',
'host' => '',
'perp' => 25,
'self' => '/hcp/',
],
$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)
't' => 'bootstrap', // Theme
'x' => '', // XHR (request)
],
$out = [
'doc' => 'NetServa',
'css' => '',
'log' => '',
'nav1' => '',
'nav2' => '',
'nav3' => '',
'head' => 'NetServa',
'main' => 'Error: missing page!',
'foot' => 'Copyright (C) 2015-2019 Mark Constable (AGPL-3.0)',
'js' => '',
'end' => '',
],
$db = [
'host' => '127.0.0.1', // DB site
'name' => 'sysadm', // DB name
'pass' => 'lib' . DS . '.ht_pw', // MySQL password override
'path' => '/var/lib/sqlite/sysadm/sysadm.db', // SQLite DB
'port' => '3306', // DB port
'sock' => '', // '/run/mysqld/mysqld.sock',
'type' => 'mysql', // mysql | sqlite
'user' => 'sysadm', // DB user
],
$nav1 = [
'non' => [
['Webmail', '../', 'fas fa-envelope fa-fw'],
['Phpmyadmin', 'phpmyadmin/', 'fas fa-globe fa-fw'],
],
'usr' => [
['Webmail', '../', 'fas fa-envelope fa-fw'],
['Phpmyadmin', 'phpmyadmin/', 'fas fa-globe fa-fw'],
],
'adm' => [
['Menu', [
['Webmail', '../', 'fas fa-envelope fa-fw'],
['Phpmyadmin', 'phpmyadmin/', 'fas fa-globe fa-fw'],
], 'fas fa-bars fa-fw'],
['Admin', [
['Accounts', '?o=accounts', 'fas fa-users fa-fw'],
['Vhosts', '?o=vhosts', 'fas fa-globe fa-fw'],
['Mailboxes', '?o=vmails', 'fas fa-envelope fa-fw'],
['Aliases', '?o=valias', 'fas fa-envelope-square fa-fw'],
['DKIM', '?o=dkim', 'fas fa-address-card fa-fw'],
['Domains', '?o=domains', 'fas fa-server fa-fw'],
], 'fas fa-user-cog fa-fw'],
['Stats', [
['Sys Info', '?o=infosys', 'fas fa-tachometer-alt fa-fw'],
['Processes', '?o=processes', 'fas fa-code-branch fa-fw'],
['Mail Info', '?o=infomail', 'fas fa-envelope-square fa-fw'],
['Mail Graph', '?o=mailgraph', 'fas fa-envelope fa-fw'],
], 'fas fa-chart-line fa-fw'],
],
],
$nav2 = [
],
$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' => '/var/lib/sqlite/sysadm/pdns.db', // DNS SQLite DB
'port' => '3306', // Alt DNS DB port
'sock' => '', // '/run/mysqld/mysqld.sock',
'type' => '', // mysql | sqlite | '' to disable
'user' => 'pdns', // Alt DNS DB user
],
],
$acl = [
0 => 'SuperAdmin',
1 => 'Administrator',
2 => 'User',
3 => 'Suspended',
9 => 'Anonymous',
];
});
?>