6 Commits

Author SHA1 Message Date
Paramtamtam
bc3ff69d72 fix the service manifest 2025-02-02 16:25:49 +04:00
Paramtamtam
2e946b4a5b wip: 🔕 temporary commit 2025-02-02 15:57:08 +04:00
Paramtamtam
f5dd0d94ea wip: 🔕 temporary commit 2025-02-02 15:53:15 +04:00
Paramtamtam
3cbe16f0e8 wip: 🔕 temporary commit 2025-02-02 15:05:14 +04:00
Paramtamtam
2a0d771bcc wip: 🔕 temporary commit 2025-02-02 15:01:41 +04:00
Paramtamtam
80634ef5e5 feat: Helm chart 2025-02-02 14:37:12 +04:00
5 changed files with 44 additions and 26 deletions

View File

@@ -43,7 +43,6 @@ jobs:
helm-pack:
name: Pack the Helm chart
runs-on: ubuntu-latest
needs: [build-docker-image]
defaults: {run: {working-directory: ./deployments/helm}}
steps:
- uses: actions/checkout@v4
@@ -76,7 +75,8 @@ jobs:
--merge \
./helm-charts/index.yaml \
./helm-charts
- {uses: gacts/directory-listing@v1, with: {overwrite: true}}
- uses: yKicchan/generate-directory-listing-action@v1
with: {target: ., ignore: "**/index.html", override: true}
- name: Commit and push the changes
run: |
git config user.name "${{ github.actor }}"

View File

@@ -24,9 +24,26 @@ jobs:
- {uses: actions/checkout@v4, with: {fetch-depth: 0}}
- uses: gacts/gitleaks@v1
filter:
name: Filter files
runs-on: ubuntu-latest
permissions: {pull-requests: read}
outputs:
docker: ${{ steps.filter.outputs.docker }}
helm: ${{ steps.filter.outputs.helm }}
steps:
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
docker: [Dockerfile, '*docker*', '*3proxy*']
helm: ['deployments/helm/**', '*kube*']
lint-charts:
name: Lint the chart
runs-on: ubuntu-latest
needs: [filter]
if: needs.filter.outputs.helm == 'true'
defaults: {run: {working-directory: ./deployments/helm}}
steps:
- uses: actions/checkout@v4
@@ -38,6 +55,8 @@ jobs:
build-image:
name: Build the docker image
runs-on: ubuntu-latest
needs: [filter] # since this is the initial step, we can filter out the rest of the jobs right here to skip them
if: needs.filter.outputs.docker == 'true'
steps:
- uses: actions/checkout@v4
- run: docker build -f ./Dockerfile --tag 3proxy:local .
@@ -49,7 +68,7 @@ jobs:
retention-days: 1
try-to-use:
name: Try to use the docker image (auth ${{ matrix.auth }})
name: Build and use the docker image (auth ${{ matrix.auth }})
runs-on: ubuntu-latest
strategy:
fail-fast: false

View File

@@ -1,20 +1,20 @@
# syntax=docker/dockerfile:1
FROM docker.io/library/gcc:15.1.0 AS builder
FROM gcc:13.3.0 AS builder
# renovate: source=github-tags name=3proxy/3proxy
ARG Z3PROXY_VERSION=0.9.5
# renovate: source=github-tags name=z3APA3A/3proxy
ARG Z3PROXY_VERSION=0.9.4
# Fetch 3proxy sources
RUN set -x \
&& git -c advice.detachedHead=false clone --depth 1 --branch "${Z3PROXY_VERSION}" https://github.com/3proxy/3proxy.git /tmp/3proxy
&& git -c advice.detachedHead=false clone --depth 1 --branch "${Z3PROXY_VERSION}" https://github.com/z3APA3A/3proxy.git /tmp/3proxy
WORKDIR /tmp/3proxy
# Patch sources
RUN set -x \
&& echo '#define ANONYMOUS 1' >> ./src/3proxy.h \
# proxy.c source: <https://github.com/3proxy/3proxy/blob/0.9.3/src/proxy.c>
# proxy.c source: <https://github.com/z3APA3A/3proxy/blob/0.9.3/src/proxy.c>
&& sed -i 's~\(<\/head>\)~<style>:root{--color-bg-primary:#fff;--color-text-primary:#131313;--color-text-secondary:#232323}\
@media (prefers-color-scheme: dark){:root{--color-bg-primary:#212121;--color-text-primary:#fafafa;--color-text-secondary:#bbb}}\
html,body{height:100%;font-family:sans-serif;background-color:var(--color-bg-primary);color:var(--color-text-primary);margin:0;\
@@ -34,11 +34,10 @@ RUN set -x \
&& strip ./bin/TrafficPlugin.ld.so \
&& strip ./bin/PCREPlugin.ld.so \
&& strip ./bin/TransparentPlugin.ld.so \
&& strip ./bin/SSLPlugin.ld.so \
&& cp /lib/$(gcc -dumpmachine)/libdl.so.* /tmp/3proxy/
&& strip ./bin/SSLPlugin.ld.so
# Prepare filesystem for 3proxy running
FROM docker.io/library/alpine:latest AS buffer
FROM alpine:latest AS buffer
# create a directory for the future root filesystem
WORKDIR /tmp/rootfs
@@ -54,7 +53,7 @@ RUN set -x \
&& chmod +x ./bin/dumb-init \
&& apk del .build-deps
COPY --from=builder /tmp/3proxy/libdl.so.* ./lib/
COPY --from=builder /lib/*-linux-gnu/libdl.so.* ./lib/
COPY --from=builder /tmp/3proxy/bin/3proxy ./bin/3proxy
COPY --from=builder /tmp/3proxy/bin/*.ld.so ./usr/local/3proxy/libexec/
COPY --from=ghcr.io/tarampampam/mustpl:0.1.1 /bin/mustpl ./bin/mustpl
@@ -64,7 +63,7 @@ COPY 3proxy.cfg.mustach ./etc/3proxy/3proxy.cfg.mustach
RUN chown -R 10001:10001 ./etc/3proxy
# Merge into a single layer
FROM docker.io/library/busybox:stable-glibc
FROM busybox:stable-glibc
LABEL \
org.opencontainers.image.title="3proxy" \

View File

@@ -30,6 +30,6 @@ And override the default values in your `values.yaml`:
```yaml
proxy-3proxy:
# ...
service: {ports: {http: 3128}}
service: {port: 8800}
# ...
```

View File

@@ -72,14 +72,14 @@ spec:
- name: {{ $authLoginEnvName }}
valueFrom:
secretKeyRef:
name: {{ tpl .fromSecret.secretName $ | quote }}
key: {{ tpl .fromSecret.secretKey $ | quote }}
name: "{{ tpl (toYaml .fromSecret.secretName) $ }}"
key: "{{ tpl (toYaml .fromSecret.secretKey) $ }}"
{{- else if .fromConfigMap.enabled }}
- name: {{ $authLoginEnvName }}
valueFrom:
configMapKeyRef:
name: {{ tpl .fromConfigMap.configMapName $ | quote }}
key: {{ tpl .fromConfigMap.configMapKey $ | quote }}
name: "{{ tpl (toYaml .fromConfigMap.configMapName) $ }}"
key: "{{ tpl (toYaml .fromConfigMap.configMapKey) $ }}"
{{- end }}
{{- end }}
@@ -91,14 +91,14 @@ spec:
- name: {{ $authPasswordEnvName }}
valueFrom:
secretKeyRef:
name: {{ tpl .fromSecret.secretName $ | quote }}
key: {{ tpl .fromSecret.secretKey $ | quote }}
name: "{{ tpl (toYaml .fromSecret.secretName) $ }}"
key: "{{ tpl (toYaml .fromSecret.secretKey) $ }}"
{{- else if .fromConfigMap.enabled }}
- name: {{ $authPasswordEnvName }}
valueFrom:
configMapKeyRef:
name: {{ tpl .fromConfigMap.configMapName $ | quote }}
key: {{ tpl .fromConfigMap.configMapKey $ | quote }}
name: "{{ tpl (toYaml .fromConfigMap.configMapName) $ }}"
key: "{{ tpl (toYaml .fromConfigMap.configMapKey) $ }}"
{{- end }}
{{- end }}
@@ -112,14 +112,14 @@ spec:
- name: {{ $extraAuthAccountsEnvName }}
valueFrom:
secretKeyRef:
name: {{ tpl .fromSecret.secretName $ | quote }}
key: {{ tpl .fromSecret.secretKey $ | quote }}
name: "{{ tpl (toYaml .fromSecret.secretName) $ }}"
key: "{{ tpl (toYaml .fromSecret.secretKey) $ }}"
{{- else if .fromConfigMap.enabled }}
- name: {{ $extraAuthAccountsEnvName }}
valueFrom:
configMapKeyRef:
name: {{ tpl .fromConfigMap.configMapName $ | quote }}
key: {{ tpl .fromConfigMap.configMapKey $ | quote }}
name: "{{ tpl (toYaml .fromConfigMap.configMapName) $ }}"
key: "{{ tpl (toYaml .fromConfigMap.configMapKey) $ }}"
{{- end }}
{{- end }}