A decentralized music tracking and discovery platform built on AT Protocol 🎵

Remove testOnly and use default env values

Remove envalid.testOnly usage and provide concrete default values for
several environment variables (NODE_ENV, HOST, PORT, PUBLIC_URL,
NATS_URL, ANALYTICS, MUSICBRAINZ_URL, MEILISEARCH_URL) and drop the
unused import.

+10 -9
+10 -9
apps/api/src/lib/env.ts
··· 1 1 import dotenv from "dotenv"; 2 - import { cleanEnv, host, port, str, testOnly } from "envalid"; 2 + import { cleanEnv, host, port, str } from "envalid"; 3 3 4 4 dotenv.config(); 5 5 6 6 export const env = cleanEnv(process.env, { 7 7 NODE_ENV: str({ 8 - devDefault: testOnly("test"), 8 + default: "development", 9 + devDefault: "development", 9 10 choices: ["development", "production", "test"], 10 11 }), 11 - HOST: host({ devDefault: testOnly("localhost") }), 12 - PORT: port({ devDefault: testOnly(8000) }), 13 - PUBLIC_URL: str({ devDefault: "http://localhost:8000" }), 12 + HOST: host({ default: "localhost" }), 13 + PORT: port({ default: 8000 }), 14 + PUBLIC_URL: str({ default: "http://localhost:8000" }), 14 15 DB_PATH: str({ devDefault: ":memory:" }), 15 16 KV_DB_PATH: str({ devDefault: ":memory:" }), 16 17 COOKIE_SECRET: str({ devDefault: "00000000000000000000000000000000" }), ··· 25 26 SPOTIFY_ENCRYPTION_IV: str(), 26 27 ROCKSKY_BETA_TOKEN: str({}), 27 28 XATA_POSTGRES_URL: str({}), 28 - NATS_URL: str({ devDefault: "nats://localhost:4222" }), 29 - ANALYTICS: str({ devDefault: "http://localhost:7879" }), 29 + NATS_URL: str({ default: "nats://localhost:4222" }), 30 + ANALYTICS: str({ default: "http://localhost:7879" }), 30 31 DROPBOX_CLIENT_ID: str({}), 31 32 DROPBOX_CLIENT_SECRET: str({}), 32 33 DROPBOX_REDIRECT_URI: str({}), ··· 35 36 DROPBOX: str({ default: "http://localhost:7881" }), 36 37 TRACKLIST: str({ default: "http://localhost:7884" }), 37 38 REDIS_URL: str({ default: "redis://localhost:6379" }), 38 - MUSICBRAINZ_URL: str({ devDefault: "http://localhost:8088" }), 39 + MUSICBRAINZ_URL: str({ default: "http://localhost:8088" }), 39 40 PRIVATE_KEY_1: str({}), 40 41 PRIVATE_KEY_2: str({}), 41 42 PRIVATE_KEY_3: str({}), 42 - MEILISEARCH_URL: str({ devDefault: "http://localhost:7700" }), 43 + MEILISEARCH_URL: str({ default: "http://localhost:7700" }), 43 44 MEILISEARCH_API_KEY: str({}), 44 45 DISABLED_TEALFM: str({ default: "" }), 45 46 });