mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
readme update
This commit is contained in:
parent
cb0ad03336
commit
eb6fe138a0
1 changed files with 13 additions and 13 deletions
26
README.md
26
README.md
|
@ -77,9 +77,9 @@ files `./src/modules.json`.
|
|||
|
||||
This server implements P2P functionality. It can fetch question databases and users from other
|
||||
server instances, and merge the response data to its own databases. The server also instantly sends
|
||||
new questions received from users to all registered peers. The sync feature should be used for
|
||||
initialization, new user getting, and rarely for catching up, since all new questions should be
|
||||
received instantly.
|
||||
new questions received from users and new users to all registered peers. The sync feature should be
|
||||
used for initialization, new user getting, and rarely for catching up, since all new questions
|
||||
should be received instantly.
|
||||
|
||||
To setup P2P functionality you have to create a few files in `./data/p2p`:
|
||||
|
||||
|
@ -97,7 +97,8 @@ To setup P2P functionality you have to create a few files in `./data/p2p`:
|
|||
```json
|
||||
{
|
||||
"pw": "password to the host, so the server can log in there. Please use a dedicated password, that only the server uses!",
|
||||
"publicKey": "public key of the server for encryption"
|
||||
"publicKey": "public key of the server for encryption",
|
||||
"http": "boolean, if true then http will be used to communicate instead of https"
|
||||
}
|
||||
```
|
||||
Public key is optional, but needed to encrypt and add the users database in the response, so they
|
||||
|
@ -105,13 +106,15 @@ To setup P2P functionality you have to create a few files in `./data/p2p`:
|
|||
|
||||
New keys will be added during certain actions, such as: `sessionCookie` and `lastSync`
|
||||
|
||||
Uppon syncing data or having a peer request data from your server there will be new entries in
|
||||
`./data/p2p/thirdPartyPeers.json`. Here you can review the peers, see their contact and host, and if
|
||||
you choose you can add them to your `peers.json` file. `thirdPartyPeers.json` should also contain
|
||||
the public key.
|
||||
### Using `/syncp2pdata`
|
||||
|
||||
To start syncing user \#1 should perform a get request to `/syncp2pdata`. Received new questions are
|
||||
automatically sent to registered peers.
|
||||
To sync user \#1 should perform a get request to `/syncp2pdata`.
|
||||
|
||||
Upon syncing data or having a peer request data from your server there will be new entries in
|
||||
`./data/p2p/thirdPartyPeers.json`. In this file you can review the peers, see their contact and
|
||||
host, and you can add them to your `peers.json` file. `thirdPartyPeers.json` doesn't contain the
|
||||
public key, you can obtain it (and some further information) by calling the peers `/api/selfinfo`
|
||||
EP.
|
||||
|
||||
`/syncp2pdata` accepts a few query parameters:
|
||||
|
||||
|
@ -124,9 +127,6 @@ automatically sent to registered peers.
|
|||
If `users` and `questions` are all missing, then everything will be synced. The last sync date is
|
||||
stored separately for them.
|
||||
|
||||
If the peer doesn't have a https server (only http) then `http: true` should be specified in
|
||||
`peers.json`
|
||||
|
||||
## Maintenance
|
||||
|
||||
The server doesn't require that much maintenance, but you are advised to:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue