Compare commits
4 Commits
1b69da5ffa
...
7384091b71
Author | SHA1 | Date |
---|---|---|
![]() |
7384091b71 | |
![]() |
7b2295be94 | |
![]() |
a3d60795d8 | |
![]() |
d2bb9ceadb |
|
@ -38,11 +38,12 @@ This setup guide is assuming that you are on a UNIX-like system and have the fol
|
|||
Installation:
|
||||
|
||||
- To install the ThreadR Forum Engine, clone this repository into a directory that the web server has access to but that it outside of any web root.
|
||||
- Symlink the directory `build/` to your desired location on the web root.
|
||||
- Add a database to your MySQL/MariaDB server that contains the tables shown below.
|
||||
- Create a MySQL/MariaDB user for ThreadR and grant usage privileges for the tables to it.
|
||||
- Symlink the directory `build/` to your desired location on the web root. ThreadR does not support being linked directly to the webroot.
|
||||
- adjust the files in `config/` to your setup
|
||||
- run ./deployment-script.sh to apply configuration
|
||||
- Optionally symlink `build/redirect_home.html` to all places that you want to redirect to ThreadR.
|
||||
|
||||
Database tables:
|
||||
- boards
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Files
|
||||
### [about.template](./about.template)
|
||||
The customizable part of the content page, HTML code for now, will eventually be replaced with a markdown file
|
||||
The customizable part of the about page, HTML code for now, will eventually be replaced with a markdown file
|
||||
### [instance.conf](./instance.conf)
|
||||
configuration for a specific instance
|
||||
- domain_name=<public facing domain name of the instance>
|
||||
|
@ -10,7 +10,7 @@ configuration for a specific instance
|
|||
- db_database=<name of the database>
|
||||
- db_svr_host=<mysql server address>
|
||||
|
||||
\* leading and trailing slashes will be added by ThreadR, if running on the web root, just "."
|
||||
\* ThreadR does not support an installation on the webroot directly. See installation instructions for how to work around that.
|
||||
|
||||
I know some of these option names are silly but they all have the same length. -BodgeMaster
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
domain_name=threadr.lostcave.ddnss.de
|
||||
threadr_dir=.
|
||||
threadr_dir=/threadr
|
||||
db_username=webstuff
|
||||
db_password=Schei// auf Pa$$w0rter!
|
||||
db_database=web
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"REQUIRE_LOGIN":"if (!$login) { header(\"Location: https:\/\/%DOMAIN_NAME%/%CONTENT_DIR%\/login\/\\?error=session\"); die(); }",
|
||||
"NO_CHEAP_SESSION_STEALING":"if (isset($_SESSION['user_id'])) {if ($_SESSION['user_ip']!=$_SERVER['REMOTE_ADDR'] || $_SESSION['user_http_user_agent']!=$_SERVER['HTTP_USER_AGENT']){ $_SESSION = array(); if (ini_get(\"session.use_cookies\")){ $params = session_get_cookie_params(); setcookie(session_name(), '', time() - 42000, $params[\"path\"], $params[\"domain\"], $params[\"secure\"], $params[\"httponly\"]); } session_destroy(); header(\"Location: https://%DOMAIN_NAME%/%CONTENT_DIR%/login/\\?error=session\"); die();}}",
|
||||
"REQUIRE_LOGIN":"if (!$login) { header(\"Location: https:\/\/%DOMAIN_NAME%%CONTENT_DIR%\/login\/\\?error=session\"); die(); }",
|
||||
"NO_CHEAP_SESSION_STEALING":"if (isset($_SESSION['user_id'])) {if ($_SESSION['user_ip']!=$_SERVER['REMOTE_ADDR'] || $_SESSION['user_http_user_agent']!=$_SERVER['HTTP_USER_AGENT']){ $_SESSION = array(); if (ini_get(\"session.use_cookies\")){ $params = session_get_cookie_params(); setcookie(session_name(), '', time() - 42000, $params[\"path\"], $params[\"domain\"], $params[\"secure\"], $params[\"httponly\"]); } session_destroy(); header(\"Location: https://%DOMAIN_NAME%%CONTENT_DIR%/login/\\?error=session\"); die();}}",
|
||||
"SET_LOGIN_VARIABLE":"if (isset($_SESSION['user_id'])) { $login = true; } else { $login = false; }",
|
||||
"FORCE_LOGOUT":"$_SESSION = array(); if (ini_get('session.use_cookies')) { $params = session_get_cookie_params(); setcookie(session_name(), '', time() - 42000, $params['path'], $params['domain'], $params['secure'], $params['httponly']);} session_destroy();"
|
||||
}
|
||||
|
|
|
@ -11,15 +11,15 @@ if (!isset($login)){
|
|||
echo "<a class=\"icon ";
|
||||
if ($login){
|
||||
if ($navbar == "home"){
|
||||
echo "active\" href=\"%CONTENT_DIR%/userhome/\"><img src=\"/%CONTENT_DIR%/img/ThreadR_Home.svg\" alt=\"My Feed\" title=\"My Feed\"";
|
||||
echo "active\" href=\"%CONTENT_DIR%/userhome/\"><img src=\"%CONTENT_DIR%/img/ThreadR_Home.svg\" alt=\"My Feed\" title=\"My Feed\"";
|
||||
} else {
|
||||
echo "\" href=\"%CONTENT_DIR%/userhome/\"><img src=\"/%CONTENT_DIR%/img/ThreadR_Home.svg\" alt=\"My Feed\" title=\"My Feed\"";
|
||||
echo "\" href=\"%CONTENT_DIR%/userhome/\"><img src=\"%CONTENT_DIR%/img/ThreadR_Home.svg\" alt=\"My Feed\" title=\"My Feed\"";
|
||||
}
|
||||
} else {
|
||||
if ($navbar == "home"){
|
||||
echo "active\" href=\"%CONTENT_DIR%/\"><img src=\"/%CONTENT_DIR%/img/ThreadR_Home.svg\" alt=\"Home\" title=\"Home\"";
|
||||
echo "active\" href=\"%CONTENT_DIR%/\"><img src=\"%CONTENT_DIR%/img/ThreadR_Home.svg\" alt=\"Home\" title=\"Home\"";
|
||||
} else {
|
||||
echo "\" href=\"%CONTENT_DIR%/\"><img src=\"/%CONTENT_DIR%/img/ThreadR_Home.svg\" alt=\"Home\" title=\"Home\"";
|
||||
echo "\" href=\"%CONTENT_DIR%/\"><img src=\"%CONTENT_DIR%/img/ThreadR_Home.svg\" alt=\"Home\" title=\"Home\"";
|
||||
}
|
||||
}
|
||||
echo "/></a>";
|
||||
|
|
|
@ -29,3 +29,5 @@ the homepage
|
|||
this file
|
||||
### [style.css](./style.css)
|
||||
the stylesheet used on every ThreadR site
|
||||
### [redirect_home.html](./redirect_home.html)
|
||||
small HTML file that redirects to ThreadR, can be linked or copied to any place that needs to redirect to ThreadR’s landing page
|
||||
|
|
|
@ -15,15 +15,15 @@ if ($statement->rowCount() > 0) {
|
|||
// IP and user agent string are used to prevent cheap session stealing
|
||||
$_SESSION['user_ip'] = $_SERVER['REMOTE_ADDR'];
|
||||
$_SESSION['user_http_user_agent'] = $_SERVER['HTTP_USER_AGENT'];
|
||||
header("Location: https://%DOMAIN_NAME%/%CONTENT_DIR%/userhome/");
|
||||
header("Location: https://%DOMAIN_NAME%%CONTENT_DIR%/userhome/");
|
||||
} else {
|
||||
//password inorrect
|
||||
header("Location: https://%DOMAIN_NAME%/%CONTENT_DIR%/login/?error=credentials");
|
||||
header("Location: https://%DOMAIN_NAME%%CONTENT_DIR%/login/?error=credentials");
|
||||
die();
|
||||
}
|
||||
} else {
|
||||
//wrong user name
|
||||
header("Location: https://%DOMAIN_NAME%/%CONTENT_DIR%/login/?error=credentials");
|
||||
header("Location: https://%DOMAIN_NAME%%CONTENT_DIR%/login/?error=credentials");
|
||||
die();
|
||||
}
|
||||
?>
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0;%CONTENT_DIR%/" />
|
||||
</head>
|
||||
<body>
|
||||
<p> Your browser seems to not support redirects. <br />
|
||||
Please klick the following link to continue: <a href="%CONTENT_DIR%/"> Go to home page... </a></p>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue