mirror of
https://gitlab.com/famedly/conduit.git
synced 2025-08-16 18:01:35 +00:00
tests: make complement work & switch to Caddyfile
This commit is contained in:
parent
ed5b0514f5
commit
f317447b77
4 changed files with 38 additions and 77 deletions
|
@ -33,5 +33,5 @@ cat "$LOG_FILE" | jq -c '
|
|||
select(
|
||||
(.Action == "pass" or .Action == "fail" or .Action == "skip")
|
||||
and .Test != null
|
||||
) | {Action: .Action, Test: .Test}
|
||||
) | {Test: .Test, Action: .Action}
|
||||
' | sort > "$RESULTS_FILE"
|
||||
|
|
30
complement/Caddyfile
Normal file
30
complement/Caddyfile
Normal file
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
log default {
|
||||
level WARN
|
||||
}
|
||||
https_port 8448
|
||||
default_sni your.server.name
|
||||
local_certs
|
||||
pki {
|
||||
ca local {
|
||||
name "Complement CA"
|
||||
root {
|
||||
cert /complement/ca/ca.crt
|
||||
key /complement/ca/ca.key
|
||||
}
|
||||
intermediate {
|
||||
cert /complement/ca/ca.crt
|
||||
key /complement/ca/ca.key
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
your.server.name
|
||||
|
||||
reverse_proxy 127.0.0.1:8008
|
||||
tls {
|
||||
issuer internal {
|
||||
ca local
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
FROM rust:1.81.0
|
||||
FROM rust:1.85.0
|
||||
|
||||
WORKDIR /workdir
|
||||
|
||||
|
@ -8,6 +8,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|||
COPY Cargo.toml Cargo.toml
|
||||
COPY Cargo.lock Cargo.lock
|
||||
COPY src src
|
||||
COPY .cargo .cargo
|
||||
RUN cargo build --release \
|
||||
&& mv target/release/conduit conduit \
|
||||
&& rm -rf target
|
||||
|
@ -27,7 +28,7 @@ RUN apt-get update \
|
|||
&& apt-get install -y caddy
|
||||
|
||||
COPY conduit-example.toml conduit.toml
|
||||
COPY complement/caddy.json caddy.json
|
||||
COPY complement/Caddyfile Caddyfile
|
||||
|
||||
ENV SERVER_NAME=localhost
|
||||
ENV CONDUIT_CONFIG=/workdir/conduit.toml
|
||||
|
@ -35,11 +36,13 @@ ENV CONDUIT_CONFIG=/workdir/conduit.toml
|
|||
RUN sed -i "s/port = 6167/port = 8008/g" conduit.toml
|
||||
RUN echo "log = \"warn,_=off,sled=off\"" >> conduit.toml
|
||||
RUN sed -i "s/address = \"127.0.0.1\"/address = \"0.0.0.0\"/g" conduit.toml
|
||||
RUN sed -i "s/registration_token = \"\"//g" conduit.toml
|
||||
RUN sed -i "s/allow_check_for_updates = true/allow_check_for_updates = false/g" conduit.toml
|
||||
|
||||
EXPOSE 8008 8448
|
||||
|
||||
CMD uname -a && \
|
||||
sed -i "s/#server_name = \"your.server.name\"/server_name = \"${SERVER_NAME}\"/g" conduit.toml && \
|
||||
sed -i "s/your.server.name/${SERVER_NAME}/g" caddy.json && \
|
||||
caddy start --config caddy.json > /dev/null && \
|
||||
sed -i "s/your.server.name/${SERVER_NAME}/g" Caddyfile && \
|
||||
caddy start > /dev/null && \
|
||||
/workdir/conduit
|
||||
|
|
|
@ -1,72 +0,0 @@
|
|||
{
|
||||
"logging": {
|
||||
"logs": {
|
||||
"default": {
|
||||
"level": "WARN"
|
||||
}
|
||||
}
|
||||
},
|
||||
"apps": {
|
||||
"http": {
|
||||
"https_port": 8448,
|
||||
"servers": {
|
||||
"srv0": {
|
||||
"listen": [":8448"],
|
||||
"routes": [{
|
||||
"match": [{
|
||||
"host": ["your.server.name"]
|
||||
}],
|
||||
"handle": [{
|
||||
"handler": "subroute",
|
||||
"routes": [{
|
||||
"handle": [{
|
||||
"handler": "reverse_proxy",
|
||||
"upstreams": [{
|
||||
"dial": "127.0.0.1:8008"
|
||||
}]
|
||||
}]
|
||||
}]
|
||||
}],
|
||||
"terminal": true
|
||||
}],
|
||||
"tls_connection_policies": [{
|
||||
"match": {
|
||||
"sni": ["your.server.name"]
|
||||
}
|
||||
}]
|
||||
}
|
||||
}
|
||||
},
|
||||
"pki": {
|
||||
"certificate_authorities": {
|
||||
"local": {
|
||||
"name": "Complement CA",
|
||||
"root": {
|
||||
"certificate": "/complement/ca/ca.crt",
|
||||
"private_key": "/complement/ca/ca.key"
|
||||
},
|
||||
"intermediate": {
|
||||
"certificate": "/complement/ca/ca.crt",
|
||||
"private_key": "/complement/ca/ca.key"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"tls": {
|
||||
"automation": {
|
||||
"policies": [{
|
||||
"subjects": ["your.server.name"],
|
||||
"issuers": [{
|
||||
"module": "internal"
|
||||
}],
|
||||
"on_demand": true
|
||||
}, {
|
||||
"issuers": [{
|
||||
"module": "internal",
|
||||
"ca": "local"
|
||||
}]
|
||||
}]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue