No description
Find a file
Padawan-GM 825fb2b5b2 Add soft service validation, global-only GID, import + templates UI
- Soft service skip: services without name or image are silently omitted
  from YAML rather than blocking generation. Error only when ALL services
  are invalid.
- Global-only admins GID: removed admins_gid from ServiceSpec; StackSpec
  field is the sole source. Empty value defaults to 1002 at generation
  time (never user-visible in the output).
- Admins GID row in per-service ServiceEditor removed; MCFWindow keeps the
  global row with placeholder text hinting at the 1002 default.
- parse_compose_yaml(): new public function that reconstructs an MCF
  StackSpec from a raw Docker Compose YAML string. Detects caddy network /
  CDP labels / internal port, group_add → global GID, and serialises
  unrecognised keys back into additional_yaml.
- ImportWindow: modal Adw.Window with NavigationView. Source page has:
    - Open File (Gtk.FileDialog async) for YAML files
    - Browse Templates (pushes template picker page)
    - Paste YAML text area + Import button
  Templates page: FlowBox of card buttons showing SVG icon + capitalised
  name for every *.yaml in templates/ that has a matching *.svg.
- MCFWindow: import button added to header bar (left side). _loading flag
  prevents the 'cannot close last tab' guard from firing during bulk-replace.
  _load_stack_spec() replaces all current editors with the imported stack.
  _add_service_with_spec() and ServiceEditor.load_spec() wire new data into
  the UI.
- Tests updated: removed test_per_service_admins_gid_overrides_global;
  added test_empty_admins_gid_defaults_to_1002,
  test_invalid_service_without_name_is_skipped,
  test_all_invalid_services_raises_error,
  test_parse_compose_yaml_basic. 18 tests pass.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-05 16:27:00 +02:00
templates Add soft service validation, global-only GID, import + templates UI 2026-05-05 16:27:00 +02:00
tests Add soft service validation, global-only GID, import + templates UI 2026-05-05 16:27:00 +02:00
.gitignore Added .gitignore 2026-05-05 15:09:34 +02:00
app.py Add soft service validation, global-only GID, import + templates UI 2026-05-05 16:27:00 +02:00
mcf_generator.py Add soft service validation, global-only GID, import + templates UI 2026-05-05 16:27:00 +02:00
README.md Genesis commit 2026-05-04 23:35:19 +02:00
requirements.txt Added requirements.txt 2026-05-05 15:11:34 +02:00

MCF Generator

A GTK 4 + libadwaita GUI for generating Docker Compose YAML that follows the Malasaur Compose Format draft.

Run

The virtual environment has been created as .venv with --system-site-packages so it can use the OS-provided GTK, libadwaita, GtkSourceView, PyGObject, and PyYAML bindings.

source .venv/bin/activate
python app.py

Checks

.venv/bin/python -m unittest discover -s tests
.venv/bin/python -m py_compile app.py mcf_generator.py

Notes

  • restart: unless-stopped is always generated.
  • container_name always matches the service name.
  • Empty optional sections are omitted.
  • Named volume sources such as cache:/cache are declared at the top level.
  • Environment variables are generated as a YAML mapping.
  • When CDP is enabled, every service joins caddy and gets CDP labels. If no internal port is set, caddy.reverse_proxy uses "{{upstreams}}".
  • The tool does not create or edit .env.