Commit Graph

79 Commits

Author SHA1 Message Date
Domingo Dirutigliano
0c52014606
minor changes and bug fixes 2026-09-23 11:21:51 +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
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
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
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
Domingo Dirutigliano
53656d531c
minor fixes and integrated test 2026-07-22 15:10:31 +02:00
Domingo Dirutigliano
24634ec60b
mantine update 2026-06-21 11:49:53 +02:00
Minei3oat
0c5a681f5b Reconnect to websocket on access_token change 2025-10-02 23:10:26 +02:00
Domingo Dirutigliano
78166cdae3
removing -dom from react-router 2025-07-28 19:00:12 +02:00
Domingo Dirutigliano
97b3d97753
using zustand for localStorage data, fixed socketio on login 2025-07-28 16:01:41 +02:00
Domingo Dirutigliano
73c40d2f5d
data handler improves, written test for nfproxy, new option on parsing fail 2025-03-09 22:14:34 +01:00
Domingo Dirutigliano
e31796b249
push partial docs 2025-03-05 10:02:15 +01:00
Domingo Dirutigliano
8ae533e8f7
push: code changes x2 2025-02-28 21:14:09 +01:00
Domingo Dirutigliano
6a11dd0d16
push: code changes 2025-02-25 23:53:04 +01:00
Domingo Dirutigliano
8652f40235
nfproxy module writing: written part of the firegex lib, frontend refactored and improved, c++ improves 2025-02-20 19:51:28 +01:00
Domingo Dirutigliano
f3ba6dc716
more RESTful APIs 2025-02-11 19:11:30 +01:00
Domingo Dirutigliano
ec279a4fc5
pushed edits 2025-02-02 22:27:12 +01:00
Domingo Dirutigliano
2d8f19679f
nfqueue to hyperscan and stream match, removed proxyregex 2025-02-02 19:54:42 +01:00
Domingo Dirutigliano
d64e0aa73c
add: filtering table of firewall + InterfaceSelector frontend fixes and improves 2024-10-19 18:39:42 +02:00
Domingo Dirutigliano
cbf2c5a43d
add: frontend update 2024-10-13 01:50:52 +02:00
Domingo Dirutigliano
74b689600b
fix: minor graphic fixes 2024-06-28 18:03:15 +02:00
Domingo Dirutigliano
9233b759df
update: new start.py syntax and commands, fix: frontend not url encoded properly (could create problems with some passwords) 2024-04-21 16:05:06 +02:00
Domingo Dirutigliano
0e34805b4c
gui: reposive? yeah responsive 2023-10-12 20:01:48 +02:00
Domingo Dirutigliano
13a8711d13
change: back to npm 2023-10-12 14:20:00 +02:00
Domingo Dirutigliano
661fedae39
refactor: reordered option 2023-10-01 02:09:07 +02:00
Domingo Dirutigliano
1c65782fce
change: removed refetch time: only refresh on websocket 2023-09-26 22:31:02 +02:00
Domingo Dirutigliano
0b0357bdaf
fix: better error messages 2023-09-26 21:16:03 +02:00
Domingo Dirutigliano
0c972baa9c
add(todo): additional setting to implement 2023-09-26 01:17:09 +02:00
Domingo Dirutigliano
c0ea0eb331
add/fix: frontend and backend improves 2023-09-25 18:10:12 +02:00
Domingo Dirutigliano
d195f2c7cd
add: created components for rules visualization 2023-09-24 22:50:42 +02:00
Domingo Dirutigliano
594e6b4e00
firewall Frontend Improvements 2023-09-24 17:05:55 +02:00
Domingo Dirutigliano
4247dc181d
react-query + enable/disable firewall 2023-09-24 05:48:54 +02:00
Domingo Dirutigliano
73297b3804
fix overflow in Modal for interfaces lists 2023-09-23 02:29:15 +02:00
Domingo Dirutigliano
ae8dbd9423
fix: backend optional types + firewall frontend initial code 2023-09-23 02:02:02 +02:00
Domingo Dirutigliano
1b414139a0
Frontend -> vite 2023-06-29 13:44:12 +02:00
Domingo Dirutigliano
0430cb3773
mantine update + passed to vite 2023-06-05 00:57:54 +02:00
Domingo Dirutigliano
63a3014676
sysctl managmento for port hijacking 2023-04-12 23:53:43 +02:00
DomySh
354770279b Port hijack frontend finished 2022-08-12 18:51:50 +00:00
DomySh
a8330a9516 Port hijack frontend progresses 2022-08-12 16:00:58 +00:00
DomySh
af59ea0ef4 Fixes and improvements in thread managment 2022-08-02 19:45:28 +00:00
DomySh
d8dc5c9f8b Fixes 2022-07-22 00:34:57 +02:00
DomySh
1399d0e22d Moduled Firegex, Merging pt2 (to finish and test) 2022-07-21 21:17:06 +02:00
DomySh
63ba0e94e7 Moduled Firegex, Merging pt1 (not finished and not working yet) 2022-07-21 20:25:39 +02:00
DomySh
acf9642f54 Restructurated frontend 2022-07-21 10:20:54 +02:00
DomySh
0ed8bb635e Restructurated backend 2022-07-21 01:02:46 +02:00
DomySh
d4cc2f566c Added reset button 2022-07-20 21:19:22 +02:00
DomySh
1266aebe0e Autosuggestion for network interfaces ips 2022-07-20 00:21:22 +02:00