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

View file

@ -19,6 +19,17 @@ steps:
- cd meta
- git checkout $DRONE_COMMIT
- 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
image: plugins/docker:20
@ -33,6 +44,15 @@ steps:
build_args:
- 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:
event:
- tag
@ -44,7 +64,7 @@ type: docker
name: publish-arm64v8
platform:
arch: arm64
arch: amd64
clone:
disable: true
@ -60,6 +80,17 @@ steps:
- cd meta
- git checkout $DRONE_COMMIT
- 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
image: plugins/docker:20
@ -74,6 +105,15 @@ steps:
build_args:
- 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:
event:
- tag
@ -97,6 +137,7 @@ steps:
commands:
- git clone $DRONE_GIT_HTTP_URL .
- git checkout $DRONE_COMMIT
- chown -R 991:991 .
- name: manifest
image: plugins/manifest:1

View file

@ -1,8 +1,6 @@
[project]
kind = "git"
repository = "https://gitlab.com/famedly/conduit"
branch = "next"
recent = 8
language = "rust"
config = "Cargo.toml"

View file

@ -1,35 +1,27 @@
ARG REPO_ARCH
ARG REPO_ARCH=amd64
FROM $REPO_ARCH/alpine:edge as base
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
# production environment
FROM asonix/rust-runner:$REPO_ARCH-latest
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
ENTRYPOINT [ "/sbin/tini", "--" ]
CMD [ "/usr/local/bin/conduit" ]
EXPOSE 8080
ENTRYPOINT ["/sbin/tini", "--"]
CMD /usr/local/bin/conduit

23
conduit.toml Normal file
View 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"