From c02a15ea4374789b84e7e2e810c670fd9bd63e87 Mon Sep 17 00:00:00 2001 From: Dnomd343 Date: Wed, 22 Mar 2023 00:15:44 +0800 Subject: [PATCH] docs: update readme document --- README.md | 95 +++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 78 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 8406ab8..88a6bb5 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,88 @@ ## Quick Start -Start a syncplay service at `tcp/8999`, you can also specify a password. +Start a syncplay service at `tcp/8999` with one command. ```bash -docker run -d \ ---network host \ ---name syncplay \ ---env PORT= \ ---env PASSWORD= \ -dnomd343/syncplay +docker run -d --network host --name syncplay dnomd343/syncplay ``` -If TLS is enabled, you have to set certificate folder with `privkey.pem`, `cert.pem` and `chain.pem`. +More arguments can be specified. ```bash -docker run -d \ ---network host \ ---name syncplay \ ---env PORT= \ ---env PASSWORD= \ ---env TLS=/certs \ ---volume :/certs \ -dnomd343/syncplay +docker run -d --network host --name syncplay dnomd343/syncplay \ + --port 12345 --password dnomd343 --motd hello --isolate-room --disable-chat ``` -You can get more information on the [official documentation](https://syncplay.pl/guide/server/). +You can also use environment variables to specify. + +```bash +docker run -d --network host --name syncplay \ + --env PORT=12345 \ + --env PASSWD=dnomd343 \ + dnomd343/syncplay +``` + +Enable TLS support of Syncplay server. + +```bash +docker run -d --network host --name syncplay \ + --volume /etc/ssl/certs/343.re/:/certs/ dnomd343/syncplay --enable-tls +``` + +> The `/etc/ssl/certs/343.re/` folder stores certificates and private key files, and specific introductions and examples will be given below. + +### Options + +You can specify the following arguments: + ++ `--port [PORT]` :Listening port of Syncplay server, the default is `8999`. + ++ `--motd [MESSAGE]` :The welcome text after the user enters the room. + ++ `--password [PASSWD]` :Authentication when the user connects to the syncplay server. + ++ `--salt [SALT]` :A string used to secure passwords (e.g. Rainbow-tables), defaults to empty. + ++ `--random-salt` :Use a randomly generated salt value, valid when `--salt` is not specified. + ++ `--isolate-room` :Room isolation enabled, users will not be able to see information from anyone other than their own room. + ++ `--disable-chat` :Disables the chat feature. + ++ `--disable-ready` :Disables the readiness indicator feature. + ++ `--max-username-length` :Maximum length of usernames (number of characters). + ++ `--max-chat-message-length` :Maximum length of chat messages (number of characters). + ++ `--enable-tls` :Enable tls support, the certificate directory should be synchronized to `/certs/`, including `cert.pem`, `chain.pem` and `privkey.pem` three files. + + + `cert.pem` :The certificate issued by the CA. + + `chain.pem` :The certificate chain of CA service. + + `privkey.pem` :The private key for the certificate. + +> For example, in [`acme.sh`](https://acme.sh/), they correspond to `--cert-file`, `--ca-file` and `--key-file` respectively, the following is an example of certificate installation. + +```bash +# Export the domain `343.re` to `/etc/ssl/certs/343.re/` +acme.sh --install-cert -d 343.re \ + --cert-file /etc/ssl/certs/343.re/cert.pem \ + --ca-file /etc/ssl/certs/343.re/chain.pem \ + --key-file /etc/ssl/certs/343.re/privkey.pem +``` + +You can also specify arguments through environment variables: + ++ `PORT` :Equivalent to `--port`. + ++ `SALT` :Equivalent to `--salt`. + ++ `PASSWD` :Equivalent to `--password`. + ++ `TLS=ON` :Equivalent to `--enable-tls`. + +> Note that its priority is lower than command line arguments. + +### License + +MIT ©2022 [@dnomd343](https://github.com/dnomd343)