aboutsummaryrefslogtreecommitdiff
path: root/readme.md
blob: 544bb063c8c493ea15ee2a8807d813d103a5cb5f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Abrechenbarkeit v2

A _simpler_ trust based ledger.

The entire application is contained within `abrechenbarkeit.lua`. This script
implements CGI. It was tested against Lua version 5.4.7. Application data is
stored in a number of files in the process working directory (See below).

The repository also contains a configuration file for the
[gnix http server](https://codeberg.org/metamuffin/gnix) (`gnix.yaml`) which is
useful for development or proxyless deployments.

## Data Files

- `log` stores the transaction log as CSV (`time,user_a,user_b,amount,pcode,pcount,comment`)
- `products` stores the product list as CSV (`barcode,price,user,name`)
- `config` stores configuration parameters as ESV (`key=value`)
  - `transaction_sound`: URL to sound played when creating a transaction

## Migration from Strichliste

```
curl 'http://strichliste.example.org/api/user?deleted=false' | jq -r '.users.[] | [ 0, "@Potential", .name, .balance, "", "", "" ] | join(",")' > log
curl 'http://strichliste.example.org/api/article' | jq -r '.articles.[] | [ .barcode, .amount, "@Drinks", .name ] | join(",")' > products
```

## Non-linked User lists

- list of Users with negative balance: `http://abrechenbarkeit.example.org/?negative`
- list of Users with balance lower than <amount>: `http://abrechenbarkeit.example.org/?negative&maximum=<amount>`