Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

deploy/k8s: sticky SH_REFRESH_* settings in moca-settings (follow-up to #467)

Open
#470 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
68/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
kubernetes, shell, yaml
Domain
devops

Research direction

Start from parse_args and write_settings in deploy/k8s/setup.sh, following how the SH_API_TOKEN_TTL_SECONDS path from #464 is handled, then add the three SH_REFRESH_* keys beside it. Add matching configMapKeyRef entries in deploy/k8s/base/control-plane.yaml, and document them in deploy/k8s/README.md §2. Done when the existing deploy-scripts tests cover storing, reusing, clearing and hash changes, and a max below idle is refused with a message naming both variables.

Written by the indexing model from the issue text.

Description

enhancement

Follow-up from #467 (B14, #395), deferred there by review agreement.

Goal

An operator of deploy/k8s can set the refresh-token limits the same way as the token TTLs: as sticky setup.sh inputs stored in the moca-settings ConfigMap.

Current state

  • #467 adds three control-plane settings with defaults in packages/control-plane/src/main.ts:
    • SH_REFRESH_IDLE_TTL_SECONDS (30 days)
    • SH_REFRESH_MAX_TTL_SECONDS (90 days; must be ≥ idle, refused at boot otherwise)
    • SH_REFRESH_REUSE_GRACE_SECONDS (30 s, 1–300)
  • They are wired into deploy/compose/docker-compose.yml and deploy/vm/env/control-plane.env.example. They are not wired into deploy/k8s, where only the defaults apply.
  • #464 added the sticky plumbing for SH_API_TOKEN_TTL_SECONDS and SH_SESSION_TOKEN_TTL_SECONDS: setup.sh's parse_args validation, write_settings (stored in moca-settings, included in the settings hash that rolls the control plane), and deploy/k8s/base/control-plane.yaml's configMapKeyRef env entries.

Scope

  1. Add the three variables to setup.sh next to the token TTLs:
    • sticky, as the TTLs are (unset keeps the stored value, empty means the default);
    • validated as whole seconds;
    • grace limited to 1–300;
    • max ≥ idle checked at setup time, so a bad pair fails the run instead of crash-looping the control plane.
  2. Add the configMapKeyRef env entries to base/control-plane.yaml.
  3. Document them in deploy/k8s/README.md §2's sticky-settings list.
  4. Extend the existing deploy/k8s setup tests for the new keys: stored, reused, cleared, and the hash changes.

Acceptance

  • SH_REFRESH_MAX_TTL_SECONDS=604800 deploy/k8s/setup.sh … stores the value, rolls the control plane once, and a re-run without it keeps the value.
  • A max below the idle limit is refused by setup.sh with a message that names both variables.
  • The deploy-scripts tests pass.
Dominant language
TypeScript
Stars
4
Forks
9
Avg merge
9h 31m
Merged PRs (30d)
139

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from rossoctl/moca

All issues in rossoctl/moca

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.