- Python >= 3.6
- PostgreSQL >= 10
On top of that, an object storage service should also be provided to store the encrypted data blocks. Both Amazon S3 or OpenStack Swift API are supported.
Communication between client and server is achieved using Websocket. This allow bidirectional communication (needed by the server to be able to notify the client of remote changes) while still relying on very well supported web standard.
Parsec server respects the twelve-factor app principles. Hence each server instance is stateless and disposable, making it easy to host it on PAAS infrastructures or in containers.
In short, from a hosting point of view, Parsec server is similar to a standard web application.
$ python -m venv venv $ . ./venv/bin/activate $ pip install parsec-cloud[backend]
Use the parsec backend run
command to start Parsec server, for instance:
$ parsec backend run --port $PORT --host 0.0.0.0 --db postgresql://<...> --blockstore s3:<...> --administration-token <token>
Note
Settings can be specified by using environment variable PARSEC_CMD_ARGS
.
All available command line arguments can be used and environ variables
within it will be expanded. For instance:
$ DB_URL=postgres:///parsec PARSEC_CMD_ARGS='--db=$DB_URL --host=0.0.0.0' parsec backend run
--host <host>, -H <host>
- Environ:
PARSEC_HOST
- Default:
127.0.0.1
Host to listen on.
--port <port>, -P <port>
- Environ:
PARSEC_PORT
- Default:
6777
Port to listen on.
--db <url>
- Environ:
PARSEC_DB
Database configuration.
Allowed values:
MOCKED
: Mocked in memorypostgresql://<...>
: Use PostgreSQL database
Warning
MOCKED
is only designed for development and testing, do not use it in production.
--db-min-connections <int>
- Environ:
PARSEC_DB_MIN_CONNECTIONS
- Default:
5
Minimal number of connections to the database if using PostgreSQL.
--db-max-connections <int>
- Environ:
PARSEC_DB_MAX_CONNECTIONS
- Default:
7
Maximum number of connections to the database if using PostgreSQL.
--blockstore <url>, -b <url>
- Environ:
PARSEC_BLOCKSTORE
Blockstore configuration.
Allowed values:
MOCKED
: Mocked in memoryPOSTGRESQL
: Use the database specified in the--db
params3:[<endpoint_url>]:<region>:<bucket>:<key>:<secret>
: Use Amazon S3 storageswift:<authurl>:<tenant>:<container>:<user>:<password>
: Use OpenStack SWIFT storage
Note endpoint_url/auth_url must be escaped (e.g. s3:https\\://foo.com:[...]
).
On top of that, multiple blockstore configurations can be provided to form a RAID0/1/5 cluster.
Each configuration must be provided with the form
<raid_type>:<node>:<config>
with <raid_type>
RAID0/RAID1/RAID5, <node>
a
integer and <config>
the MOCKED/POSTGRESQL/S3/SWIFT config.
For instance, to configure a RAID0 with 2 nodes:
$ parsec backend run -b RAID0:0:MOCKED -b RAID0:1:POSTGRESQL [...]
Warning
MOCKED
and POSTGRESQL
are only designed for development and testing,
do not use them in production.
--administration-token <token>
- Environ:
PARSEC_ADMINISTRATION_TOKEN
Secret token to access the administration api.
--ssl-keyfile <file>
- Environ:
PARSEC_SSL_KEYFILE
Custom SSL key file.
--ssl-certfile <file>
- Environ:
PARSEC_SSL_CERTFILE
Custom SSL certificate file.
--log-level <level>, -l <level>
- Environ:
PARSEC_LOG_LEVEL
- Default:
WARNING
The granularity of Error log outputs.
Must be one of DEBUG
, INFO
, WARNING
, ERROR
, CRITICAL
.
--log-format <format>, -f <format>
- Environ:
PARSEC_LOG_FORMAT
- Default:
CONSOLE
Log formatting to use.
Must be one of CONSOLE
, JSON
.
--log-file <file>, -o <file>
- Environ:
PARSEC_LOG_FILE
- Default: log to stderr
The log file to write to.
--sentry-url <url>
- Environ:
PARSEC_SENTRY_URL
Sentry URL for telemetry report.
--debug
- Environ:
PARSEC_DEBUG
Enable debug informations.
--dev
Equivalent to --debug --db=MOCKED --blockstore=MOCKED --administration-token=s3cr3t
.