const.inc.php 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  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. //define("IPV6_ADDRESS", "2a01:e0a:15c:2e40:acab:4c4b:1312:fed1");
  9. // Custom Niver paths
  10. define("PREFIX", "/motrig"); // Prefix in URL, if any
  11. define("ROOT_PATH", "/var/www/niver" . PREFIX); // Niver's directory
  12. define("SERVICE", substr(dirname($_SERVER['PHP_SELF']), strlen(PREFIX) + 1));
  13. define("PAGE", basename($_SERVER['PHP_SELF'], '.php'));
  14. define("DB_PATH", ROOT_PATH . "/db/niver.db"); // Niver's SQLite database
  15. define("NIVER_TEMPLATE_PATH", "/usr/local/share/niver"); // Templates directory (skel, nginx, knot...)
  16. define("MANIVER_PATH", "/usr/local/bin/maniver"); // Executable file
  17. define("HT_PATH", "/srv/ht"); // The mountpoint of the hypertext storage partition (that will be accessed over SFTP)
  18. // Nginx
  19. define("NGINX_CONFIG_PATH", "/etc/nginx/ht"); // Nginx configuration directory
  20. // Tor
  21. define("TOR_CONFIG_PATH", "/etc/tor/instances/niver/torrc"); // Tor configuration file
  22. define("TOR_KEYS_PATH", "/var/lib/tor-instances/niver/keys"); // Tor keys directory
  23. // Knot
  24. define("KNOT_ZONES_PATH", "/var/lib/knot/zones"); // Knot zones directory
  25. // Executable files (you can get the full path of a command with $ which <command>)
  26. define("KNOTC_PATH", "/usr/sbin/knotc");
  27. define("KEYMGR_PATH", "/usr/sbin/keymgr");
  28. define("SUDO_PATH", "/usr/bin/sudo");
  29. define("LS_PATH", "/usr/bin/ls");
  30. // Both frontend and backend regexes
  31. define("USERNAME_REGEX", "^[a-z]{4,32}$");
  32. define("PASSWORD_REGEX", "^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])[a-zA-Z0-9]{8,1024}|.{10,1024}$");
  33. define("SUBDOMAIN_REGEX", "^[a-z]{4,63}$");
  34. // Color scheme
  35. define("THEME", array(
  36. 'htColor' => "#FF0000",
  37. 'regColor' => "#DA03E5",
  38. 'authColor' => "#00FF00",
  39. 'nsColor' => "#00A5A5",//00c4c4
  40. 'lightColor' => '#FFFFFF',
  41. 'darkColor' => '#2a2a2a',
  42. ));
  43. // Public suffixes
  44. define("SUFFIXES", array(
  45. "4.niv.re.",
  46. "asso.4.niv.re.",
  47. "org.4.niv.re.",
  48. "perso.4.niv.re.",
  49. "blog.4.niv.re.",
  50. "me.4.niv.re.",
  51. "edu.4.niv.re.",
  52. "info.4.niv.re.",
  53. "wiki.4.niv.re.",
  54. "sci.4.niv.re.",
  55. "pol.4.niv.re.",
  56. "libre.4.niv.re.",
  57. "fem.4.niv.re.",
  58. "eco.4.niv.re.",
  59. "veg.4.niv.re.",
  60. "bio.4.niv.re.",
  61. "anar.4.niv.re.",
  62. "ancom.4.niv.re.",
  63. "acab.4.niv.re.",
  64. "handi.4.niv.re.",
  65. "queer.4.niv.re.",
  66. "gay.4.niv.re.",
  67. "enby.4.niv.re.",
  68. "trans.4.niv.re.",
  69. "net.4.niv.re.",
  70. "tech.4.niv.re.",
  71. "io.4.niv.re.",
  72. "sec.4.niv.re.",
  73. "cyber.4.niv.re.",
  74. "dev.4.niv.re.",
  75. "geek.4.niv.re.",
  76. "fs.4.niv.re.",
  77. "ht.4.niv.re.",
  78. "hyper.4.niv.re.",
  79. "git.4.niv.re.",
  80. "forge.4.niv.re.",
  81. "code.4.niv.re.",
  82. "lab.4.niv.re.",
  83. "labs.4.niv.re.",
  84. "gemini.4.niv.re.",
  85. "gmi.4.niv.re.",
  86. "gemlog.4.niv.re.",
  87. "mail.4.niv.re.",
  88. "ynh.4.niv.re.",
  89. "yuno.4.niv.re.",
  90. "sys.4.niv.re.",
  91. "fed.4.niv.re.",
  92. "fedi.4.niv.re.",
  93. "soc.4.niv.re.",
  94. "masto.4.niv.re.",
  95. "plero.4.niv.re.",
  96. "pix.4.niv.re.",
  97. "mobi.4.niv.re.",
  98. "art.4.niv.re.",
  99. "music.4.niv.re.",
  100. "video.4.niv.re.",
  101. "draw.4.niv.re.",
  102. "audio.4.niv.re.",
  103. "ink.4.niv.re.",
  104. "na.4.niv.re.",
  105. "psy.4.niv.re.",
  106. "neuro.4.niv.re.",
  107. "auti.4.niv.re.",
  108. "plur.4.niv.re.",
  109. "blue.4.niv.re.",
  110. "red.4.niv.re.",
  111. "pink.4.niv.re.",
  112. "green.4.niv.re.",
  113. "black.4.niv.re.",
  114. "city.4.niv.re.",
  115. "town.4.niv.re.",
  116. "cafe.4.niv.re.",
  117. "home.4.niv.re.",
  118. "forum.4.niv.re.",
  119. "dream.4.niv.re.",
  120. "space.4.niv.re.",
  121. "forest.4.niv.re.",
  122. "rain.4.niv.re.",
  123. "snow.4.niv.re.",
  124. "sun.4.niv.re.",
  125. "earth.4.niv.re.",
  126. "world.4.niv.re.",
  127. "soft.4.niv.re.",
  128. "cute.4.niv.re.",
  129. "cutie.4.niv.re.",
  130. "fun.4.niv.re.",
  131. "play.4.niv.re.",
  132. "game.4.niv.re.",
  133. ));