a58f69be04
If the listen address scheme is set to tcp4:// or tcp6://, it needs to be made sure that the remote address matches this scheme before it is added to the database. This prevents invalid URIs like tcp4://<IPv6 address>:<port> or tcp6://<IPv4 address>:<port>. GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3378 |
||
---|---|---|
.. | ||
clean.go | ||
db.go | ||
LICENSE | ||
main.go | ||
psql.go | ||
ql.go | ||
querysrv.go | ||
README.md | ||
stats.go |
discosrv
This is the global discovery server for the syncthing
project.
To get it, run go get github.com/syncthing/discosrv
or download the
latest build
from the build server.
Usage
The discovery server supports ql
and postgres
backends.
Specify the backend via -db-backend
and the database DSN via -db-dsn
.
By default it will use in-memory ql
backend. If you wish to persist the
information on disk between restarts in ql
, specify a file DSN:
$ discosrv -db-dsn="file:///var/run/discosrv.db"
For postgres
, you will need to create a database and a user with permissions
to create tables in it, then start the discosrv as follows:
$ export DISCOSRV_DB_DSN="postgres://user:password@localhost/databasename"
$ discosrv -db-backend="postgres"
You can pass the DSN as command line option, but the value what you pass in will be visible in most process managers, potentially exposing the database password to other users.
In all cases, the appropriate tables and indexes will be created at first startup. If it doesn't exit with an error, you're fine.
See discosrv -help
for other options.