Commit Graph

566 Commits

Author SHA1 Message Date
Domingo Dirutigliano
e9e2289c2c
Merge pull request #45 from Pwnzer0tt1/dev
Write pending block counters before an export
2026-10-16 19:03:49 +02:00
Domingo Dirutigliano
8df2512744
Write pending block counters before an export
A backup taken within a second of a block missed it. The backup test
also snapshotted while NFQUEUE blocks were still being reported, which
failed the 5.0.0 release run; it now waits until two reads agree.
2026-10-16 19:03:41 +02:00
Domingo Dirutigliano
ed9c3c9b27
Merge pull request #44 from Pwnzer0tt1/dev
Run the test suite from its own venv
2026-10-16 18:18:28 +02:00
Domingo Dirutigliano
79a2e1aacb
Run the test suite from its own venv
As root on Ubuntu, pip into the system Python cannot replace apt's
typing_extensions, so pytest was never installed and the 5.0.0
release gate failed. run_tests.sh now installs into tests/.venv and
stops on a failed install.
2026-10-16 18:17:18 +02:00
Domingo Dirutigliano
9e74ad2f61
Merge pull request #43 from Pwnzer0tt1/dev
Releasing Firegex 5.0.0 with new UI interface for filters with unified services model, proxy tunnels, QUIC, HTTP/2 HTTP/3 support
2026-10-16 18:07:27 +02:00
Domingo Dirutigliano
21e3027f0b
Minor fixes for release 2026-10-16 18:06:50 +02:00
Domingo Dirutigliano
a6643490c1
Merge origin/main into dev
The queue watchdog and packet-exception handling from main were already
carried by dev (services/ managers, utils.cpp, nfqueue.cpp); the tree is
kept as dev has it.
2026-10-01 21:16:23 +02:00
Domingo Dirutigliano
896eb2dfb4
backup managment fixes 2026-10-01 12:32:12 +02:00
Domingo Dirutigliano
61e50b72b6
minor nftable and quic managment improves 2026-10-01 10:05:17 +02:00
Domingo Dirutigliano
e38e77745e
removing CLAUDE.md 2026-09-29 09:27:52 +02:00
Domingo Dirutigliano
8ce9b21400
general fixes and old/new connection resilience for proxy filters 2026-09-26 09:52:20 +02:00
Domingo Dirutigliano
70373eb4f6
minor adjustments 2026-09-24 09:19:00 +02:00
Domingo Dirutigliano
0c52014606
minor changes and bug fixes 2026-09-23 11:21:51 +02:00
Domingo Dirutigliano
d94c08293a
added additional tests 2026-09-19 02:17:51 +02:00
Domingo Dirutigliano
440b7c91ec
docs and code minor fixing 2026-09-18 23:01:11 +02:00
Domingo Dirutigliano
4a87bf2184
fixes from main 2026-09-18 15:10:08 +02:00
Domingo Dirutigliano
f0821afe72
catching exception on queue crashing on packet handling, implementation of a watchdog for queue processes 2026-09-18 09:36:20 +02:00
Domingo Dirutigliano
4476da02bd
QUIC support and bug fixes 2026-09-18 09:34:44 +02:00
Domingo Dirutigliano
e491a14899
improved addr/int selection UI + change llhttp managment 2026-09-13 15:54:56 +02:00
Domingo Dirutigliano
9d2a4dc4bf
additional improves on UDP 2026-09-11 18:53:41 +02:00
Domingo Dirutigliano
a26bda5161
fixup packet been dropped in the first connection 2026-09-10 09:24:47 +02:00
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
6b34de4371
Merge pull request #42 from Pwnzer0tt1/dev
Minor UI and demo fixes
2026-09-03 18:46:20 +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
b5b35aa65f
Merge pull request #41 from Pwnzer0tt1/dev
version bump to fedora 44
2026-09-03 10:25:08 +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