Compare commits

...

3 Commits

Author SHA1 Message Date
BodgeMaster 626c886a8e removed useless comment 2021-08-31 03:24:19 +02:00
BodgeMaster 514bdd618e added links to all the READMEs 2021-08-31 03:21:30 +02:00
BodgeMaster a6a6899e93 changed *[DIR] to [DIR]* fixing #4 2021-08-31 02:30:03 +02:00
16 changed files with 74 additions and 70 deletions

View File

@ -57,27 +57,29 @@ This section has moved. Look in the files or their documentation below.
```
# Individual documentation for each file
### policies [DIR]
### [[DIR] policies](./policies)
This folder contains the documents from which our policy pages (privacy policy, TOS, etc) will be built in the future.
### threadr [DIR]
### [[DIR] threadr](./threadr)
This folder contains all the files that are parts of ThreadR directly
### admin.php
### [admin.php](./admin.php)
This is the file that is shown on the internal admin page. It will contain a list of users, forums, threads, etc.
At the moment, it is just a convenient way to access the other internal administration tools.
This is not directly a part of ThreadR.
### default.html
### [default.html](./default.html)
The main index.html on the server. It redirects to ThreadR.
### deployment_script.sh
### [deployment_script.sh](./deployment_script.sh)
This script is executed each time (well... if Gitea decides to actually run the WebHook) the repository gets pushed.
It contains the commands to execute the code variable replcement system and some other useful tasks.
Its working directory is the root of the git repository.
If you want to know more: It is commented. Just look at it.
### icon.png
### [icon.png](./icon.png)
Well, thats a story about developers looking at the documentation and realizing what this is for...
I (Jan) intended it as the icon file for the tab icon but some folks put another icon elsewhere. Just ignore it. Maybe, one time, I will find a use for it.
### index.html
### [index.html](./index.html)
This was originally intended to be our index file. Turns out, we even need PHP on our index, so this one became another redirect to the new ThreadR index.php.
### strassenkind.php, internal.css, commands_status.conf, commands_ondemand.conf, commands_git.conf
DEPRECATED: We dont have a /common directory anymore and therefore this is no longer needed. To be removed.
### [strassenkind.php](./strassenkind.php), [internal.css](./internal.css), [commands_status.conf](./commands_status.conf), [commands_ondemand.conf](./commands_ondemand.conf), [commands_git.conf](./commands_git.conf)
The internal status page. strassenkind.php is the index, internal.css is the stylesheet strassenkind.php uses
and the .conf files are lists of commands to be executed by the status page. The status page auto-refreshes to display up-to-date information on the commands in commands_status.conf.
It is advised to put commands that have a high disk usage or start/stop/restart/reload system services etc. on the commands_ondemand.conf file as the ondemand status page does not auto-refresh.
@ -94,18 +96,22 @@ cd web-deployment
exit
logout
```
### README.md
### [README.md](./README.md)
this file
### run-once-script.sh
### [run-once-script.sh](./run-once-script.sh)
This script will be executed each time it is altered and pushed. Make sure to remove everything the previous user added before using it to not run these commands again.
Leave the bang (#! comment) and the bottom part that has been commented to instruct you to leave it there.
### variable_grabbler.py
DEPRECATED: This file depends on things being placed outside of the repository which will cause issues with the deployment system in the future. To be removed.
### [variable_grabbler.py](./variable_grabbler.py)
This is the code variable replacer. It takes two arguments: The configuration file to be used and the file to be worked on.
The configuration file contains a json which defines replacement string for each code variable in the format `"<VARNAME>":"<String>"`. Code variables are preceeded and followed by a % sign in code but this is not the case in the configuration.
Also, they must be capitalized in code.
An alternative option to providing a string in the config is to add arrays defining files or commands (Commands are not implemented yet.). Format: `"<VARNAME>":["<file|exec>","<filepath|command>"]
Read the source code for further information.
### variable_grabbler.pass*.json
NOTICE: This file (or rather a more up-to-date version of it) will be moved to a new repository containing the deployment system.
### [variable_grabbler.pass0.json](./variable_grabbler.pass0.json), [variable_grabbler.pass1.json](./variable_grabbler.pass1.json), [variable_grabbler.pass2.json](./variable_grabbler.pass2.json)
These are the the config files for variable_grabbler.py.
A short description of what the variables do and where they should go:
* `%NAVBAR%` (in HTML part of PHP file) → the Navbar, also includes an automatic logout-function if the user is in a place where they should never be logged in (triggered by absence of the $login variable)
@ -117,6 +123,6 @@ A short description of what the variables do and where they should go:
* `%CONTENT_DIR%` (anywhere in code) → the path to the ThreadR directory (without domain name)
* `%STYLESHEET%` (in HTML) → adds the tag linking the stylesheet
* `%REQUIRE_LOGIN%` (in PHP code, before any non-header data is sent to client) → sends users to the login page if they are not logged in
### navbar.template, banner_cookies.template
### [navbar.template](./navbar.template), [banner_cookies.template](./banner_cookies.template)
file templates for variables from the code variable replacement system

View File

@ -1,9 +1,9 @@
# Short documentation of each file
### cookie_policy.md
### [cookie_policy.md](./cookie_policy.md)
the cookie policy (markdown)
### anonymous_terms_and_conditions.md
### [anonymous_terms_and_conditions.md](./anonymous_terms_and_conditions.md)
the TOS for anonymous users (markdown)
### terms_and_conditions.md
### [terms_and_conditions.md](./terms_and_conditions.md)
the TOS (markdown)
### README.md
### [README.md](./README.md)
this file

View File

@ -1,31 +1,31 @@
# Short documentation of each file
### about [DIR]
### [[DIR] about](./about)
contains the about us page
### board [DIR]
### [[DIR] board](./board)
contains the files needed to display a board
### boards [DIR]
### [[DIR] boards](./boards)
contains the files for the board list
### img [DIR]
the directory that contains images that are part of the WebSite itself (no user content)
### login [DIR]
### [[DIR] img](./img)
the directory that contains images that are part of the website itself (no user content)
### [[DIR] login](./login)
everything that is needed to log in a user
### logout [DIR]
### [[DIR] logout](./logout)
the logout process
### news [DIR]
### [[DIR] news](./news)
a page displaying a special board that is write-protected and shows updates about ThreadR
### profile [DIR]
### [[DIR] profile](./profile)
profile pages and profile settings
### signup [DIR]
### [[DIR] signup](./signup)
the signup process
### userhome [DIR]
### [[DIR] userhome](./userhome)
the users feed
### accept_cookie.php
### [accept_cookie.php](./accept_cookie.php)
redirect immediately back to where the user came from but sets a cookie that says 'You accept cookies.'
$_GET variables:
* from: the url the user came from after urlencode() was used on it
### index.php
### [index.php](./index.php)
the homepage
### README.md
### [README.md](./README.php)
this file
### style.css
### [style.css](./style.css)
the stylesheet used on every ThreadR site

View File

@ -1,5 +1,5 @@
# Short documentation of all files
### index.php
### [index.php](./index.php)
Self-Explanatory
### README.md
### [README.md](./README.md)
this file

View File

@ -1,19 +1,19 @@
# A short overview of the files:
### index.php
### [index.php](./index.php)
Somewhat obvious...
$_GET values:
* id → the board id
* action → what action file should be loaded in the bottom section (see below)
* valid actions: [not present], post, submit, edit
### board.php
### [board.php](./board.php)
the top part of a board page, displays the posts, loaded via include()
### post.php
### [post.php](./post.php)
one of the action files for the bottom of the page, displays a form to add a post, loaded via include()
### submit.php
### [submit.php](./submit.php)
displays a message in the bottom of the page and submits a new post, loaded via include()
### edit.php
### [edit.php](./edit.php)
? [Will look into it later, seems not to do very much ATM]
### default.php
### [default.php](./default.php)
displays a button giving the user the option to post something
### README.md
### [README.md](./README.md)
this file

View File

@ -1,5 +1,5 @@
# Short description of each file
### index.php
### [index.php](./index.php)
obvious, hopefully
### README.md
### [README.md](./README.md)
this file

View File

@ -1,7 +1,7 @@
# Short documentation of all files
### index.html
### [index.html](./index.html)
This is my usual nope.html to prevent kiddies from poking at my files. It just redirects. There is no real security benefit to it though as it does not even prevent `wget -r`.
### *.{svg,png,jpg}
images that are used on the page
### README.md
### [README.md](./README.md)
this file

View File

@ -1,7 +1,7 @@
# A short description of each file
### index.php
### [index.php](./index.php)
should be obvious, accepts a $_GET variable to display error messages: error=<credentials|session>
### README.md
### [README.md](./README.md)
this file
### redirect.php
### [redirect.php](./redirect.php)
does some tasks for login and redirects to the users personal feed page

View File

@ -54,9 +54,6 @@ if (isset($_SESSION['user_id'])){
<a href="%CONTENT_DIR%/signup/"> <button> Register </button> </a>
<p></p>
</div>
<!-- <div class="item-4">
<center><a href="https://lostcave.ddnss.de%CONTENT_DIR%/about/">About</a></center>
</div> -->
</div>
%BANNER_COOKIES%
</body>

View File

@ -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://lostcave.ddnss.de/common/threadr/userhome/");
header("Location: https://threadr.lostcave.ddnss.de/threadr/userhome/");
} else {
//password inorrect
header("Location: https://lostcave.ddnss.de/common/threadr/login/?error=credentials");
header("Location: https://threadr.lostcave.ddnss.de/threadr/login/?error=credentials");
die();
}
} else {
//wrong user name
header("Location: https://lostcave.ddnss.de/common/threadr/login/?error=credentials");
header("Location: https://threadr.lostcave.ddnss.de/threadr/login/?error=credentials");
die();
}
?>

View File

@ -1,5 +1,5 @@
# Short documentation of all files
### index.php
### [index.php](./index.php)
Self-Explanatory
### README.md
### [README.md](./README.md)
this file

View File

@ -1,5 +1,5 @@
# Short description of each file
### index.php
### [index.php](./index.php)
Well, guess what?
### README.md
### [README.md](./README.md)
this file

View File

@ -1,10 +1,10 @@
# Short documentation of each file
### index.php
### [index.php](./index.php)
Fairly obvious, if you ask me.
Accepts a $_GET variable: action=<[not present]|edit>
### default.php
### [default.php](./default.php)
shown by default, loaded via include()
### edit.php
### [edit.php](./edit.php)
profile edit page, loaded via include()
### README.md
### [README.md](./README.md)
this file

View File

@ -1,7 +1,8 @@
# Short description for each file
### verify-email [DIR] the folder containing the email verification page
### index.php
### [[DIR] verify-email](./verify-email)
the folder containing the email verification page
### [index.php](./index.php)
You can figure that out on your own.
Interesting fact about this page: Will force-logout the user without notice.
### README.md
### [README.md](./README.md)
this file

View File

@ -1,7 +1,7 @@
# Files
### index.php
### [index.php](./index.php)
obvious
### redirect.php
### [redirect.php](./redirect.php)
activates the user after the email has been verified
### README.md
### [README.md](./README.php)
this file

View File

@ -1,5 +1,5 @@
## Short documentation of all files
### index.php
### [index.php](./index.php)
Self-Explanatory
### README.md
### [README.md](./README.md)
this file