readme update, env variable for disabling https

This commit is contained in:
mrfry 2023-04-06 07:58:14 +02:00
parent 0488d3be35
commit e307d08341
3 changed files with 15 additions and 9 deletions

View file

@ -32,7 +32,7 @@ threads, and serve more requests at once. The used cores can be limited with env
| Question database | A JSON file, array of saved subjects wich have a Name, and Questions array |
| peer to peer functionality | The ability to share question databases and users with other instances of this server |
| Peer | Another instance of this server, with peer to peer functionality set up |
| User #1 | The first user created, admin of the server |
| User \#1 | The first user created, admin of the server |
## Setup
@ -44,6 +44,11 @@ according to the messages, these are necessary for the server to function.
There will be also a lot of information about files and other necessary things being created. **Please
read them very carefully, you should know about what was created!**
## Web server paths
There are different routes assigned to different modules. You can see these in detail in the files
`./src/modules.json`.
## Peer to peer
This server implements P2P functionality. It can fetch question databases and users from other
@ -54,10 +59,10 @@ To setup P2P functionality you have to create a few files in `./data/p2p`:
* `selfInfo.json`: information of this peer. Required:
```
{
name: "Any name you choose",
contact: "contact to server administrator (irc server, e-mail, anything)",
host: "server host (like somesite.com, without 'http(s)://')",
port: "server port, number",
"name": "Any name you choose",
"contact": "contact to server administrator (irc server, e-mail, anything)",
"host": "server host (like somesite.com, without 'http(s)://')",
"port": "server port, number",
}
```
@ -69,7 +74,7 @@ Uppon syncing data or having a peer request data from your server there will be
you choose you can add them to your `peers.json` file. `thirdPartyPeers.json` should also contain
the public key
To start syncing user #1 should perform a get request to `/syncp2pdata`
To start syncing user \#1 should perform a get request to `/syncp2pdata`
## Maintenance
@ -132,7 +137,8 @@ needed at all
| PORT | number | The port the http server should run on |
| NS_THREAD_COUNT | number | Nubmer of CPU cores to use |
| NS_NOUSER | boolean | If the authorization should be skipped (for testing) |
| NS_DEVEL | boolean | Developemnt mode. Now it only disables automatic redirects from http to https |
| NS_NO_HTTPS_FORCE | boolean | Disables automatic redirects from http to https |
| NS_DEVEL | boolean | Developemnt mode. Now it only forces login page to use localhost |
| NS_LOGLEVEL | number | Debug log level, 0 is the least verbose |
| NS_NOLOG | boolean | If logging should be skipped |
| NS_SQL_DEBUG_LOG | boolean | If the SQL queries should be logged |

View file

@ -4,7 +4,7 @@
"publicdirs": ["publicDirs/qminingPublic/"],
"nextdir": "nextStatic/dataEditorPublic",
"name": "dataeditor",
"route": "/data-editor",
"route": "/dataeditor",
"isNextJs": true
},
"qmining": {

View file

@ -178,7 +178,7 @@ if (certsLoaded) {
logger.Log('Https not avaible', 'yellowbg')
}
if (!process.env.NS_DEVEL) {
if (!process.env.NS_NO_HTTPS_FORCE) {
app.use(function (req, res, next) {
if (req.secure) {
next()