Skip to content

Commit 1fbe1c8

Browse files
committed
zero sync deployed to fly
1 parent 0b9331d commit 1fbe1c8

5 files changed

Lines changed: 50 additions & 2 deletions

File tree

hackathon-app/app/modules/config/env.server.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,15 @@ const ClerkSchema = z.object({
4040
secretKey: z.string(),
4141
});
4242

43+
const ZeroSchema = z.object({
44+
syncServerUrl: z.string().url(),
45+
authSecret: z.string(),
46+
});
47+
4348
const MainConfigSchema = z
4449
.object({
4550
clerk: ClerkSchema,
51+
zero: ZeroSchema,
4652
})
4753
.merge(InstanceSchema);
4854

@@ -56,4 +62,8 @@ export const mainConfig: MainConfig = validateConfigOrExit(MainConfigSchema, {
5662
publishableKey: process.env.CLERK_PUBLISHABLE_KEY,
5763
secretKey: process.env.CLERK_SECRET_KEY,
5864
},
65+
zero: {
66+
syncServerUrl: process.env.ZERO_SERVER_URL,
67+
authSecret: process.env.ZERO_AUTH_SECRET,
68+
},
5969
});

hackathon-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "hackathon-app",
2+
"name": "hack-allthingsweb-app",
33
"private": true,
44
"type": "module",
55
"scripts": {
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
ZERO_UPSTREAM_DB=
2+
ZERO_CVR_DB=
3+
ZERO_CHANGE_DB=
4+
ZERO_REPLICA_FILE="/data/sync-replica.db"
5+
ZERO_AUTH_SECRET=
6+
# Currently required for zero to work with Neon.
7+
ZERO_AUTO_RESET=true

hackathon-app/sync-server/fly.toml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
app = 'hack-allthingsweb-sync'
2+
primary_region = 'sjc'
3+
4+
[build]
5+
image = "registry.hub.docker.com/rocicorp/zero:0.16.2025022602"
6+
7+
[http_service]
8+
internal_port = 4848
9+
force_https = true
10+
auto_stop_machines = 'off'
11+
min_machines_running = 1
12+
13+
[[http_service.checks]]
14+
grace_period = "10s"
15+
interval = "30s"
16+
method = "GET"
17+
timeout = "5s"
18+
path = "/"
19+
20+
[[vm]]
21+
memory = '2gb'
22+
cpu_kind = 'shared'
23+
cpus = 2
24+
25+
[mounts]
26+
source = "sqlite_db"
27+
destination = "/data"
28+
29+
[env]
30+
LOG_LEVEL = "debug"
31+

website/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@allthingsweb/app",
2+
"name": "allthingsweb-app",
33
"private": true,
44
"sideEffects": false,
55
"type": "module",

0 commit comments

Comments
 (0)