Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
conduwuit
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
🥺
conduwuit
Commits
ada15cea
Commit
ada15cea
authored
2 years ago
by
Jonathan de Jong
Browse files
Options
Downloads
Patches
Plain Diff
Complement improvements
parent
cb2b5bee
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitignore
+1
-0
1 addition, 0 deletions
.gitignore
complement/Dockerfile
+47
-0
47 additions, 0 deletions
complement/Dockerfile
complement/caddy.json
+72
-0
72 additions, 0 deletions
complement/caddy.json
with
120 additions
and
0 deletions
.gitignore
+
1
−
0
View file @
ada15cea
...
@@ -62,3 +62,4 @@ conduit.db
...
@@ -62,3 +62,4 @@ conduit.db
# Etc.
# Etc.
**/*.rs.bk
**/*.rs.bk
cached_target
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tests/C
omplement
.
Dockerfile
→
c
omplement
/
Dockerfile
+
47
−
0
View file @
ada15cea
# For use in our CI only. This requires a build artifact created by a previous run pipline stage to be placed in cached_target/release/conduit
# For use in our CI only. This requires a build artifact created by a previous run pipline stage to be placed in cached_target/release/conduit
FROM
valkum/docker-rust-ci:latest
as
builder
FROM
registry.gitlab.com/jfowl/conduit-containers/rust-with-tools:commit-16a08e9b
as
builder
#FROM rust:latest as builder
WORKDIR
/workdir
WORKDIR
/workdir
ARG
RUSTC_WRAPPER
ARG
RUSTC_WRAPPER
...
@@ -13,18 +15,15 @@ COPY . .
...
@@ -13,18 +15,15 @@ COPY . .
RUN
mkdir
-p
target/release
RUN
mkdir
-p
target/release
RUN
test
-e
cached_target/release/conduit
&&
cp
cached_target/release/conduit target/release/conduit
||
cargo build
--release
RUN
test
-e
cached_target/release/conduit
&&
cp
cached_target/release/conduit target/release/conduit
||
cargo build
--release
## Actual image
FROM
valkum/docker-rust-ci:latest
FROM
debian:bullseye
WORKDIR
/workdir
WORKDIR
/workdir
RUN
curl
-OL
"https://github.com/caddyserver/caddy/releases/download/v2.2.1/caddy_2.2.1_linux_amd64.tar.gz"
# Install caddy
RUN
tar
xzf caddy_2.2.1_linux_amd64.tar.gz
RUN
apt-get update
&&
apt-get
install
-y
debian-keyring debian-archive-keyring apt-transport-https curl
&&
curl
-1sLf
'https://dl.cloudsmith.io/public/caddy/testing/gpg.key'
| gpg
--dearmor
-o
/usr/share/keyrings/caddy-testing-archive-keyring.gpg
&&
curl
-1sLf
'https://dl.cloudsmith.io/public/caddy/testing/debian.deb.txt'
|
tee
/etc/apt/sources.list.d/caddy-testing.list
&&
apt-get update
&&
apt-get
install
-y
caddy
COPY
cached_target/release/conduit /workdir/conduit
RUN
chmod
+x /workdir/conduit
RUN
chmod
+x /workdir/caddy
COPY
conduit-example.toml conduit.toml
COPY
conduit-example.toml conduit.toml
COPY
complement/caddy.json caddy.json
ENV
SERVER_NAME=localhost
ENV
SERVER_NAME=localhost
ENV
CONDUIT_CONFIG=/workdir/conduit.toml
ENV
CONDUIT_CONFIG=/workdir/conduit.toml
...
@@ -36,13 +35,13 @@ RUN echo "allow_registration = true" >> conduit.toml
...
@@ -36,13 +35,13 @@ RUN echo "allow_registration = true" >> conduit.toml
RUN
echo
"log =
\"
warn,_=off,sled=off
\"
"
>>
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/address =
\"
127.0.0.1
\"
/address =
\"
0.0.0.0
\"
/g"
conduit.toml
# Enabled Caddy auto cert generation for complement provided CA.
COPY
--from=builder /workdir/target/release/conduit /workdir/conduit
RUN
e
ch
o
'{"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": "/ca/ca.crt","private_key": "/ca/ca.key"},"intermediate": {"certificate": "/ca/ca.crt","private_key": "/ca/ca.key"}}}},"tls":{"automation":{"policies":[{"subjects":["your.server.name"],"issuer":{"module":"internal"},"on_demand":true},{"issuer":{"module":"internal", "ca": "local"}}]}}}}'
>
caddy.json
RUN
ch
mod
+x /workdir/conduit
EXPOSE
8008 8448
EXPOSE
8008 8448
CMD
([ -z "${COMPLEMENT_CA}" ] && echo "Error: Need Complement PKI support" && true) ||
\
CMD
uname -a &&
\
sed -i "s/#server_name = \"your.server.name\"/server_name = \"${SERVER_NAME}\"/g" conduit.toml && \
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 && \
sed -i "s/your.server.name/${SERVER_NAME}/g" caddy.json && \
/workdir/
caddy start --config caddy.json > /dev/null && \
caddy start --config caddy.json > /dev/null && \
/workdir/conduit
/workdir/conduit
This diff is collapsed.
Click to expand it.
complement/caddy.json
0 → 100644
+
72
−
0
View file @
ada15cea
{
"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"
}]
}]
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment