syncthing/cmd/discosrv/README.md

41 lines
1.4 KiB
Markdown
Raw Normal View History

2014-07-30 22:15:16 +02:00
discosrv
========
[![Latest Build](http://img.shields.io/jenkins/s/http/build.syncthing.net/discosrv.svg?style=flat-square)](http://build.syncthing.net/job/discosrv/lastBuild/)
2014-07-31 12:37:18 +02:00
2014-07-30 22:15:16 +02:00
This is the global discovery server for the `syncthing` project.
2015-03-25 08:16:52 +01:00
To get it, run `go get github.com/syncthing/discosrv` or download the
[latest build](http://build.syncthing.net/job/discosrv/lastSuccessfulBuild/artifact/)
from the build server.
2014-07-30 22:15:16 +02:00
2015-03-25 08:16:52 +01:00
Usage
-----
2014-08-02 09:03:38 +02:00
2015-07-22 00:56:27 +02:00
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:
```bash
2015-11-08 14:53:07 +01:00
$ discosrv -db-dsn="file:///var/run/discosrv.db"
2015-07-22 00:56:27 +02:00
```
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:
2015-03-25 08:16:52 +01:00
```bash
2015-07-22 00:56:27 +02:00
$ export DISCOSRV_DB_DSN="postgres://user:password@localhost/databasename"
$ discosrv -db-backend="postgres"
2015-03-25 08:16:52 +01:00
```
2015-07-22 00:56:27 +02:00
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.
2015-03-25 08:16:52 +01:00
See `discosrv -help` for other options.