updated documentation

master
BodgeMaster 2021-09-02 15:47:01 +02:00
parent 726a2675ae
commit 7e62d6f11e
3 changed files with 35 additions and 21 deletions

View File

@ -1,16 +1,16 @@
# Files # Files
### [about.template](./about.template) ### [about.template](./about.template)
The customizable part of the content page, will eventually be replaced with a markdown file The customizable part of the content page, HTML code for now, will eventually be replaced with a markdown file
### [names.conf](./names.conf) ### [instance.conf](./instance.conf)
Information about the installation location of ThreadR configuration for a specific instance
- domain name - domain_name=<public facing domain name of the instance>
- ThreadR directory on that domain - threadr_dir=<directory on the webhost>
- db_username=<mysql user>
- db_password=<mysql password>
Format: <config option>=<value> The format is strictly `<option>=<value>` because the mechanism used to load the config values is very simple. Dont add additional whitespace for fancy formatting. Things *will* break. You have been warned.
This format is strictly enforced because the mechanism to load the config is very primitive. Dont add additional whitespace for fancy formatting. Things *will* break. You have been warned. The config is loaded once on deployment by the "variable grabbler" macro processor with `["exec","echo -n \"$(sed --quiet \"/<option>=/s/.*=//p\" config/instance.conf)\""]`.
How it is integrated: exec section of variable grabbler `/<config option>=/s/.*=//p" config/names.conf`
### [README.md](./README.md) ### [README.md](./README.md)
this file this file

View File

@ -1,15 +1,27 @@
# Files # Files
### [variable_grabbler.pass0.json](./variable_grabbler.pass0.json), [variable_grabbler.pass1.json](./variable_grabbler.pass1.json), [variable_grabbler.pass2.json](./variable_grabbler.pass2.json) ### [[DIR] templates](./templates)
These are the the config files for ../variable_grabbler.py. contains the templates used by the macro processor
A short description of what the variables do and where they should go: ### [pass0_templates.json](./pass0_templates.json)
* `%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) Macros that insert templates
* `%SET_LOGIN_VARIABLE%` (in PHP code) → sets the $login variable in PHP by detecting if the user has a valid logged in session - `%NAVBAR%` the navigation bar at the top of the website (requires PHP)
* `%NO_CHEAP_LOGIN_STEALING%` (in PHP code, before any non-header data is sent to client) → prevents the most primitive cookie stealing attempts, nothing advanced though - `%BANNER_COOKIES%` the cookie banner (requires PHP)
* `%BANNER_COOKIES%` (in HTML part of PHP file) → the cookie banner that every web page has ### [pass1_misc.json](./pass1_misc.json)
* `%PLEAZE_NO_CACHE%` (in PHP code, before any non-header data is sent to client) → requests the browser to not cache this page Miscellaneous macros
* `%FORCE_LOGOUT%` (in PHP code) → logout immediately (obviously less common than the other variables...) - `%STYLESHEET%` links stylesheet (HTML <head> section)
* `%CONTENT_DIR%` (anywhere in code) → the path to the ThreadR directory (without domain name) - `%PLEAZE_NO_CACHE%` tell the browser not to cache this page (PHP, before any data is sent to the client)
* `%STYLESHEET%` (in HTML) → adds the tag linking the stylesheet - `%COLOR_BEIGE%`, `%COLOR_ORANGE%`, `%COLOR_BLUE%`, `%COLOR_PINK%`, `%COLOR_CYAN%` color codes, format: #XXXXXX
* `%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 ### [pass2_session.json](./pass2_session.json)
Session handling macros
- `%REQUIRE_LOGIN%` go to login page if not logged in
- `%NO_CHEAP_SESSION_STEALING%` make sure that IP and user agent stay the same, otherwise end session
- `%SET_LOGIN_VARIABLE%` sets the variable $login based on whether the user is logged in
- `%FORCE_LOGOUT%` end session right here and now
### [pass3_install-config.json](./pass3_install-config.json)
Macros that grab the configuration values and inject them into the instance
- `%DOMAIN_NAME%` the domain name of the instance
- `%CONTENT_DIR%` the directory of the ThreadR home page on the webhost
- `%DB_PASSWORD%` password for the MySQL server
- `%DB_USERNAME%` username for the MySQL server
- `%ABOUT_PAGE%` the template for the about page
### [README.md](./README.md) ### [README.md](./README.md)
this file this file

View File

@ -3,3 +3,5 @@
contains the navbar, depends on a variable in PHP to determine which field on the navbar should be highlighted contains the navbar, depends on a variable in PHP to determine which field on the navbar should be highlighted
### [banner_cookies.template](./banner_cookies.template) ### [banner_cookies.template](./banner_cookies.template)
contains the cookie banner contains the cookie banner
### [README.md](./README.md)
this file