diff --git a/.gitignore b/.gitignore index d16fc9a301a5a27d16244a04528b6197e649c81a..0edfa988adef3dd6e08aa4a2a4bd76075b61f46f 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ /gdpr-data /ipfs /dev/conduit-db +/dev/psql # Generated files assets.bin.go diff --git a/README.md b/README.md index 0409108e6669925221e6798eaefc795dc612c5e2..b6c69b5e937b522da399cde53f0ded3d7e897ec4 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,19 @@ csApi: "http://localhost:8008" # This is exposed by the nginx container Federated media requests should function normally with this setup, though the homeserver itself will be unable to federate. For convenience, an element-web instance is also hosted at the same port from the root. +A postgresql server is also created by the docker stack for ease of use. To use it, add the following to your configuration: + +```yaml +database: + postgres: "postgres://postgres:test1234@127.0.0.1:5432/postgres?sslmode=disable" + pool: + maxConnections: 10 + maxIdleConnections: 10 +``` + +Note that the postgresql image is *insecure* and not recommended for production use. It also does not follow best practices +for database management - use at your own risk. + ## Importing media from synapse Media is imported by connecting to your synapse database and downloading all the content from the homeserver. This is so diff --git a/dev/Conduit.Dockerfile b/dev/Conduit.Dockerfile deleted file mode 100644 index 8a64b22985cf41acda131ef27b71c886cfe161fd..0000000000000000000000000000000000000000 --- a/dev/Conduit.Dockerfile +++ /dev/null @@ -1,30 +0,0 @@ -# Note: this builds a minimal conduit image from the git repo. It has nothing to do with the media repo directly. -# This should not be used in production. It is adapted from the official version. - -FROM alpine:3.12 as builder - -RUN sed -i -e 's|v3\.12|edge|' /etc/apk/repositories -RUN apk add --no-cache cargo openssl-dev git -RUN git clone https://git.koesters.xyz/timo/conduit.git /conduit -WORKDIR /conduit -RUN cargo install --path . - -# --- ---------------------- --- - -FROM alpine:3.12 - -# Non-standard port -EXPOSE 8004 - -RUN mkdir -p /srv/conduit/.local/share/conduit -COPY --from=builder /root/.cargo/bin/conduit /srv/conduit/ -RUN set -x ; \ - addgroup -Sg 82 www-data 2>/dev/null ; \ - adduser -S -D -H -h /srv/conduit -G www-data -g www-data www-data 2>/dev/null ; \ - addgroup www-data www-data 2>/dev/null && exit 0 ; exit 1 -RUN chown -cR www-data:www-data /srv/conduit -RUN apk add --no-cache ca-certificates libgcc -VOLUME ["/srv/conduit/.local/share/conduit"] -USER www-data -WORKDIR /src/conduit -ENTRYPOINT ["/srv/conduit/conduit"] diff --git a/dev/docker-compose.yaml b/dev/docker-compose.yaml index 99b8d9bce22b34f6e290a70d645d18dde03a9fa4..120fb39002ede9b3afc59fb6c476b6a697b29176 100644 --- a/dev/docker-compose.yaml +++ b/dev/docker-compose.yaml @@ -2,9 +2,7 @@ version: '2.0' services: media_conduit: container_name: "media_repo_conduit" - build: - context: '.' - dockerfile: 'Conduit.Dockerfile' + image: "matrixconduit/matrix-conduit:latest" restart: unless-stopped volumes: - ./conduit-db:/srv/conduit/.local/share/conduit @@ -13,6 +11,7 @@ services: ROCKET_PORT: 8004 ROCKET_REGISTRATION_DISABLED: "false" ROCKET_ENCRYPTION_DISABLED: "false" + ROCKET_FEDERATION_ENABLED: "false" networks: - media_proxy media_nginx: @@ -27,11 +26,24 @@ services: - media_proxy media_element: container_name: "media_repo_element" - image: "vectorim/riot-web:latest" + image: "vectorim/element-web:latest" restart: unless-stopped volumes: - ./element-config.json:/app/config.json networks: - media_proxy + media_psql: + container_name: "media_repo_psql" + image: "postgres" + restart: unless-stopped + volumes: + - ./psql:/var/lib/postgresql/data + environment: + POSTGRES_PASSWORD: "test1234" + PGDATA: "/var/lib/postgresql/data/pgdata" + ports: + - "5432:5432" + networks: + - media_proxy networks: media_proxy: