Compare commits

...

3 Commits

Author SHA1 Message Date
Jon Staab 6fcd0297dd Fix stuck declines
Docker / build-and-push-image (push) Successful in 23s
2026-06-12 16:50:28 -07:00
Jon Staab d0cb34b6eb Build at runtime so env vars work
Docker / build-and-push-image (push) Successful in 32s
2026-06-12 15:56:16 -07:00
Jon Staab de169161dc Add dockerfile and workflow
Docker / build-and-push-image (push) Successful in 36s
2026-06-12 15:11:51 -07:00
5 changed files with 103 additions and 3 deletions
+13
View File
@@ -0,0 +1,13 @@
node_modules
dist
.env
.git
.gitignore
*.log
.DS_Store
.vscode
.idea
.claude
Dockerfile
.dockerignore
README.md
+2 -2
View File
@@ -1,2 +1,2 @@
VITE_SEARCH_RELAYS=wss://relay.nostr.band,wss://nostr.wine VITE_SEARCH_RELAYS=wss://relay.ditto.pub,wss://antiprimal.net,wss://relay.vertexlab.io
VITE_INDEXER_RELAYS=wss://purplepag.es VITE_INDEXER_RELAYS=wss://purplepag.es,wss://relay.damus.io,wss://indexer.coracle.social
+52
View File
@@ -0,0 +1,52 @@
name: Docker
on:
push:
branches: [master]
env:
REGISTRY: gitea.coracle.social
IMAGE: coracle/nq
jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: hodlbod
password: ${{ secrets.PACKAGE_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE }}
tags: |
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/master' }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver: docker-container
- name: Build and push Docker image
id: push
uses: docker/build-push-action@v5
with:
context: .
push: true
platforms: linux/amd64 #,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE }}:buildcache
cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE }}:buildcache,mode=max,image-manifest=true,oci-mediatypes=true
+26
View File
@@ -0,0 +1,26 @@
# syntax=docker/dockerfile:1
# Single stage: the Vite/SolidJS app is built at *container start* rather than at
# image build, so VITE_* env vars passed to `docker run` are inlined into the bundle.
FROM node:24-alpine
WORKDIR /app
# pnpm ships with Node via corepack; pin to the version that produced pnpm-lock.yaml.
RUN corepack enable && corepack prepare pnpm@10.33.0 --activate
# `serve` (what `npx serve` runs) — installed now so the image is self-contained.
RUN npm install -g serve@14
# Install deps first so this layer is cached unless the manifest/lockfile change.
# devDependencies are kept because the build runs at container start.
COPY package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile
# App source. The build itself is deferred to the CMD below.
COPY . .
EXPOSE 3000
# Build (`tsc && vite build` → /app/dist) at runtime so VITE_* vars from the
# environment configure the app, then serve the static output.
CMD pnpm build && serve -s dist -l 3000
+10 -1
View File
@@ -431,7 +431,16 @@ function buildSnapshot(
// run triggered by our own repository.publish is a no-op. // run triggered by our own repository.publish is a no-op.
function advanceSigning(mine: Hex, s: Snapshot, tasks: Array<() => Promise<void>>): void { function advanceSigning(mine: Hex, s: Snapshot, tasks: Array<() => Promise<void>>): void {
const p = getProgress(s.requestId) const p = getProgress(s.requestId)
if (p.declined || p.aborted) { return } // NB: `p.declined` is per-user local state ("*I* clicked Decline"), NOT the terminal
// "too many declined" condition (that is isOverDeclined() in the UI, derived from the count
// of 7061 events). So a personal decline must NOT stop us here: only an *aborted* session is
// terminal. We still advance to ST2 and aggregate + finalize once the other members reach the
// threshold, so the decliner observes the signature resolving instead of being stuck on
// "round 1" forever. Declining only suppresses our own contribution, which falls out without
// an extra guard — ST0 fires only for the initiator (who can't have declined) and ST1 fires
// only once we've sent round 1 (a decliner never does). ST2 needs only public data (the other
// members' nonces + shares and the quorum commitments), all of which a decliner still receives.
if (p.aborted) { return }
const ownIndex = s.members.find(m => m.pubkey === mine)?.index const ownIndex = s.members.find(m => m.pubkey === mine)?.index
if (ownIndex === undefined) { return } if (ownIndex === undefined) { return }