Commit Graph

543 Commits

Author SHA1 Message Date
Domingo Dirutigliano
9832e449c6
Initial commit for future 5.0.0 version: new UI, proxies and managment 2026-09-10 08:51:08 +02:00
Domingo Dirutigliano
6140fcbe81
Align the demo backend with the real nfproxy API
The stubbed `GET .../code` answered with `{ code }` while the real endpoint
is a PlainTextResponse returning the source, which is what crashed the demo
service page, and the save route was registered as POST where the real API
and the frontend both use PUT.

The seeded sample also carried a `strip_debug_header` filter that mutated
`HttpRequest.headers`. That silently does nothing: `headers` is a read-only
property over the parsed message, and nothing re-serialises it onto the wire
(a mangle forwards `current_pkt.raw_packet`, which the dict never touches).
Dropped it, leaving the one filter that behaves as shown, and brought the
filter counts and the packet counters back in line with it.
2026-09-03 18:42:37 +02:00
Domingo Dirutigliano
ba2703d4bf
Stop a non-string filter code from crashing the nfproxy page
`genericapi` ran every response body through `JSON.parse`, falling back to
the raw text only when that threw. The nfproxy filter source is served as a
PlainTextResponse, so a filter file that happens to be valid JSON came back
as a number/array/object. Mantine's CodeHighlight then calls `code.trim()`
on it, which throws and takes the whole page down with it. `42`, `"abc"`,
`[1,2]` and `{"a":1}` are all both valid JSON and valid Python, so they
pass the upload validation and leave the service page unreachable.

Responses declaring text/plain are no longer parsed, and the render site
type-checks the code before handing it to CodeHighlight.
2026-09-03 18:42:28 +02:00
Domingo Dirutigliano
090d117115
Keep a dragged firewall rule at its measured width
The Card carried Mantine's `w="100%"` prop, whose style props land in the
style attribute after anything passed via `style`, so it overrode the pixel
width dnd measures at lift time. On a `position: fixed` element `100%`
resolves against the viewport rather than the list, so grabbing a rule
snapped the card from 734px to 798px and pushed it past the right edge.

Moving the width into `style`, ahead of the dnd spread, leaves normal flow
untouched and lets the measured width win while dragging.
2026-09-03 18:42:16 +02:00
Domingo Dirutigliano
2caea98222
version bump to fedora 44 2026-09-03 10:22:19 +02:00
Domingo Dirutigliano
46fa029d75
Update frontend dependencies to latest
`bun update --latest`. Notably TypeScript 6 -> 7 (native compiler),
Mantine 9.3.2 -> 9.6.0, react-router 8.0.1 -> 8.3.1, vite 8.0.16 -> 8.2.2
and shiki 4.2 -> 4.4.3. `tsc --noEmit` and `bun run build` both pass.
2026-09-03 10:22:19 +02:00
Domingo Dirutigliano
72b3386d3e
Fix drag-and-drop reordering of firewall rules
Three separate defects made the rule list impossible to reorder:

- The Card's own `style` was placed after `{...provided.draggableProps}`,
  clobbering the `position`/`transform` dnd sets while dragging. The drag
  did start, but nothing moved on screen. Styles are now merged with dnd's
  winning, and the dragged card is highlighted.
- `Draggable index` used the position in the full `state` array and the
  rules of the other table were filtered out afterwards, leaving gaps.
  dnd requires contiguous indexes from 0 inside a Droppable, so a single
  rule in the other table broke the visible tab entirely. Visible rules
  are now re-indexed and mapped back to their `state` position on drop.
- `destination?.index || 0` reordered to the top instead of doing nothing
  when a rule was dropped outside the list.
2026-09-03 10:22:19 +02:00
Domingo Dirutigliano
60011612e5
Add demo link to README
Added a demo link to the README file.
2026-09-03 09:43:14 +02:00
Domingo Dirutigliano
a4271de5a4
Enable Pages on the repository instead of from the workflow
GITHUB_TOKEN cannot create a Pages site - configure-pages reported "Resource
not accessible by integration" even with pages: write on the job. Pages is now
enabled on the repository with source "GitHub Actions", so the step only has
to read the existing configuration.
2026-09-03 09:39:05 +02:00
Domingo Dirutigliano
b95b87977b
Let the Pages deploy enable Pages itself
The first run failed at configure-pages because the repository had no Pages
site yet. The deploy job already holds pages: write, so it can create one
instead of the setting having to be flipped by hand.
2026-09-03 09:37:48 +02:00
Domingo Dirutigliano
08d83e0041
Publish a browsable demo on GitHub Pages
The real frontend, built against an in-memory backend, so the UI can be tried
without a Linux host, NET_ADMIN or a running firewall. A visitor can create,
edit, start, stop and delete services across all five modules and watch the UI
react as it would against a real instance; a reload restores the seed.

- frontend/src/js/demo.ts holds the mock. genericapi() and the socket.io client
  are the frontend's only two ways out to the network, so routing both through
  it was enough - no component knows the difference. It also emits the same
  "update" events the backend does, and ticks the packet counters of running
  services so the page looks alive.
- The demo lives behind IS_DEMO, which vite inlines as a literal, so a normal
  `bun run build` tree-shakes the module and its seed data away. Verified: no
  demo string survives in the production bundle.
- The workflow rebuilds on every push touching frontend/ or docs/ and deploys
  to demo.firegex.pwnzer0tt1.it, copying index.html to 404.html so deep links
  resolve on Pages.
2026-09-03 09:36:37 +02:00
Domingo Dirutigliano
cb270b45ef
Fix the ALLOWED_IPS allow-case check for containerised runs
IPFilterMiddleware matches the raw TCP peer address, which is 127.0.0.1 only
when firegex shares the host's network namespace. Behind a published docker
port the peer is the bridge gateway instead, so the scenario allowing
127.0.0.1/32,::1/128 got a 403 and the suite failed everywhere except
standalone mode.

Allow loopback plus the private ranges a docker bridge can occupy. The check
keeps its meaning: the deny scenario uses 203.0.113.0/24 (TEST-NET-3), which no
real peer can fall into, so the allow/deny pair still exercises the middleware.
2026-09-03 01:24:48 +02:00
Domingo Dirutigliano
eba2c9063a
Align CLAUDE.md with the current CI, tests and auth surface
- CI is release.yml and runs only on `release: published`, gating the publish
  jobs. The documented docker-image.yml no longer exists, and nothing validates
  a push or a pull request.
- nginx_test.py is gone; document ipfilter_test.py instead, including that it
  drives run.py itself and is not part of run_tests.sh.
- `restart` now force-recreates the container, so it re-applies compose env
  vars; note that, and that most start/restart flags persist to the config file.
- Describe the authentication surface: everything hangs off the `api` router
  dependency plus the socket.io connect handler, with three routes deliberately
  declared on `app`. Cover --unsafe-disable-auth and the fail-closed IP filter.
2026-09-03 01:20:33 +02:00
Domingo Dirutigliano
c28d4488de
Merge pull request #40 from devopn/main
CUT-22: add reverse-proxy support to firegex with no-auth
2026-09-03 01:17:45 +02:00
Domingo Dirutigliano
2c3316b036
Harden the no-auth reverse-proxy mode
Rename the flag to --unsafe-disable-auth so the risk is visible at the call
site, and close the ways the mode could outlive itself:

- Keep an explicit -P/--startup-psw instead of dropping it. Without a password
  in the database, --no-unsafe-disable-auth brought firegex up in its
  initial-setup state, where anyone able to reach it could choose the password.
- Refuse /api/login, /api/set-password and /api/change-password while
  authentication is disabled: an anonymous caller could otherwise plant a
  credential that kept working once authentication was turned back on.
  run.py config --password still works, writing to the database from the host.
- Print a banner on every start/restart with authentication disabled. The flag
  is persisted in the config file, so a later bare `run.py start` inherits it.
- Report the change in `run.py config --unsafe-disable-auth`, which claimed
  "No configuration changes specified" while persisting it, and stop that
  command from nulling the stored port and host on the way.
- Expose the state as auth_disabled in /api/status and hide the logout button
  and the change-password entry, which were silent no-ops in this mode.

Tests cover both directions of the toggle, the socket.io handler, the password
endpoints and the -P handling.
2026-09-03 01:07:51 +02:00
Savva Serebriakov
6fb08f41f6 CUT-22: add reverse-proxy support to firegex 2026-09-02 19:08:51 +03:00
Domingo Dirutigliano
f3ce593af5
Update copyright year and remove star history
Updated copyright year from 2025 to 2026 and removed star history section.
2026-08-24 16:48:27 +02:00
Domingo Dirutigliano
60ca9c049d
Merge pull request #39 from Pwnzer0tt1/dev
integrated more tooltips
2026-07-24 13:47:58 +02:00
Domingo Dirutigliano
0dd538621d
integrated more tooltips 2026-07-24 13:47:31 +02:00
Domingo Dirutigliano
8a2212a898
Merge pull request #38 from Pwnzer0tt1/dev
Improve README documentation
2026-07-24 11:06:17 +02:00
Domingo Dirutigliano
728fcbdf2f
improved readme 2026-07-24 11:05:38 +02:00
Domingo Dirutigliano
6cc2b7d6bc
Merge pull request #37 from Pwnzer0tt1/dev
enforced security over import backup, minor changes
2026-07-23 18:45:26 +02:00
Domingo Dirutigliano
0943aeaa01
enforced security over import backup, minor changes 2026-07-23 18:38:22 +02:00
Domingo Dirutigliano
cc81d02d90
Merge pull request #36 from Pwnzer0tt1/dev
Dev
2026-07-23 16:53:32 +02:00
Domingo Dirutigliano
bd55a7bc9c
integrated and refactore docs + minor changes 2026-07-23 16:53:09 +02:00
Domingo Dirutigliano
f06c389161
Merge pull request #35 from Pwnzer0tt1/dev-tmp
Integrating edits on main to dev branch
2026-07-23 13:45:33 +02:00
Domingo Dirutigliano
d27831c9ec
Merge branch 'dev' into dev-tmp 2026-07-23 13:45:25 +02:00
Domingo Dirutigliano
7881da7128
Merge pull request #33 from Sogoss/feat/tls-support
Add transparent TLS proxying and certificate management for NFProxy and NFRegex
2026-07-23 13:43:16 +02:00
Domingo Dirutigliano
be7f46424a
Merge branch 'main' into feat/tls-support 2026-07-23 13:40:19 +02:00
Domingo Dirutigliano
c37d2b31e8
graphics and TLS feature total refactoring 2026-07-23 13:39:01 +02:00
Domingo Dirutigliano
1a1135ab6a
Merge pull request #34 from Sogoss/feat/http-history
Add HttpHistory support for pyfilters in HTTP requests
2026-07-22 15:11:37 +02:00
Domingo Dirutigliano
53656d531c
minor fixes and integrated test 2026-07-22 15:10:31 +02:00
Domingo Dirutigliano
4125eff93f
minor adjustments + network address based access control 2026-07-22 07:54:38 +02:00
Sogoss
9e4f93455b fix(nfproxy): prevent O(N²) memory growth from nested history snapshots
Objects archived in the history deques no longer carry their own
_history snapshot, breaking the recursive chain where each historical
entry held copies of all prior entries. The .history property on
archived objects now returns an empty HttpHistory([], []) instead.
2026-07-21 15:19:30 +02:00
Sogoss
c71ad7c199 fix(nfproxy): export HttpHistory in nfproxy and ensure list immutability in getters 2026-07-20 16:14:07 +02:00
Sogoss
dbc8b176b1 fix(nfproxy): fix HttpHistory parameter ordering and state immutability
- Fix parameter order sensitivity in HttpHistory._fetch_packet when history is first argument

- Delegate total_size and should_upgrade to _message instead of live _parser

- Sanitize FGEX_MAX_HISTORY_SIZE with max(0, int(val)) and dynamically sync deque maxlen
2026-07-20 16:03:43 +02:00
Sogoss
a94854d00e feat(nfproxy): add HttpHistory support for pyfilters in HTTP requests 2026-07-20 15:31:56 +02:00
Sogoss
75c54f0155 Add transparent TLS proxying and certificate management for NFProxy and NFRegex
- Add Nginx stream proxy module for transparent TLS termination in NFProxy and NFRegex
- Add backend routes and SQLite schema for certificate management (upload, view, delete)
- Implement DNAT nftables redirection rules for deterministic TLS ports
- Add frontend React components (TLSConfigModal, TLSServiceFields) for certificate configuration
- Update Dockerfile and docker-entrypoint.sh to support Nginx stream module and sysctl forwarding
2026-07-20 12:25:30 +02:00
Domingo Dirutigliano
bd10f9e8b8
Merge pull request #32 from Pwnzer0tt1/dev
auto-recognize version when using cloned firegex
2026-07-12 19:02:41 +02:00
Domingo Dirutigliano
4f62a7c7c9
Merge branch 'dev' of github.com:Pwnzer0tt1/firegex into dev 2026-07-12 18:59:06 +02:00
Domingo Dirutigliano
935a6a1574
auto-recognize version when using cloned firegex 2026-07-12 18:58:57 +02:00
Domingo Dirutigliano
cf2cbfea80
auto-recognize version when using cloned firegex 2026-07-12 18:46:35 +02:00
Domingo Dirutigliano
729139852b
Update standalone mode description in README
Clarify the conditions for running Firegex in standalone mode.
2026-07-08 16:34:51 +02:00
Domingo Dirutigliano
24634ec60b
mantine update 2026-06-21 11:49:53 +02:00
Domingo Dirutigliano
721f94c52b
Merge branch 'main' of github.com:Pwnzer0tt1/firegex 2026-06-18 21:00:41 +02:00
Domingo Dirutigliano
5bf000fdce
invalid request check on nfqueue updated 2026-06-18 21:00:30 +02:00
Domingo Dirutigliano
8df9fbf359
Update Netfilter Proxy description in README
Removed 'EXPERIMENTAL' label from Netfilter Proxy description in README.
2026-06-07 15:49:57 +02:00
Domingo Dirutigliano
16d0bfd169
CRITICAL: fix possible path traversal 2026-04-10 14:52:22 +02:00
Domingo Dirutigliano
16f96aa6f6
using brotli 1.2 from pypi, fixed tests to py 3.14, removed from experimental pyproxy 2025-11-11 23:30:48 +01:00
Domingo Dirutigliano
49c6c14fe5
upgrade to py3.14 and fedora 43 2025-10-13 15:38:38 +02:00