{ "module": "nextcloud", "version": "1", "slug": "ncloud", "requires": [ "postgres-database", "s3-bucket", "route" ], "contributes": { "postgres-database": { "name": "nextcloud" }, "route": { "label": "drive", "endpoint": "web" } }, "binds": { "postgres-database": "${dir:state}/database.json", "s3-bucket": "${dir:state}/store.json", "route": "${dir:state}/route.json" }, "secrets": { "postgres-database": "${dir:state}/database.secret", "s3-bucket": "${dir:state}/store.secret" }, "emits": [ "user.created", "share.created" ], "own-secrets": { "admin": "${dir:state}/admin.secret" }, "capabilities": [ "container-runtime" ], "listens": [ { "name": "web", "port": 80, "protocol": "tcp", "from": "mesh", "why": "files and sync, over http; a public name is a route grant later" } ], "resources": [ { "id": "mesh-state", "type": "directory", "mode": "0700", "place": "mesh" }, { "id": "state", "type": "directory", "mode": "0700", "place": "." }, { "id": "server-env", "type": "file", "path": "${dir:state}/server.env", "mode": "0600", "content": "POSTGRES_HOST=${bound:postgres-database:at}:${bound:postgres-database:port}\nPOSTGRES_DB=${bound:postgres-database:as}\nPOSTGRES_USER=${bound:postgres-database:as}\nPOSTGRES_PASSWORD=${secret:postgres-database}\nNEXTCLOUD_ADMIN_USER=mesh-admin\nNEXTCLOUD_ADMIN_PASSWORD=${secret:admin}\nOBJECTSTORE_S3_HOST=${bound:s3-bucket:at}\nOBJECTSTORE_S3_PORT=${bound:s3-bucket:port}\nOBJECTSTORE_S3_BUCKET=mesh-novox-ncloud\nOBJECTSTORE_S3_KEY=${bound:s3-bucket:as}\nOBJECTSTORE_S3_SECRET=${secret:s3-bucket}\nOBJECTSTORE_S3_SSL=false\nOBJECTSTORE_S3_USEPATH_STYLE=true\nOBJECTSTORE_S3_REGION=${bound:s3-bucket:region}\n" }, { "id": "html", "type": "directory", "mode": "0750", "owner": "33:33" }, { "id": "server", "type": "container", "name": "nextcloud", "image": "nextcloud@sha256:fb966733647ea03f0446b0c22eac9733c8eb616d37b960caca9d4c3010e14a08", "env-file": [ "${dir:state}/server.env" ], "ports": [ "80" ], "volumes": [ "${dir:html}:/var/www/html" ], "secrets-in-environment": "the image honours POSTGRES_PASSWORD_FILE and NEXTCLOUD_ADMIN_PASSWORD_FILE (entrypoint file_env); OBJECTSTORE_S3_SECRET has none and needs a generated config fragment; convertible, awaiting a bed" }, { "id": "runtime-config", "type": "file", "path": "${dir:mesh-state}/config.json", "mode": "0600", "content": "{}\n", "merge": "json" } ], "build": { "artifacts": [ { "name": "code", "kind": "bundle", "language": "typescript", "entrypoints": [ "index.js", "tools/index.js" ], "loads": [ "index.js", "tools/index.js" ], "env": { "MESH_NEXTCLOUD_URL": "http://127.0.0.1:${port:80}", "MESH_NEXTCLOUD_CONFIG_FILE": "${dir:mesh-state}/config.json", "MESH_NEXTCLOUD_ADMIN_USER": "mesh-admin", "MESH_NEXTCLOUD_ADMIN_PASSWORD_FILE": "${dir:state}/admin.secret" } } ] } }