Skip to content
This repository was archived by the owner on Aug 15, 2026. It is now read-only.

feat: bash-to-YAML reverse import - #1

Merged
studiowebux merged 2 commits into
mainfrom
feat/bash-import
Feb 20, 2026
Merged

studiowebux merged 2 commits into
mainfrom
feat/bash-import

Conversation

@studiowebux

Copy link
Copy Markdown
Owner

Summary

  • Add reverse parser (js/reverse-parser.mjs) that converts firewall-cmd commands into firegen YAML config objects
  • Add "Paste Commands" button and modal overlay in the editor toolbar for pasting bash scripts
  • Support all zone commands (14 patterns), direct commands (chains, rules, passthroughs), and rich rules
  • Handle --add-* and --remove-* variants, strip sudo, skip comments/shebang/reload lines

Test plan

  • Load sample YAML, copy Apply output, paste into Paste Commands modal, verify equivalent YAML is produced
  • Repeat with docker-firewall.yaml example
  • Test pasting garbage/mixed content — verify skipped line count shown
  • Verify modal opens/closes correctly (button, backdrop click, Escape key, Cancel)
  • Verify dark mode styling on the modal
  • Verify existing Import/Export/Load Example still work (no regressions)

🤖 Generated with Claude Code

studiowebux and others added 2 commits February 19, 2026 21:29
Structured error objects with line numbers replace plain strings.
Gutter dots (red/orange) and line highlights show exactly where
YAML syntax errors and validation warnings occur. Heuristic
adjusts js-yaml's reported line to the actual cause for missing
colons and unclosed quotes. Theme choice persists across reloads.

Co-Authored-By: Claude <noreply@anthropic.com>
Parse pasted firewall-cmd commands into YAML configuration.
Supports all zone commands, direct rules, rich rules, forward
ports, and ICMP blocks. Adds Paste Commands button with modal
overlay in the editor toolbar.

Co-Authored-By: Claude <noreply@anthropic.com>
@studiowebux
studiowebux merged commit 54c9f7a into main Feb 20, 2026
1 check passed
@studiowebux
studiowebux deleted the feat/bash-import branch February 20, 2026 03:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant