Merge branch 'master' into ab/wallet

This commit is contained in:
Evgeny @ SimpleX Chat
2026-10-10 16:51:52 +00:00
950 changed files with 43958 additions and 2739 deletions
+99
View File
@@ -0,0 +1,99 @@
# syntax=docker/dockerfile:1
# Built from the repository root, not this directory, because the COPY paths are repo-relative.
# The Haskell stage compiles simplexmq and simplex-chat from source, which takes hours on a cold
# cache and needs about 15 GB.
ARG UBUNTU=24.04
ARG GHC=9.6.3
ARG CABAL=3.10.2.0
ARG NODE=24
# The checkout page's dist/ is gitignored, so this stage builds it.
FROM node:${NODE}-bookworm-slim AS web
WORKDIR /web
COPY apps/simplex-badge-service/web/package.json apps/simplex-badge-service/web/package-lock.json ./
RUN npm ci
COPY apps/simplex-badge-service/web ./
RUN npm run build
FROM ubuntu:${UBUNTU} AS build
ARG GHC
ARG CABAL
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential ca-certificates curl git libgmp3-dev libnuma-dev \
libpq-dev libssl-dev llvm pkg-config zlib1g-dev && \
rm -rf /var/lib/apt/lists/*
ENV BOOTSTRAP_HASKELL_NONINTERACTIVE=1 \
BOOTSTRAP_HASKELL_GHC_VERSION=${GHC} \
BOOTSTRAP_HASKELL_CABAL_VERSION=${CABAL} \
BOOTSTRAP_HASKELL_INSTALL_NO_STACK=true \
BOOTSTRAP_HASKELL_INSTALL_NO_STACK_HOOK=true
RUN curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
ENV PATH="/root/.ghcup/bin:/root/.cabal/bin:$PATH"
# Set explicitly so the cache mount below matches where cabal keeps its store.
ENV CABAL_DIR=/root/.cabal
WORKDIR /src
COPY cabal.project simplex-chat.cabal README.md PRIVACY.md ./
COPY scripts/cabal.project.local.linux ./cabal.project.local
COPY src ./src
# Excluding web/ keeps a webapp edit from invalidating this layer and re-running the cabal build,
# and the binary does not depend on it.
COPY --exclude=web apps/simplex-badge-service ./apps/simplex-badge-service
# The store and build tree are cache mounts rather than layers, so the binary is copied out inside
# the same RUN because dist-newstyle does not exist in the resulting layer.
RUN --mount=type=cache,target=/root/.cabal \
--mount=type=cache,target=/src/dist-newstyle \
set -eu; \
cabal update; \
cabal build --flags="+client_postgres" exe:simplex-badge-service; \
mkdir -p /out; \
cp "$(cabal list-bin --flags="+client_postgres" exe:simplex-badge-service)" /out/simplex-badge-service; \
strip /out/simplex-badge-service
FROM ubuntu:${UBUNTU} AS runtime
ENV DEBIAN_FRONTEND=noninteractive
# Built with +client_postgres, so the binary needs libpq and there is no SQLite backend.
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates dumb-init libgmp10 libpq5 libssl3 zlib1g && \
rm -rf /var/lib/apt/lists/*
# Set these to your own uid and gid so the state volume is readable without root.
ARG USER_UID=1000
ARG USER_GID=1000
# ubuntu:24.04 ships a default user at 1000, so drop whoever holds the ids.
RUN if existing_user=$(getent passwd ${USER_UID} | cut -d: -f1) && [ -n "${existing_user}" ]; then \
userdel -r "${existing_user}" 2>/dev/null || userdel "${existing_user}"; \
fi && \
if existing_group=$(getent group ${USER_GID} | cut -d: -f1) && [ -n "${existing_group}" ]; then \
groupdel "${existing_group}" 2>/dev/null || true; \
fi && \
groupadd -g ${USER_GID} badge && \
useradd -u ${USER_UID} -g ${USER_GID} -m -d /home/badge badge
COPY --from=build /out/simplex-badge-service /usr/local/bin/simplex-badge-service
COPY --from=web /web/dist /srv/web
USER badge
WORKDIR /home/badge
EXPOSE 8080
# There is no HEALTHCHECK because the listener answers before the chat side has an address, so it
# would report healthy too early.
# The flags live in CMD so `docker compose run` can replace them while dumb-init still forwards
# signals.
ENTRYPOINT ["dumb-init", "--", "simplex-badge-service"]
# Without --yes-migrate the service blocks on stdin at every schema change, and a container has no
# console to answer.
CMD ["-d", "postgresql://simplex@127.0.0.1:5432/badge_service", "--create-schema", "--yes-migrate", "--service-config", "/etc/simplex-badge-service/badge_service.ini"]
@@ -0,0 +1,30 @@
# The build context is the repository root. Exclude everything, then add back
# what the image is built from, one directory level at a time.
*
!cabal.project
!simplex-chat.cabal
!README.md
!PRIVACY.md
!src
!scripts
scripts/*
!scripts/cabal.project.local.linux
!apps
apps/*
!apps/simplex-badge-service
# Build output, caches, local state, and anything holding a secret. The ini is
# mounted at run time and must never be baked into an image: it holds the issuer
# secret, and with [btcpay] the API key and webhook secret too.
badge_service.ini
**/dist
**/dist-newstyle
**/node_modules
**/*.db
**/*.db-*
apps/simplex-badge-service/test-fixtures
apps/simplex-badge-service/web-traversal-test
apps/simplex-badge-service/web/build
@@ -0,0 +1,54 @@
[listener]
host = 0.0.0.0
port = 8080
; the built webapp in the image, read as the export source
static_dir = /srv/web
; split deployment: Caddy serves the exported folder; this service is the API and webhooks only.
; Set to on for an all-in-one deployment where this service serves the webapp itself.
serve_webapp = off
; the webapp is written here at boot with the publishable key injected; compose bind-mounts it to a
; host path Caddy serves. Unset it when serve_webapp = on.
webapp_export_dir = /srv/webapp
; on because Caddy proxies /api and /webhooks to this service; without it the rate limiter keys on
; Caddy's address and shares one bucket across all callers
trust_forwarded_for = on
[btcpay]
host = https://btcpay.example.org
api_key = replace-me
store_id = replace-me
webhook_secret = replace-me
expiry_minutes = 60
speed_policy = MediumSpeed
payment_tolerance = 0.5
; optional; omit the whole [stripe] section to disable card payments
[stripe]
; restricted key (rk_): Payment Intents write + Charges read — never a full secret key (sk_)
secret_key = rk_test_replace-me
publishable_key = pk_test_replace-me
; the signing secret of the /webhooks/stripe endpoint configured in the Dashboard
webhook_secret = whsec_replace-me
; minutes the service holds an unpaid card invoice open before it expires it; 1-1440
session_minutes = 60
[poll]
waiting_seconds = 3
idle_seconds = 60
; index is the one clients verify against; private_key is from `simplex-chat badge keygen`.
; To rotate, change both together, once clients trust the new index.
[issuer]
index = 1
private_key = replace-me
; Optional. When present, the service creates and manages one group on its first
; start without --run-cli, and logs its join link once, on the start that creates it.
; The link is a bearer secret that stays valid, so keep that log private. The first
; member to join is promoted to owner, so join right away.
; Moderators can /issue and /bulk codes; admins and owners can also /revoke.
; display_name must be a name the chat core accepts unchanged: one it would spell
; differently stops the whole service, payments included, from starting.
;[group]
;display_name = SimpleX Badges
;description = Welcome to the badges group
+24
View File
@@ -0,0 +1,24 @@
services:
badge-service:
image: simplex-badge-service:latest
build:
context: ../..
dockerfile: scripts/badge-service/Dockerfile
args:
USER_UID: ${USER_UID:-1000}
USER_GID: ${USER_GID:-1000}
restart: on-failure:5
user: "${USER_UID:-1000}:${USER_GID:-1000}"
tty: true
network_mode: host
command:
- "-d"
- "${BADGE_DB_CONN:-postgresql://simplex@127.0.0.1:5432/badge_service}"
- "--create-schema"
- "--yes-migrate"
- "--service-config"
- "/etc/simplex-badge-service/badge_service.ini"
volumes:
- ./badge_service.ini:/etc/simplex-badge-service/badge_service.ini:ro
- ./web:/srv/webapp
stop_grace_period: 10s
+121
View File
@@ -0,0 +1,121 @@
# syntax=docker/dockerfile:1
# The runtime glibc must be the same or newer.
ARG UBUNTU_LIBS=22.04
ARG GHC=9.6.3
ARG CABAL=3.10.2.0
ARG NODE=24
# --------------------------------------------------------------------------- #
# libsimplex
# --------------------------------------------------------------------------- #
FROM ubuntu:${UBUNTU_LIBS} AS libsimplex
ARG GHC
ARG CABAL
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential ca-certificates curl git libgmp3-dev libnuma-dev \
libsqlite3-dev libssl-dev llvm patchelf pkg-config zlib1g-dev && \
rm -rf /var/lib/apt/lists/*
ENV BOOTSTRAP_HASKELL_NONINTERACTIVE=1 \
BOOTSTRAP_HASKELL_GHC_VERSION=${GHC} \
BOOTSTRAP_HASKELL_CABAL_VERSION=${CABAL} \
BOOTSTRAP_HASKELL_INSTALL_NO_STACK=true \
BOOTSTRAP_HASKELL_INSTALL_NO_STACK_HOOK=true
RUN curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
ENV PATH="/root/.ghcup/bin:/root/.cabal/bin:$PATH"
ENV CABAL_DIR=/root/.cabal
WORKDIR /src
COPY cabal.project simplex-chat.cabal README.md PRIVACY.md ./
COPY scripts/cabal.project.local.linux ./cabal.project.local
# The build script checks the export lists in these.
COPY libsimplex.dll.def flake.nix ./
COPY scripts/desktop ./scripts/desktop
COPY src ./src
# VLC is only for the desktop app.
RUN sed -i '/prepare-vlc-linux.sh/d' scripts/desktop/build-lib-linux.sh
# Other versions' build trees are removed: the script's simplex-chat-* glob
# fails with "cd: too many arguments" when the cache holds more than one.
RUN --mount=type=cache,target=/root/.cabal \
--mount=type=cache,target=/src/dist-newstyle \
set -eu; \
ver=$(sed -n 's/^version: *//p' simplex-chat.cabal | tr -d '[:space:]'); \
build_dir=dist-newstyle/build/$(uname -m)-linux/ghc-${GHC}/simplex-chat-$ver/build; \
find dist-newstyle/build -maxdepth 3 -type d -name 'simplex-chat-*' \
! -path "*/simplex-chat-$ver" -exec rm -rf {} + 2>/dev/null || true; \
cabal update; \
scripts/desktop/build-lib-linux.sh sqlite; \
mkdir -p /libs; \
cp "$build_dir"/libsimplex.so "$build_dir"/deps/* /libs/
# --------------------------------------------------------------------------- #
# build
# --------------------------------------------------------------------------- #
FROM node:${NODE}-bookworm-slim AS build
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential python3 && \
rm -rf /var/lib/apt/lists/*
COPY --from=libsimplex /libs /opt/simplex/libs
# Without it, npm re-running the library's preinstall downloads the released libs.
ENV SIMPLEX_LIBS_DIR=/opt/simplex/libs
WORKDIR /src
COPY packages/simplex-chat-client/types/typescript packages/simplex-chat-client/types/typescript
RUN cd packages/simplex-chat-client/types/typescript && \
npm install --no-audit --no-fund && \
npx tsc
COPY packages/simplex-chat-nodejs packages/simplex-chat-nodejs
RUN cd packages/simplex-chat-nodejs && \
npm install --no-audit --no-fund && \
npm install --no-save --no-audit --no-fund ../simplex-chat-client/types/typescript && \
npx tsc && \
cp src/simplex.* dist/
WORKDIR /src/apps/simplex-calculator-bot
# No package-lock.json, so no npm ci.
COPY apps/simplex-calculator-bot/package.json ./
RUN npm install --no-audit --no-fund
RUN npm install --no-save --no-audit --no-fund \
/src/packages/simplex-chat-nodejs \
/src/packages/simplex-chat-client/types/typescript
# calculatorBot.test.ts needs network and tests/fixtures/tls.
COPY apps/simplex-calculator-bot ./
RUN npm run build && npx vitest run calculator.test.ts
# --------------------------------------------------------------------------- #
# runtime
# --------------------------------------------------------------------------- #
FROM node:${NODE}-bookworm-slim AS runtime
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates dumb-init libffi8 libgmp10 libssl3 zlib1g && \
rm -rf /var/lib/apt/lists/*
COPY --from=build --chown=node:node /src /src
# A named volume takes this ownership; a bind mount must be owned by uid 1000.
RUN mkdir -p /src/apps/simplex-calculator-bot/data && \
chown node:node /src/apps/simplex-calculator-bot/data && \
chmod 0700 /src/apps/simplex-calculator-bot/data
USER node
WORKDIR /src/apps/simplex-calculator-bot
ENV NODE_ENV=production
# node as PID 1 ignores SIGTERM.
ENTRYPOINT ["dumb-init", "--", "node", "dist/index.js"]
@@ -0,0 +1,22 @@
*
!cabal.project
!simplex-chat.cabal
!README.md
!PRIVACY.md
!libsimplex.dll.def
!flake.nix
!src
!scripts/cabal.project.local.linux
!scripts/desktop
!packages/simplex-chat-client
!packages/simplex-chat-nodejs
!apps/simplex-calculator-bot
**/node_modules
**/dist
**/build
**/libs
**/data
**/.env
**/.npmrc
+16
View File
@@ -0,0 +1,16 @@
services:
calculator-bot:
image: simplex-calculator-bot:latest
build:
context: ../..
dockerfile: scripts/calculator-bot/Dockerfile
restart: on-failure:5
# The name must first be registered with the bot address short link.
# command:
# - "--domain"
# - "yourname.simplex"
volumes:
- calculator-bot-data:/src/apps/simplex-calculator-bot/data
volumes:
calculator-bot-data:
@@ -38,6 +38,23 @@
</description>
<releases>
<release version="7.0.3" date="2026-09-26">
<url type="details">https://simplex.chat/blog/20260722-simplex-public-names.html</url>
<description>
<p>New in v7.0-v7.0.3.</p>
<p>SimpleX public names for channels and businesses (BETA).</p>
<p>Better channels:</p>
<ul>
<li>Promote subscribers to contributors.</li>
<li>Publish your channel on your website.</li>
<li>Verify security code with contributors.</li>
<li>Wider messages, easier to read.</li>
<li>Host your own chat relays.</li>
</ul>
<p>Add a longer description to your profile.</p>
<p>Simplified app settings.</p>
</description>
</release>
<release version="7.0.2" date="2026-09-02">
<url type="details">https://simplex.chat/blog/20260722-simplex-public-names.html</url>
<description>
+2 -2
View File
@@ -1,7 +1,7 @@
{
"https://github.com/simplex-chat/simplexmq.git"."9f907a27401e596394033e1253c6ff699bc86736" = "1vchhhmqwglfrv7l10fj8q5rp2qf4x7b07jkx2xnyplxqdq259zp";
"https://github.com/simplex-chat/simplexmq.git"."58b47e2a862ff4b4adb9d5c3b03c68ac2052b23e" = "1sb0ia3xjyg3pjxk5k8ahah6l0h3nvsgqlw7nkksf2afv8q3lnzk";
"https://github.com/simplex-chat/hs-socks.git"."a30cc7a79a08d8108316094f8f2f82a0c5e1ac51" = "0yasvnr7g91k76mjkamvzab2kvlb1g5pspjyjn2fr6v83swjhj38";
"https://github.com/simplex-chat/direct-sqlcipher.git"."f814ee68b16a9447fbb467ccc8f29bdd3546bfd9" = "1ql13f4kfwkbaq7nygkxgw84213i0zm7c1a8hwvramayxl38dq5d";
"https://github.com/simplex-chat/direct-sqlcipher.git"."2330df3dc8c4b660674d3c02d76bb86f66c2abee" = "11pfj1vqsjdl26nplkr2l6z1xj7cn153qijj5gknmlzq3krn7x1i";
"https://github.com/simplex-chat/sqlcipher-simple.git"."a46bd361a19376c5211f1058908fc0ae6bf42446" = "1z0r78d8f0812kxbgsm735qf6xx8lvaz27k1a0b4a2m0sshpd5gl";
"https://github.com/simplex-chat/aeson.git"."aab7b5a14d6c5ea64c64dcaee418de1bb00dcc2b" = "0jz7kda8gai893vyvj96fy962ncv8dcsx71fbddyy8zrvc88jfrr";
"https://github.com/simplex-chat/haskell-terminal.git"."f708b00009b54890172068f168bf98508ffcd495" = "0zmq7lmfsk8m340g47g5963yba7i88n4afa6z93sg9px5jv1mijj";