diff --git a/README.md b/README.md index cc29bed..4c90c94 100644 --- a/README.md +++ b/README.md @@ -25,13 +25,15 @@ creating, grouping, pausing, running, and monitoring scheduled shell commands. - Job definitions stored in a clean, hand-editable `jobs.json`. - `@every` intervals and standard 5-field cron expressions. - Manual and scheduled command runs. -- Parallel or sequential execution mode; configurable overlap policy (skip or queue). +- Parallel or sequential execution mode; overlap policy (skip or queue) set globally or per job. +- Run timeout, off by default, set globally or per job. - Per-run `.log` files with stdout/stderr capture. - Log cleanup by maximum file count and maximum age. - Global pause/resume for scheduled job execution (manual runs remain available). - Desktop notifications on job failure. - Windows tray icon: left-click to show the window, right-click for the menu. - Autostart on login (Windows shortcut; Linux XDG desktop entry). +- Detailed or compact job list, and a default or branded theme; both are remembered. ## Platforms @@ -70,10 +72,22 @@ portable application: moving the program folder also moves its configuration. "keep_running_in_tray": true, "notify_on_failure": true, "execution_mode": "parallel", - "overlap_policy": "skip" + "overlap_policy": "skip", + "default_timeout_seconds": 0, + "theme": "default", + "job_list_view": "detailed" } ``` +That is the file GoSentry writes on first run. `default_timeout_seconds` is the +run timeout applied to jobs that do not set their own; `0` means no timeout, and +it is written out even though it is zero, because a missing value and a +deliberate "no timeout" have to stay distinguishable in a hand-edited file. +`theme` is `default` or `gosentry` (the branded teal/amber look), and +`job_list_view` is `detailed` or `compact` — both are remembered from the +choices made in the app. Keys left at their off value (`start_on_login`, +`paused`) are omitted until they are turned on. + `jobs.json` stores job definitions: ```json @@ -159,8 +173,8 @@ without opening the main window. ## Queue Settings -Two settings in the **Queue** group of the Settings tab control how simultaneous -and overlapping runs are handled. +Three settings in the **Queue** group of the Settings tab control how +simultaneous, overlapping, and over-long runs are handled. **Execution mode** — applies when multiple jobs become due at the same tick: @@ -169,14 +183,25 @@ and overlapping runs are handled. | `parallel` (default) | All due jobs start at the same time. | | `sequential` | Due jobs are started one after another, in the order they appear in the list. | -**Overlap policy** — applies when a job's next scheduled run fires while its -previous run is still active: +**Default overlap policy** — applies when a job's next scheduled run fires while +its previous run is still active: | Value | Behaviour | |-------|-----------| | `skip` (default) | The new run is discarded; the running instance continues. | | `queue` | The new run is held and starts immediately after the current run finishes. | +**Default timeout (s)** — how long a run may take before it is killed. `0` (the +default) means no limit. + +The last two are defaults: a job's own dialog has an **Overlap policy** and a +**Timeout (s)** field that override them. A job that overrides nothing follows +whatever the Settings tab says, so changing a default moves every such job with +it. In `jobs.json` an override is an `overlap_policy` or `timeout_seconds` key +on the job; absent means inherit. A `"timeout_seconds": 0` on a job is an +override too — it means that job has no timeout even when the global default +sets one. + ## Notifications When **Notify on failure** is enabled in Settings, GoSentry sends a desktop @@ -197,7 +222,7 @@ Linux: [Desktop Entry] Type=Application Name=GoSentry -Exec=/opt/gosentry/gosentry-0.9.0-linux-amd64 --start-in-tray +Exec=/opt/gosentry/gosentry--linux-amd64 --start-in-tray Terminal=false ``` @@ -238,7 +263,7 @@ Known workaround: ```text dist\windows\ - gosentry-0.9.0-windows-amd64.exe + gosentry--windows-amd64.exe opengl32.dll ... ``` diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md index bceb818..7c98391 100644 --- a/docs/ARCHITECTURE.md +++ b/docs/ARCHITECTURE.md @@ -17,7 +17,7 @@ src/ storage/ JSON persistence (gosentry.json, jobs.json) platform/ autostart/ Manager interface + Windows (shortcut) and Linux (XDG) impls - desktop/ display-scale helper (Linux only) + desktop/ desktop entry + icon under XDG data home (Linux only) filemanager/ open a folder in the desktop file manager winproc/ hidden-window startup flags (Windows only) ui/ Fyne windows, tabs, and dialogs; reads service via Events @@ -40,7 +40,7 @@ flowchart LR shell["Platform shell - cmd.exe /C or sh -c"] user -->|"edits jobs, settings, runs commands"| ui - ui -->|"CreateJob, UpdateJob, DeleteJob, RunNow, UpdateSettings, …"| svc + ui -->|"CreateJob, UpdateJob, DeleteJob, RunNow, UpdateSettings, AutostartStatus, …"| svc svc -->|"SaveJobs, SaveConfig, LoadJobs, LoadConfig"| store store -->|"read/write"| config store -->|"read/write"| jobs @@ -54,7 +54,6 @@ flowchart LR svc -->|"emit JobChanged / RunRecorded / JobsLoaded / ErrorOccurred"| ui ui -->|"display jobs, history, status"| user - ui -->|"SetAutostart, AutostartStatus"| autostart svc -->|"Set / Status via Manager"| autostart ``` @@ -64,7 +63,7 @@ flowchart LR `cmd/gosentry` calls `ui.Run`, which creates an `app.Service`, opens the store, loads `gosentry.json` and `jobs.json`, subscribes the UI to service events, builds the main window, and calls `Service.Start` to begin the - scheduler loop. On first launch the service seeds per-job run-time statistics + scheduler loop. On every launch the service seeds per-job run-time statistics from existing log files so the details panel reflects accumulated history immediately (see §Statistics below). @@ -205,8 +204,9 @@ the moment the window opens. ### `jobs_view.go` file structure -`src/ui/jobs_view.go` is split across three files to stay within the ~250-line -size guideline: +The size guideline for a file in this project is ~250 lines. `src/ui/jobs_view.go` +is split across three files along these seams; the view file itself has grown +back over the guideline since, and is the next candidate if it grows further: | File | Contents | |------|----------| @@ -217,7 +217,8 @@ size guideline: ### `settings_view.go` file structure `src/ui/settings_view.go` is split across three files the same way, once its -own size passed the ~250-line guideline: +own size passed the guideline. `src/ui/history_view.go` is over it too and has +not been split: | File | Contents | |------|----------| diff --git a/docs/DEVELOPMENT.md b/docs/DEVELOPMENT.md index 8da1228..17f6abb 100644 --- a/docs/DEVELOPMENT.md +++ b/docs/DEVELOPMENT.md @@ -64,7 +64,7 @@ The Windows build is created as a GUI application, so it does not open a termina The binary is written to: ```text -dist\windows\gosentry-0.9.0-windows-amd64.exe +dist\windows\gosentry--windows-amd64.exe ``` ### Linux @@ -78,7 +78,7 @@ chmod +x ./scripts/build-linux.sh The binary is written to: ```text -dist/linux/gosentry-0.9.0-linux-amd64 +dist/linux/gosentry--linux-amd64 ``` ### Linux using Docker @@ -94,7 +94,7 @@ chmod +x ./scripts/build-linux-docker.sh The binary is copied to: ```text -dist/linux/gosentry-0.9.0-linux-amd64 +dist/linux/gosentry--linux-amd64 ``` ### Release build from Linux @@ -118,9 +118,9 @@ Non-interactive release builds can pass target names: The binaries are copied to: ```text -dist/linux/gosentry-0.9.0-linux-amd64 -dist/linux/gosentry-0.9.0-linux-arm64 -dist/windows/gosentry-0.9.0-windows-amd64.exe +dist/linux/gosentry--linux-amd64 +dist/linux/gosentry--linux-arm64 +dist/windows/gosentry--windows-amd64.exe ``` ### Automated release builds (CI) @@ -195,7 +195,7 @@ CGO_ENABLED=1 go run ./cmd/gosentry - `src/runner` — shell command execution, log file writing, and log cleanup. - `src/storage` — JSON persistence (`gosentry.json`, `jobs.json`). - `src/platform/autostart` — `Manager` interface with Windows (shortcut) and Linux (XDG) implementations. -- `src/platform/desktop` — display-scale helper (Linux only). +- `src/platform/desktop` — desktop entry and icon under XDG data home (Linux only). - `src/platform/winproc` — hidden-window startup flags (Windows only). - `src/ui` — Fyne windows, tabs, and dialogs; reads service state through events. - `assets` — app icons embedded into the application binary. diff --git a/docs/STANDARDS.md b/docs/STANDARDS.md index ec37b63..116ae8f 100644 --- a/docs/STANDARDS.md +++ b/docs/STANDARDS.md @@ -69,5 +69,6 @@ change to their shape has to stay compatible on its own. ## Out of scope -Larger or blocked work is tracked in [ROADMAP.md](ROADMAP.md) (window size -persistence, History column filters, CI coverage gate). +Larger or blocked work is tracked in [ROADMAP.md](ROADMAP.md) (update check from +GitHub releases, cron-table import/export, window size persistence, History +column filters).