Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ services:
environment:
# Set to "true" on private instances once your accounts exist.
REGISTRATION_DISABLED: "false"
# Set Listen Address so the service is accessible from outside the container
LISTEN_ADDRESS: "::"
restart: unless-stopped

volumes:
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ services:
environment:
# Set to "true" on private instances once your accounts exist.
REGISTRATION_DISABLED: "false"
# Set Listen Address so the service is accessible from outside the container
LISTEN_ADDRESS: "::"
restart: unless-stopped

volumes:
Expand Down
4 changes: 3 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { autoPause } from './models/pause.js';

const DATABASE_PATH = process.env.DATABASE_PATH ?? '/data/crosspoint.db';
const PORT = Number(process.env.PORT ?? 8080);
const ADDRESS = process.env.LISTEN_ADDRESS ?? 'localhost';

const db = openDatabase(DATABASE_PATH);
migrate(db);
Expand All @@ -28,11 +29,12 @@ if (connectorsEnabled) {
// Daily: pause books with no progress for 30 days (reads also check lazily).
startFanInWorker(db, 24 * 60 * 60_000, async (d) => autoPause(d));

serve({ fetch: app.fetch, port: PORT }, (info) => {
serve({ fetch: app.fetch, port: PORT, hostname: ADDRESS }, (info) => {
console.log(
JSON.stringify({
msg: 'crosspoint-sync listening',
port: info.port,
address: info.address,
db: DATABASE_PATH,
connectors: connectorsEnabled ? 'enabled' : 'disabled (no TOKEN_ENC_KEY)',
})
Expand Down