const.inc.php 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. <?php
  2. if (strpos($_SERVER['PHP_SELF'], "inc.php") !== false)
  3. exit("This file is meant to be included.");
  4. // --- Constants definitions ---
  5. // Public IP adresses (shown on the interface)
  6. define("IPV4_ADDRESS", "82.66.61.19");
  7. define("IPV6_ADDRESS", "2a01:e0a:15c:2e40:acab:3:3:3");
  8. // Example IP adresses (for placeholders)
  9. define("IPV4_EXAMPLE", "203.0.113.42"); // See RFC5737: IPv4 Address Blocks Reserved for Documentation
  10. define("IPV6_EXAMPLE", "2001:db8::3"); // See RFC3849: IPv6 Address Prefix Reserved for Documentation
  11. define("DOMAIN_EXAMPLE", "example"); // From RFC2606: Reserved Top Level DNS Names > 2. TLDs for Testing, & Documentation Examples
  12. // Custom Niver paths
  13. define("PREFIX", "/motrig"); // Prefix in URL, if any
  14. define("ROOT_PATH", "/var/www/niver" . PREFIX); // Niver's directory
  15. define("SERVICE", substr(dirname($_SERVER['PHP_SELF']), strlen(PREFIX) + 1));
  16. define("PAGE", basename($_SERVER['PHP_SELF'], '.php'));
  17. define("DB_PATH", ROOT_PATH . "/db/niver.db"); // Niver's SQLite database
  18. define("NIVER_TEMPLATE_PATH", "/usr/local/share/niver"); // Templates directory (skel, nginx, knot...)
  19. define("MANIVER_PATH", "/usr/local/bin/maniver"); // Executable file
  20. define("HT_PATH", "/srv/ht"); // The mountpoint of the hypertext storage partition (that will be accessed over SFTP)
  21. // Nginx
  22. define("NGINX_CONFIG_PATH", "/etc/nginx/ht"); // Nginx configuration directory
  23. // Tor
  24. define("TOR_CONFIG_PATH", "/etc/tor/instances/niver/torrc"); // Tor configuration file
  25. define("TOR_KEYS_PATH", "/var/lib/tor-instances/niver/keys"); // Tor keys directory
  26. // Knot
  27. define("KNOT_ZONES_PATH", "/var/lib/knot/zones"); // Knot zones directory
  28. // Executable files (you can get the full path of a command with $ which <command>)
  29. define("KNOTC_PATH", "/usr/sbin/knotc");
  30. define("KEYMGR_PATH", "/usr/sbin/keymgr");
  31. define("SUDO_PATH", "/usr/bin/sudo");
  32. define("LS_PATH", "/usr/bin/ls");
  33. // Both frontend and backend regexes
  34. define("USERNAME_REGEX", "^[a-z]{4,32}$");
  35. define("PASSWORD_REGEX", "^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])[a-zA-Z0-9]{8,1024}|.{10,1024}$");
  36. define("SUBDOMAIN_REGEX", "^[a-z]{4,63}$");
  37. // Password storage security
  38. define("ALGO_PASSWORD", PASSWORD_ARGON2ID);
  39. define("OPTIONS_PASSWORD", array(
  40. "memory_cost" => 65536,
  41. "time_cost" => 24,
  42. "threads" => 64,
  43. ));
  44. // Color scheme
  45. define("THEME", array(
  46. // Displayed on light theme
  47. 'darkRegColor' => "#D100D1",
  48. 'darkNsColor' => "#006DFF",
  49. 'darkHtColor' => "#008768",
  50. 'darkAuthColor' => "#EE0000",
  51. // Displayed on dark theme
  52. 'lightRegColor' => "#FF50FF",
  53. 'lightNsColor' => "#00FFFF",
  54. 'lightHtColor' => "#FFFF00",
  55. 'lightAuthColor' => "#00FF00",
  56. //The old theme for both dark and light themes
  57. /*'htColor' => "#FF0000",
  58. 'regColor' => "#DA03E5",
  59. 'authColor' => "#00FF00",
  60. 'nsColor' => "#00A5A5",*/
  61. 'lightColor' => '#FFFFFF',
  62. 'darkColor' => '#000000',
  63. ));
  64. // Public suffixes
  65. define("SUFFIXES", array(
  66. "4.niv.re.",
  67. "asso.4.niv.re.",
  68. "org.4.niv.re.",
  69. "perso.4.niv.re.",
  70. "blog.4.niv.re.",
  71. "me.4.niv.re.",
  72. "edu.4.niv.re.",
  73. "info.4.niv.re.",
  74. "wiki.4.niv.re.",
  75. "sci.4.niv.re.",
  76. "pol.4.niv.re.",
  77. "libre.4.niv.re.",
  78. "fem.4.niv.re.",
  79. "eco.4.niv.re.",
  80. "veg.4.niv.re.",
  81. "bio.4.niv.re.",
  82. "anar.4.niv.re.",
  83. "ancom.4.niv.re.",
  84. "acab.4.niv.re.",
  85. "handi.4.niv.re.",
  86. "queer.4.niv.re.",
  87. "gay.4.niv.re.",
  88. "enby.4.niv.re.",
  89. "trans.4.niv.re.",
  90. "net.4.niv.re.",
  91. "tech.4.niv.re.",
  92. "io.4.niv.re.",
  93. "sec.4.niv.re.",
  94. "cyber.4.niv.re.",
  95. "dev.4.niv.re.",
  96. "geek.4.niv.re.",
  97. "fs.4.niv.re.",
  98. "ht.4.niv.re.",
  99. "hyper.4.niv.re.",
  100. "git.4.niv.re.",
  101. "forge.4.niv.re.",
  102. "code.4.niv.re.",
  103. "lab.4.niv.re.",
  104. "labs.4.niv.re.",
  105. "gemini.4.niv.re.",
  106. "gmi.4.niv.re.",
  107. "gemlog.4.niv.re.",
  108. "mail.4.niv.re.",
  109. "ynh.4.niv.re.",
  110. "yuno.4.niv.re.",
  111. "sys.4.niv.re.",
  112. "fed.4.niv.re.",
  113. "fedi.4.niv.re.",
  114. "soc.4.niv.re.",
  115. "masto.4.niv.re.",
  116. "plero.4.niv.re.",
  117. "pix.4.niv.re.",
  118. "mobi.4.niv.re.",
  119. "art.4.niv.re.",
  120. "music.4.niv.re.",
  121. "video.4.niv.re.",
  122. "draw.4.niv.re.",
  123. "audio.4.niv.re.",
  124. "ink.4.niv.re.",
  125. "na.4.niv.re.",
  126. "psy.4.niv.re.",
  127. "neuro.4.niv.re.",
  128. "auti.4.niv.re.",
  129. "plur.4.niv.re.",
  130. "blue.4.niv.re.",
  131. "red.4.niv.re.",
  132. "pink.4.niv.re.",
  133. "green.4.niv.re.",
  134. "black.4.niv.re.",
  135. "city.4.niv.re.",
  136. "town.4.niv.re.",
  137. "cafe.4.niv.re.",
  138. "home.4.niv.re.",
  139. "forum.4.niv.re.",
  140. "dream.4.niv.re.",
  141. "space.4.niv.re.",
  142. "forest.4.niv.re.",
  143. "rain.4.niv.re.",
  144. "snow.4.niv.re.",
  145. "sun.4.niv.re.",
  146. "earth.4.niv.re.",
  147. "world.4.niv.re.",
  148. "soft.4.niv.re.",
  149. "cute.4.niv.re.",
  150. "cutie.4.niv.re.",
  151. "fun.4.niv.re.",
  152. "play.4.niv.re.",
  153. "game.4.niv.re.",
  154. ));