Compare commits
No commits in common. "main" and "v0.2.0-r2" have entirely different histories.
4 changed files with 88 additions and 34 deletions
43
.drone.yml
43
.drone.yml
|
@ -19,6 +19,17 @@ steps:
|
||||||
- cd meta
|
- cd meta
|
||||||
- git checkout $DRONE_COMMIT
|
- git checkout $DRONE_COMMIT
|
||||||
- cd ..
|
- cd ..
|
||||||
|
- rm rust-toolchain
|
||||||
|
- chown -R 991:991 .
|
||||||
|
|
||||||
|
- name: build
|
||||||
|
image: asonix/rust-builder:amd64-latest
|
||||||
|
pull: always
|
||||||
|
commands:
|
||||||
|
- cargo build --target=$TARGET --release
|
||||||
|
- $TOOL-strip target/$TARGET/release/conduit
|
||||||
|
- cp target/$TARGET/release/conduit .
|
||||||
|
- cp conduit conduit-linux-amd64
|
||||||
|
|
||||||
- name: push
|
- name: push
|
||||||
image: plugins/docker:20
|
image: plugins/docker:20
|
||||||
|
@ -33,6 +44,15 @@ steps:
|
||||||
build_args:
|
build_args:
|
||||||
- REPO_ARCH=amd64
|
- REPO_ARCH=amd64
|
||||||
|
|
||||||
|
- name: publish
|
||||||
|
image: plugins/gitea-release:1
|
||||||
|
settings:
|
||||||
|
api_key:
|
||||||
|
from_secret: gitea_token
|
||||||
|
base_url: https://git.asonix.dog
|
||||||
|
files:
|
||||||
|
- conduit-linux-amd64
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
event:
|
event:
|
||||||
- tag
|
- tag
|
||||||
|
@ -44,7 +64,7 @@ type: docker
|
||||||
name: publish-arm64v8
|
name: publish-arm64v8
|
||||||
|
|
||||||
platform:
|
platform:
|
||||||
arch: arm64
|
arch: amd64
|
||||||
|
|
||||||
clone:
|
clone:
|
||||||
disable: true
|
disable: true
|
||||||
|
@ -60,6 +80,17 @@ steps:
|
||||||
- cd meta
|
- cd meta
|
||||||
- git checkout $DRONE_COMMIT
|
- git checkout $DRONE_COMMIT
|
||||||
- cd ..
|
- cd ..
|
||||||
|
- rm rust-toolchain
|
||||||
|
- chown -R 991:991 .
|
||||||
|
|
||||||
|
- name: build
|
||||||
|
image: asonix/rust-builder:arm64v8-latest
|
||||||
|
pull: always
|
||||||
|
commands:
|
||||||
|
- cargo build --target=$TARGET --release
|
||||||
|
- $TOOL-strip target/$TARGET/release/conduit
|
||||||
|
- cp target/$TARGET/release/conduit .
|
||||||
|
- cp conduit conduit-linux-arm64v8
|
||||||
|
|
||||||
- name: push
|
- name: push
|
||||||
image: plugins/docker:20
|
image: plugins/docker:20
|
||||||
|
@ -74,6 +105,15 @@ steps:
|
||||||
build_args:
|
build_args:
|
||||||
- REPO_ARCH=arm64v8
|
- REPO_ARCH=arm64v8
|
||||||
|
|
||||||
|
- name: publish
|
||||||
|
image: plugins/gitea-release:1
|
||||||
|
settings:
|
||||||
|
api_key:
|
||||||
|
from_secret: gitea_token
|
||||||
|
base_url: https://git.asonix.dog
|
||||||
|
files:
|
||||||
|
- conduit-linux-arm64v8
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
event:
|
event:
|
||||||
- tag
|
- tag
|
||||||
|
@ -97,6 +137,7 @@ steps:
|
||||||
commands:
|
commands:
|
||||||
- git clone $DRONE_GIT_HTTP_URL .
|
- git clone $DRONE_GIT_HTTP_URL .
|
||||||
- git checkout $DRONE_COMMIT
|
- git checkout $DRONE_COMMIT
|
||||||
|
- chown -R 991:991 .
|
||||||
|
|
||||||
- name: manifest
|
- name: manifest
|
||||||
image: plugins/manifest:1
|
image: plugins/manifest:1
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
[project]
|
[project]
|
||||||
kind = "git"
|
kind = "git"
|
||||||
repository = "https://gitlab.com/famedly/conduit"
|
repository = "https://gitlab.com/famedly/conduit"
|
||||||
branch = "next"
|
|
||||||
recent = 8
|
|
||||||
language = "rust"
|
language = "rust"
|
||||||
config = "Cargo.toml"
|
config = "Cargo.toml"
|
||||||
|
|
||||||
|
|
54
Dockerfile
54
Dockerfile
|
@ -1,35 +1,27 @@
|
||||||
ARG REPO_ARCH
|
ARG REPO_ARCH=amd64
|
||||||
|
|
||||||
FROM $REPO_ARCH/alpine:edge as base
|
# production environment
|
||||||
|
FROM asonix/rust-runner:$REPO_ARCH-latest
|
||||||
ARG UID=991
|
|
||||||
ARG GID=991
|
|
||||||
|
|
||||||
RUN \
|
|
||||||
addgroup --gid "${GID}" app && \
|
|
||||||
adduser -D -G app -u "${UID}" -g "" -h /opt/app app && \
|
|
||||||
apk add tini libgcc libstdc++ musl
|
|
||||||
|
|
||||||
FROM base as builder
|
|
||||||
|
|
||||||
RUN \
|
|
||||||
apk add clang15 clang15-dev linux-headers gcc g++ make cargo rust rustfmt
|
|
||||||
|
|
||||||
USER app
|
|
||||||
|
|
||||||
COPY --chown=app:app . /conduit
|
|
||||||
|
|
||||||
WORKDIR /conduit
|
|
||||||
|
|
||||||
RUN \
|
|
||||||
cargo build --release --no-default-features --features conduit_bin,backend_rocksdb && \
|
|
||||||
strip target/release/conduit
|
|
||||||
|
|
||||||
FROM base as runner
|
|
||||||
|
|
||||||
COPY --from=builder /conduit/target/release/conduit /usr/local/bin/conduit
|
|
||||||
|
|
||||||
ENV CONDUIT_CONFIG="/opt/app/conduit.toml"
|
ENV CONDUIT_CONFIG="/opt/app/conduit.toml"
|
||||||
|
|
||||||
|
USER root
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
apk add --no-cache \
|
||||||
|
ca-certificates \
|
||||||
|
curl \
|
||||||
|
libgcc
|
||||||
|
|
||||||
|
COPY conduit /usr/local/bin/conduit
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
chown -R app:app /mnt
|
||||||
|
|
||||||
|
COPY meta/conduit.toml /opt/app/conduit.toml
|
||||||
|
|
||||||
|
VOLUME /mnt
|
||||||
USER app
|
USER app
|
||||||
ENTRYPOINT [ "/sbin/tini", "--" ]
|
EXPOSE 8080
|
||||||
CMD [ "/usr/local/bin/conduit" ]
|
ENTRYPOINT ["/sbin/tini", "--"]
|
||||||
|
CMD /usr/local/bin/conduit
|
||||||
|
|
23
conduit.toml
Normal file
23
conduit.toml
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
[global]
|
||||||
|
# This is the only directory where Conduit will save its data
|
||||||
|
database_path = "/mnt/conduit_db"
|
||||||
|
|
||||||
|
# The port Conduit will be running on. You need to set up a reverse proxy in
|
||||||
|
# your web server (e.g. apache or nginx), so all requests to /_matrix on port
|
||||||
|
# 443 and 8448 will be forwarded to the Conduit instance running on this port
|
||||||
|
port = 6167
|
||||||
|
|
||||||
|
# Max size for uploads
|
||||||
|
max_request_size = 40_000_000 # in bytes
|
||||||
|
|
||||||
|
# Enables registration. If set to false, no users can register on this server.
|
||||||
|
allow_registration = true
|
||||||
|
|
||||||
|
# Disable encryption, so no new encrypted rooms can be created
|
||||||
|
# Note: existing rooms will continue to work
|
||||||
|
allow_encryption = true
|
||||||
|
allow_federation = true
|
||||||
|
|
||||||
|
trusted_servers = ["matrix.org"]
|
||||||
|
|
||||||
|
address = "0.0.0.0"
|
Loading…
Reference in a new issue