mirror of
https://github.com/nickyeoman/docker-compose-cookbooks.git
synced 2026-12-06 12:28:50 +00:00
fixing paisa volumes
This commit is contained in:
@@ -32,7 +32,7 @@ These deliberately violate the conventions above — do not "fix" them:
|
|||||||
- `pangolin_dev` is itself an edge reverse proxy (Pangolin + gerbil + traefik), not a client of NPM; the `proxy` network is declared for convention but unused by its services, and `traefik` uses `network_mode: service:gerbil` instead of joining `internal`
|
- `pangolin_dev` is itself an edge reverse proxy (Pangolin + gerbil + traefik), not a client of NPM; the `proxy` network is declared for convention but unused by its services, and `traefik` uses `network_mode: service:gerbil` instead of joining `internal`
|
||||||
- `zammad_dev` `zammad-init` service hardcodes `restart: on-failure` (init container)
|
- `zammad_dev` `zammad-init` service hardcodes `restart: on-failure` (init container)
|
||||||
- `nextcloud/compose-aio.yaml` follows the upstream AIO layout: fixed container/volume names, no env templating, no proxy network
|
- `nextcloud/compose-aio.yaml` follows the upstream AIO layout: fixed container/volume names, no env templating, no proxy network
|
||||||
- `paisa` mounts its ledger repo from `${PAISA_LEDGER_PATH:-/data/paisa}` (a full path, not `VOL_PROJECTS`) so it can point at any folder, e.g. `paisa/demo` in a clone of this repo
|
- `paisa` uses a single volume `${VOL_PATH:-/data/paisa}` (a full path, nested default, no `VOL_PROJECTS`) holding the ledger git repo and `paisa.db`, so it can point at any folder, e.g. `paisa/demo` in a clone of this repo
|
||||||
- `opencode` and `vscode` default `VOL_PROJECTS` to `${VOL_PATH:-/data}/projects` (nested default), not plain `/data`
|
- `opencode` and `vscode` default `VOL_PROJECTS` to `${VOL_PATH:-/data}/projects` (nested default), not plain `/data`
|
||||||
- `mailu_dev` passes env via `env_file: .env`, so its sample.env holds vars the compose file never references
|
- `mailu_dev` passes env via `env_file: .env`, so its sample.env holds vars the compose file never references
|
||||||
- `headscale` sample.env documents `HEADSCALE_DOMAIN`/`HEADSCALE_URL` for the config file even though compose doesn't use them
|
- `headscale` sample.env documents `HEADSCALE_DOMAIN`/`HEADSCALE_URL` for the config file even though compose doesn't use them
|
||||||
|
|||||||
+2
-1
@@ -23,6 +23,7 @@ UNIVERSAL_VARS = {"VOL_PATH", "VOL_PROJECTS", "TZ", "CONFIG_PATH", "LOG_PATH"}
|
|||||||
|
|
||||||
# Known exceptions — see AGENTS.md "Known exceptions"
|
# Known exceptions — see AGENTS.md "Known exceptions"
|
||||||
NO_PROXY_OK = {"pihole", "nginx-proxy-manager"}
|
NO_PROXY_OK = {"pihole", "nginx-proxy-manager"}
|
||||||
|
NESTED_VOL_PATH_OK = {"paisa"} # single full-path volume
|
||||||
HARDCODED_RESTART_OK = {("zammad_dev", "on-failure")}
|
HARDCODED_RESTART_OK = {("zammad_dev", "on-failure")}
|
||||||
STALE_VARS_OK = {
|
STALE_VARS_OK = {
|
||||||
"mailu_dev": None, # env_file: .env — all vars consumed in-container
|
"mailu_dev": None, # env_file: .env — all vars consumed in-container
|
||||||
@@ -54,7 +55,7 @@ def check_compose(stack, path):
|
|||||||
err(stack, f"relative volume path: {m.group(1)}")
|
err(stack, f"relative volume path: {m.group(1)}")
|
||||||
if re.search(r"\$\{VOL_PATH\}", c):
|
if re.search(r"\$\{VOL_PATH\}", c):
|
||||||
err(stack, "VOL_PATH used without :-/data default")
|
err(stack, "VOL_PATH used without :-/data default")
|
||||||
if re.search(r"VOL_PATH:-(?!/data\})", c):
|
if stack not in NESTED_VOL_PATH_OK and re.search(r"VOL_PATH:-(?!/data\})", c):
|
||||||
err(stack, "VOL_PATH default is not /data")
|
err(stack, "VOL_PATH default is not /data")
|
||||||
for m in re.finditer(r"TZ:-([^}\s]+)", c):
|
for m in re.finditer(r"TZ:-([^}\s]+)", c):
|
||||||
if m.group(1) != "America/Vancouver":
|
if m.group(1) != "America/Vancouver":
|
||||||
|
|||||||
+15
-21
@@ -15,13 +15,13 @@ budgets, and transaction management.
|
|||||||
|
|
||||||
## Getting Started
|
## Getting Started
|
||||||
|
|
||||||
1. Copy this stack's `config/` folder to `${PAISA_LEDGER_PATH:-/data/paisa}`
|
1. Copy this stack's `config/` folder to `${VOL_PATH:-/data/paisa}`
|
||||||
and make it a git repo. It holds `paisa.yaml`, an empty `main.ledger`,
|
and make it a git repo. It holds `paisa.yaml`, an empty `main.ledger`,
|
||||||
`sheets/`, and a `.gitignore`. Edit `paisa.yaml` to suit you.
|
`sheets/`, and a `.gitignore`. Edit `paisa.yaml` to suit you.
|
||||||
Starting a new business? Copy `template/` instead: it has a chart of
|
Starting a new business? Copy `template/` instead: it has a chart of
|
||||||
accounts for a small BC corporation and commented example entries.
|
accounts for a small BC corporation and commented example entries.
|
||||||
Fill in its `TODO`s.
|
Fill in its `TODO`s.
|
||||||
2. Deploy the stack. Paisa creates `paisa.db` in `${VOL_PATH:-/data}/paisa`.
|
2. Deploy the stack. Paisa creates `paisa.db` in the same folder.
|
||||||
3. Open http://localhost:7500 in your browser.
|
3. Open http://localhost:7500 in your browser.
|
||||||
|
|
||||||
To explore first, see [docs/demo.md](docs/demo.md) for the sample books of
|
To explore first, see [docs/demo.md](docs/demo.md) for the sample books of
|
||||||
@@ -34,25 +34,20 @@ especially the section on closing entries.
|
|||||||
|
|
||||||
PAISA_IMAGE – container image (default ananthakumaran/paisa:latest)
|
PAISA_IMAGE – container image (default ananthakumaran/paisa:latest)
|
||||||
PAISA_RESTART – restart policy (default unless-stopped)
|
PAISA_RESTART – restart policy (default unless-stopped)
|
||||||
VOL_PATH – host base path for the database, backed up by restic (default /data)
|
VOL_PATH – full host path of the ledger git repo; nothing is appended (default /data/paisa)
|
||||||
PAISA_LEDGER_PATH – full host path of the ledger git repo, not a base path (default /data/paisa)
|
|
||||||
PAISA_PORT – host port for the web UI (default 7500)
|
PAISA_PORT – host port for the web UI (default 7500)
|
||||||
|
|
||||||
## Volume Notes
|
## Volume Notes
|
||||||
|
|
||||||
Anything that belongs in git goes in `PAISA_LEDGER_PATH`; anything that
|
One volume holds everything:
|
||||||
doesn't (the SQLite database) goes in `VOL_PATH`, which is backed up.
|
|
||||||
|
|
||||||
- `/root/Documents/paisa` — `paisa.yaml`, `*.ledger`, `sheets/`;
|
- `/root/Documents/paisa` — `paisa.yaml`, `*.ledger`, `sheets/`, and
|
||||||
`${PAISA_LEDGER_PATH:-/data/paisa}` on the host, kept in git
|
`paisa.db`; `${VOL_PATH:-/data/paisa}` on the host
|
||||||
- `/var/lib/paisa` — `paisa.db`; `${VOL_PATH:-/data}/paisa` on the
|
|
||||||
host, backed up by restic
|
|
||||||
|
|
||||||
Both default to `/data/paisa`, so they start out as the same folder.
|
`VOL_PATH` is the full path to the folder (nothing is appended), so it
|
||||||
`PAISA_LEDGER_PATH` is a full path (nothing is appended), so it can point
|
can point anywhere, such as the `demo/` folder in a clone of this repo.
|
||||||
anywhere, such as the `demo/` folder in a clone of this repo. The
|
Keep the folder in git; the shipped `.gitignore` keeps `paisa.db` out of
|
||||||
database location comes from `db_path` in `paisa.yaml`
|
commits. The database is a cache rebuilt from the ledger files.
|
||||||
(`/var/lib/paisa/paisa.db`), so it never lands in the ledger repo.
|
|
||||||
|
|
||||||
## Network Notes
|
## Network Notes
|
||||||
|
|
||||||
@@ -65,7 +60,6 @@ docker run -d \
|
|||||||
--name=paisa \
|
--name=paisa \
|
||||||
-p 7500:7500 \
|
-p 7500:7500 \
|
||||||
-v /data/paisa:/root/Documents/paisa \
|
-v /data/paisa:/root/Documents/paisa \
|
||||||
-v /data/paisa:/var/lib/paisa \
|
|
||||||
ananthakumaran/paisa:latest
|
ananthakumaran/paisa:latest
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -73,11 +67,11 @@ docker run -d \
|
|||||||
|
|
||||||
- If Paisa finds no `paisa.yaml`, it creates one with Indian defaults
|
- If Paisa finds no `paisa.yaml`, it creates one with Indian defaults
|
||||||
(INR, en-IN, fiscal year starting in April), so copy `config/` in first.
|
(INR, en-IN, fiscal year starting in April), so copy `config/` in first.
|
||||||
- `db_path: /var/lib/paisa/paisa.db` in `paisa.yaml` is what keeps the
|
- `paisa.db` sits in the git folder (`db_path: paisa.db`); keep the
|
||||||
database out of git. Keep it if you write your own config.
|
shipped `.gitignore` so it isn't committed.
|
||||||
- With the default `/data` for both, `paisa.db` sits in the git folder;
|
- Upgrading from the old two-volume layout with the old default
|
||||||
the shipped `.gitignore` keeps it out of commits. Existing single-folder
|
(`VOL_PATH=/data`): set `VOL_PATH=/data/paisa` or Paisa will look in
|
||||||
installs keep working, since `/var/lib/paisa/paisa.db` is the same file.
|
`/data`.
|
||||||
- `config/paisa.yaml` uses CAD, en-US number formatting,
|
- `config/paisa.yaml` uses CAD, en-US number formatting,
|
||||||
America/Vancouver, a January fiscal year, and no login. Add
|
America/Vancouver, a January fiscal year, and no login. Add
|
||||||
`user_accounts` before exposing Paisa through the proxy.
|
`user_accounts` before exposing Paisa through the proxy.
|
||||||
|
|||||||
+1
-2
@@ -6,8 +6,7 @@ services:
|
|||||||
restart: ${PAISA_RESTART:-unless-stopped}
|
restart: ${PAISA_RESTART:-unless-stopped}
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
- ${PAISA_LEDGER_PATH:-/data/paisa}:/root/Documents/paisa
|
- ${VOL_PATH:-/data}/paisa:/root/Documents/paisa
|
||||||
- ${VOL_PATH:-/data}/paisa:/var/lib/paisa
|
|
||||||
|
|
||||||
ports:
|
ports:
|
||||||
- "${PAISA_PORT:-7500}:7500"
|
- "${PAISA_PORT:-7500}:7500"
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
# paisa.db lives in VOL_PATH; ignore it if both paths point at the same folder
|
# paisa.db is a rebuildable cache next to paisa.yaml; keep it out of git
|
||||||
paisa.db
|
paisa.db
|
||||||
paisa.db-*
|
paisa.db-*
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
# Paisa starter config — copy this folder into ${VOL_PROJECTS:-/data}/paisa (git repo)
|
# Paisa starter config — copy this folder into ${VOL_PATH:-/data/paisa} (git repo)
|
||||||
# Reference: https://paisa.fyi/reference/config/
|
# Reference: https://paisa.fyi/reference/config/
|
||||||
|
|
||||||
# Relative paths resolve from this file's directory (in git)
|
# Relative paths resolve from this file's directory (in git)
|
||||||
journal_path: main.ledger
|
journal_path: main.ledger
|
||||||
sheets_directory: sheets
|
sheets_directory: sheets
|
||||||
|
|
||||||
# Database is not in git: ${VOL_PATH:-/data}/paisa, backed up by restic
|
# Database sits next to this file; .gitignore keeps it out of git
|
||||||
db_path: /var/lib/paisa/paisa.db
|
db_path: paisa.db
|
||||||
|
|
||||||
# ledger | hledger | beancount (hledger/beancount need the matching image tag)
|
# ledger | hledger | beancount (hledger/beancount need the matching image tag)
|
||||||
ledger_cli: ledger
|
ledger_cli: ledger
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
# paisa.db lives in VOL_PATH; ignore it if both paths point at the same folder
|
# paisa.db is a rebuildable cache next to paisa.yaml; keep it out of git
|
||||||
paisa.db
|
paisa.db
|
||||||
paisa.db-*
|
paisa.db-*
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
; Demolition Company Ltd. — demo books (BC, Canada)
|
; Demolition Company Ltd. — demo books (BC, Canada)
|
||||||
; Ledger git repo: ${VOL_PROJECTS:-/data}/paisa, mounted at /root/Documents/paisa
|
; Ledger git repo: ${VOL_PATH:-/data/paisa}, mounted at /root/Documents/paisa
|
||||||
; Incorporated in BC on 2025/12/01; fiscal year end December 31
|
; Incorporated in BC on 2025/12/01; fiscal year end December 31
|
||||||
; Sales tax: GST 5% (federal) + PST 7% (BC)
|
; Sales tax: GST 5% (federal) + PST 7% (BC)
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
# Paisa config for Demolition Company Ltd. (demo)
|
# Paisa config for Demolition Company Ltd. (demo)
|
||||||
# Incorporated in BC 2025/12/01; 100 shares (66 Class A voting, 34 Class B non-voting)
|
# Incorporated in BC 2025/12/01; 100 shares (66 Class A voting, 34 Class B non-voting)
|
||||||
# Git repo: ${VOL_PROJECTS:-/data}/paisa, mounted at /root/Documents/paisa
|
# Git repo: ${VOL_PATH:-/data/paisa}, mounted at /root/Documents/paisa
|
||||||
# Reference: https://paisa.fyi/reference/config/
|
# Reference: https://paisa.fyi/reference/config/
|
||||||
|
|
||||||
# Relative paths resolve from this file's directory (in git)
|
# Relative paths resolve from this file's directory (in git)
|
||||||
journal_path: main.ledger
|
journal_path: main.ledger
|
||||||
sheets_directory: sheets
|
sheets_directory: sheets
|
||||||
|
|
||||||
# Database is not in git: ${VOL_PATH:-/data}/paisa, backed up by restic
|
# Database sits next to this file; .gitignore keeps it out of git
|
||||||
db_path: /var/lib/paisa/paisa.db
|
db_path: paisa.db
|
||||||
|
|
||||||
# ledger | hledger | beancount (hledger/beancount need the matching image tag)
|
# ledger | hledger | beancount (hledger/beancount need the matching image tag)
|
||||||
ledger_cli: ledger
|
ledger_cli: ledger
|
||||||
|
|||||||
+11
-16
@@ -15,7 +15,7 @@ Paisa before entering your own books. All figures are made up.
|
|||||||
| `2025.ledger` | Incorporation, share issue, equipment purchase (Dec 2025) |
|
| `2025.ledger` | Incorporation, share issue, equipment purchase (Dec 2025) |
|
||||||
| `2026.ledger` | January and February 2026 transactions |
|
| `2026.ledger` | January and February 2026 transactions |
|
||||||
| `sheets/` | Paisa sheet with 2025 and 2026 tax estimates |
|
| `sheets/` | Paisa sheet with 2025 and 2026 tax estimates |
|
||||||
| `.gitignore` | Keeps `paisa.db` out of git if both paths share a folder |
|
| `.gitignore` | Keeps `paisa.db` out of git |
|
||||||
|
|
||||||
## The company
|
## The company
|
||||||
|
|
||||||
@@ -113,35 +113,30 @@ loan, a credit card, and a savings transfer toward an excavator fund.
|
|||||||
|
|
||||||
## Where the files go
|
## Where the files go
|
||||||
|
|
||||||
| Data | Host path | In git? |
|
Everything lives in one folder, `${VOL_PATH:-/data/paisa}`: the
|
||||||
| ----------------------------- | ---------------------------- | ------- |
|
`paisa.yaml` and `*.ledger` files (in git) and `paisa.db` (a cache,
|
||||||
| `paisa.yaml`, `*.ledger` | `${PAISA_LEDGER_PATH:-/data/paisa}` | Yes |
|
ignored by `.gitignore`).
|
||||||
| `paisa.db` (SQLite) | `${VOL_PATH:-/data}/paisa` | No, backed up by restic |
|
|
||||||
|
|
||||||
Out of the box both are `/data/paisa`.
|
|
||||||
|
|
||||||
## Load the demo
|
## Load the demo
|
||||||
|
|
||||||
1. Clone this repo somewhere on the Docker host, e.g.:
|
1. Clone this repo somewhere on the Docker host, e.g.:
|
||||||
```bash
|
```bash
|
||||||
cd /data/paisa
|
cd /data
|
||||||
git clone https://github.com/nickyeoman/docker-compose-cookbooks.git
|
git clone https://github.com/nickyeoman/docker-compose-cookbooks.git
|
||||||
```
|
```
|
||||||
2. In Dockhand, set the stack's environment variable to the demo folder:
|
2. In Dockhand, point the stack at the demo folder:
|
||||||
```env
|
```env
|
||||||
PAISA_LEDGER_PATH=/data/paisa/docker-compose-cookbooks/paisa/demo
|
VOL_PATH=/data/docker-compose-cookbooks/paisa/demo
|
||||||
```
|
```
|
||||||
The path is used as-is, so the ledger comes straight from the clone.
|
The path is used as-is. Paisa writes `paisa.db` into that folder;
|
||||||
The database stays in `${VOL_PATH:-/data}/paisa` (from `db_path` in
|
`demo/.gitignore` keeps it out of git.
|
||||||
`demo/paisa.yaml`).
|
|
||||||
3. Redeploy the stack and open http://localhost:7500 (or the host's
|
3. Redeploy the stack and open http://localhost:7500 (or the host's
|
||||||
address or proxy hostname if you're not on the Docker host).
|
address or proxy hostname if you're not on the Docker host).
|
||||||
|
|
||||||
## Switch back to your own books
|
## Switch back to your own books
|
||||||
|
|
||||||
Set `PAISA_LEDGER_PATH` back to your books (default `/data/paisa`) and
|
Set `VOL_PATH` back to your books (default `/data/paisa`) and redeploy.
|
||||||
redeploy. Paisa rebuilds `paisa.db` from the ledger files, so the demo
|
The demo's `paisa.db` stays in the clone and can be deleted any time.
|
||||||
data in it is replaced on the next sync.
|
|
||||||
|
|
||||||
## Start your own books
|
## Start your own books
|
||||||
|
|
||||||
|
|||||||
+1
-2
@@ -1,5 +1,4 @@
|
|||||||
PAISA_IMAGE=ananthakumaran/paisa:latest
|
PAISA_IMAGE=ananthakumaran/paisa:latest
|
||||||
PAISA_RESTART=unless-stopped
|
PAISA_RESTART=unless-stopped
|
||||||
VOL_PATH=/data
|
VOL_PATH=/data/paisa
|
||||||
PAISA_LEDGER_PATH=/data/paisa
|
|
||||||
PAISA_PORT=7500
|
PAISA_PORT=7500
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
# paisa.db lives in VOL_PATH; ignore it if both paths point at the same folder
|
# paisa.db is a rebuildable cache next to paisa.yaml; keep it out of git
|
||||||
paisa.db
|
paisa.db
|
||||||
paisa.db-*
|
paisa.db-*
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
; TODO: Business Name Ltd. — books (BC, Canada)
|
; TODO: Business Name Ltd. — books (BC, Canada)
|
||||||
; Ledger git repo: ${VOL_PROJECTS:-/data}/paisa, mounted at /root/Documents/paisa
|
; Ledger git repo: ${VOL_PATH:-/data/paisa}, mounted at /root/Documents/paisa
|
||||||
; TODO: incorporation date and fiscal year end
|
; TODO: incorporation date and fiscal year end
|
||||||
; Sales tax: GST 5% (federal) + PST 7% (BC)
|
; Sales tax: GST 5% (federal) + PST 7% (BC)
|
||||||
;
|
;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Paisa template for a new business — copy this folder into ${VOL_PROJECTS:-/data}/paisa (git repo)
|
# Paisa template for a new business — copy this folder into ${VOL_PATH:-/data/paisa} (git repo)
|
||||||
# Fill in the TODOs here and in accounts.ledger, then start recording in the year file.
|
# Fill in the TODOs here and in accounts.ledger, then start recording in the year file.
|
||||||
# Reference: https://paisa.fyi/reference/config/
|
# Reference: https://paisa.fyi/reference/config/
|
||||||
|
|
||||||
@@ -6,8 +6,8 @@
|
|||||||
journal_path: main.ledger
|
journal_path: main.ledger
|
||||||
sheets_directory: sheets
|
sheets_directory: sheets
|
||||||
|
|
||||||
# Database is not in git: ${VOL_PATH:-/data}/paisa, backed up by restic
|
# Database sits next to this file; .gitignore keeps it out of git
|
||||||
db_path: /var/lib/paisa/paisa.db
|
db_path: paisa.db
|
||||||
|
|
||||||
# ledger | hledger | beancount (hledger/beancount need the matching image tag)
|
# ledger | hledger | beancount (hledger/beancount need the matching image tag)
|
||||||
ledger_cli: ledger
|
ledger_cli: ledger
|
||||||
|
|||||||
Reference in New Issue
Block a user