Archived
Files was folded into the messenger, so this repository is the account service and nothing else. The file server, its web client, its tenant schemas and the documentation for all of it are gone. Removed: EnclaveServer and its routes, EnclaveAccess, EnclaveCrypto, the browser client under client/, the Files spec and vectors, the tenant SQL under sql/, the web build and the node CI job, and the Leaf dependency that only ever rendered the file server's pages. The Dockerfile built EnclaveServer and shipped Public/ and Resources/; it now builds the account service alone. Nothing was lost. Every table in the production Files database was empty when this was written: no nodes, no blobs, no identities, no tenants. flamenetfiles.com, www.flamenetfiles.com and files.flamenet.io were served by that stack and now answer 404; the compose file, the env and a schema dump are on the box under /srv/prod/backups/, and the two docker volumes were kept rather than pruned. The service now issues pseudonyms for one product. `050_retire_files.sql` deletes the `files` rows and replaces the CHECK constraint rather than dropping it, so a container still being drained cannot write one back. Every account had a `files` pseudonym and none had a `files` identity, which is why there is no key material to migrate: the row was bookkeeping for a product nobody enrolled in. That also settles the delete endpoint added on this branch. It was built around keeping a shared account alive while another product still held an identity, and with one product that rule can never fire. `AccountRemoval` and its five tests are gone, the response no longer reports which of two outcomes happened, and a delete simply removes the account. None of it had shipped, so there is no wire compatibility to keep. Verified: the suites pass, the live delete script passes against a real Postgres and a running service, and the image builds and boots to its "DATABASE_URL is required" refusal, which is the account service and not a file server. `flamenet/files/auth/v1` stays as the authentication context string. It is a wire constant baked into every stored verifier, not a product name, and changing it would lock out every existing account. Said so in ARCHITECTURE.md so nobody tidies it later. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
43 lines
1.5 KiB
Docker
43 lines
1.5 KiB
Docker
# ---- build ------------------------------------------------------------------
|
|
# Swift 6.2, not 6.0: the dependency graph (swift-log, async-http-client,
|
|
# swift-nio) declares tools versions 6.1 and 6.2, and an older toolchain
|
|
# fails resolution outright rather than falling back.
|
|
FROM swift:6.2-noble AS build
|
|
|
|
WORKDIR /build
|
|
|
|
# Resolve dependencies first so edits to source do not invalidate the layer.
|
|
COPY Package.swift Package.resolved ./
|
|
RUN swift package resolve --skip-update
|
|
|
|
COPY Sources ./Sources
|
|
COPY Tests ./Tests
|
|
COPY scripts ./scripts
|
|
|
|
# Static stdlib keeps the runtime image free of a Swift installation.
|
|
RUN swift build -c release --product EnclaveAccounts --static-swift-stdlib
|
|
|
|
WORKDIR /staging
|
|
RUN BIN="$(swift build --package-path /build -c release --show-bin-path)" \
|
|
&& cp "$BIN/EnclaveAccounts" ./ \
|
|
&& find -L "$BIN" -regex '.*\.resources$' -exec cp -Ra {} ./ \;
|
|
|
|
|
|
# ---- runtime ----------------------------------------------------------------
|
|
FROM ubuntu:noble
|
|
|
|
RUN apt-get update \
|
|
&& apt-get install -y --no-install-recommends ca-certificates tzdata libcurl4 libxml2 curl \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Never run as root. The server needs no write access to its own image.
|
|
RUN useradd --user-group --create-home --system --skel /dev/null --home-dir /app enclave
|
|
|
|
WORKDIR /app
|
|
COPY --from=build --chown=enclave:enclave /staging /app
|
|
USER enclave:enclave
|
|
|
|
EXPOSE 8100
|
|
# No ENTRYPOINT: compose selects which binary this container runs.
|
|
CMD ["./EnclaveAccounts", "serve", "--env", "production", "--hostname", "0.0.0.0", "--port", "8100"]
|