servnest/inc/const.inc.php

169 lines
4.4 KiB
PHP
Raw Normal View History

<?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");
// Example IP adresses (for placeholders)
define("IPV4_EXAMPLE", "203.0.113.42"); // See RFC5737: IPv4 Address Blocks Reserved for Documentation
define("IPV6_EXAMPLE", "2001:db8::3"); // See RFC3849: IPv6 Address Prefix Reserved for Documentation
define("DOMAIN_EXAMPLE", "example"); // From RFC2606: Reserved Top Level DNS Names > 2. TLDs for Testing, & Documentation Examples
// 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(
// Displayed on light theme
'darkRegColor' => "#D100D1",
'darkNsColor' => "#006DFF",
'darkHtColor' => "#008768",
'darkAuthColor' => "#EE0000",
// Displayed on dark theme
'lightRegColor' => "#FF50FF",
'lightNsColor' => "#00FFFF",
'lightHtColor' => "#FFFF00",
'lightAuthColor' => "#00FF00",
//The old theme for both dark and light themes
/*'htColor' => "#FF0000",
'regColor' => "#DA03E5",
'authColor' => "#00FF00",
'nsColor' => "#00A5A5",*/
'lightColor' => '#FFFFFF',
'darkColor' => '#000000',
));
// 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.",
));