mirror of
https://github.com/jhd3197/ServerKit.git
synced 2026-12-05 22:51:51 +09:00
The engine templates were written from upstream docs and reviewed carefully, but
only ever read. Every one has now been brought up for real, authenticated
against, and torn down.
CouchDB was broken. A fresh node never created its system databases: `/_all_dbs`
answered `[]`, `_users` did not exist so no non-admin account could ever be
created, and it error-looped on "Missing system database _users". The image
reads only COUCHDB_USER/PASSWORD/SECRET/ERLANG_COOKIE — both
COUCHDB_COUCHDB__SINGLE_NODE and ERL_FLAGS are rejected as unknown_config_value
— so `single_node = true` ships as a local.d config file instead.
Meilisearch and Valkey advertised versions they do not install (1.0 vs the 1.12
that boots; 8.0 vs 8.1.9), caught by comparing the catalog header against what
actually reported for itself.
The method mattered more than the count. Probing auth from INSIDE the container
is not a test and would have passed two engines that were never checked:
postgres initdb writes `host all all 127.0.0.1/32 trust`, so a deliberately
wrong password succeeds on loopback, and the ClickHouse client reads
CLICKHOUSE_PASSWORD out of the container's own environment. Re-run from a remote
source address, both correctly refuse. Every auth assertion here was made from
off-host.
Nine tests cover what can be checked without Docker, led by the one that matters
most: the generated admin password must actually REACH the image. Mongo,
ClickHouse and CouchDB all start happily with authentication disabled when the
password is generated but never passed — silent, and indistinguishable from
working. Also: every ${VAR} resolves, no port binds all interfaces, the catalog
port matches the published one, the declared version is the tag installed, and a
config file can never be rendered over the data volume's mount point (which
would delete persistence without a word).
Verified by reverting each fix and confirming the tests fail with the right
message, then restoring. 67 passed.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
89 lines
2.3 KiB
YAML
89 lines
2.3 KiB
YAML
id: couchdb
|
|
name: CouchDB
|
|
version: "3.3"
|
|
description: Document database with an HTTP API and multi-master replication for offline-first apps
|
|
icon: https://serverkit.ai/imgs/template-icons/couchdb.svg
|
|
categories:
|
|
- database
|
|
- nosql
|
|
website: https://couchdb.apache.org
|
|
documentation: https://docs.couchdb.org/
|
|
|
|
engine:
|
|
family: Document
|
|
protocol: none
|
|
default_port: 5984
|
|
admin_user: admin
|
|
admin_password_var: DB_PASSWORD
|
|
port_var: PORT
|
|
bind_var: BIND_ADDRESS
|
|
unit: documents
|
|
client: curl
|
|
data_path: /opt/couchdb/data
|
|
version_var: IMAGE_TAG
|
|
versions:
|
|
- "3.3"
|
|
- "3.2"
|
|
|
|
variables:
|
|
- name: IMAGE_TAG
|
|
type: string
|
|
default: "3.3"
|
|
hidden: true
|
|
description: Image tag; constrained to engine.versions by the installer
|
|
- name: PORT
|
|
type: port
|
|
default: "5984"
|
|
hidden: false
|
|
description: Host port to publish CouchDB on
|
|
- name: BIND_ADDRESS
|
|
type: string
|
|
default: 127.0.0.1
|
|
hidden: true
|
|
description: Address the port binds to. 127.0.0.1 keeps the engine private.
|
|
- name: DB_PASSWORD
|
|
type: password
|
|
length: 28
|
|
description: Password for the CouchDB admin user
|
|
|
|
compose:
|
|
services:
|
|
app:
|
|
image: couchdb:${IMAGE_TAG}
|
|
container_name: ${APP_NAME}
|
|
restart: unless-stopped
|
|
ports:
|
|
- "${BIND_ADDRESS}:${PORT}:5984"
|
|
environment:
|
|
# Without BOTH of these the node comes up in "admin party" mode, where
|
|
# any client can create and delete databases.
|
|
COUCHDB_USER: admin
|
|
COUCHDB_PASSWORD: "${DB_PASSWORD}"
|
|
volumes:
|
|
- couchdb-data:/opt/couchdb/data
|
|
|
|
volumes:
|
|
couchdb-data:
|
|
|
|
files:
|
|
# A CouchDB node with no `single_node` flag never creates its own system
|
|
# databases: `_all_dbs` comes back empty, `_users` is missing, and the node
|
|
# logs `database_does_not_exist` for `_users` on a loop -- so no non-admin
|
|
# account can ever be created. The image has no environment variable for
|
|
# this (its entrypoint only reads COUCHDB_USER / COUCHDB_PASSWORD /
|
|
# COUCHDB_SECRET / COUCHDB_ERLANG_COOKIE), so the flag goes in a config
|
|
# snippet dropped into local.d, which CouchDB merges at startup.
|
|
- path: /opt/couchdb/etc/local.d/single-node.ini
|
|
content: |
|
|
[couchdb]
|
|
single_node = true
|
|
|
|
ports:
|
|
- port: "${PORT}"
|
|
protocol: http
|
|
description: CouchDB HTTP API
|
|
|
|
requirements:
|
|
memory: 512MB
|
|
storage: 5GB
|