Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Added:
- **Internet schedule** (new page). Turn the internet off at set times of the week for chosen people (all their devices) or single devices: bedtime on school nights, study time, meal times. One click starts from a ready plan ("School nights", "Every night", "Study time", "Meal times"); a schedule can have several times, a time can run past midnight, and dates can be marked as days off (holidays, Eid). **Bonus time** gives a few extra minutes without changing the schedule. **Always allowed** sites (a school platform, a study site) keep working during every schedule. While a schedule is on, the device's card shows when the internet comes back, the home network (printer, shared drives, the dashboard) keeps working, and the cut is done by the gateway itself, so it works on any phone, tablet, TV or console with no app. Each device gets its end time in the system kernel, so it comes back online on time even if the gateway service restarts or stops. Sites on the "always allowed" list only open on devices that look names up through the gateway; a phone with Private DNS (or a browser with secure DNS) turned on keeps them blocked during a schedule. Contributed by @amr-elgharip2006. Closes #32.

Changed:
- The gateway service can now also be reached as `netrex`: `sudo systemctl status netrex`, `sudo journalctl -u netrex`. The old name `quota-gateway` keeps working too, so nothing you already use changes. The link is added the next time the gateway updates.
- **The packages are now named Netrex.** The files are `netrex_<version>_all.deb`, `netrex-<version>-1.noarch.rpm`, `netrex-<version>-1-any.pkg.tar.zst` and `netrex-<version>.tar.gz`, and the apt command is `sudo apt-get install netrex`. If you installed it as `quota-manager`, the dashboard updater, `apt-get install netrex` and `dnf install` move you over by themselves: the old package is replaced, and your settings, data and users stay where they were. Nothing else was renamed (service, folders and database are unchanged).
- A new version is now published only after all the tests and the install checks on Debian, Ubuntu, Fedora and Arch pass on exactly that version. Contributed by @compnew2006.

Expand Down
3 changes: 3 additions & 0 deletions Structure_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
> (`packaging/DEBIAN/transitional.control.template`, built in `apt-repo.yml`, never a
> release asset: old updaters take the first `.deb`). `packaging/ci/smoke.sh` installs the
> real 0.5.11 package and upgrades it in Debian, Ubuntu, Fedora and Arch containers.
> The systemd unit keeps its file name `quota-gateway.service` and has `Alias=netrex.service`
> (the setup script runs `systemctl enable quota-gateway` on every install/update, which
> creates the alias link; old package scripts stop/start the old name).
> `apt-get upgrade` keeps the new dependency back; the documented command is
> `apt-get install netrex`.
Expand Down
6 changes: 5 additions & 1 deletion scripts/setup_gateway_kali.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1105,7 +1105,7 @@ if wan_mode; then
fi
cat > /etc/systemd/system/quota-gateway.service <<EOF
[Unit]
Description=Quota Manager gateway (accounting + quota enforcement)
Description=Netrex gateway (accounting + quota enforcement)
After=$AFTER_DEP
[Service]
Expand All @@ -1122,6 +1122,10 @@ ${ADMIN_ENV_LINE}
[Install]
WantedBy=multi-user.target
# `systemctl status netrex` / `journalctl -u netrex` work too. The unit file keeps
# its old name (old package scripts stop/start quota-gateway by name); enabling
# the unit below creates the netrex.service alias link.
Alias=netrex.service
EOF
if [ -n "$ADMIN_PASSWORD" ]; then
chmod 600 /etc/systemd/system/quota-gateway.service
Expand Down
10 changes: 10 additions & 0 deletions tests/test_packaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -615,3 +615,13 @@ def test_every_asset_is_named_netrex_but_installs_to_the_old_path():
assert needle in build, needle
assert "dist/quota-manager" not in build
assert 'mkdir -p dist "$STAGE/DEBIAN" "$STAGE/opt/quota-manager"' in build


def test_gateway_unit_is_reachable_as_netrex_service():
"""`systemctl status netrex` works through an alias; the unit file itself
keeps the name quota-gateway (older package scripts stop/start it by name)."""
text = _read(REPO / "scripts" / "setup_gateway_kali.sh")
unit = text.split("cat > /etc/systemd/system/quota-gateway.service <<EOF", 1)[1].split("\nEOF\n", 1)[0]
assert "Alias=netrex.service" in unit.split("[Install]", 1)[1]
assert "systemctl enable quota-gateway" in text, "the alias link is created by enabling the unit"
assert "Description=Netrex gateway" in unit
Loading