-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7986014
commit 5dc6b82
Showing
4 changed files
with
124 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
FROM litestream/litestream:latest AS litestream | ||
|
||
FROM directus/directus:latest | ||
|
||
USER root | ||
|
||
# Litefs | ||
RUN apk add ca-certificates fuse3 sqlite | ||
COPY --from=flyio/litefs:0.5 /usr/local/bin/litefs /usr/local/bin/litefs | ||
ADD litefs.yml /etc/litefs.yml | ||
|
||
# Litestream | ||
COPY --from=litestream /usr/local/bin/litestream /usr/local/bin/litestream | ||
ADD litestream.yml /etc/litestream.yml | ||
|
||
ENTRYPOINT litefs mount |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# fly.toml app configuration file generated for vladgg-api on 2024-09-18T20:31:56-07:00 | ||
# | ||
# See https://fly.io/docs/reference/configuration/ for information about how to use this file. | ||
# | ||
|
||
app = 'vladgg-api' | ||
primary_region = 'sea' | ||
|
||
[build] | ||
|
||
[http_service] | ||
internal_port = 8080 | ||
protocol = "tcp" | ||
|
||
[mounts] | ||
source = "litefs" | ||
destination = "/var/lib/litefs" | ||
|
||
[[vm]] | ||
memory = '512mb' | ||
cpu_kind = 'shared' | ||
cpus = 1 | ||
|
||
[env] | ||
PUBLIC_URL = "https://api.vlad.gg" | ||
DB_CLIENT = "sqlite3" | ||
DB_FILENAME = "/litefs/data.db" | ||
AUTH_PROVIDERS = "authentik" | ||
AUTH_AUTHENTIK_LABEL = "Polaris Auth" | ||
AUTH_AUTHENTIK_ICON = "admin_panel_settings" | ||
AUTH_AUTHENTIK_DRIVER = "openid" | ||
AUTH_AUTHENTIK_SCOPE = "openid profile email split_name" | ||
AUTH_AUTHENTIK_IDENTIFIER_KEY = "email" | ||
AUTH_AUTHENTIK_FIRST_NAME_KEY = "given_name" | ||
AUTH_AUTHENTIK_LAST_NAME_KEY = "family_name" | ||
AUTH_AUTHENTIK_SYNC_USER_INFO = "true" | ||
AUTH_AUTHENTIK_DEFAULT_ROLE_ID = "ac44bb88-4e2f-4804-99d9-44fa6e4f5659" | ||
AUTH_AUTHENTIK_ALLOW_PUBLIC_REGISTRATION = "true" | ||
STORAGE_LOCATIONS = "cloudflare,tigris" | ||
STORAGE_CLOUDFLARE_DRIVER = "s3" | ||
STORAGE_CLOUDFLARE_REGION = "auto" | ||
STORAGE_TIGRIS_DRIVER = "s3" | ||
STORAGE_TIGRIS_REGION = "auto" | ||
EMAIL_TRANSPORT = "smtp" | ||
EMAIL_SMTP_PORT = "465" | ||
EMAIL_SMTP_SECURE = "true" | ||
RATE_LIMITER_ENABLED = "true" | ||
RATE_LIMITER_GLOBAL_ENABLED = "true" | ||
# RATE_LIMITER_STORE="redis" | ||
CACHE_ENABLED = "true" | ||
# CACHE_STORE="redis" | ||
REDIS_ENABLED="false" | ||
REDIS_PORT="6379" | ||
REDIS_USERNAME="default" | ||
# SYNCHRONIZATION_STORE="redis" | ||
WEBSOCKETS_ENABLED = "true" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
fuse: | ||
dir: "/litefs" | ||
|
||
data: | ||
dir: "/var/lib/litefs" | ||
|
||
exit-on-error: false | ||
|
||
proxy: | ||
addr: ":8080" | ||
target: "localhost:8055" | ||
db: "data.db" | ||
passthrough: | ||
- "*.ico" | ||
- "*.png" | ||
|
||
exec: | ||
- cmd: "litestream replicate" | ||
|
||
lease: | ||
type: "consul" | ||
advertise-url: "http://${HOSTNAME}.vm.${FLY_APP_NAME}.internal:20202" | ||
candidate: ${FLY_REGION == PRIMARY_REGION} | ||
promote: true | ||
|
||
consul: | ||
url: "${FLY_CONSUL_URL}" | ||
key: "litefs/${FLY_APP_NAME}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
exec: pm2-runtime start ecosystem.config.cjs && node cli.js bootstrap | ||
|
||
dbs: | ||
- path: /litefs/data.db | ||
meta-path: /var/lib/litefs/data.db-litestream | ||
replicas: | ||
- name: cloudflare | ||
type: s3 | ||
endpoint: ${STORAGE_CLOUDFLARE_ENDPOINT} | ||
bucket: ${STORAGE_CLOUDFLARE_BUCKET} | ||
path: backup/data.db | ||
region: auto | ||
force-path-style: true | ||
access-key-id: ${STORAGE_CLOUDFLARE_KEY} | ||
secret-access-key: ${STORAGE_CLOUDFLARE_SECRET} | ||
- name: tigris | ||
type: s3 | ||
endpoint: ${STORAGE_TIGRIS_ENDPOINT} | ||
bucket: ${STORAGE_TIGRIS_BUCKET} | ||
path: backup/data.db | ||
region: auto | ||
force-path-style: true | ||
access-key-id: ${STORAGE_TIGRIS_KEY} | ||
secret-access-key: ${STORAGE_TIGRIS_SECRET} |