hledger-web 1.43 → 1.43.1
raw patch · 10 files changed
+720/−103 lines, 10 filesdep ~hledgerdep ~hledger-lib
Dependency ranges changed: hledger, hledger-lib
Files
- CHANGES.md +7/−0
- Hledger/Web/Handler/MiscR.hs +1/−2
- Hledger/Web/Handler/RegisterR.hs +1/−1
- Hledger/Web/Main.hs +1/−1
- Hledger/Web/Test.hs +1/−1
- config/openapi.yaml +610/−0
- hledger-web.1 +2/−2
- hledger-web.cabal +8/−7
- hledger-web.info +10/−10
- hledger-web.txt +79/−79
CHANGES.md view
@@ -22,6 +22,13 @@ See also the hledger changelog. +# 1.43.1 2025-06-04++Fixes++- Fixed a compilation error when not in the hledger source tree. [#2397]++ # 1.43 2025-06-01 Features
Hledger/Web/Handler/MiscR.hs view
@@ -26,7 +26,6 @@ import qualified Data.Text as T import qualified Data.Yaml as Yaml import qualified Data.ByteString as BS-import Data.FileEmbed (embedFile) import Yesod.Default.Handlers (getFaviconR, getRobotsR) import Hledger@@ -112,7 +111,7 @@ accountTransactionsReport rspec{_rsQuery=Any} j thisacctq openApiYaml :: BS.ByteString-openApiYaml = $(embedFile "config/openapi.yaml")+openApiYaml = $(embedFileRelative "config/openapi.yaml") getOpenApiR :: Handler Value getOpenApiR =
Hledger/Web/Handler/RegisterR.hs view
@@ -93,7 +93,7 @@ let (link, xs1) = span (isJust . fst) xs0 (comma, xs2) = span (isNothing . fst) xs1 in (acct, (map snd link, map snd comma)) : undecorateLinks xs2- _ -> error "link name not decorated with account" -- PARTIAL:+ _ -> error' "link name not decorated with account" -- PARTIAL: decorateLinks :: [(acct, ([char], [char]))] -> [(Maybe acct, char)] decorateLinks = concatMap $ \(acct, (name, comma)) ->
Hledger/Web/Main.hs view
@@ -161,7 +161,7 @@ when (isSocket sockstat) $ removeFile s ) (\sock -> Network.Wai.Handler.Warp.runSettingsSocket warpsettings sock app)- else error $ unlines+ else error' $ unlines ["Unix domain sockets are not available on your operating system." ,"Please try again without --socket." ]
Hledger/Web/Test.hs view
@@ -136,7 +136,7 @@ ," assets 10" ," income" ])- j <- fmap (either error id) . runExceptT $ journalFinalise iopts f "" pj -- PARTIAL: journalFinalise should not fail+ j <- fmap (either error' id) . runExceptT $ journalFinalise iopts f "" pj -- PARTIAL: journalFinalise should not fail runTests "hledger-web with --forecast" rawopts j $ do yit "shows forecasted transactions" $ do
+ config/openapi.yaml view
@@ -0,0 +1,610 @@+# This is an OpenAPI Spec of hledger-web's JSON-over-HTTP API:+#+# https://hledger.org/hledger-web.html#json-api+#+# Originally generated by openapi-devtools:+#+# https://github.com/AndrewWalsh/openapi-devtools+# https://github.com/OpenAPITools/openapi-generator/blob/master/docs/generators/haskell-yesod.md+#+# and then modified by hand.+++openapi: 3.1.0++info:+ title: hledger-web API+ description: >+ Provides interaction with hledger, the plaintext accounting tool powered by+ Haskell. Lookup account details, balances, commodity prices, and+ transactions.+ version: 1.0.0++servers:+- url: http://127.0.0.1:5000+ description: Locally hosted server for hledger-web API+++paths:++ /version:+ get:+ summary: The hledger version+ description: Returns the hledger version that powers this API as a SemVer string.+ operationId: hledger_version+ responses:+ "200":+ description: Successful Response+ content:+ application/json:+ schema: {}+ security:+ - apikey_cookie__session: []+ - apikey_header_cookie: []++ /accountnames:+ get:+ summary: Account names+ description: Returns all of the account names in a JSON array+ operationId: hledger_account_names+ responses:+ "200":+ description: Successful Response+ content:+ application/json:+ schema:+ items: {}+ security:+ - apikey_cookie__session: []+ - apikey_header_cookie: []++ /transactions:+ get:+ summary: Transaction query+ description: >+ Queries the journal for transactions (txs). Returns a list of JSON+ objects describing the tx postings.+ responses:+ "200":+ description: Successful Response+ content:+ application/json:+ schema:+ items:+ required:+ - tcode+ - tcomment+ - tdate+ - tdate2+ - tdescription+ - tindex+ - tpostings+ - tprecedingcomment+ - tsourcepos+ - tstatus+ - ttags+ properties:+ tcode: {}+ tcomment: {}+ tdate: {}+ tdate2: {}+ tdescription: {}+ tindex: {}+ tpostings:+ items:+ required:+ - paccount+ - pamount+ - pbalanceassertion+ - pcomment+ - pdate+ - pdate2+ - poriginal+ - pstatus+ - ptags+ - ptransaction_+ - ptype+ properties:+ paccount: {}+ pamount:+ items:+ required:+ - acommodity+ - acost+ - aquantity+ - astyle+ properties:+ acommodity: {}+ acost:+ anyOf:+ - {}+ - required:+ - contents+ - tag+ properties:+ contents:+ required:+ - acommodity+ - acost+ - aquantity+ - astyle+ properties:+ acommodity: {}+ acost: {}+ aquantity:+ required:+ - decimalMantissa+ - decimalPlaces+ - floatingPoint+ properties:+ decimalMantissa: {}+ decimalPlaces: {}+ floatingPoint: {}+ astyle:+ required:+ - ascommodityside+ - ascommodityspaced+ - asdecimalmark+ - asdigitgroups+ - asprecision+ - asrounding+ properties:+ ascommodityside: {}+ ascommodityspaced: {}+ asdecimalmark: {}+ asdigitgroups: {}+ asprecision: {}+ asrounding: {}+ tag: {}+ aquantity:+ required:+ - decimalMantissa+ - decimalPlaces+ - floatingPoint+ properties:+ decimalMantissa: {}+ decimalPlaces: {}+ floatingPoint: {}+ astyle:+ required:+ - ascommodityside+ - ascommodityspaced+ - asdecimalmark+ - asdigitgroups+ - asprecision+ - asrounding+ properties:+ ascommodityside: {}+ ascommodityspaced: {}+ asdecimalmark: {}+ asdigitgroups: {}+ asprecision: {}+ asrounding: {}+ pbalanceassertion: {}+ pcomment: {}+ pdate: {}+ pdate2: {}+ poriginal: {}+ pstatus: {}+ ptags: {}+ ptransaction_: {}+ ptype: {}+ tprecedingcomment: {}+ tsourcepos:+ items:+ required:+ - sourceColumn+ - sourceLine+ - sourceName+ properties:+ sourceColumn: {}+ sourceLine: {}+ sourceName: {}+ tstatus: {}+ ttags: {}+ security:+ - apikey_cookie__session: []+ - apikey_header_cookie: []++ /prices:+ get:+ summary: Commodity prices+ description: >+ Queries the journal for commodity prices. Returns a list of JSON objects+ with commodity price information.+ operationId: hledger_commodity_prices+ responses:+ "200":+ description: Successful Response+ content:+ application/json:+ schema:+ items:+ required:+ - mpdate+ - mpfrom+ - mprate+ - mpto+ properties:+ mpdate: {}+ mpfrom: {}+ mprate:+ required:+ - decimalMantissa+ - decimalPlaces+ - floatingPoint+ properties:+ decimalMantissa: {}+ decimalPlaces: {}+ floatingPoint: {}+ mpto: {}+ security:+ - apikey_cookie__session: []+ - apikey_header_cookie: []++ /commodities:+ get:+ operationId: hledger_commodity_symbols+ summary: Commodity symbols+ description: >+ List all tracked commodities in the ledger. Returns a JSON list of+ strings of commodity symbols+ responses:+ "200":+ description: Successful Response+ content:+ application/json:+ schema:+ items: {}+ security:+ - apikey_cookie__session: []+ - apikey_header_cookie: []++ /accounts:+ get:+ operationId: hledger_accounts+ summary: Account information+ description: >+ Queries the journal for account information. Returns a JSON list of+ account objects+ responses:+ "200":+ description: Successful Response+ content:+ application/json:+ schema:+ items:+ required:+ - aboring+ - adeclarationinfo+ - aebalance+ - aibalance+ - aname+ - anumpostings+ - aparent_+ - asubs+ - asubs_+ properties:+ aname: {}+ adeclarationinfo: {}+ aebalance:+ items:+ required:+ - acommodity+ - acost+ - aquantity+ - astyle+ properties:+ acommodity: {}+ acost:+ anyOf:+ - {}+ - required:+ - contents+ - tag+ properties:+ contents:+ required:+ - acommodity+ - acost+ - aquantity+ - astyle+ properties:+ acommodity: {}+ acost: {}+ aquantity:+ required:+ - decimalMantissa+ - decimalPlaces+ - floatingPoint+ properties:+ decimalMantissa: {}+ decimalPlaces: {}+ floatingPoint: {}+ astyle:+ required:+ - ascommodityside+ - ascommodityspaced+ - asdecimalmark+ - asdigitgroups+ - asprecision+ - asrounding+ properties:+ ascommodityside: {}+ ascommodityspaced: {}+ asdecimalmark: {}+ asdigitgroups: {}+ asprecision: {}+ asrounding: {}+ tag: {}+ aquantity:+ required:+ - decimalMantissa+ - decimalPlaces+ - floatingPoint+ properties:+ decimalMantissa: {}+ decimalPlaces: {}+ floatingPoint: {}+ astyle:+ required:+ - ascommodityside+ - ascommodityspaced+ - asdecimalmark+ - asdigitgroups+ - asprecision+ - asrounding+ properties:+ ascommodityside: {}+ ascommodityspaced: {}+ asdecimalmark: {}+ asdigitgroups: {}+ asprecision: {}+ asrounding: {}+ aibalance:+ items:+ required:+ - acommodity+ - acost+ - aquantity+ - astyle+ properties:+ acommodity: {}+ acost:+ anyOf:+ - {}+ - required:+ - contents+ - tag+ properties:+ contents:+ required:+ - acommodity+ - acost+ - aquantity+ - astyle+ properties:+ acommodity: {}+ acost: {}+ aquantity:+ required:+ - decimalMantissa+ - decimalPlaces+ - floatingPoint+ properties:+ decimalMantissa: {}+ decimalPlaces: {}+ floatingPoint: {}+ astyle:+ required:+ - ascommodityside+ - ascommodityspaced+ - asdecimalmark+ - asdigitgroups+ - asprecision+ - asrounding+ properties:+ ascommodityside: {}+ ascommodityspaced: {}+ asdecimalmark: {}+ asdigitgroups: {}+ asprecision: {}+ asrounding: {}+ tag: {}+ aquantity:+ required:+ - decimalMantissa+ - decimalPlaces+ - floatingPoint+ properties:+ decimalMantissa: {}+ decimalPlaces: {}+ floatingPoint: {}+ astyle:+ required:+ - ascommodityside+ - ascommodityspaced+ - asdecimalmark+ - asdigitgroups+ - asprecision+ - asrounding+ properties:+ ascommodityside: {}+ ascommodityspaced: {}+ asdecimalmark: {}+ asdigitgroups: {}+ asprecision: {}+ asrounding: {}+ anumpostings: {}+ aboring: {}+ aparent_: {}+ asubs_:+ items: {}+ asubs: {}+ security:+ - apikey_cookie__session: []+ - apikey_header_cookie: []++ /accounttransactions/{name}:+ get:+ operationId: hledger_account_txs+ summary: Account transactions+ description: >+ List transactions in the requested account. Returns a JSON list of+ transaction objects (txs).+ parameters:+ - name: name+ in: path+ required: true+ description: The account name to lookup+ schema:+ type: string+ responses:+ "200":+ description: Successful Response+ content:+ application/json:+ schema:+ items:+ items:+ anyOf:+ - {}+ - items:+ required:+ - acommodity+ - acost+ - aquantity+ - astyle+ properties:+ acommodity: {}+ acost: {}+ aquantity:+ required:+ - decimalMantissa+ - decimalPlaces+ - floatingPoint+ properties:+ decimalMantissa: {}+ decimalPlaces: {}+ floatingPoint: {}+ astyle:+ required:+ - ascommodityside+ - ascommodityspaced+ - asdecimalmark+ - asdigitgroups+ - asprecision+ - asrounding+ properties:+ ascommodityside: {}+ ascommodityspaced: {}+ asdecimalmark: {}+ asdigitgroups: {}+ asprecision: {}+ asrounding: {}+ - required:+ - tcode+ - tcomment+ - tdate+ - tdate2+ - tdescription+ - tindex+ - tpostings+ - tprecedingcomment+ - tsourcepos+ - tstatus+ - ttags+ properties:+ tcode: {}+ tcomment: {}+ tdate: {}+ tdate2: {}+ tdescription: {}+ tindex: {}+ tpostings:+ items:+ required:+ - paccount+ - pamount+ - pbalanceassertion+ - pcomment+ - pdate+ - pdate2+ - poriginal+ - pstatus+ - ptags+ - ptransaction_+ - ptype+ properties:+ paccount: {}+ pamount:+ items:+ required:+ - acommodity+ - acost+ - aquantity+ - astyle+ properties:+ acommodity: {}+ acost: {}+ aquantity:+ required:+ - decimalMantissa+ - decimalPlaces+ - floatingPoint+ properties:+ decimalMantissa: {}+ decimalPlaces: {}+ floatingPoint: {}+ astyle:+ required:+ - ascommodityside+ - ascommodityspaced+ - asdecimalmark+ - asdigitgroups+ - asprecision+ - asrounding+ properties:+ ascommodityside: {}+ ascommodityspaced: {}+ asdecimalmark: {}+ asdigitgroups: {}+ asprecision: {}+ asrounding: {}+ pbalanceassertion: {}+ pcomment: {}+ pdate: {}+ pdate2: {}+ poriginal: {}+ pstatus: {}+ ptags: {}+ ptransaction_: {}+ ptype: {}+ tprecedingcomment: {}+ tsourcepos:+ items:+ required:+ - sourceColumn+ - sourceLine+ - sourceName+ properties:+ sourceColumn: {}+ sourceLine: {}+ sourceName: {}+ tstatus: {}+ ttags: {}+ security:+ - apikey_cookie__session: []+ - apikey_header_cookie: []++components:+ schemas: {}+ securitySchemes:+ apikey_cookie__session:+ type: apiKey+ name: _session+ in: cookie+ apikey_header_cookie:+ type: apiKey+ name: COOKIE+ in: header
hledger-web.1 view
@@ -1,5 +1,5 @@ -.TH "HLEDGER\-WEB" "1" "May 2025" "hledger-web-1.43 " "hledger User Manuals"+.TH "HLEDGER\-WEB" "1" "June 2025" "hledger-web-1.43.1 " "hledger User Manuals" @@ -17,7 +17,7 @@ .PD \f[CR]hledger web \-\- [OPTS] [QUERY]\f[R] .SH DESCRIPTION-This manual is for hledger\[aq]s web interface, version 1.43.+This manual is for hledger\[aq]s web interface, version 1.43.1. See also the hledger manual for common concepts and file formats. .PP hledger is a robust, user\-friendly, cross\-platform set of programs for
hledger-web.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack name: hledger-web-version: 1.43+version: 1.43.1 synopsis: Web user interface for the hledger accounting system description: A simple web user interface for the hledger accounting system, providing a more modern UI than the command-line or terminal interfaces.@@ -28,12 +28,13 @@ license-file: LICENSE build-type: Simple tested-with:- ghc==8.10.7, ghc==9.0.2, ghc==9.2.8, ghc==9.4.8, ghc==9.6.7, ghc==9.8.4, ghc==9.10.1+ ghc==8.10.7, ghc==9.0.2, ghc==9.2.8, ghc==9.4.8, ghc==9.6.7, ghc==9.8.4, ghc==9.10.2, ghc==9.12.1 extra-source-files: CHANGES.md README.md config/favicon.ico config/keter.yaml+ config/openapi.yaml config/robots.txt config/routes config/settings.yml@@ -158,7 +159,7 @@ hs-source-dirs: ./ ghc-options: -Wall -Wredundant-constraints -Wincomplete-record-updates -Wincomplete-uni-patterns- cpp-options: -DVERSION="1.43"+ cpp-options: -DVERSION="1.43.1" build-depends: Decimal >=0.5.1 , aeson >=1 && <2.3@@ -180,8 +181,8 @@ , filepath , githash >=0.1.6.2 , hjsmin- , hledger ==1.43.*- , hledger-lib ==1.43.*+ , hledger >=1.43.1 && <1.44+ , hledger-lib >=1.43.1 && <1.44 , hspec , http-client , http-conduit@@ -228,7 +229,7 @@ hs-source-dirs: app ghc-options: -Wall -Wredundant-constraints -Wincomplete-record-updates -Wincomplete-uni-patterns -with-rtsopts=-T- cpp-options: -DVERSION="1.43"+ cpp-options: -DVERSION="1.43.1" build-depends: base >=4.14 && <4.22 , hledger-web@@ -250,7 +251,7 @@ hs-source-dirs: test ghc-options: -Wall -Wredundant-constraints -Wincomplete-record-updates -Wincomplete-uni-patterns- cpp-options: -DVERSION="1.43"+ cpp-options: -DVERSION="1.43.1" build-depends: base >=4.14 && <4.22 , hledger-web
hledger-web.info view
@@ -18,7 +18,7 @@ or 'hledger web -- [OPTS] [QUERY]' - This manual is for hledger's web interface, version 1.43. See also+ This manual is for hledger's web interface, version 1.43.1. See also the hledger manual for common concepts and file formats. hledger is a robust, user-friendly, cross-platform set of programs@@ -525,15 +525,15 @@ Tag Table: Node: Top223-Node: OPTIONS2578-Node: PERMISSIONS11267-Node: EDITING UPLOADING DOWNLOADING12417-Node: RELOADING13432-Node: JSON API13999-Node: DEBUG OUTPUT19648-Node: Debug output19800-Node: ENVIRONMENT20318-Node: BUGS20554+Node: OPTIONS2580+Node: PERMISSIONS11269+Node: EDITING UPLOADING DOWNLOADING12419+Node: RELOADING13434+Node: JSON API14001+Node: DEBUG OUTPUT19650+Node: Debug output19802+Node: ENVIRONMENT20320+Node: BUGS20556 End Tag Table
hledger-web.txt view
@@ -11,38 +11,38 @@ hledger web -- [OPTS] [QUERY] DESCRIPTION- This manual is for hledger's web interface, version 1.43. See also the- hledger manual for common concepts and file formats.+ This manual is for hledger's web interface, version 1.43.1. See also+ the hledger manual for common concepts and file formats. - hledger is a robust, user-friendly, cross-platform set of programs for- tracking money, time, or any other commodity, using double-entry ac-- counting and a simple, editable file format. hledger is inspired by- and largely compatible with ledger(1), and largely interconvertible+ hledger is a robust, user-friendly, cross-platform set of programs for+ tracking money, time, or any other commodity, using double-entry ac-+ counting and a simple, editable file format. hledger is inspired by+ and largely compatible with ledger(1), and largely interconvertible with beancount(1). - hledger-web is a simple web application for browsing and adding trans-- actions. It provides a more user-friendly UI than the hledger CLI or- hledger-ui TUI, showing more at once (accounts, the current account+ hledger-web is a simple web application for browsing and adding trans-+ actions. It provides a more user-friendly UI than the hledger CLI or+ hledger-ui TUI, showing more at once (accounts, the current account register, balance charts) and allowing history-aware data entry, inter- active searching, and bookmarking. - hledger-web also lets you share a journal with multiple users, or even- the public web. There is no access control, so if you need that you- should put it behind a suitable web proxy. As a small protection- against data loss when running an unprotected instance, it writes a+ hledger-web also lets you share a journal with multiple users, or even+ the public web. There is no access control, so if you need that you+ should put it behind a suitable web proxy. As a small protection+ against data loss when running an unprotected instance, it writes a numbered backup of the main journal file (only) on every edit. - Like hledger, it reads from (and appends to) a journal file specified- by the LEDGER_FILE environment variable (defaulting to- $HOME/.hledger.journal); or you can specify files with -f options. It- can also read timeclock files, timedot files, or any CSV/SSV/TSV file+ Like hledger, it reads from (and appends to) a journal file specified+ by the LEDGER_FILE environment variable (defaulting to+ $HOME/.hledger.journal); or you can specify files with -f options. It+ can also read timeclock files, timedot files, or any CSV/SSV/TSV file with a date field. (See hledger(1) -> Input for details.) hledger-web can be run in three modes: o --serve-browse mode (the default): the app serves the web UI and JSON- API, and opens your default web browser to show the app if possible,- and exits automatically after two minutes of inactivity (with no re-+ API, and opens your default web browser to show the app if possible,+ and exits automatically after two minutes of inactivity (with no re- quests received and no open browser windows viewing it). o --serve: the app just serves the web UI and JSON API.@@ -75,28 +75,28 @@ runner args may follow a --, eg: hledger-web --test -- --help - By default hledger-web listens only on IP address 127.0.0.1, which be+ By default hledger-web listens only on IP address 127.0.0.1, which be accessed only from the local machine. To allow access from elsewhere, use --host to specify an externally ac-- cessible address configured on this machine, The special address+ cessible address configured on this machine, The special address 0.0.0.0 causes it to listen on all of this machine's addresses. - Similarly, you can use --port to listen on a TCP port other than 5000.- This is useful if you want to run multiple hledger-web instances on a+ Similarly, you can use --port to listen on a TCP port other than 5000.+ This is useful if you want to run multiple hledger-web instances on a machine. - When --socket is used, hledger-web creates and communicates via a- socket file instead of a TCP port. This can be more secure, respects+ When --socket is used, hledger-web creates and communicates via a+ socket file instead of a TCP port. This can be more secure, respects unix file permissions, and makes certain use cases easier, such as run- ning per-user instances behind an nginx reverse proxy. (Eg: proxy_pass http://unix:/tmp/hledger/${remote_user}.socket;.) - You can use --base-url to change the protocol, hostname, port and path- that appear in hledger-web's hyperlinks. This is useful eg when inte-- grating hledger-web within a larger website. The default is- http://HOST:PORT/ using the server's configured host address and TCP- port (or http://HOST if PORT is 80). Note this affects url generation+ You can use --base-url to change the protocol, hostname, port and path+ that appear in hledger-web's hyperlinks. This is useful eg when inte-+ grating hledger-web within a larger website. The default is+ http://HOST:PORT/ using the server's configured host address and TCP+ port (or http://HOST if PORT is 80). Note this affects url generation but not route parsing. hledger-web also supports many of hledger's general options:@@ -182,74 +182,74 @@ --pager=YN use a pager when needed ? y/yes (default) or n/no --color=YNA --colour use ANSI color ? y/yes, n/no, or auto (default) - hledger-web shows accounts with zero balances by default (like- hledger-ui, and unlike hledger). Using the -E/--empty flag will re-- verse this behaviour. If you see accounts which appear to have a zero- balance, but cannot be hidden with -E, it's because they have a- mixed-cost balance, which looks like zero when costs are hidden.+ hledger-web shows accounts with zero balances by default (like+ hledger-ui, and unlike hledger). Using the -E/--empty flag will re-+ verse this behaviour. If you see accounts which appear to have a zero+ balance, but cannot be hidden with -E, it's because they have a+ mixed-cost balance, which looks like zero when costs are hidden. (hledger-web does not show costs.) - Reporting options and/or query arguments can be used to set an initial+ Reporting options and/or query arguments can be used to set an initial query, which although not shown in the UI, will restrict the data shown (in addition to any search query entered in the UI). - If you use the bash shell, you can auto-complete flags by pressing TAB- in the command line. If this is not working see Install > Shell com-+ If you use the bash shell, you can auto-complete flags by pressing TAB+ in the command line. If this is not working see Install > Shell com- pletions. PERMISSIONS- By default, hledger-web allows anyone who can reach it to view the+ By default, hledger-web allows anyone who can reach it to view the journal and to add new transactions, but not to change existing data. You can restrict who can reach it, by - o setting the IP address it listens on (see --host above). By default- it listens on 127.0.0.1, accessible to users on the local machine+ o setting the IP address it listens on (see --host above). By default+ it listens on 127.0.0.1, accessible to users on the local machine only. o putting it behind an authenticating proxy, such as caddy or apache o putting it behind a firewall - And you can restrict what the users reaching it can do, by specifying+ And you can restrict what the users reaching it can do, by specifying the --allow=ACCESSLEVEL option at startup. ACCESSLEVEL is one of: o view - allows viewing the journal file(s) o add - also allows adding new transactions to the main journal file - o edit - also allows editing, uploading or downloading the journal+ o edit - also allows editing, uploading or downloading the journal file(s) - o sandstorm - (for the hledger-web Sandstorm app:) allows whichever of- view, add, or edit are specified in the X-Sandstorm-Permissions HTTP+ o sandstorm - (for the hledger-web Sandstorm app:) allows whichever of+ view, add, or edit are specified in the X-Sandstorm-Permissions HTTP header The default access level is add. EDITING, UPLOADING, DOWNLOADING- If you enable the manage capability mentioned above, you'll see a new- "spanner" button to the right of the search form. Clicking this will- let you edit, upload, or download the journal file or any files it in-+ If you enable the manage capability mentioned above, you'll see a new+ "spanner" button to the right of the search form. Clicking this will+ let you edit, upload, or download the journal file or any files it in- cludes. - Note, unlike any other hledger command, in this mode you (or any visi-+ Note, unlike any other hledger command, in this mode you (or any visi- tor) can alter or wipe the data files. - Normally whenever a file is changed in this way, hledger-web saves a- numbered backup (assuming file permissions allow it, the disk is not- full, etc.) hledger-web is not aware of version control systems, cur-- rently; if you use one, you'll have to arrange to commit the changes+ Normally whenever a file is changed in this way, hledger-web saves a+ numbered backup (assuming file permissions allow it, the disk is not+ full, etc.) hledger-web is not aware of version control systems, cur-+ rently; if you use one, you'll have to arrange to commit the changes yourself (eg with a cron job or a file watcher like entr). - Changes which would leave the journal file(s) unparseable or non-valid- (eg with failing balance assertions) are prevented. (Probably. This+ Changes which would leave the journal file(s) unparseable or non-valid+ (eg with failing balance assertions) are prevented. (Probably. This needs re-testing.) RELOADING hledger-web detects changes made to the files by other means (eg if you- edit it directly, outside of hledger-web), and it will show the new- data when you reload the page or navigate to a new page. If a change+ edit it directly, outside of hledger-web), and it will show the new+ data when you reload the page or navigate to a new page. If a change makes a file unparseable, hledger-web will display an error message un- til the file has been fixed. @@ -257,8 +257,8 @@ that both machine clocks are roughly in step.) JSON API- In addition to the web UI, hledger-web also serves a JSON API that can- be used to get data or add new transactions. If you want the JSON API+ In addition to the web UI, hledger-web also serves a JSON API that can+ be used to get data or add new transactions. If you want the JSON API only, you can use the --serve-api flag. Eg: $ hledger-web -f examples/sample.journal --serve-api@@ -275,7 +275,7 @@ /accounttransactions/ACCOUNTNAME Eg, all account names in the journal (similar to the accounts command).- (hledger-web's JSON does not include newlines, here we use python to+ (hledger-web's JSON does not include newlines, here we use python to prettify it): $ curl -s http://127.0.0.1:5000/accountnames | python -m json.tool@@ -316,26 +316,26 @@ "aprice": null, ... - Most of the JSON corresponds to hledger's data types; for details of- what the fields mean, see the Hledger.Data.Json haddock docs and click- on the various data types, eg Transaction. And for a higher level un-+ Most of the JSON corresponds to hledger's data types; for details of+ what the fields mean, see the Hledger.Data.Json haddock docs and click+ on the various data types, eg Transaction. And for a higher level un- derstanding, see the journal docs. There is also a basic OpenAPI spec- ification. In some cases there is outer JSON corresponding to a "Report" type. To- understand that, go to the Hledger.Web.Handler.MiscR haddock and look- at the source for the appropriate handler to see what it returns. Eg+ understand that, go to the Hledger.Web.Handler.MiscR haddock and look+ at the source for the appropriate handler to see what it returns. Eg for /accounttransactions it's getAccounttransactionsR, returning a "ac-- countTransactionsReport ...". Looking up the haddock for that we can- see that /accounttransactions returns an AccountTransactionsReport,- which consists of a report title and a list of AccountTransactionsRe-+ countTransactionsReport ...". Looking up the haddock for that we can+ see that /accounttransactions returns an AccountTransactionsReport,+ which consists of a report title and a list of AccountTransactionsRe- portItem (etc). - You can add a new transaction to the journal with a PUT request to- /add, if hledger-web was started with the add capability (enabled by+ You can add a new transaction to the journal with a PUT request to+ /add, if hledger-web was started with the add capability (enabled by default). The payload must be the full, exact JSON representation of a- hledger transaction (partial data won't do). You can get sample JSON- from hledger-web's /transactions or /accounttransactions, or you can+ hledger transaction (partial data won't do). You can get sample JSON+ from hledger-web's /transactions or /accounttransactions, or you can export it with hledger-lib, eg like so: .../hledger$ stack ghci hledger-lib@@ -431,27 +431,27 @@ "tstatus": "Unmarked" } - And here's how to test adding it with curl. This should add a new en-+ And here's how to test adding it with curl. This should add a new en- try to your journal: $ curl http://127.0.0.1:5000/add -X PUT -H 'Content-Type: application/json' --data-binary @txn.json DEBUG OUTPUT Debug output- You can add --debug[=N] to the command line to log debug output. N+ You can add --debug[=N] to the command line to log debug output. N ranges from 1 (least output, the default) to 9 (maximum output). Typi-- cally you would start with 1 and increase until you are seeing enough.- Debug output goes to stderr, interleaved with the requests logged on+ cally you would start with 1 and increase until you are seeing enough.+ Debug output goes to stderr, interleaved with the requests logged on stdout. To capture debug output in a log file instead, you can usually redirect stderr, eg: hledger-web --debug=3 2>hledger-web.log. ENVIRONMENT- LEDGER_FILE The main journal file to use when not specified with+ LEDGER_FILE The main journal file to use when not specified with -f/--file. Default: $HOME/.hledger.journal. BUGS- We welcome bug reports in the hledger issue tracker+ We welcome bug reports in the hledger issue tracker (https://bugs.hledger.org), or on the hledger chat or mail list (https://hledger.org/support). @@ -477,4 +477,4 @@ SEE ALSO hledger(1), hledger-ui(1), hledger-web(1), ledger(1) -hledger-web-1.43 May 2025 HLEDGER-WEB(1)+hledger-web-1.43.1 June 2025 HLEDGER-WEB(1)