Skip to content

Releases

v1.4.0

Choose a tag to compare

@github-actions github-actions released this 28 Nov 17:51
c3d9743

Upgrade notes

  • Supervisor: on FAIL_NOT_LOGGED_IN from still_alive, the client now exits with status 1 instead of continuing; have the supervisor restart it on failure
  • Startup: the client now refuses to start with an empty Filesystem or SQLite cache while more than 20 static ranges are assigned, or on Filesystem if the disk cannot hold the cache size
  • Image proxy: a proxy set on the H@H settings page now takes effect; clear it there if the proxy is unreachable
  • Release archives no longer contain migrate-to-r2 or hath-bench
  • client-login: delete version, proxy and lruCacheSize, with their types and defaults, to silence the warning on startup (see Deprecated)
  • Library API: exports and signatures changed (see Changed)

Changed

  • Release archives ship only hs-hath and LICENSE (build migrate-to-r2 and hath-bench from source); Linux builds are static musl binaries for amd64 and arm64 without UPX
  • unix dependency is gated to non-Windows targets
  • Filesystem backend deletes blacklisted entries only if they are regular files
  • A failed login waits 5 s before exiting, 15 min on FAIL_STARTUP_LOOP
  • FAIL_NOT_LOGGED_IN from still_alive shuts down with exit status 1
  • Requests that miss the same file share one upstream download
  • Filesystem eviction works through the directory with the oldest file instead of rescanning the whole cache
  • Library: Hath.Cache.Filesystem exports openFsCache and evict instead of newFsCache and sweep; startServer returns an ExitCode; ServerOptions has skipStartupVerify; toldToStop returns Maybe Stop; locateResource takes the settings and fetchFile the image proxy

Added

  • Multi-arch Docker image (ghcr.io/pe200012/hs-hath, linux/amd64 and linux/arm64) on distroless nonroot, plus compose.yaml
  • --version reads HATH_BUILD_COMMIT at compile time when set
  • Windows build support and hs-hath-<version>-windows-x64.zip release archives (Ctrl+C and Ctrl+Break trigger graceful shutdown; closing the console window exits immediately)
  • Hath.Cache.FileStatus module for cross-platform file status and mtime lookups
  • RPC failover between the rpc_server_ip servers, as in the official client
  • Image proxy from the H@H settings page, for cache misses, proxy tests and retried gallery downloads
  • ETag, If-None-Match (304) and single byte ranges for cached files; Cache-Control adds immutable
  • Filesystem backend: totals saved at shutdown and reused at start; SHA-1 check of a file last served over a week ago; verify_cache and rescan_cache
  • Official startup checks: refuse an empty cache with more than 20 static ranges, and a disk too small for the cache size
  • No caching while less than diskremaining_bytes (at least 100 MiB) would be left free; gallery downloads pause under diskremaining_bytes + 1000 MiB

Removed

  • service/ (personal VPN/tunnel Dockerfile and compose file)

Deprecated

  • version, proxy and lruCacheSize in client-login: never used; they may now be omitted, trigger a warning if present, and will be removed
  • Library: Hath.Config deprecates version, proxy, lruCacheSize and ClientProxy

v1.3.0

Choose a tag to compare

@github-actions github-actions released this 18 Nov 15:11
8cc0aab

Upgrade notes

  • /metrics and /admin/settings answer only a request that sends Authorization: Bearer <token>, the token being the value of HATH_METRICS_TOKEN in the environment. Without the variable both are gone (404); a Prometheus scrape needs authorization: { credentials: <token> } (see Security)
  • Reverse proxy: behind a reverse proxy, run hs-hath with --trust-proxy-headers. Server commands are now accepted only from the addresses rpc_server_ip lists and from local ones (loopback, private), taken from the peer as flood control sees it. A proxy or tunnel on a local address that does not pass the reader's address on therefore still works: its commands are judged by their key alone, as every command was before
  • client_start failures: when client_start fails for a reason other than FAIL_OTHER_CLIENT_CONNECTED (another client connected) or FAIL_CID_IN_USE (client id in use), for example FAIL_CONNECT_TEST or no reply, the process stays up without announcing itself, as the official client does, instead of retrying every second. A supervisor will not restart it
  • Blacklist: blacklisted files are now deleted from the cache (SQLite, Filesystem and R2); before, the list was only printed
  • Certificate: a certificate with less than 24 h left is refused at start
  • Gallery layout: galleries are downloaded into a new directory layout, <downloadDir>/<title> [<gid>] (see Changed); files under the old <downloadDir>/<gid>/ are not recognised, so those galleries are fetched again
  • /h/ requests need valid fileindex and xres options even for cached files (404 otherwise), as with the official client
  • Library API: modules and exports were removed, and signatures changed (see Changed). Removed modules: Hath.Metrics.Counter, Hath.Metrics.Gauge, Hath.Metrics.Histogram, Hath.Metrics.Prometheus, Hath.Metrics.Registry, Hath.Metrics.Snapshot and Hath.Metrics.Types (Hath.Stats holds the counters and renders them). Removed exports: from Hath.Stats the Stats effect (Stats(..), runStats, readPrometheus) and the fields of StatsEnv; Hath.Cache.SQLite.FileRecord; Hath.Locate.streamUpstream; Hath.Gallery.Downloader.downloadNextGallery; the re-exports of CacheRunner(..) and GalleryTask(..) from Hath.Server; the constructor and fields of Hath.Server.FloodControl.IPRecord and its Hashable IP instance; the galleryFileCount field of Hath.Gallery.GalleryMetadata; the optShowVersion field of Hath.CLI.Options (the option parser answers --version itself); Hath.Server.Middleware.normalizeAcceptMiddleware and withHathHeaders

Security

  • Dependencies with published advisories: the snapshot is lts-24.67 (was lts-24.27), and stack.yaml and stack-release.yaml take warp-3.4.21 and http2-5.4.14 as extra dependencies, with http-semantics-0.4.2 and time-manager-0.5.2, which they need. warp before 3.4.17 could be made to read one request as two, which lets a request past a reverse proxy in front of it (HSEC-2026-0013); http2 before 5.4.14 took a CONNECT naming two hosts (HSEC-2026-0015); the snapshot brings aeson 2.2.5.1 (HSEC-2026-0007) and scientific 0.3.10.0 (HSEC-2026-0011). file-io is held at the compiler's 0.1.5. Still open: crypton-x509 1.7 does not enforce X.509 Name Constraints (HSEC-2026-0008); the fix is in 1.9.1, which tls 2.1 cannot be built with
  • /metrics and /admin/settings answered anyone who reached the port, and the second lists the RPC servers' addresses. They now need a token (see Upgrade notes), compared in constant time; a wrong or missing one gets 403
  • Flood control counts a request to any path, as the official client counts every connection; it only counted /h/, so /t/, /servercmd/ and the rest could be asked for without limit
  • Keys and signatures (keystamps, the keys of server commands and speed tests, the signature of an RPC reply, a gallery list's DLHASH) are compared in constant time, so the time a refusal takes says nothing about how close a guess was
  • Cache misses: a file being fetched is held in memory until it is cached, and every request for it meanwhile fetched it again, so one valid link asked for often enough could take all the memory. The downloads under way may now hold 512 MiB between them; past that a miss is answered 503 until some have finished (a single larger file is still fetched when nothing else is under way)
  • RPC replies longer than 10 MiB are refused, as by the official client. The RPC server is reached over plain HTTP, and a reply without end from whoever sits in between was read into memory until none was left
  • CI: the workflows' token is read-only except in the job that creates the release, and the actions that are not GitHub's own are pinned to a commit (the release image to a digest) instead of a tag that can be moved
  • .gitignore lists the files that hold secrets (client-login, .env, *.p12, service/client.toml, r2/wrangler.toml), so that they cannot be committed by accident

Changed

  • Gallery layout as in the official client: a gallery goes into <downloadDir>/<title> [<gid>], or [<gid>-<xres>x] for a resized one, its title cleaned up the same way and cut short with ... to max_filename_length (from the server's settings, 125 by default); it used to be <downloadDir>/<gid>/. If the file system will not take the name, the directory is <gid> or <gid>-<xres>x. A file already there and intact is kept, a damaged one deleted
  • Certificate refresh swaps the certificate in place for new handshakes instead of restarting the listener, so transfers in progress are no longer cut off and client_start is not re-sent
  • Filesystem backend: hits are sent from the file instead of being read into memory, and the least recently served files are evicted to stay under the disk limit from the H@H settings page (100 MiB below it, as the official client). Its per-request in-memory LRU, which never survived past one request, is gone
  • Metrics: hath_latency_seconds (a gauge holding the last request's latency in microseconds) is replaced by the histogram hath_request_duration_seconds; the always-zero hath_errors_total is removed. /metrics is rendered when it is read, not every 5 seconds by a background thread, so it shows current values and hath_uptime_seconds, which was always 0, counts; the other names, their order and the format are unchanged
  • client-login.example uses the Filesystem backend
  • Logs: failed TLS handshakes and connections that close before sending anything (scanners probing SSL3/TLS 1.0/1.1 and cipher suites, a few thousand a day on a public node) are no longer printed. The TLS 1.0/1.1 entries are dropped from the allowed versions; tls 2.x rejected them anyway
  • TLS session resumption (session IDs on TLS 1.2, tickets on TLS 1.3): a returning visitor skips the certificate and its RSA signature, which cuts the server's CPU per handshake by about 45 % on TLS 1.3 and 75 % on TLS 1.2 (several ms on a small VM)
  • Internals: the modules live under Hath.*, split by subject
  • /admin/settings lists only the settings the server assigns
  • The SQLite backend no longer records the file name a file was first requested under, and a hit no longer writes to the database (the lru_counter column, which nothing read, stays as it is)
  • R2 backend: a file just uploaded after a cache miss is redirected at once on its next request, instead of first asking the bucket whether it is there (a 40–350 ms round trip)
  • hath-bench writes the hs-hath config through ClientConfig's ToDhall instance instead of a hand-written copy of the record
  • RPC requests are sent as the official client sends them: the query carries clientbuild, act, add, cid, acttime, actkey in that order, add= even when empty, with the ; inside add unescaped. Requests to the RPC server, to image servers (cache misses) and for gallery files carry User-Agent: Hentai@Home 1.6.6 and, as in the official client, Connection: Close (RPC, gallery files) or Hath-Request (image servers), and nothing else: no longer our response headers (Cache-Control, Server, X-Content-Type-Options) or Accept-Encoding: gzip
  • RPC transport: a request whose exchange fails (no connection, a broken reply, an HTTP error other than 404/410) is sent again at once, three times in all, and a connection attempt gives up after 5 s, as in the official client. The reply may still take up to 60 s
  • Responses carry the official client's headers: Server, Connection: close, Content-Type and Content-Length, and Cache-Control only with a body; no more User-Agent or X-Content-Type-Options. An empty body says Content-Length: 0 where the official client says nothing and closes. An error is the official page, An error has occurred. (<status>) as text/html; charset=ISO-8859-1; so are the replies of server commands, and robots.txt is text/plain; charset=ISO-8859-1. A request other than GET or HEAD gets 400. As in the official client, the path is not percent-decoded except for %3d. Flood control's 429, and Range and If-Modified-Since for files from disk, are as they were
  • Library API (RPC): CallRPC and CallDownloader take add as Text, empty when there is none; HathError's TransportError carries a Text; serverStat returns () and fails unless the server answers OK; clientLogin and clientSettings need Embed IO; Hath.Protocol.clientBuild is an Int64. New: Hath.Settings.settingNumber, Hath.Protocol's rpcQuery, outgoingHeaders and retryWithServerTime, Hath.RPC.worthRetrying
  • Library API (stats, R2): `Hath....
Read more

v1.2.0

Choose a tag to compare

@pe200012 pe200012 released this 08 Nov 11:07
624e8f5

Security

  • Gallery downloader: file names from the server could contain path separators, letting a forged list write anywhere the client can. Lists must now carry a valid DLHASH, and names/types are limited to what the gallery system produces (official 1.6.6 fix)

Changed

  • Protocol 1.6.6 (build 181): RPC moves to /16/rpc and /16/dl; replies must be signed with the client key and unsigned or altered ones are rejected. The build is fixed in code; the config version field is no longer used
  • Flood control now matches the official client (10 hits draining 1/s, 60 s block; local network and RPC servers exempt)
  • Cache misses are streamed to the requester while being fetched instead of after the full download
  • Hackage: builds without extra flags; cryptostore is vendored with crypton baked in

Fixed

  • threaded_proxy_test reports real results; servercmd signatures are checked
  • Files whose hash is unknown (generated on demand) can now be downloaded
  • webp/avif Content-Type; a failed cache write no longer fails the request; shutdown no longer spins when the RPC server is unreachable

Added

  • hath-bench: a mock RPC server and benchmark that drives hs-hath or the official client

Upgrading

  • Upgrading is recommended for the gallery downloader security fix. This release speaks the H@H 1.6.6 protocol (client build 181); the build number is now fixed in code; the version field in client-login is ignored and only kept so existing configs still load.
  • Flood control is on by default and behaves like the official client, so --disable-rate-limit is no longer needed.

Downloads

  • hs-hath-v1.2.0-ubuntu-22.04-x86_64.tar.gz: hs-hath, hath-bench and migrate-to-r2 for x86_64 Linux, built on Ubuntu 22.04 (needs glibc ≥ 2.34). hs-hath --version reports commit 624e8f5.
  • Hackage: https://hackage.haskell.org/package/hs-hath-1.2.0

SHA-256: 57e64013c97f42325a21dc240fe2f55913574856c03a5a7da3927f8f9e8af97c