Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
5bed923
reject missing host paths when enabling Docker logging
bensynapse Oct 3, 2026
8fbfbb7
Validate host paths for wrapped logging commands
bensynapse Oct 3, 2026
a489bc8
Handle multiline commands when unwrapping logging
bensynapse Oct 3, 2026
08bc59e
Merge pull request #109 from bensynapse/fix-host-logging-path
fccview Oct 4, 2026
78beeba
bump deps
fccview Oct 4, 2026
8dd83d8
Merge branch 'develop' of github-fccview:fccview/cronmaster into develop
fccview Oct 4, 2026
24f75cd
about bloody time we get some logging in here
fccview Oct 4, 2026
717acee
disk and inode usage in the sidebar
fccview Oct 4, 2026
6eb14c1
schedule scripts straight from the library
fccview Oct 4, 2026
fc9d082
this was seriously a shit bug, ffs
fccview Oct 4, 2026
c99a9fc
nologin users can run now, su was choking on them the whole time
fccview Oct 4, 2026
bb31463
node 24 babe
fccview Oct 4, 2026
86db4c7
logger stop repeating shit
fccview Oct 4, 2026
2c67deb
hopefully no more console.error
fccview Oct 4, 2026
81aa419
failed crontabs don’t spit a whole file anymore
fccview Oct 4, 2026
3abd524
auth flow and nice hello
fccview Oct 4, 2026
9872dc5
proxy stops printing session cookies in debug, what the actual fuck i…
fccview Oct 4, 2026
68ef106
client components use the logger too
fccview Oct 4, 2026
f1bec54
logging docs, plus a test that fails the second anyone types console.…
fccview Oct 4, 2026
b946a75
disk stats get a proper log scope like everything else
fccview Oct 4, 2026
69d9111
server actions check auth themselves and ../ stops reading any file o…
fccview Oct 4, 2026
86b1683
server actions stop catching errors as any
fccview Oct 4, 2026
9a4cd14
utils lose the dead code and the any shit
fccview Oct 4, 2026
ea7ea99
api routes stop pretending they know what they caught (lmfao)
fccview Oct 4, 2026
6f4224f
layout gets a const, test script gets an import
fccview Oct 4, 2026
f7f0567
components drop unused icons and any-typed props
fccview Oct 4, 2026
2c3ebd7
hooks and contexts stop setting state inside effects
fccview Oct 4, 2026
31aa031
components derive what they can poor bastards
fccview Oct 4, 2026
7845a15
scripts get translations
fccview Oct 4, 2026
5546de9
lint is fully green, LINT IS FULLYFUCKING GREEN
fccview Oct 4, 2026
0c0c459
no more matrix, we ain’t in 2007, fccview
fccview Oct 4, 2026
e9b9f50
mobile job list stops scrolling sideways like a piece of shit
fccview Oct 4, 2026
3e8b93e
warnings show in orange
fccview Oct 4, 2026
5e3910a
cron jobs, their modals and the quick patterns get translated
fccview Oct 4, 2026
b834b19
sidebar, toasts and the little corner buttons get translated too
fccview Oct 4, 2026
007693f
login page translations
fccview Oct 4, 2026
c6ac5ce
test for missing locale keys, italian was four short, bloody italians
fccview Oct 4, 2026
ac8ca47
chinese crons were quietly english the whole time, sorry china
fccview Oct 4, 2026
b555ad3
rate limited logins get a translated telling off
fccview Oct 4, 2026
29d60e2
"Description(Optional)" gets its space back
fccview Oct 4, 2026
39f3b86
status colours finally work outside english
fccview Oct 4, 2026
1e3e315
startup banner with a red asterisk, duh
fccview Oct 4, 2026
536660f
sso group and role checks like jotty
fccview Oct 4, 2026
e253f0a
one copy of the wrapper parsing instead of two drifting apart
fccview Oct 4, 2026
2cf667a
paths only get quoted when they have spaces
fccview Oct 4, 2026
9dd675a
a dot in the url no longer gets you past auth, no, seriously, how dum…
fccview Oct 4, 2026
f5954f7
agents.md, mostly "don't touch anyone's fucking crontab”, you gotta t…
fccview Oct 4, 2026
4919687
service worker gets built at build time instead of begging for an esb…
fccview Oct 4, 2026
daaff8c
a 99% full disk now counts as a problem, who knew
fccview Oct 4, 2026
3f610c6
dead code
fccview Oct 4, 2026
0707582
container path in script gone
fccview Oct 4, 2026
b6fedf9
four bloody places to log shit, kesus christ
fccview Oct 4, 2026
89841b1
RUN_SCRIPT outlived the only function that ever ran it lmfao
fccview Oct 4, 2026
4debeef
tick 1 once
fccview Oct 4, 2026
e2767b9
escape closes modals
fccview Oct 4, 2026
77d991f
alert fail scripts
fccview Oct 4, 2026
5ec5510
test-api admits it is an ES module so node 24 stop doing my damn head in
fccview Oct 4, 2026
0555daf
disk stats don’t warn about docker anymore
fccview Oct 4, 2026
a4dfd64
maybe update the docs you idiot?
fccview Oct 4, 2026
30bc6a1
and sso-only users finally get a logout button
fccview Oct 4, 2026
9e59e7b
logging out of an sso session actually visits the sso logout
fccview Oct 4, 2026
5a727a6
delete, pause and resume can be streamlined
fccview Oct 4, 2026
cba7cde
compact and full should use the same icons, really
fccview Oct 4, 2026
5477b08
six copy-pasted failure toasts?!?!? oh ffs.
fccview Oct 4, 2026
c4faaf5
searchScripts was dead, yikes
fccview Oct 4, 2026
fdf8c11
some people do have big hdds
fccview Oct 4, 2026
1128dc5
one function for script headers
fccview Oct 4, 2026
4fe7f51
native installs stop screaming about nsenter on every damn page load
fccview Oct 4, 2026
414d050
2.4.0, because this was not a fucking patch release
fccview Oct 4, 2026
7a774b7
docker stops hoovering up 9 gigs of agent worktrees and your local da…
fccview Oct 4, 2026
0b23281
Merge pull request #110 from fccview/feature/missed-you-cronmaster
fccview Oct 4, 2026
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
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ README.md
.git
.gitignore
.next
.claude
data
14 changes: 10 additions & 4 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ jobs:
echo "Please create a PR to 'develop' first, this will become a release candidate when merged into 'main' by a maintainer"
exit 1
fi
echo "Valid PR: develop → main"
echo "Valid PR: develop -> main"

- name: PR info
run: |
echo "PR validation passed"
echo "Source: ${{ github.head_ref }}"
echo "Target: ${{ github.base_ref }}"

typing:
name: Type and install checks
tests:
name: Tests now - BOOORING
runs-on: ubuntu-latest
needs: validate-branch
steps:
Expand All @@ -38,11 +38,17 @@ jobs:
- name: Setup the best engine ever
uses: actions/setup-node@v4
with:
node-version: "20"
node-version: "24"
cache: "yarn"

- name: Install all dependencies
run: yarn install --frozen-lockfile

- name: This will totally fail if you only use AI
run: yarn tsc --noEmit

- name: You better have linting rules in your vscode
run: yarn lint

- name: Regression tests, because we have those now
run: yarn test
2 changes: 1 addition & 1 deletion .github/workflows/prebuild-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Setup the best engine ever
uses: actions/setup-node@v4
with:
node-version: '20'
node-version: '24'
cache: 'yarn'

- name: Install dependencies
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ node_modules
tsconfig.tsbuildinfo
docker-compose.test.yml
/data
claude.md
claude.md
.claude/worktrees
115 changes: 115 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
# Cr*nMaster

Cr*nMaster is a web UI for cron. It reads and writes the real crontabs of real users on a machine somebody owns, and it can run any of those jobs on demand. It runs natively, or in a container that reaches into the host to do the same thing. Either way, whoever can use it can run commands as any user on that host, root included.

Treat it like a root shell with a nice UI, because that is what it is.

There is no company behind this and no support desk. When a crontab gets mangled, a backup script stops running at 3am and nobody notices for a month. There is a person, their server, and whatever backup they happened to take.

The name has an asterisk in it. Cr*nMaster, `cr*nmaster` in log tags. It is not a typo, so don't fix it.

This file covers what we value. Branching and pull requests live in `CONTRIBUTING.md`, and the user-facing documentation lives in `howto/`.

## The crontab is the database

There is no database. The source of truth is the crontab itself, plus some metadata we tuck into the comment line above each job. People edit those files by hand, with `crontab -e`, with Ansible, with other tools. Our lines have to survive that, and their lines have to survive us.

A line we wrote two years ago has to parse today. People update when they remember, so the shape you are reading may come from a version that no longer exists. We keep reading old shapes forever. Changing how we write a line means every parser accepts both the old and the new form first, with tests built from real lines in the old format.

A job line that works today is written back byte for byte. Don't quote it, reformat it, normalise its whitespace or tidy it on the way through. I have been burned by this more than once. The current format has worked for a long time without complaints, and that is worth more than whatever your change makes prettier.

Read, change, write back. A write that fails halfway can leave somebody with an empty crontab, and an empty crontab looks exactly like a working one until the jobs don't run.

## Every setup is different

Cr*nMaster runs on NAS boxes, Raspberry Pis, LXC containers, VPSes, laptops and old towers under desks. Different distros, different cron daemons, service users with no login shell, paths with spaces, containers in a different timezone from the host, filesystems that don't record when a file was created, and drives that spin down to save power.

"It works on my machine" proves very little here. Before you rely on something about the host, ask what happens on the weirdest machine you can think of. Somebody runs it there.

New behaviour is opt-in. Defaults don't change under people's feet: no new required environment variables, no inputs rejected that used to work, no feature that starts touching disks it never touched before. If the secure or correct choice would break existing setups, add it behind an environment variable, document it, and tell me so it can become the default in a major release.

The disks thing is real. Some people run this on a NAS full of sleeping drives. Anything that polls, scans or stats the filesystem has to stay on what it was asked about, cache its answer, and leave everything else alone.

## Security

Every value that ends up in a shell command or a crontab line is hostile until proven otherwise. Usernames, job ids, schedules, comments, script names, log file names. Quote what goes into a shell, validate what goes into a crontab, and check containment on every path you build from something the browser sent. A newline in a comment is a new cron line. A `..` in a filename is somebody else's file.

Server actions are public endpoints, whatever the UI does with them. When auth is configured, every action checks it on the server, every time. Client-side checks exist so people don't click buttons that will refuse them, and that is all they do.

Running without auth is a choice people make on purpose, usually behind a VPN or on a home network. Respect it. Warn about it, document it, don't force a login on them. The API key protects the REST API and nothing else, and people who set it without a password get an orange warning at startup telling them so. That warning stays.

Secrets never reach the logs or the browser. Passwords, API keys, session ids, cookies, and the full contents of somebody's crontab. Error messages shown to the user say what went wrong, not what was in the file.

A mutation shipped without its auth check, or a shell string built from user input without quoting, is the first thing I look for in review.

## Running jobs

"Run now" and the scheduled run have to behave the same way, as the same user, with the same environment as close as we can get it. If a job works when the host's cron runs it and fails when somebody presses the button, people stop trusting both.

Job logs are written on the host by a small wrapper script, and they belong to the user. Cleanup follows the documented limits and nothing else. A log that disappears when somebody refreshes the page is a bug that makes people think their job never ran.

Never touch the real crontab of the machine you are working on. Not in tests, not to check something quickly, not to "just see if it works". Mock it, fake it, or spin up a throwaway container as the host and delete it afterwards. Don't install or purge packages on shared machines or VMs either. The crontab on this laptop runs my actual stuff.

## Translations

Anything a user reads goes through a translation key. Buttons, toasts, tooltips, errors, empty states. A hardcoded string is an English word in somebody's German interface. Every locale file has to carry the same keys as English, and the tests check it. Don't leave English placeholders in the other locales, translate them.

## The REST API

People call it from scripts, Home Assistant, n8n and shell aliases, and they never read the changelog. Adding a field is safe. Renaming one, dropping one, or changing what a status means breaks somebody's automation.

## How I like to work

Look before you build. What you need probably exists already, under a name you wouldn't have picked. Most requests are an environment variable, a check on an existing action, or a few lines next to a case that is already handled.

Fix causes. A guard that hides the error while the crontab on disk is still wrong is worse than the error.

Boy scout rule, within reason. Tidy the mess next to your change while you are in the file. Don't turn a bug fix into a rewrite of the crontab parser.

Pull requests go to `develop`. Never `main`.

Don't push, don't edit `.env`, and don't run anything against a real crontab unless I asked for it in the message you are answering. If a variable is missing, name it and ask.

Treat all of this as good defaults. What I ask for in the message you are answering beats anything here. What you decided on your own does not, so if a rule here fights the task, say so and ask.

## Taste

- No comments. Say it in the naming, or say it to me in the pull request.
- Arrow functions. Short, honest names. If the name needs a paragraph, the function is doing too much.
- `any` is not a solution. Catch `unknown` and narrow it.
- Constants over magic strings, especially for anything that ends up in a cron line or a shell command.
- Log when you catch, through the project logger, with a scope. Never `console.*`, the tests will catch you. Never log a secret or a whole crontab.
- Small files and real modules. Shared logic lives in one place. If the client and the server both need it, they import the same thing instead of keeping two copies that drift.
- New abstractions earn their place. Two similar things are not a pattern.
- The UI is terminal-styled and themed. Reuse the theme variables and the existing components so every theme and dark mode keep working. Nothing hardcoded green on black.
- Keep it quirky. The tag is `cr*nmaster`, the asterisk is red, and commit messages are allowed to have opinions. Understandable first, funny second.

## Words

Same words for the same things, please.

- **you** is the agent reading this. **we** is me, fccview, plus whoever is contributing. **user** is somebody using a running instance, not the developer and not me.
- **instance** is one deployment somebody self-hosts. **host** is the machine whose crontabs we manage. In Docker that is not the container.
- **job** is one cron entry with its schedule, command and our metadata. **crontab user** is the account that owns it and that it runs as.
- **run now** is a manual run from the UI or API. **scheduled run** is the host's cron doing its job. Both write logs when logging is on.
- **wrapper** is the script that wraps a job's command when logging is on, and writes its log on the host.
- **script** is a file in the scripts library. **snippet** is a reusable piece of bash for the editor. **backup** is a saved copy of a job that can be restored.
- **howto** is the user-facing documentation, written for the person running the instance.

## Verifying

Smallest thing that proves the change works. Type check, lint with zero warnings, and the tests covering the area. Run the whole suite if you touched something shared.

Bug fixes come with a regression test where it is practical. If you changed behaviour the tests cover, update them and tell me you did.

The tests around auth, injection, path containment and crontab line round-trips exist because those things broke, or nearly did. If your change makes one of them fail, the change is wrong until proven otherwise.

<!-- BEGIN:nextjs-agent-rules -->

# This is NOT the Next.js you know

This version has breaking changes — APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in `node_modules/next/dist/docs/` (resolved from this file's directory; in monorepos the `next` package may not be visible from the repo root) before writing any code. Heed deprecation notices.

This block is written and re-added by `next dev` — verify at `node_modules/next/dist/server/lib/generate-agent-files.js`. Removing it from a diff only re-creates the uncommitted change; committing it with your work keeps the tree clean.

<!-- END:nextjs-agent-rules -->
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:20-alpine AS base
FROM node:24-alpine AS base

FROM base AS deps
RUN apk add --no-cache libc6-compat
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
- [Localization](#localization)
- [Local Development](#local-development)
- [Environment Variables](howto/ENV_VARIABLES.md)
- [System Logging](howto/LOGGING.md)
- [Authentication](#authentication)
- [Usage](#usage)
- [Viewing System Information](#viewing-system-information)
Expand Down Expand Up @@ -185,7 +186,7 @@ This includes all configuration options for:
### Important Notes for Docker

- Root user is required for cron operations and direct file access. There is no way around this, if you don't feel comfortable in running it as root feel free to run the app locally with `yarn install`, `yarn build` and `yarn start`
- The `DOCKER=true` environment variable enables direct file access mode for crontab operations. This is REQUIRED when running the application in docker mode.
- Docker is detected automatically, there is no `DOCKER` environment variable to set
- The Docker socket and data volume mounts are required for proper functionality

**Important Note on Root Commands**: When running commands as `root` within Cronmaster, ensure that these commands also function correctly as `root` on your host machine. If a command works as `root` on your host but fails within Cronmaster, please open an issue with detailed information.
Expand Down Expand Up @@ -258,6 +259,8 @@ The application automatically detects your operating system and displays:

📖 **For complete logging documentation, see [howto/LOGS.md](howto/LOGS.md)**

📖 **For Cronmaster's own system logs (`LOG_LEVEL`, `LOG_FORMAT=json`, scopes), see [howto/LOGGING.md](howto/LOGGING.md)**

### Cron Schedule Format

The application uses standard cron format: `* * * * *`
Expand Down
52 changes: 33 additions & 19 deletions app/_components/FeatureComponents/Cronjobs/CronJobList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,11 @@ import {
ClockIcon,
PlusIcon,
Archive,
CaretDownIcon,
CodeIcon,
ChatTextIcon,
GearIcon,
CircleNotchIcon,
FunnelIcon,
} from "@phosphor-icons/react";
import { CronJob } from "@/app/_utils/cronjob-utils";
import { Script } from "@/app/_utils/scripts-utils";
import { UserFilter } from "@/app/_components/FeatureComponents/User/UserFilter";

import { useCronJobState } from "@/app/_hooks/useCronJobState";
import { CronJobItem } from "@/app/_components/FeatureComponents/Cronjobs/Parts/CronJobItem";
Expand All @@ -44,13 +39,24 @@ import {
restoreAllCronJobs,
} from "@/app/_server/actions/cronjobs";
import { showToast } from "@/app/_components/GlobalComponents/UIElements/Toast";
import { createLogger } from "@/app/_utils/logger";
import { useIsHydrated } from "@/app/_hooks/useIsHydrated";

const log = createLogger("ui:jobs");

interface CronJobListProps {
cronJobs: CronJob[];
scripts: Script[];
scriptToSchedule?: Script | null;
onScriptScheduled?: () => void;
}

export const CronJobList = ({ cronJobs, scripts }: CronJobListProps) => {
export const CronJobList = ({
cronJobs,
scripts,
scriptToSchedule,
onScriptScheduled,
}: CronJobListProps) => {
const t = useTranslations();
const router = useRouter();
const { subscribe } = useSSEContext();
Expand All @@ -68,10 +74,11 @@ export const CronJobList = ({ cronJobs, scripts }: CronJobListProps) => {
const [loadedSettings, setLoadedSettings] = useState<boolean>(false);
const [isFiltersModalOpen, setIsFiltersModalOpen] = useState(false);
const [minimalMode, setMinimalMode] = useState(false);
const [isClient, setIsClient] = useState(false);
const isClient = useIsHydrated();
const [settingsChecked, setSettingsChecked] = useState(false);

useEffect(() => {
setIsClient(true);
if (isClient && !settingsChecked) {
setSettingsChecked(true);

try {
const savedScheduleMode = localStorage.getItem(
Expand All @@ -92,9 +99,9 @@ export const CronJobList = ({ cronJobs, scripts }: CronJobListProps) => {

setLoadedSettings(true);
} catch (error) {
console.warn("Failed to load settings from localStorage:", error);
log.warn("Failed to load settings from localStorage", error);
}
}, []);
}

useEffect(() => {
const unsubscribe = subscribe((event) => {
Expand All @@ -115,8 +122,8 @@ export const CronJobList = ({ cronJobs, scripts }: CronJobListProps) => {
scheduleDisplayMode
);
} catch (error) {
console.warn(
"Failed to save schedule display mode to localStorage:",
log.warn(
"Failed to save schedule display mode to localStorage",
error
);
}
Expand All @@ -128,7 +135,7 @@ export const CronJobList = ({ cronJobs, scripts }: CronJobListProps) => {
try {
localStorage.setItem("cronjob-minimal-mode", minimalMode.toString());
} catch (error) {
console.warn("Failed to save minimal mode to localStorage:", error);
log.warn("Failed to save minimal mode to localStorage", error);
}
}, [minimalMode, isClient]);

Expand All @@ -151,18 +158,18 @@ export const CronJobList = ({ cronJobs, scripts }: CronJobListProps) => {
const handleRestoreAll = async () => {
const result = await restoreAllCronJobs();
if (result.success) {
showToast("success", result.message);
showToast("success", t("cronjobs.restoreAllSuccess"), result.message);
router.refresh();
setIsBackupModalOpen(false);
} else {
showToast("error", "Failed to restore all jobs", result.message);
showToast("error", t("cronjobs.restoreAllFailed"), result.message);
}
};

const handleBackupAll = async () => {
const result = await backupAllCronJobs();
if (result.success) {
showToast("success", result.message);
showToast("success", t("cronjobs.backupAllSuccess"));
loadBackupFiles();
} else {
showToast("error", t("cronjobs.backupAllFailed"), result.message);
Expand All @@ -175,7 +182,7 @@ export const CronJobList = ({ cronJobs, scripts }: CronJobListProps) => {
showToast("success", t("cronjobs.backupDeleted"));
loadBackupFiles();
} else {
showToast("error", "Failed to delete backup", result.message);
showToast("error", t("cronjobs.deleteBackupFailed"), result.message);
}
};

Expand Down Expand Up @@ -225,11 +232,18 @@ export const CronJobList = ({ cronJobs, scripts }: CronJobListProps) => {
confirmDelete,
confirmClone,
handleEdit,
openNewCronWithScript,
handleEditSubmitLocal,
handleNewCronSubmitLocal,
handleBackupLocal,
} = useCronJobState({ cronJobs, scripts });

useEffect(() => {
if (!scriptToSchedule) return;
openNewCronWithScript(scriptToSchedule);
onScriptScheduled?.();
}, [scriptToSchedule, openNewCronWithScript, onScriptScheduled]);

return (
<>
<Card className="glass-card">
Expand Down Expand Up @@ -301,7 +315,7 @@ export const CronJobList = ({ cronJobs, scripts }: CronJobListProps) => {
onNewTaskClick={() => setIsNewCronModalOpen(true)}
/>
) : (
<div className="space-y-4 max-h-[55vh] min-h-[55vh] overflow-y-auto tui-scrollbar pr-1">
<div className="space-y-4 lg:max-h-[55vh] lg:min-h-[55vh] lg:overflow-y-auto tui-scrollbar lg:pr-1">
{loadedSettings ? (
filteredJobs.map((job) =>
minimalMode ? (
Expand Down
Loading
Loading