Skip to content

Commit

Permalink
Make Litestream retention configurable (#447)
Browse files Browse the repository at this point in the history
Details in #446 

One problem though: due to current code organization (few
"entrypoints"), I did not find a good **single** place for a default
value.

---------

Co-authored-by: Michael Lynch <[email protected]>
  • Loading branch information
ribtoks and mtlynch authored Jul 19, 2023
1 parent c67d347 commit e3ba3a7
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ COPY ./litestream.yml /etc/litestream.yml
COPY ./static /app/static
COPY ./LICENSE /app/LICENSE

ENV LITESTREAM_RETENTION=72h

WORKDIR /app

ENTRYPOINT ["/app/docker-entrypoint"]
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ You can adjust behavior of the Docker container by specifying these Docker-speci
| `LITESTREAM_ENDPOINT` | Litestream-compatible cloud storage endpoint where Litestream should replicate data. |
| `LITESTREAM_ACCESS_KEY_ID` | Litestream-compatible cloud storage access key ID to the bucket where you want to replicate data. |
| `LITESTREAM_SECRET_ACCESS_KEY` | Litestream-compatible cloud storage secret access key to the bucket where you want to replicate data. |
| `LITESTREAM_RETENTION` | The amount of time Litestream snapshots & WAL files will be kept (defaults to 72h). |

### Docker build args

Expand Down
1 change: 1 addition & 0 deletions docker-entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ if [[ "${IS_LITESTREAM_ENABLED}" == 'true' ]]; then
/app/litestream version
echo "LITESTREAM_BUCKET=${LITESTREAM_BUCKET}"
echo "LITESTREAM_ENDPOINT=${LITESTREAM_ENDPOINT}"
echo "LITESTREAM_RETENTION=${LITESTREAM_RETENTION}"

if [[ -f "$DB_PATH" ]]; then
echo "Existing database is $(stat -c %s "${DB_PATH}") bytes"
Expand Down
1 change: 1 addition & 0 deletions fly.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ processes = []
PS_BEHIND_PROXY="yes"
LITESTREAM_BUCKET="picoshare-litestream"
LITESTREAM_ENDPOINT="s3.us-west-002.backblazeb2.com"
LITESTREAM_RETENTION="72h"

[experimental]
allowed_public_ports = []
Expand Down
2 changes: 1 addition & 1 deletion litestream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ dbs:
path: db
endpoint: ${LITESTREAM_ENDPOINT}
force-path-style: true
retention: 72h
retention: ${LITESTREAM_RETENTION}
snapshot-interval: 24h
2 changes: 1 addition & 1 deletion playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { devices } from "@playwright/test";

const config: PlaywrightTestConfig = {
testDir: "./e2e",
timeout: 30 * 1000,
timeout: 35 * 1000,
expect: {
timeout: 5 * 1000,
},
Expand Down

0 comments on commit e3ba3a7

Please sign in to comment.