mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
readme update, env variable for disabling https
This commit is contained in:
parent
0488d3be35
commit
e307d08341
3 changed files with 15 additions and 9 deletions
20
README.md
20
README.md
|
@ -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 |
|
| 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 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 |
|
| 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
|
## 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
|
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!**
|
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
|
## Peer to peer
|
||||||
|
|
||||||
This server implements P2P functionality. It can fetch question databases and users from other
|
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:
|
* `selfInfo.json`: information of this peer. Required:
|
||||||
```
|
```
|
||||||
{
|
{
|
||||||
name: "Any name you choose",
|
"name": "Any name you choose",
|
||||||
contact: "contact to server administrator (irc server, e-mail, anything)",
|
"contact": "contact to server administrator (irc server, e-mail, anything)",
|
||||||
host: "server host (like somesite.com, without 'http(s)://')",
|
"host": "server host (like somesite.com, without 'http(s)://')",
|
||||||
port: "server port, number",
|
"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
|
you choose you can add them to your `peers.json` file. `thirdPartyPeers.json` should also contain
|
||||||
the public key
|
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
|
## Maintenance
|
||||||
|
|
||||||
|
@ -132,7 +137,8 @@ needed at all
|
||||||
| PORT | number | The port the http server should run on |
|
| PORT | number | The port the http server should run on |
|
||||||
| NS_THREAD_COUNT | number | Nubmer of CPU cores to use |
|
| NS_THREAD_COUNT | number | Nubmer of CPU cores to use |
|
||||||
| NS_NOUSER | boolean | If the authorization should be skipped (for testing) |
|
| 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_LOGLEVEL | number | Debug log level, 0 is the least verbose |
|
||||||
| NS_NOLOG | boolean | If logging should be skipped |
|
| NS_NOLOG | boolean | If logging should be skipped |
|
||||||
| NS_SQL_DEBUG_LOG | boolean | If the SQL queries should be logged |
|
| NS_SQL_DEBUG_LOG | boolean | If the SQL queries should be logged |
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
"publicdirs": ["publicDirs/qminingPublic/"],
|
"publicdirs": ["publicDirs/qminingPublic/"],
|
||||||
"nextdir": "nextStatic/dataEditorPublic",
|
"nextdir": "nextStatic/dataEditorPublic",
|
||||||
"name": "dataeditor",
|
"name": "dataeditor",
|
||||||
"route": "/data-editor",
|
"route": "/dataeditor",
|
||||||
"isNextJs": true
|
"isNextJs": true
|
||||||
},
|
},
|
||||||
"qmining": {
|
"qmining": {
|
||||||
|
|
|
@ -178,7 +178,7 @@ if (certsLoaded) {
|
||||||
logger.Log('Https not avaible', 'yellowbg')
|
logger.Log('Https not avaible', 'yellowbg')
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!process.env.NS_DEVEL) {
|
if (!process.env.NS_NO_HTTPS_FORCE) {
|
||||||
app.use(function (req, res, next) {
|
app.use(function (req, res, next) {
|
||||||
if (req.secure) {
|
if (req.secure) {
|
||||||
next()
|
next()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue