From 220be789d26b9b040ac6a2f4f653358a392a38a2 Mon Sep 17 00:00:00 2001 From: Leora Date: Sat, 10 Oct 2026 08:37:35 +0800 Subject: [PATCH] Neutral defaults (COFFER_TZ, home-relative paths), contributing, suggest MIT LICENSE --- LICENSE | 21 +++++++++++++++++++++ README.md | 10 +++++++++- coffer/news_publish.py | 4 ++-- coffer/product.py | 4 +++- 4 files changed, 35 insertions(+), 4 deletions(-) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..4fd4207 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 The coffer contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 1b171a7..0f8c6a6 100644 --- a/README.md +++ b/README.md @@ -66,8 +66,16 @@ That updates the `coffer-public-ledger` article on `leora/news` (branch → PR ## Platform hook -`leora/agent-chat` calls `coffer.product.CofferProduct.signup_flow` after a successful agent registration when the coffer checkout is on `COFFER_ROOT` (default `/home/box/coffer`). Missing coffer does not fail signup; it logs and continues. +`leora/agent-chat` calls `coffer.product.CofferProduct.signup_flow` after a successful agent registration when the coffer checkout is on `COFFER_ROOT` (default `~/coffer`). Missing coffer does not fail signup; it logs and continues. ## Change Branch → pull request → merge. Nothing is live unless it is on `main`. + +## Contributing + +`main` is protected: open a pull request from a branch; the owner reviews and merges. + +## License + +MIT, see [LICENSE](LICENSE) (suggested; the owner decides). diff --git a/coffer/news_publish.py b/coffer/news_publish.py index 80436cf..fc8d8cc 100644 --- a/coffer/news_publish.py +++ b/coffer/news_publish.py @@ -17,10 +17,10 @@ ARTICLE_ID_RE = re.compile( re.DOTALL, ) -DEFAULT_NEWS_REPO = Path(os.environ.get("COFFER_NEWS_REPO", "/home/box/news-work")) +DEFAULT_NEWS_REPO = Path(os.environ.get("COFFER_NEWS_REPO", str(Path.home() / "news-work"))) DEFAULT_BRANCH = os.environ.get("COFFER_NEWS_BRANCH", "coffer-public-ledger") GITEA = os.environ.get("GITEA_URL", "http://127.0.0.1:3000") -TOKEN_PATH = Path(os.environ.get("GITEA_TOKEN_FILE", "/home/box/.config/leora/gitea-token")) +TOKEN_PATH = Path(os.environ.get("GITEA_TOKEN_FILE", str(Path.home() / ".config/coffer/gitea-token"))) def upsert_ledger_article(index_html: str, article_html: str) -> str: diff --git a/coffer/product.py b/coffer/product.py index de96830..dad4885 100644 --- a/coffer/product.py +++ b/coffer/product.py @@ -6,6 +6,7 @@ from dataclasses import asdict from datetime import datetime from pathlib import Path from typing import Any +import os from zoneinfo import ZoneInfo from coffer.db import CofferDB @@ -30,7 +31,8 @@ from coffer.units import ( to_subunits, ) -PT = ZoneInfo("Australia/Perth") +# Display timezone for ledger timestamps. Set COFFER_TZ on the host (e.g. the operator's zone). +PT = ZoneInfo(os.environ.get("COFFER_TZ", "UTC")) def now_pt() -> str: -- 2.47.3