mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-11-22 03:37:18 +00:00
store: rename badge service to store service (#7987)
Co-authored-by: sh-agents <350651734+sh-agents@users.noreply.github.com>
This commit is contained in:
1 parent
6f8ebda2c5
commit
2c09d06793
191 files changed
+1341
-1309
No files matched your search
@@ -97,12 +97,12 @@ The reduced build runs one Linux job, build-linux (ubuntu-22.04 x86_64), for eve
|
||||
|
||||
#### badge-web
|
||||
|
||||
- Globs: apps/simplex-badge-service/web/**. These paths are also in the core globs (apps/simplex-badge-service/**), and web/src/catalog.ts is read by core tests (tests/Bots/BadgeService/CatalogTests.hs, WebTests.hs).
|
||||
- Globs: apps/simplex-store-service/web/**. These paths are also in the core globs (apps/simplex-store-service/**), and web/src/catalog.ts is read by core tests (tests/Bots/StoreService/CatalogTests.hs, WebTests.hs).
|
||||
- CI, in build-linux: core build and tests, then `scope-tests.sh badge-web` (step "Test changed scopes").
|
||||
- Selected core tests: `/SimpleX badge service/` and `/SimpleX badge service e2e/`.
|
||||
- Local:
|
||||
```sh
|
||||
cd apps/simplex-badge-service/web
|
||||
cd apps/simplex-store-service/web
|
||||
npm ci
|
||||
npm test
|
||||
```
|
||||
|
||||
@@ -55,7 +55,7 @@ BUILD_CHANGES = {
|
||||
"apps/simplex-chat/**",
|
||||
"apps/simplex-bot/**",
|
||||
"apps/simplex-bot-advanced/**",
|
||||
"apps/simplex-badge-service/**",
|
||||
"apps/simplex-store-service/**",
|
||||
"apps/simplex-broadcast-bot/**",
|
||||
"apps/simplex-directory-service/**",
|
||||
"tests/**",
|
||||
@@ -80,7 +80,7 @@ BUILD_CHANGES = {
|
||||
],
|
||||
}
|
||||
SCOPE_CHANGES = {
|
||||
"badge-web": ["apps/simplex-badge-service/web/**"],
|
||||
"badge-web": ["apps/simplex-store-service/web/**"],
|
||||
"ci-scripts": ["scripts/ci/packages_release.py", "scripts/ci/test_packages_release.py"],
|
||||
}
|
||||
CABAL_FILE = "simplex-chat.cabal"
|
||||
|
||||
@@ -6,7 +6,7 @@ cd "$(dirname "$0")/../.."
|
||||
|
||||
case "${1:-}" in
|
||||
badge-web)
|
||||
(cd apps/simplex-badge-service/web && npm ci && npm test)
|
||||
(cd apps/simplex-store-service/web && npm ci && npm test)
|
||||
;;
|
||||
ci-scripts)
|
||||
python3 scripts/ci/test_packages_release.py
|
||||
|
||||
@@ -507,7 +507,7 @@ class ChangesTest(GitRepoTest):
|
||||
self.assertEqual(self.builds("packages/simplex-chat-python/src/simplex_chat/client.py"), {"packages"})
|
||||
|
||||
def test_badge_web_change_builds_the_core_and_tests_its_scope(self):
|
||||
self.assertEqual(self.builds("apps/simplex-badge-service/web/src/catalog.ts"), {"haskell"})
|
||||
self.assertEqual(self.builds("apps/simplex-store-service/web/src/catalog.ts"), {"haskell"})
|
||||
self.assertEqual(self.values["scopes"], "badge-web")
|
||||
|
||||
def test_release_script_change_tests_the_ci_scripts(self):
|
||||
|
||||
File renamed without changes.
@@ -12,9 +12,9 @@ ARG NODE=24
|
||||
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 ./
|
||||
COPY apps/simplex-store-service/web/package.json apps/simplex-store-service/web/package-lock.json ./
|
||||
RUN npm ci
|
||||
COPY apps/simplex-badge-service/web ./
|
||||
COPY apps/simplex-store-service/web ./
|
||||
RUN npm run build
|
||||
|
||||
FROM ubuntu:${UBUNTU} AS build
|
||||
@@ -44,7 +44,7 @@ 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
|
||||
COPY --exclude=web apps/simplex-store-service ./apps/simplex-store-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.
|
||||
@@ -52,10 +52,10 @@ 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; \
|
||||
cabal build --flags="+client_postgres" exe:simplex-store-service; \
|
||||
mkdir -p /out; \
|
||||
cp "$(cabal list-bin --flags="+client_postgres" exe:simplex-badge-service)" /out/simplex-badge-service; \
|
||||
strip /out/simplex-badge-service
|
||||
cp "$(cabal list-bin --flags="+client_postgres" exe:simplex-store-service)" /out/simplex-store-service; \
|
||||
strip /out/simplex-store-service
|
||||
|
||||
FROM ubuntu:${UBUNTU} AS runtime
|
||||
|
||||
@@ -80,7 +80,7 @@ RUN if existing_user=$(getent passwd ${USER_UID} | cut -d: -f1) && [ -n "${exist
|
||||
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=build /out/simplex-store-service /usr/local/bin/simplex-store-service
|
||||
COPY --from=web /web/dist /srv/web
|
||||
|
||||
USER badge
|
||||
@@ -93,7 +93,7 @@ EXPOSE 8080
|
||||
|
||||
# The flags live in CMD so `docker compose run` can replace them while dumb-init still forwards
|
||||
# signals.
|
||||
ENTRYPOINT ["dumb-init", "--", "simplex-badge-service"]
|
||||
ENTRYPOINT ["dumb-init", "--", "simplex-store-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"]
|
||||
CMD ["-d", "postgresql://simplex@127.0.0.1:5432/badge_service", "--create-schema", "--yes-migrate", "--service-config", "/etc/simplex-store-service/store_service.ini"]
|
||||
+5
-5
@@ -14,17 +14,17 @@ scripts/*
|
||||
|
||||
!apps
|
||||
apps/*
|
||||
!apps/simplex-badge-service
|
||||
!apps/simplex-store-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
|
||||
store_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
|
||||
apps/simplex-store-service/test-fixtures
|
||||
apps/simplex-store-service/web-traversal-test
|
||||
apps/simplex-store-service/web/build
|
||||
@@ -1,9 +1,9 @@
|
||||
services:
|
||||
badge-service:
|
||||
image: simplex-badge-service:latest
|
||||
store-service:
|
||||
image: simplex-store-service:latest
|
||||
build:
|
||||
context: ../..
|
||||
dockerfile: scripts/badge-service/Dockerfile
|
||||
dockerfile: scripts/store-service/Dockerfile
|
||||
args:
|
||||
USER_UID: ${USER_UID:-1000}
|
||||
USER_GID: ${USER_GID:-1000}
|
||||
@@ -17,11 +17,11 @@ services:
|
||||
- "--create-schema"
|
||||
- "--yes-migrate"
|
||||
- "--service-config"
|
||||
- "/etc/simplex-badge-service/badge_service.ini"
|
||||
- "/etc/simplex-store-service/store_service.ini"
|
||||
volumes:
|
||||
- type: bind
|
||||
source: ./config
|
||||
target: /etc/simplex-badge-service
|
||||
target: /etc/simplex-store-service
|
||||
read_only: true
|
||||
bind:
|
||||
create_host_path: false
|
||||
+3
-3
@@ -46,10 +46,10 @@ idle_seconds = 60
|
||||
; only host accepted unless [dev] credit_test_purchases = on, which needs the Sandbox host instead.
|
||||
;[apple]
|
||||
;bundle_id = chat.simplex.app
|
||||
;root_certificates = /etc/simplex-badge-service/AppleRootCA-G3.cer
|
||||
;root_certificates = /etc/simplex-store-service/AppleRootCA-G3.cer
|
||||
;api_key_id = 2X9R4HXF34
|
||||
;api_issuer_id = 57246542-96fe-1a63-e053-0824d011072a
|
||||
;api_private_key_file = /etc/simplex-badge-service/AuthKey_2X9R4HXF34.p8
|
||||
;api_private_key_file = /etc/simplex-store-service/AuthKey_2X9R4HXF34.p8
|
||||
|
||||
; optional; without it every Play receipt is answered provider_not_configured, which the app retries later.
|
||||
; service_account_file is the JSON key of a service account with the Play Console permissions "View
|
||||
@@ -58,7 +58,7 @@ idle_seconds = 60
|
||||
; itself is answered internal until the permission is granted. Place it in config/; the file must be readable by the service's user alone.
|
||||
;[google]
|
||||
;package_name = chat.simplex.app
|
||||
;service_account_file = /etc/simplex-badge-service/play-service-account.json
|
||||
;service_account_file = /etc/simplex-store-service/play-service-account.json
|
||||
|
||||
; 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.
|
||||
Reference in new issue
Block a user