project-nomad/admin/start/env.ts
Florian Neuhuber 6db599ecc3 feat(collections): add German/Austria ZIM categories, configurable base URL, and NOMAD-DATA PDF tooling
- Add Kiwix ZIM categories: Deutsch & Österreich (Wikipedia DE, Wiktionary, Wikibooks, Wikivoyage, Medizin, Klexikon, Koch-Wiki, iFixit DE), Militär & Taktik, Kommunikation & Sicherheit, Energie & Off-Grid
- Add map collection entries for Europe and Oberösterreich (user-supplied PMTiles)
- Add NOMAD_COLLECTIONS_BASE_URL and NOMAD_DATA_PATH env options; collection specs load from configurable base URL
- Add install/nomad-data-pdf-urls.txt manifest and download-nomad-data-pdfs.sh for BBK, DGUV, FEMA, WHO, Zivilschutz AT, and related PDFs
- Add install/NOMAD-DATA-DOWNLOADS.md with usage and Austria PMTiles extract notes
- Update release notes (Unreleased)

Made-with: Cursor
2026-03-16 21:39:19 +01:00

78 lines
2.8 KiB
TypeScript

/*
|--------------------------------------------------------------------------
| Environment variables service
|--------------------------------------------------------------------------
|
| The `Env.create` method creates an instance of the Env service. The
| service validates the environment variables and also cast values
| to JavaScript data types.
|
*/
import { Env } from '@adonisjs/core/env'
export default await Env.create(new URL('../', import.meta.url), {
NODE_ENV: Env.schema.enum(['development', 'production', 'test'] as const),
PORT: Env.schema.number(),
APP_KEY: Env.schema.string(),
HOST: Env.schema.string({ format: 'host' }),
URL: Env.schema.string(),
LOG_LEVEL: Env.schema.string(),
INTERNET_STATUS_TEST_URL: Env.schema.string.optional(),
/*
|----------------------------------------------------------
| Variables for configuring storage paths
|----------------------------------------------------------
*/
NOMAD_STORAGE_PATH: Env.schema.string.optional(),
/**
* Optional path to NOMAD-DATA folder (e.g. /storage/nomad_data).
* When set, the RAG sync will also scan 10_EIGENE_PDFS_RAG for PDFs, text, and images to embed.
*/
NOMAD_DATA_PATH: Env.schema.string.optional(),
/*
|----------------------------------------------------------
| Variables for configuring session package
|----------------------------------------------------------
*/
//SESSION_DRIVER: Env.schema.enum(['cookie', 'memory'] as const),
/*
|----------------------------------------------------------
| Variables for configuring the database package
|----------------------------------------------------------
*/
DB_HOST: Env.schema.string({ format: 'host' }),
DB_PORT: Env.schema.number(),
DB_USER: Env.schema.string(),
DB_PASSWORD: Env.schema.string.optional(),
DB_DATABASE: Env.schema.string(),
DB_SSL: Env.schema.boolean.optional(),
/*
|----------------------------------------------------------
| Variables for configuring the Redis connection
|----------------------------------------------------------
*/
REDIS_HOST: Env.schema.string({ format: 'host' }),
REDIS_PORT: Env.schema.number(),
/*
|----------------------------------------------------------
| Variables for configuring Project Nomad's external API URL
|----------------------------------------------------------
*/
NOMAD_API_URL: Env.schema.string.optional(),
/**
* Optional base URL for collection specs (kiwix-categories, maps, wikipedia).
* If set, replaces the default GitHub raw URL. Example for your fork:
* NOMAD_COLLECTIONS_BASE_URL=https://raw.githubusercontent.com/YOUR_USER/project-nomad/refs/heads/main
* Then the app fetches .../collections/kiwix-categories.json etc. So new ZIM categories go live after push.
*/
NOMAD_COLLECTIONS_BASE_URL: Env.schema.string.optional(),
})