Skip to content

Document the environment variables the server reads but .env.example omits #8

Open

Description

@blixvip

.env.example documents PORT, the director overrides and the mainland-China base URLs. The code reads six more variables that appear nowhere in .env.example or the README:

Variable Read at Effect
GENMOTION_PORT server/index.mjs:18 Port fallback when PORT isn't set
GENMOTION_HOST server/index.mjs:19 Bind address. Anything other than 127.0.0.1 also turns off the Host check in trusted() (server/index.mjs:50)
GENMOTION_LIBRARY server/library.mjs:9 Where images, audio and projects are stored
GENMOTION_ENV_FILE server/env.mjs:9 Which .env file is read and written
OPENAI_BASE_URL server/providers/image/openai.mjs:9, server/providers/llm/index.mjs:57 OpenAI-compatible proxy for GPT Image and the GPT director
MOONSHOT_BASE_URL server/providers/llm/index.mjs:61 Kimi endpoint (e.g. https://api.moonshot.cn/v1 for mainland accounts)

The GENMOTION_HOST note matters. With the Host check off, any machine on the LAN can call /api/generate on the owner's keys, because requests without an Origin header are trusted (server/index.mjs:53).

Task: add the six variables to the Optional block of .env.example, keeping every value commented out or empty. That keeps the .env.example parses to all-empty keys test passing. Add a short note to the README that GENMOTION_HOST exposes the server to the network with no authentication.

Where: .env.example:34-46, README.md:57-61 (Quick start notes), test/core.test.mjs:97-102.

Done when: for v in GENMOTION_PORT GENMOTION_HOST GENMOTION_LIBRARY GENMOTION_ENV_FILE OPENAI_BASE_URL MOONSHOT_BASE_URL; do grep -q "$v" .env.example || echo "missing $v"; done prints nothing, npm test still passes (including .env.example parses to all-empty keys), and the README Quick start notes warn that setting GENMOTION_HOST exposes the server to the network with no authentication.


Getting started: Node 22, no npm install needed: git clone, then npm test and npm run check. Comment here to claim it. Questions → Discord.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationgood first issueGood for newcomers

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions