123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176 |
- <?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}$");
- // Password storage security
- define("ALGO_PASSWORD", PASSWORD_ARGON2ID);
- define("OPTIONS_PASSWORD", array(
- "memory_cost" => 65536,
- "time_cost" => 24,
- "threads" => 64,
- ));
- // 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.",
- ));
|