Skip to content

docs: add missing dev:energy variant and ACLED OAuth credentials#4328

Open
shon91827 wants to merge 1 commit into
koala73:mainfrom
shon91827:fix/missing-variant-and-acled-docs
Open

docs: add missing dev:energy variant and ACLED OAuth credentials#4328
shon91827 wants to merge 1 commit into
koala73:mainfrom
shon91827:fix/missing-variant-and-acled-docs

Conversation

@shon91827

Copy link
Copy Markdown
Contributor

Summary

Two small documentation gaps:

1. README.md — missing dev:energy in Quick Start

The variant-specific dev commands list had 4 of 5 non-default variants. npm run dev:energy was missing.

2. SELF_HOSTING.md — ACLED section only showed the static token

The docker-compose API keys example only listed ACLED_ACCESS_TOKEN, but server/_shared/acled-auth.ts documents that ACLED_EMAIL + ACLED_PASSWORD is the preferred method (OAuth with auto-refresh). The static token expires every 24 hours, which causes data gaps in self-hosted deployments. Added both options with a note about which is preferred.

No code changes — documentation only.

🤖 Generated with Claude Code

@vercel

vercel Bot commented Jun 18, 2026

Copy link
Copy Markdown

@shonchen is attempting to deploy a commit to the World Monitor Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added the trust:safe Brin: contributor trust score safe label Jun 18, 2026
@greptile-apps

greptile-apps Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This documentation-only PR fills two gaps in the developer-facing docs: the npm run dev:energy command was missing from the Quick Start variant table in README.md, and SELF_HOSTING.md only showed the legacy static-token credential while omitting the preferred OAuth credentials (ACLED_EMAIL + ACLED_PASSWORD) that drive auto-refresh logic already present in server/_shared/acled-auth.ts.

  • README.md: Adds the missing dev:energy line to the variant dev-command block, making the list complete across all 5 non-default variants.
  • SELF_HOSTING.md: Expands the ACLED credentials example to show ACLED_EMAIL / ACLED_PASSWORD as the preferred OAuth path (with auto-refresh note) and demotes ACLED_ACCESS_TOKEN to an "Alternative" with a 24 h expiry warning — matching the priority logic in getAcledAccessToken().

Confidence Score: 5/5

Documentation-only change with no code modifications; both additions are accurate and consistent with the codebase.

Both documentation additions were verified against the source: dev:energy exists in package.json, and the ACLED credential ordering and descriptions match the priority logic in server/_shared/acled-auth.ts. No code paths are affected.

No files require special attention.

Important Files Changed

Filename Overview
README.md Adds the missing dev:energy variant command; confirmed present in package.json and consistent with the variant list in AGENTS.md.
SELF_HOSTING.md Expands ACLED credentials block with OAuth fields; ordering and comments accurately reflect the priority logic in acled-auth.ts.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    Start([getAcledAccessToken called]) --> CheckOAuth{ACLED_EMAIL\n+ ACLED_PASSWORD set?}

    CheckOAuth -- Yes --> L1{L1: memCached\nstill fresh?}
    L1 -- Yes --> ReturnMem[Return in-memory token]
    L1 -- No --> L2{L2: Redis cache\nstill fresh?}
    L2 -- Yes --> ReturnRedis[Hydrate memCached\nReturn Redis token]
    L2 -- No --> Refresh{Existing\nrefresh token?}

    Refresh -- Yes --> TryRefresh[refreshAccessToken]
    TryRefresh -- Success --> CacheWrite1[Write to Redis\nUpdate memCached\nReturn token]
    TryRefresh -- Fail --> ReAuth

    Refresh -- No --> ReAuth[exchangeCredentials\nemail + password]
    ReAuth -- Success --> CacheWrite2[Write to Redis\nUpdate memCached\nReturn token]
    ReAuth -- Fail --> FallbackToken[Return stale cached\ntoken or null]

    CheckOAuth -- No --> StaticToken{ACLED_ACCESS_TOKEN\nset?}
    StaticToken -- Yes --> ReturnStatic[Return static token\n⚠️ expires every 24h]
    StaticToken -- No --> ReturnNull[Return null\ngraceful degradation]
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    Start([getAcledAccessToken called]) --> CheckOAuth{ACLED_EMAIL\n+ ACLED_PASSWORD set?}

    CheckOAuth -- Yes --> L1{L1: memCached\nstill fresh?}
    L1 -- Yes --> ReturnMem[Return in-memory token]
    L1 -- No --> L2{L2: Redis cache\nstill fresh?}
    L2 -- Yes --> ReturnRedis[Hydrate memCached\nReturn Redis token]
    L2 -- No --> Refresh{Existing\nrefresh token?}

    Refresh -- Yes --> TryRefresh[refreshAccessToken]
    TryRefresh -- Success --> CacheWrite1[Write to Redis\nUpdate memCached\nReturn token]
    TryRefresh -- Fail --> ReAuth

    Refresh -- No --> ReAuth[exchangeCredentials\nemail + password]
    ReAuth -- Success --> CacheWrite2[Write to Redis\nUpdate memCached\nReturn token]
    ReAuth -- Fail --> FallbackToken[Return stale cached\ntoken or null]

    CheckOAuth -- No --> StaticToken{ACLED_ACCESS_TOKEN\nset?}
    StaticToken -- Yes --> ReturnStatic[Return static token\n⚠️ expires every 24h]
    StaticToken -- No --> ReturnNull[Return null\ngraceful degradation]
Loading

Reviews (1): Last reviewed commit: "docs: add missing dev:energy variant and..." | Re-trigger Greptile

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

Labels

trust:safe Brin: contributor trust score safe

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants