grain.social is a photo sharing platform built on atproto.
1# The fuse section describes settings for the FUSE file system. This file system
2# is used as a thin layer between the SQLite client in your application and the
3# storage on disk. It intercepts disk writes to determine transaction boundaries
4# so that those transactions can be saved and shipped to replicas.
5fuse:
6 dir: "/litefs"
7
8# The data section describes settings for the internal LiteFS storage. We'll
9# mount a volume to the data directory so it can be persisted across restarts.
10# However, this data should not be accessed directly by the user application.
11data:
12 dir: "/var/lib/litefs"
13
14# This flag ensure that LiteFS continues to run if there is an issue on starup.
15# It makes it easy to ssh in and debug any issues you might be having rather
16# than continually restarting on initialization failure.
17exit-on-error: false
18
19# This section defines settings for the option HTTP proxy.
20# This proxy can handle primary forwarding & replica consistency
21# for applications that use a single SQLite database.
22proxy:
23 addr: ":8080"
24 target: "localhost:8081"
25 db: "sqlite.db"
26 passthrough:
27 - "*.ico"
28 - "*.png"
29
30# This section defines a list of commands to run after LiteFS has connected
31# and sync'd with the cluster. You can run multiple commands but LiteFS expects
32# the last command to be long-running (e.g. an application server). When the
33# last command exits, LiteFS is shut down.
34exec:
35 - cmd: "deno run -A --unstable-kv --unstable-ffi main.tsx"
36
37# The lease section specifies how the cluster will be managed. We're using the
38# "consul" lease type so that our application can dynamically change the primary.
39#
40# These environment variables will be available in your Fly.io application.
41lease:
42 type: "consul"
43 advertise-url: "http://${HOSTNAME}.vm.${FLY_APP_NAME}.internal:20202"
44 candidate: ${FLY_REGION == PRIMARY_REGION}
45 promote: true
46
47 consul:
48 url: "${FLY_CONSUL_URL}"
49 key: "litefs/${FLY_APP_NAME}-v1"