Files
mesh-catalog/modules/nextcloud/module.json
T

166 lines
4.0 KiB
JSON

{
"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"
}
],
"data": {
"own": [
{
"id": "html",
"path": "${dir:html}",
"class": "valuable",
"why": "the instance's configuration, its secret and installed apps; the files are in the object store"
}
]
},
"config": {
"container": {
"type": "string",
"description": "The name of the container the module's tools run Nextcloud's occ in; empty is nextcloud.",
"trusted": true,
"default": ""
},
"url": {
"type": "string",
"description": "The address the module's tools reach Nextcloud's sharing API at, as a URL; empty is this machine's Nextcloud on its port.",
"trusted": true,
"default": ""
},
"user": {
"type": "string",
"description": "The Nextcloud account the module's tools act as; empty is admin.",
"trusted": true,
"default": ""
}
},
"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",
"template": "files/server.env"
},
{
"id": "html",
"type": "directory",
"mode": "0750",
"owner": "33:33"
},
{
"id": "server",
"type": "container",
"health": {
"kind": "http",
"endpoint": "web",
"path": "/status.php",
"status": 200,
"body": "\"installed\":true",
"needs": "postgres-database"
},
"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",
"template": "files/config.json",
"takes-config": ["container", "url", "user"],
"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"
}
},
{
"name": "files",
"kind": "archive",
"from": "files"
}
]
}
}