9 Commits

Author SHA1 Message Date
6a1de4c43b feat(limit): Add clean command to reset IP limiter state 2025-11-07 07:24:53 +00:00
4a2e1b7d3f fix(limit): Ensure IP removal on disconnect for all users 2025-11-06 19:36:11 +00:00
ce968b182b chore(shell): clean up shell script formatting and structure 2025-09-24 19:51:23 +00:00
c943596912 refactor(scripts): migrate IP limit state from JSON to MongoDB 2025-09-15 18:05:49 +00:00
eac13764e2 feat: Add per-user IP limit exemption
Introduces a new 'unlimited_user' flag for users. When set to true, the user is exempt from the concurrent IP limit enforcement by `limit.sh`.

- `core/scripts/hysteria2/add_user.py`:
  - Adds an optional `unlimited_user` argument (defaults to false).
  - Stores the `unlimited_user` boolean in the `users.json` file when adding a user.

- `core/scripts/hysteria2/limit.sh`:
  - Modifies `check_ip_limit` function to first check the `unlimited_user` flag for the connecting user in `users.json`.
  - If the flag is true, the script bypasses the IP limit check for that user.
  - Uses `jq` for reliable parsing and includes a `grep` fallback for systems without `jq`.
  - Existing users without the flag are treated as limited (default behavior).
2025-08-11 23:21:36 +03:30
c66ea43c7d fix: correct systemd service target for hysteria-ip-limit 2025-05-16 22:09:59 +03:30
20d5204a1a Ensure BLOCK_DURATION and MAX_IPS exist in CONFIG_ENV correctly 2025-03-24 11:33:10 +03:30
3c025ed5f7 feat: Add Hysteria IP limiter script 2025-03-23 12:42:45 +03:30
e2d3d91eb6 Create limit.sh 2025-03-22 15:44:16 +03:30