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

Commit b3c22b1

Browse files
committed
feat: Integrate OPNsense XML generation into the configuration tool
- Add opnsense_config_generator.py for direct XML configuration generation - Enhance generate_csv.py to support OPNsense XML output alongside CSV - Update AGENTS.md and README.md to reflect new features and usage - Implement error handling and validation for XML generation processes - Ensure proper attribution to original work by Stefan Reichhard These changes expand the tool's capabilities, allowing users to generate complete OPNsense configurations with realistic data, enhancing testing and development workflows.
1 parent 10f7af8 commit b3c22b1

11 files changed

Lines changed: 1999 additions & 210 deletions

File tree

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve the network configuration data generator
4+
title: '[BUG] '
5+
labels: [bug, needs-triage]
6+
assignees: []
7+
---
8+
9+
## Bug Description
10+
11+
A clear and concise description of what the bug is.
12+
13+
## Steps to Reproduce
14+
15+
1. Run command: `python generate_csv.py --count 10`
16+
2. See error: `[ERROR] Invalid VLAN ID generated`
17+
18+
## Expected Behavior
19+
20+
A clear description of what you expected to happen.
21+
22+
## Actual Behavior
23+
24+
A clear description of what actually happened.
25+
26+
## Environment Information
27+
28+
- **OS**: [e.g., macOS 14.0, Ubuntu 22.04, Windows 11]
29+
- **Python Version**: [e.g., 3.10.12, 3.13.0]
30+
- **Package Version**: [e.g., opnsense-config-faker 0.1.0]
31+
- **Command Used**: \[e.g., `python generate_csv.py --count 50 --output test.csv`\]
32+
33+
## Error Messages
34+
35+
```text
36+
# Paste any error messages, stack traces, or logs here
37+
```
38+
39+
## Additional Context
40+
41+
Add any other context about the problem here, such as:
42+
43+
- What you were trying to accomplish
44+
- Any workarounds you've tried
45+
- Related issues or pull requests
46+
47+
## Checklist
48+
49+
- [ ] I have searched existing issues to avoid duplicates
50+
- [ ] I have provided all requested information
51+
- [ ] I can reproduce this issue consistently
52+
- [ ] This is a bug in the current version (not a feature request or enhancement)
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
name: Documentation
3+
about: Report documentation issues or suggest improvements
4+
title: '[DOCS] '
5+
labels: [documentation, needs-triage]
6+
assignees: []
7+
---
8+
9+
## Documentation Issue
10+
11+
A clear and concise description of what documentation problem you're reporting or what improvement you're suggesting.
12+
13+
## Type of Documentation Issue
14+
15+
- [ ] **Missing**: Documentation doesn't exist for a feature/function
16+
- [ ] **Outdated**: Documentation is incorrect or no longer accurate
17+
- [ ] **Unclear**: Documentation exists but is confusing or hard to understand
18+
- [ ] **Incomplete**: Documentation exists but lacks important details
19+
- [ ] **Wrong location**: Documentation exists but is in the wrong place
20+
- [ ] **Formatting**: Documentation has formatting or structural issues
21+
22+
## Affected Documentation
23+
24+
- [ ] README.md
25+
- [ ] Command-line help (`python generate_csv.py --help`)
26+
- [ ] Code comments/docstrings
27+
- [ ] Examples in the repository
28+
- [ ] Other: [specify]
29+
30+
## Current State
31+
32+
What the documentation currently says or where it's missing:
33+
34+
```markdown
35+
# If applicable, paste the current documentation here
36+
```
37+
38+
## Expected State
39+
40+
What the documentation should say or where it should be:
41+
42+
```markdown
43+
# If applicable, paste what the documentation should look like
44+
```
45+
46+
## Context
47+
48+
Additional context about why this documentation issue matters:
49+
50+
- **Impact**: How does this affect users?
51+
- **Frequency**: How often do users encounter this issue?
52+
- **User Type**: Who is most affected by this documentation issue?
53+
54+
## Suggested Solution
55+
56+
If you have ideas for how to fix this documentation issue, describe them here.
57+
58+
## Checklist
59+
60+
- [ ] I have searched existing issues to avoid duplicates
61+
- [ ] I have provided specific examples of the documentation issue
62+
- [ ] I can suggest improvements if needed
63+
- [ ] This is a documentation issue (not a bug or feature request)
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for the network configuration data generator
4+
title: '[FEATURE] '
5+
labels: [enhancement, needs-triage]
6+
assignees: []
7+
---
8+
9+
## Problem Statement
10+
11+
A clear and concise description of what problem this feature would solve. For example:
12+
13+
- "I need to generate firewall rules with realistic patterns"
14+
- "The current VLAN generation doesn't support custom IP ranges"
15+
- "I want to export data in YAML format"
16+
17+
## Proposed Solution
18+
19+
A clear and concise description of what you want to happen.
20+
21+
## Alternative Solutions
22+
23+
A clear and concise description of any alternative solutions or features you've considered.
24+
25+
## Use Case
26+
27+
Describe how this feature would be used:
28+
29+
- **Who**: [e.g., Network administrators, DevOps engineers, QA testers]
30+
- **When**: [e.g., During network testing, configuration validation, load testing]
31+
- **Why**: [e.g., To improve test coverage, reduce manual work, support new tools]
32+
33+
## Example Usage
34+
35+
```bash
36+
# Example of how the new feature might work
37+
python generate_csv.py --firewall-rules --count 100 --output firewall-config.csv
38+
```
39+
40+
## Expected Output
41+
42+
```csv
43+
# Example of what the output might look like
44+
VLAN,IP Range,Firewall Rule,Action,Protocol,Port
45+
1234,10.123.45.x,Allow HTTP,ACCEPT,TCP,80
46+
1234,10.123.45.x,Allow HTTPS,ACCEPT,TCP,443
47+
```
48+
49+
## Impact
50+
51+
- **High**: Core functionality that many users would benefit from
52+
- **Medium**: Useful enhancement that improves user experience
53+
- **Low**: Nice-to-have feature for specific use cases
54+
55+
## Implementation Considerations
56+
57+
Any thoughts on how this might be implemented:
58+
59+
- New command line arguments
60+
- Configuration file changes
61+
- Data model modifications
62+
- Dependencies that might be needed
63+
64+
## Checklist
65+
66+
- [ ] I have searched existing issues to avoid duplicates
67+
- [ ] This feature would be useful to the broader community
68+
- [ ] I'm willing to help implement this feature if needed
69+
- [ ] I can provide additional context or examples if requested

.github/config.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# GitHub repository configuration
2+
# This file configures various GitHub features
3+
4+
# Issue template configuration
5+
blank_issues_enabled: false
6+
7+
# Contact links for additional support channels
8+
contact_links:
9+
- name: GitHub Discussions
10+
url: https://github.com/EvilBit-Labs/OPNsense-config-faker/discussions
11+
about: Please ask and answer questions here.
12+
- name: Security Issues
13+
url: https://github.com/EvilBit-Labs/OPNsense-config-faker/security/advisories
14+
about: Please report security vulnerabilities here.

.github/pull_request_template.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
## Description
2+
3+
A clear and concise description of what this pull request does.
4+
5+
## Type of Change
6+
7+
- [ ] **Bug fix** (non-breaking change which fixes an issue)
8+
- [ ] **New feature** (non-breaking change which adds functionality)
9+
- [ ] **Breaking change** (fix or feature that would cause existing functionality to not work as expected)
10+
- [ ] **Documentation update** (updates to README, docstrings, etc.)
11+
- [ ] **Refactoring** (no functional changes, just code improvements)
12+
- [ ] **Test updates** (adding or updating tests)
13+
14+
## Related Issues
15+
16+
Fixes #(issue number)
17+
Closes #(issue number)
18+
Related to #(issue number)
19+
20+
## Testing
21+
22+
- [ ] I have tested this change locally
23+
- [ ] I have added tests that prove my fix is effective or that my feature works
24+
- [ ] All existing tests pass
25+
- [ ] I have run the linter and it passes (`ruff check .`)
26+
- [ ] I have run type checking and it passes (`basedpyright`)
27+
28+
## Checklist
29+
30+
- [ ] My code follows the project's style guidelines
31+
- [ ] I have performed a self-review of my own code
32+
- [ ] I have commented my code, particularly in hard-to-understand areas
33+
- [ ] I have made corresponding changes to the documentation
34+
- [ ] My changes generate no new warnings
35+
- [ ] I have added tests that prove my fix is effective or that my feature works
36+
- [ ] New and existing unit tests pass locally with my changes
37+
- [ ] Any dependent changes have been merged and published in downstream modules
38+
39+
## Screenshots (if applicable)
40+
41+
If this is a UI change, please include screenshots of the before and after states.
42+
43+
## Additional Notes
44+
45+
Any additional information that reviewers should know about this pull request.

.github/workflows/ci.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main, develop ]
8+
9+
jobs:
10+
ci-check:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
- name: Setup Python
18+
uses: actions/setup-python@v5
19+
with:
20+
python-version: '3.13'
21+
22+
- name: Install uv
23+
uses: astral-sh/setup-uv@v2
24+
with:
25+
version: latest
26+
27+
- name: Install just
28+
uses: taiki-e/install-action@just
29+
30+
- name: Cache dependencies
31+
uses: actions/cache@v4
32+
with:
33+
path: |
34+
.uv/cache
35+
.pytest_cache
36+
key: ${{ runner.os }}-uv-${{ hashFiles('**/pyproject.toml') }}
37+
restore-keys: |
38+
${{ runner.os }}-uv-
39+
40+
- name: Install dependencies
41+
run: |
42+
uv sync --no-install-project --group dev
43+
uv run pre-commit install --hook-type commit-msg
44+
45+
- name: Run CI checks
46+
run: |
47+
just ci-check
48+
49+
- name: Upload coverage reports
50+
uses: codecov/codecov-action@v4
51+
if: always()
52+
with:
53+
file: ./coverage.xml
54+
flags: unittests
55+
name: codecov-umbrella
56+
fail_ci_if_error: false

0 commit comments

Comments
 (0)