badge-service: verify App Store and Google Play purchases (#7654)

This commit is contained in:
spaced4ndy
2026-10-13 15:24:07 +00:00
committed by GitHub
parent 5cddbffaa1
commit 59c588932e
31 changed files with 1574 additions and 79 deletions
@@ -36,6 +36,22 @@ session_minutes = 60
waiting_seconds = 3
idle_seconds = 60
; optional; without it every App Store receipt is answered provider_not_configured, which the app retries later.
; root_certificate is https://www.apple.com/certificateauthority/AppleRootCA-G3.cer, in DER;
; uncomment its mount in compose.yml.
;[apple]
;bundle_id = chat.simplex.app
;root_certificate = /etc/simplex-badge-service/AppleRootCA-G3.cer
; 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
; financial data, orders, and cancellation survey responses" and "Manage orders and subscriptions", to
; read and acknowledge purchases. Without the second, a purchase the app has not already acknowledged
; itself is answered internal until the permission is granted. Uncomment its mount in compose.yml; 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
; 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]
@@ -54,6 +70,7 @@ private_key = replace-me
;description = Welcome to the badges group
; local testing only, in both run modes: accepts any well-formed App Store or Play receipt without
; verifying it, so anyone who can reach this service can mint badges
; verifying it, so anyone who can reach this service can mint badges. The service refuses to start
; with this on beside an [apple] or [google] section.
[dev]
accept_unverified_store_receipts = off
+2
View File
@@ -20,5 +20,7 @@ services:
- "/etc/simplex-badge-service/badge_service.ini"
volumes:
- ./badge_service.ini:/etc/simplex-badge-service/badge_service.ini:ro
# - ./AppleRootCA-G3.cer:/etc/simplex-badge-service/AppleRootCA-G3.cer:ro
# - ./play-service-account.json:/etc/simplex-badge-service/play-service-account.json:ro
- ./web:/srv/webapp
stop_grace_period: 10s