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
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# CHANGELOG

## v2.1.0 (24 September 2026)

### Policies page

- Each policy card shows a one-line summary of what it blocks, with rules and devices behind a "Details and devices" toggle
- The policy editor has a Bedtime switch (times and nights) alongside safe search; custom rules, proxy users, and the description are under Advanced, which opens automatically for policies that use them
- Starter policies sit under the page heading; "Test a site" and gateway-wide categories are collapsible

### Fixes

- Saving a device's name, owner, or category from the device details dialog did nothing

## v2.0.0 (24 September 2026)

**Breaking:** the policy document format changes from version 1 to version 2. Existing policies upgrade automatically on first read and keep enforcing what they enforced before; the next policy write persists the new format. The v1 API fields (`action`, `domains`, `categories` on a group, and `mitm_action` on a rule) are replaced by the fields below.
Expand Down
219 changes: 77 additions & 142 deletions README.md

Large diffs are not rendered by default.

147 changes: 68 additions & 79 deletions application/webserver/frontend/files/fs/bundle.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions application/webserver/frontend/files/fs/style-2f533e80.css

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion application/webserver/frontend/files/fs/style-365a8e36.css

This file was deleted.

1 change: 0 additions & 1 deletion application/webserver/frontend/files/fs/style-ce16ea58.css

This file was deleted.

2 changes: 1 addition & 1 deletion application/webserver/frontend/files/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Gatesentry</title>
<script type="module" crossorigin src="/fs/bundle.js"></script>
<link rel="stylesheet" href="/fs/style-ce16ea58.css">
<link rel="stylesheet" href="/fs/style-2f533e80.css">
</head>
<body>
<div id="app"></div>
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ var GSPROXYPORT = "10413"
var GSWEBADMINPORT = "10786"
var GSBASEDIR = ""
var Baseendpointv2 = "https://www.gatesentryfilter.com/api/"
var GATESENTRY_VERSION = "2.0.0"
var GATESENTRY_VERSION = "2.1.0"
var GS_BOUND_ADDRESS = ":"
var R *application.GSRuntime

Expand Down
7 changes: 7 additions & 0 deletions ui/src/components/__tests__/device_detail_ui.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,10 @@ test("device detail links decision history to the log view", () => {
expect(source).toContain('"/logs"');
expect(source).toContain("decision history");
});

test("device detail saves labels through the modal submit event", () => {
// Carbon's ModalFooter primary button calls the ComposedModal submit
// context, so the handler must be on the modal, not the footer.
expect(source).toContain("on:submit={save}");
expect(source).not.toContain("on:click:button--primary");
});
3 changes: 1 addition & 2 deletions ui/src/routes/devices/devicedetail.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@
}
</script>

<ComposedModal {open} on:close={close} size="lg">
<ComposedModal {open} on:close={close} on:submit={save} size="lg">
<ModalHeader
title="Device Details"
label={device?.display_name || "Unknown Device"}
Expand Down Expand Up @@ -594,7 +594,6 @@
primaryButtonText={saving ? "Saving..." : "Save"}
primaryButtonDisabled={saving}
secondaryButtonText="Cancel"
on:click:button--primary={save}
/>
</ComposedModal>

Expand Down
131 changes: 118 additions & 13 deletions ui/src/routes/rules/groupform.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,17 @@
import { ChevronDown, ChevronUp } from "carbon-icons-svelte";
import Categoryselect from "./categoryselect.svelte";
import Domainlist from "./domainlist.svelte";
import { DEFAULT_GROUP_ID, SCHEDULE_PRESET_CUSTOM, WEEKDAYS, emptyRule, needsProxy, scheduleLabel } from "./policymodel";
import {
DEFAULT_GROUP_ID,
SCHEDULE_PRESET_CUSTOM,
WEEKDAYS,
bedtimeRule,
emptyRule,
hasAdvancedSettings,
isBedtimeRule,
needsProxy,
scheduleLabel,
} from "./policymodel";
import type { CategoryStatus, GroupRule, PolicyGroup, SchedulePreset } from "./policymodel";

// The draft is the page's object, mutated in place: the page reads it back
Expand All @@ -35,6 +45,36 @@

$: isDefault = draft.id === DEFAULT_GROUP_ID;

// The simple editor covers what most households need: categories, sites,
// safe search, and bedtime. Everything else lives under Advanced, which
// opens on its own when the policy already uses it.
const startAdvanced = hasAdvancedSettings(draft);
$: bedtimeIndex = draft.rules.findIndex(isBedtimeRule);
$: bedtime = bedtimeIndex >= 0 ? draft.rules[bedtimeIndex] : null;

function setBedtime(on: boolean) {
if (on && !bedtime) {
const preset = schedulePresets.find((candidate) => candidate.id === "bedtime");
draft.rules = [bedtimeRule(timezone, preset), ...draft.rules];
} else if (!on && bedtime) {
removeRule(bedtimeIndex);
}
}

function onBedtimeTime(key: "from" | "to", event: Event) {
if (!bedtime?.schedule) return;
bedtime.schedule.windows[0][key] = (event.target as HTMLInputElement).value;
bedtime.schedule.preset = undefined;
touchRules();
}

function onBedtimeDays(selected: (string | number)[]) {
if (!bedtime?.schedule) return;
bedtime.schedule.weekdays = selected.map(Number).sort((a, b) => a - b);
bedtime.schedule.preset = undefined;
touchRules();
}

// Svelte re-renders an each block when the array it reads is reassigned, and
// the rule objects keep their identity, so the page still sees every edit.
function touchRules() {
Expand Down Expand Up @@ -155,18 +195,13 @@
}
</script>

<Row>
<Column sm={4} md={8} lg={8}>
<TextInput labelText="Name" bind:value={draft.name} />
</Column>
<Column sm={4} md={8} lg={8}>
<TextArea labelText="Description" rows={1} bind:value={draft.description} />
</Column>
</Row>
<div class="name-field">
<TextInput labelText="Name" placeholder="Kids" bind:value={draft.name} />
</div>

<fieldset class="field">
<legend class="field-label">Blocked categories</legend>
<p class="field-note">Self-updating domain lists. A category also covers every subdomain of the sites it lists.</p>
<p class="field-note">Lists of sites that update themselves.</p>
<Categoryselect
{categories}
selection={draft.blocked_categories}
Expand Down Expand Up @@ -195,7 +230,7 @@
tagType="green"
on:change={(event) => (draft.allowed_domains = event.detail)}
/>
<p class="field-note">Wins over blocked categories, blocked domains, and the gateway blocklist.</p>
<p class="field-note">Always reachable, even if a blocked category lists it.</p>
</fieldset>
</Column>
</Row>
Expand All @@ -209,6 +244,54 @@
/>
</div>

<fieldset class="field">
<legend class="field-label">Bedtime</legend>
<Toggle
labelText="Bedtime"
hideLabel
labelA="Off"
labelB="No internet during these hours"
toggled={!!bedtime}
on:toggle={(event) => setBedtime(event.detail.toggled)}
/>
{#if bedtime?.schedule}
<div class="window-row bedtime-row">
<TimePicker
size="sm"
labelText="From"
placeholder="HH:MM"
pattern={TIME_PATTERN}
value={bedtime.schedule.windows[0]?.from || ""}
on:change={(event) => onBedtimeTime("from", event)}
/>
<TimePicker
size="sm"
labelText="Until"
placeholder="HH:MM"
pattern={TIME_PATTERN}
value={bedtime.schedule.windows[0]?.to || ""}
on:change={(event) => onBedtimeTime("to", event)}
/>
<MultiSelect
size="sm"
titleText="Nights"
label="Every night"
items={WEEKDAYS}
selectedIds={bedtime.schedule.weekdays.map(String)}
on:select={(event) => onBedtimeDays(event.detail.selectedIds)}
/>
</div>
<p class="field-note">A night lasts until the next morning, in {bedtime.schedule.timezone || "UTC"}.</p>
{/if}
</fieldset>

<details class="advanced-section" open={startAdvanced}>
<summary>Advanced: custom rules, proxy users, description</summary>

<div class="field">
<TextArea labelText="Description" rows={1} bind:value={draft.description} />
</div>

{#if !isDefault && users.length}
<div class="field">
<MultiSelect
Expand All @@ -225,11 +308,12 @@
<fieldset class="field">
<legend class="field-label">Rules</legend>
<p class="field-note">
Rules run before the lists above, top to bottom, and the first match decides. Use them for time limits
("block all traffic at bedtime"), exceptions ("allow YouTube after school"), or blocking part of a site.
Rules run top to bottom before the lists above, and the first match decides. Use them for schedules on
specific sites ("allow YouTube after school"), per-user exceptions, or blocking part of a site.
</p>

{#each draft.rules as rule, index (index)}
{#if index !== bedtimeIndex}
<div class="rule">
<div class="rule-head">
<h5>Rule {index + 1}</h5>
Expand Down Expand Up @@ -416,10 +500,12 @@
</p>
{/if}
</div>
{/if}
{/each}

<Button size="small" kind="tertiary" on:click={addRule}>Add rule</Button>
</fieldset>
</details>

<div class="group-actions">
<Button size="small" disabled={saving} on:click={onSave}>Save policy</Button>
Expand All @@ -436,6 +522,25 @@
font-weight: 600;
line-height: 1.375rem;
}
.name-field {
max-width: 24rem;
}
.bedtime-row {
flex-wrap: wrap;
align-items: flex-end;
margin-top: 0.75rem;
margin-bottom: 0;
}
.advanced-section {
margin-top: 1.5rem;
padding-top: 1rem;
border-top: 1px solid #e0e0e0;
}
.advanced-section > summary {
color: #0f62fe;
cursor: pointer;
font-size: 0.875rem;
}
.field {
margin: 1.5rem 0 0;
padding: 0;
Expand Down
Loading
Loading