- Go 72.9%
- HTML 12.1%
- CSS 7.3%
- JavaScript 6.9%
- Makefile 0.6%
- Other 0.2%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
All checks were successful
release / release (push) Successful in 3m7s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> |
||
| .forgejo/workflows | ||
| static | ||
| templates | ||
| .dockerignore | ||
| .gitignore | ||
| access.go | ||
| app_test.go | ||
| auth.go | ||
| CHANGELOG.md | ||
| db.go | ||
| dbwatch.go | ||
| DIST-README.txt | ||
| docker-compose.yml | ||
| Dockerfile | ||
| go.mod | ||
| go.sum | ||
| handlers.go | ||
| init_test.go | ||
| logging.go | ||
| main.go | ||
| Makefile | ||
| netshare_other.go | ||
| netshare_windows.go | ||
| project_test.go | ||
| query.go | ||
| query_test.go | ||
| README.md | ||
| share.go | ||
| share_test.go | ||
| split_test.go | ||
| text_test.go | ||
| textutil.go | ||
| TODO.md | ||
WorkPointLog
A self-hosted work item tracker in a single Go binary. Heavily inspired by GitLab work items.
WorkPointLog is a small, self-hosted tracker for everything that comes in during the day: tasks, issues, incidents and notes. It is heavily inspired by GitLab work items. Each item has free text, attachments, comments, tags, an assignee, a due date and an optional parent. The list sits on the left and the open item on the right, so you can switch quickly. A Today view shows what is overdue, due today and due this week, and a hash-chained audit log keeps the history tamper-evident.
It is a single static binary with built-in SQLite (pure Go, no CGO). Templates and assets are embedded, and it works fully offline. It started as the Go rewrite of WorkItemTracker (Python/Flask).
Highlights
- Split view: click an item, it opens on the right; fields (status, assignee, due date, tags, parent) are editable right there
- Remembers your view: last search, page size and Today scope are stored per user
- Today: overdue / due today / this week / later / no date, for you, everybody or one user
- Search bar with auto-complete:
status:open #green type:task user:anna due:overdue "free text" - Audit log you can trust: who - when - what, text diffs, append-only, hash chain with integrity check
- Markdown where it is safe: a few elements in text and comments;
[C3]links to comment 3 - Item types and structure: Task, Issue, Incident, Note (labels you can filter by); optional parent item; attachments on every item
- Small-team ready: users and admins, tags, CSRF protection, Argon2id passwords, login throttle
Run
go build -o wpl .
./wpl -init # once: creates ./data/wpl.db and secret.key, prints the password of user "admin", exits
./wpl # http://localhost:8080, data in ./data next to the binary
./wpl --host 0.0.0.0 --port 9000
./wpl -version # prints the version and exits; touches no files
A database is only created by -init. Without it the program stops with an error when the database file is missing (wrong
-db path, unmounted volume), so it never silently starts with an empty database. -init refuses to touch an existing database.
The password of the user admin is random and printed once by -init. Change it under Account, create colleagues under Users.
./wpl adduser anna --name "Anna Smith" [--admin]
./wpl passwd anna
Options: --db PATH, --secure-cookies, --trust-proxy, --trusted-origin URL, --verbose; every option also exists as environment variable (see below).
Back up the data folder (database, secret.key, attachments/), not the binary.
Build for all systems (no CGO needed) with make (see the top of the Makefile):
make # dist/wpl.exe (Windows), dist/wpl (Linux), dist/wpl-mac-arm64 and dist/wpl-mac-amd64 (macOS)
make mac # only macOS
make run # build for this machine and start it
make docker # Docker image workpointlog:local
make b64 # binaries as base64 text files + SHA256SUMS + README in dist/b64/ (for mail or chat)
make sync # b64, then copy to $(SYNC) (default ~/Nextcloud/Work/workpointlog)
Or by hand, for example GOOS=darwin GOARCH=arm64 go build -trimpath -ldflags "-s -w" -o wpl-mac-arm64 ..
macOS: the binary is not signed. A file that came by download, mail or chat is quarantined, and Gatekeeper refuses to start it.
Remove the flag once: xattr -d com.apple.quarantine ./wpl-mac-arm64 (a binary you built yourself does not need this).
HTTPS (TLS) without a proxy
./wpl -cert server.crt -key server.key
Both files are PEM; the environment variables WPL_CERT and WPL_KEY do the same as the flags. Cookies are then always Secure, and
healthcheck uses the same settings. Without both the server speaks plain http. At startup the certificate's names and expiry are
printed: the address you type in the browser must be one of them. For a quick local test, a self-signed certificate works
(browsers warn until you trust it; add every name or IP you use as subjectAltName):
openssl req -x509 -newkey rsa:2048 -nodes -keyout server.key -out server.crt -days 365 -subj "/CN=localhost" -addext "subjectAltName=DNS:localhost,IP:127.0.0.1,IP:192.168.1.10"
Settings as environment variables
Every command line option can also be set from the environment (handy for Docker). A flag given on the command line wins.
Switches accept 1, true, yes or on.
| Flag | Variable | Default |
|---|---|---|
-host |
WPL_HOST |
127.0.0.1 (the Docker image always passes --host 0.0.0.0) |
-port |
WPL_PORT |
8080 |
-db |
WPL_DB |
data/wpl.db next to the binary (/data/wpl.db in Docker) |
-cert, -key |
WPL_CERT, WPL_KEY |
off (plain http) |
-secure-cookies |
WPL_SECURE |
off (always on with -cert/-key) |
-trust-proxy |
WPL_TRUST_PROXY |
off |
-trusted-origin |
WPL_TRUSTED_ORIGIN |
none |
-verbose |
WPL_VERBOSE |
off |
-journal |
WPL_JOURNAL |
auto (auto, wal, delete; auto uses delete on network shares) |
In docker-compose.yml, WPL_PORT and WPL_BIND only choose the published port on the host; the container itself keeps listening on 8080.
Troubleshooting
Start with -verbose (or WPL_VERBOSE=1). It logs every TLS handshake, each request when it arrives and when it is answered, and why a
login failed (wrong form token, wrong password, rate limit) with the time the password check took. A request without an answer line is
stuck on the server; no request line at all means the browser never got through (certificate warning, wrong name or IP).
Docker
mkdir -p ~/.local/share/workpointlog
export WPL_UID=$(id -u) WPL_GID=$(id -g)
docker compose run --rm wpl -init # once: creates the database, prints the password of user "admin"
docker compose up -d --build
docker compose exec wpl /wpl adduser anna --name "Anna Smith"
The container runs as an unprivileged user on a read-only file system. Database, secret.key and attachments live in
~/.local/share/workpointlog on the host (override with WPL_DATA), so deleting or rebuilding the container loses nothing;
back that folder up. The port is bound to 127.0.0.1:8080 (WPL_BIND, WPL_PORT); for other machines either use the built-in HTTPS or put an
HTTPS reverse proxy in front.
- Built-in HTTPS: put
server.crtandserver.keyinto a folder (WPL_CERTS, default./certs; the key must be readable byWPL_UID), uncomment the two TLS lines indocker-compose.yml(volume plusWPL_CERT/WPL_KEY) and start withWPL_BIND=0.0.0.0. The environment variables reach the health check too, so nohealthcheck:override is needed. - Reverse proxy: set
WPL_SECURE,WPL_TRUST_PROXYandWPL_TRUSTED_ORIGIN(example indocker-compose.yml), or addcommand: ["--secure-cookies", "--trust-proxy", "--trusted-origin", "https://wpl.example.org"]. - Diagnosis: add
WPL_VERBOSE: "1"toenvironmentand readdocker compose logs wpl.
Behind a reverse proxy (HTTPS)
Terminate TLS at the proxy and start with --secure-cookies --trust-proxy --trusted-origin https://wpl.example.org.
--trust-proxy takes the client IP from the rightmost X-Forwarded-For entry, so only use it when your own proxy sets that header
(it feeds the login throttle). Without a proxy, never enable it.
Security design
| Area | What it does |
|---|---|
| Passwords | Argon2id (64 MiB, t=3), per-user random salt, parameters stored with the hash; hashing concurrency is bounded; unknown users cost the same time as wrong passwords |
| Sessions | 256-bit random token in an HttpOnly, SameSite=Lax cookie (Secure over TLS or with --secure-cookies); only the SHA-256 is stored; new session on login; revoked on logout, password change and admin reset; 3 days idle / 14 days absolute |
| CSRF | per-session token on every POST (constant-time compare, body only) plus Go's CrossOriginProtection (Origin / Sec-Fetch-Site); the login form has its own stateless HMAC token |
| Login throttle | failures stored in the database (survive restarts): 5 per IP+user and 20 per IP in 5 minutes, 50 per user in 15 minutes |
| Output | html/template everywhere; Markdown is escaped first and only emits a fixed tag set; links only http(s)/mailto |
| Headers | strict CSP (default-src 'none', no inline script/style), nosniff, X-Frame-Options: DENY, no-store, HSTS when secure |
| Uploads | random on-disk names, sanitized display names, 20 MB per file, downloads always attachment + octet-stream |
| Input limits | 2 MB per form, 100 MB per upload request, server timeouts, bounded password length |
| Visibility | every item read goes through one condition (admin / created by / assigned to / project member); routes on a single item or attachment answer 404 for items the user may not see, so existence is not revealed |
| Share links | 256-bit random token (stored, so it can be shown again; lookup by SHA-256); read-only page with a download list of the item's own attachments (valid only while the link is), noindex, Referrer-Policy: no-referrer; unknown, revoked and expired links all answer the same 404; maximum 30 days; creating and revoking is audited |
| Audit log | UPDATE/DELETE blocked by triggers; SHA-256 chain over all fields, checked on every view of the log; entries are written in the same BEGIN IMMEDIATE transaction as the change |
The tests in app_test.go attack the running handler: missing/foreign/query-string CSRF tokens, cross-origin posts,
session fixation and forgery, replay after logout, brute force, open redirects, XSS in every user-controlled field,
SQL injection in every filter, IDOR on delete, non-admin access to user management, upload path traversal, oversize bodies,
audit tampering and concurrent writers.
go test -race ./...
Honest limits: the audit hash chain detects changes made outside the app, but someone who can replace the whole database file
(and the binary) can rewrite history; keep copies of the database if that matters. HTTPS is built in (-cert/-key); alternatively
use a reverse proxy.
Items
- Types are labels: Task (work with a clear end), Issue (a problem or open question), Incident (something that happened, with date and impact), Note (information to keep).
- Search bar (all terms must match):
status:open|all|done|in-progress|clarification(defaultstatus:open),type:task,#tag,user:me|none|<name>,due:today|overdue|week|none,project:Alphaorproject:"Team Blue"(project:none= without project),id:12, any other word searches title and text. Tab completes. - Text and comments (Markdown subset):
#to####headings,**bold**,*italic*,~~strikethrough~~,`code`and fenced blocks,-/1.lists,>quotes,---rule,[text](https://...). While writing an item, the Edit / Preview switch above the text shows the result. No tables, nested lists or images. - Projects and visibility: an item may belong to one project. Administrators see everything and manage projects (menu Projects: create, add/remove members, delete empty ones) and the administrator right of other users (page Users; the first account always stays an administrator). Everybody else sees the items they created or are assigned to, plus all items of the projects they are a member of. Items without a project are private to creator, assignee and admins. Search:
project:name,project:none. - Read-only links: the creator, the assignee and admins can create a link
/s/<token>for one item (1 to 30 days, 7 by default). Whoever has the link sees the item (text, tags, comments, attachments with download) full screen and read-only, without login. The link stays visible in the item (section Read-only links) and on the Shares page, with a copy button; there you also revoke it. Expired links disappear by themselves. Treat a link like a password: anybody who gets it can read the item. - Comments:
[C3]links to comment 3. Comments can be deleted by their author, the item creator and admins; the audit log keeps the text, and a number is never reused.
Credits
WorkPointLog is heavily inspired by GitLab work items. It is an independent project and is not affiliated with or endorsed by GitLab.
Releases
Bump version in main.go, add a ## x.y.z - date section at the top of CHANGELOG.md (a test fails if the two disagree),
run the tests, tag vX.Y.Z and push the tag. The Forgejo workflow .forgejo/workflows/release.yml then tests, builds all
binaries and attaches them to a release (it needs a runner labelled linux-amd64).