151 lines
3.7 KiB
PHP
151 lines
3.7 KiB
PHP
|
<?php
|
||
|
if (strpos($_SERVER['PHP_SELF'], "inc.php") !== false)
|
||
|
exit("This file is meant to be included.");
|
||
|
|
||
|
// --- Constants definitions ---
|
||
|
|
||
|
// Public IP adresses (shown on the interface)
|
||
|
define("IPV4_ADDRESS", "82.66.61.19");
|
||
|
define("IPV6_ADDRESS", "2a01:e0a:15c:2e40:acab:3:3:3");
|
||
|
//define("IPV6_ADDRESS", "2a01:e0a:15c:2e40:acab:4c4b:1312:fed1");
|
||
|
|
||
|
// Custom Niver paths
|
||
|
define("PREFIX", "/motrig"); // Prefix in URL, if any
|
||
|
define("ROOT_PATH", "/var/www/niver" . PREFIX); // Niver's directory
|
||
|
define("SERVICE", substr(dirname($_SERVER['PHP_SELF']), strlen(PREFIX) + 1));
|
||
|
define("PAGE", basename($_SERVER['PHP_SELF'], '.php'));
|
||
|
define("DB_PATH", ROOT_PATH . "/db/niver.db"); // Niver's SQLite database
|
||
|
define("NIVER_TEMPLATE_PATH", "/usr/local/share/niver"); // Templates directory (skel, nginx, knot...)
|
||
|
define("MANIVER_PATH", "/usr/local/bin/maniver"); // Executable file
|
||
|
define("HT_PATH", "/srv/ht"); // The mountpoint of the hypertext storage partition (that will be accessed over SFTP)
|
||
|
// Nginx
|
||
|
define("NGINX_CONFIG_PATH", "/etc/nginx/ht"); // Nginx configuration directory
|
||
|
// Tor
|
||
|
define("TOR_CONFIG_PATH", "/etc/tor/instances/niver/torrc"); // Tor configuration file
|
||
|
define("TOR_KEYS_PATH", "/var/lib/tor-instances/niver/keys"); // Tor keys directory
|
||
|
// Knot
|
||
|
define("KNOT_ZONES_PATH", "/var/lib/knot/zones"); // Knot zones directory
|
||
|
// Executable files (you can get the full path of a command with $ which <command>)
|
||
|
define("KNOTC_PATH", "/usr/sbin/knotc");
|
||
|
define("KEYMGR_PATH", "/usr/sbin/keymgr");
|
||
|
define("SUDO_PATH", "/usr/bin/sudo");
|
||
|
define("LS_PATH", "/usr/bin/ls");
|
||
|
|
||
|
// Both frontend and backend regexes
|
||
|
define("USERNAME_REGEX", "^[a-z]{4,32}$");
|
||
|
define("PASSWORD_REGEX", "^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])[a-zA-Z0-9]{8,1024}|.{10,1024}$");
|
||
|
define("SUBDOMAIN_REGEX", "^[a-z]{4,63}$");
|
||
|
|
||
|
// Color scheme
|
||
|
define("THEME", array(
|
||
|
'htColor' => "#FF0000",
|
||
|
'regColor' => "#DA03E5",
|
||
|
'authColor' => "#00FF00",
|
||
|
'nsColor' => "#00A5A5",//00c4c4
|
||
|
'lightColor' => '#FFFFFF',
|
||
|
'darkColor' => '#2a2a2a',
|
||
|
));
|
||
|
|
||
|
// Public suffixes
|
||
|
define("SUFFIXES", array(
|
||
|
"4.niv.re.",
|
||
|
|
||
|
"asso.4.niv.re.",
|
||
|
"org.4.niv.re.",
|
||
|
"perso.4.niv.re.",
|
||
|
"blog.4.niv.re.",
|
||
|
"me.4.niv.re.",
|
||
|
|
||
|
"edu.4.niv.re.",
|
||
|
"info.4.niv.re.",
|
||
|
"wiki.4.niv.re.",
|
||
|
"sci.4.niv.re.",
|
||
|
|
||
|
"pol.4.niv.re.",
|
||
|
"libre.4.niv.re.",
|
||
|
"fem.4.niv.re.",
|
||
|
"eco.4.niv.re.",
|
||
|
"veg.4.niv.re.",
|
||
|
"bio.4.niv.re.",
|
||
|
"anar.4.niv.re.",
|
||
|
"ancom.4.niv.re.",
|
||
|
"acab.4.niv.re.",
|
||
|
"handi.4.niv.re.",
|
||
|
|
||
|
"queer.4.niv.re.",
|
||
|
"gay.4.niv.re.",
|
||
|
"enby.4.niv.re.",
|
||
|
"trans.4.niv.re.",
|
||
|
|
||
|
"net.4.niv.re.",
|
||
|
"tech.4.niv.re.",
|
||
|
"io.4.niv.re.",
|
||
|
"sec.4.niv.re.",
|
||
|
"cyber.4.niv.re.",
|
||
|
"dev.4.niv.re.",
|
||
|
"geek.4.niv.re.",
|
||
|
"fs.4.niv.re.",
|
||
|
"ht.4.niv.re.",
|
||
|
"hyper.4.niv.re.",
|
||
|
"git.4.niv.re.",
|
||
|
"forge.4.niv.re.",
|
||
|
"code.4.niv.re.",
|
||
|
"lab.4.niv.re.",
|
||
|
"labs.4.niv.re.",
|
||
|
"gemini.4.niv.re.",
|
||
|
"gmi.4.niv.re.",
|
||
|
"gemlog.4.niv.re.",
|
||
|
"mail.4.niv.re.",
|
||
|
"ynh.4.niv.re.",
|
||
|
"yuno.4.niv.re.",
|
||
|
"sys.4.niv.re.",
|
||
|
|
||
|
"fed.4.niv.re.",
|
||
|
"fedi.4.niv.re.",
|
||
|
"soc.4.niv.re.",
|
||
|
"masto.4.niv.re.",
|
||
|
"plero.4.niv.re.",
|
||
|
"pix.4.niv.re.",
|
||
|
"mobi.4.niv.re.",
|
||
|
|
||
|
"art.4.niv.re.",
|
||
|
"music.4.niv.re.",
|
||
|
"video.4.niv.re.",
|
||
|
"draw.4.niv.re.",
|
||
|
"audio.4.niv.re.",
|
||
|
"ink.4.niv.re.",
|
||
|
|
||
|
"na.4.niv.re.",
|
||
|
"psy.4.niv.re.",
|
||
|
"neuro.4.niv.re.",
|
||
|
"auti.4.niv.re.",
|
||
|
"plur.4.niv.re.",
|
||
|
|
||
|
"blue.4.niv.re.",
|
||
|
"red.4.niv.re.",
|
||
|
"pink.4.niv.re.",
|
||
|
"green.4.niv.re.",
|
||
|
"black.4.niv.re.",
|
||
|
|
||
|
"city.4.niv.re.",
|
||
|
"town.4.niv.re.",
|
||
|
"cafe.4.niv.re.",
|
||
|
"home.4.niv.re.",
|
||
|
"forum.4.niv.re.",
|
||
|
|
||
|
"dream.4.niv.re.",
|
||
|
"space.4.niv.re.",
|
||
|
"forest.4.niv.re.",
|
||
|
"rain.4.niv.re.",
|
||
|
"snow.4.niv.re.",
|
||
|
"sun.4.niv.re.",
|
||
|
"earth.4.niv.re.",
|
||
|
"world.4.niv.re.",
|
||
|
"soft.4.niv.re.",
|
||
|
"cute.4.niv.re.",
|
||
|
"cutie.4.niv.re.",
|
||
|
"fun.4.niv.re.",
|
||
|
"play.4.niv.re.",
|
||
|
"game.4.niv.re.",
|
||
|
));
|