Home » Documentation » Configuration

Configuration

This document describes the uniqush-push configuration file. See Basic Operations first if you haven't already.

Location

The configuration file defaults to /etc/uniqush/uniqush-push.conf, or specify your own with the -config flag: uniqush-push -config /path/to/uniqush-push.conf.

Structure

The file has several sections, each with options as key-value pairs:

globaloption=globalvalue

[Section1]
option1=value1
option2=value2

[Section2]
option=value

Lines outside any [Section] header are in the default section. All options are optional; an empty config file is a valid one, and uniqush-push uses its defaults for everything.

Sections

SectionDescription
defaultGlobal settings that apply outside any named section.
WebFrontendThe REST API: listen address, logging.
AddPushServiceProvider, RemovePushServiceProvider, Subscribe, Unsubscribe, Push, Subscriptions, PSPs, ServicesLogging for the matching API call.
DatabaseThe Redis connection.
apnsAPNs-specific settings.
webpush, unifiedpushWeb Push / UnifiedPush destination policy. Independent sections, even though it's one backend registered under two names.

Options in the default section

OptionValuesDefault
logfilea file pathstandard errorWhere uniqush-push logs. Created with mode 0600 if it doesn't exist; falls back to standard error if that fails.

Common options (every section except Database and the default section)

OptionValuesDefault
logon/offonTurn logging for this section on or off.
loglevelalert, error, warn, standard/verbose/info, debugstandardVerbosity.

WebFrontend

OptionValuesDefault
addr[host]:[port]localhost:9898Where the REST API listens. There is no authentication — keep this on localhost, or put a reverse proxy that authenticates in front of it.

Database

OptionValuesDefault
engineredisredisOnly Redis is supported.
hostan addresslocalhostThe Redis host.
porta port number0 (Redis's default, 6379)
namea database index0
passworda passwordempty
slave_host, slave_portan address/portunsetRoute reads to a replica, to reduce load on the master.
everysecseconds600How often the in-memory cache syncs to Redis.
leastdirtya count10The cache syncs early if at least this many entries are dirty.
cachesizea count1024Maximum entries the cache holds.

apns

OptionValuesDefault
pool_sizea count, up to 5013Connections to APNs' binary protocol per active provider. Only relevant to the deprecated binary path; HTTP/2 doesn't pool this way.
allow_non_apple_endpointstrue/falsefalseAllow an /addpsp endpoint outside push.apple.com — for pointing a provider at a simulator or relay. See Using Uniqush.

webpush / unifiedpush

OptionValuesDefault
allow_private_addressestrue/falsefalseAllow pushing to a non-globally-routable address (for a self-hosted push server on a private network).
allowed_hostsa comma-separated listunsetRestrict which hosts are allowed, alongside allow_private_addresses.

Sample Configuration File

The repository's conf/uniqush-push.conf is a working starting point:

logfile=/var/log/uniqush

[WebFrontend]
log=on
loglevel=standard
addr=localhost:9898

[AddPushServiceProvider]
log=on
loglevel=standard

[RemovePushServiceProvider]
log=on
loglevel=standard

[Subscribe]
log=on
loglevel=standard

[Unsubscribe]
log=on
loglevel=standard

[Push]
log=on
loglevel=standard

[Database]
engine=redis
port=0
name=0
everysec=600
leastdirty=10
cachesize=1024

[apns]
pool_size=13