readme update

This commit is contained in:
mrfry 2023-04-29 10:12:39 +02:00
parent cb0ad03336
commit eb6fe138a0

View file

@ -77,9 +77,9 @@ files `./src/modules.json`.
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
server instances, and merge the response data to its own databases. The server also instantly sends 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 new questions received from users and new users to all registered peers. The sync feature should be
initialization, new user getting, and rarely for catching up, since all new questions should be used for initialization, new user getting, and rarely for catching up, since all new questions
received instantly. should be received instantly.
To setup P2P functionality you have to create a few files in `./data/p2p`: 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 ```json
{ {
"pw": "password to the host, so the server can log in there. Please use a dedicated password, that only the server uses!", "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 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` 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 ### Using `/syncp2pdata`
`./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.
To start syncing user \#1 should perform a get request to `/syncp2pdata`. Received new questions are To sync user \#1 should perform a get request to `/syncp2pdata`.
automatically sent to registered peers.
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: `/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 If `users` and `questions` are all missing, then everything will be synced. The last sync date is
stored separately for them. 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 ## Maintenance
The server doesn't require that much maintenance, but you are advised to: The server doesn't require that much maintenance, but you are advised to: