Skip to content

Commit

Permalink
Fix default settings
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasvbeek committed Feb 2, 2022
1 parent 3f8d1e9 commit 2f99238
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 2 deletions.
12 changes: 12 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@ nfpms:
dst: /etc/default/librespeed-go
- src: scripts/systemd/librespeed-go.service
dst: /usr/lib/systemd/system/librespeed-go.service
- src: web/assets
dst: /usr/local/share/librespeed-go/assets
- src: scripts/settings.toml
dst: /etc/librespeed-go/settings.toml
type: config
- src: scripts/librespeed-go.db
dst: /var/lib/librespeed-go/librespeed-go.db
type: noreplace
file_info:
owner: librespeed
group: librespeed
mode: 0600
formats:
- deb
- rpm
Expand Down
2 changes: 1 addition & 1 deletion scripts/defaults
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# Due to shell scaping, to pass backslashes for regexes, you need to double
# them (\\d for \d). If running under systemd, you need to double them again
# (\\\\d to mean \d), and escape newlines too.
ARGS=""
ARGS="-c /etc/librespeed-go/settings.toml"
Empty file added scripts/librespeed-go.db
Empty file.
3 changes: 3 additions & 0 deletions scripts/postinstall.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/sh

adduser --quiet --system --home /var/lib/librespeed-go --no-create-home \
--group --gecos "LibreSpeed-Go" librespeed

systemctl daemon-reload
systemctl enable librespeed-go
systemctl start librespeed-go
30 changes: 30 additions & 0 deletions scripts/settings.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# bind address, use empty string to bind to all interfaces
bind_address=""
# backend listen port
listen_port=8989
# proxy protocol port, use 0 to disable
proxyprotocol_port=0
# Server location
server_lat=1
server_lng=1
# ipinfo.io API key, if applicable
ipinfo_api_key=""

# assets directory path, defaults to `assets` in the same directory
assets_path="/usr/local/share/librespeed-go/assets"

# password for logging into statistics page
statistics_password="PASSWORD"
# redact IP addresses
redact_ip_addresses=false

# database type for statistics data, currently supports: none, memory, bolt, mysql, postgresql
# if none is specified, no telemetry/stats will be recorded, and no result PNG will be generated
database_type="bolt"
database_hostname=""
database_name=""
database_username=""
database_password=""

# if you use `bolt` as database, set database_file to database file location
database_file="/var/lib/librespeed-go/librespeed-go.db"
1 change: 0 additions & 1 deletion scripts/systemd/librespeed-go.service
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ Documentation=https://github.com/FreedomNetNL/speedtest-go

[Service]
Restart=on-failure
DynamicUser=yes
User=librespeed
EnvironmentFile=/etc/default/librespeed-go
ExecStart=/usr/local/bin/librespeed-go $ARGS
Expand Down

0 comments on commit 2f99238

Please sign in to comment.