Compare commits
16 Commits
auto-updat
...
auto-updat
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a24c506322 | ||
|
|
84b9606b81 | ||
|
|
99f17c71ae | ||
| 0498d09aa4 | |||
| fa8962c181 | |||
| c8f9eb09bf | |||
| bd1c56508c | |||
| 7cfeb6cba0 | |||
|
|
d022f99f17 | ||
| 8e26876b9c | |||
| be9eda2de7 | |||
| e10c27aa5a | |||
| 605c7b01f0 | |||
| b6169045fd | |||
| cbe76ad87e | |||
| ef934b3475 |
@@ -45,6 +45,7 @@ ArgoCD homelab project
|
|||||||
| **jellyfin** | [](https://ag.hexor.cy/applications/argocd/jellyfin) |
|
| **jellyfin** | [](https://ag.hexor.cy/applications/argocd/jellyfin) |
|
||||||
| **k8s-secrets** | [](https://ag.hexor.cy/applications/argocd/k8s-secrets) |
|
| **k8s-secrets** | [](https://ag.hexor.cy/applications/argocd/k8s-secrets) |
|
||||||
| **khm** | [](https://ag.hexor.cy/applications/argocd/khm) |
|
| **khm** | [](https://ag.hexor.cy/applications/argocd/khm) |
|
||||||
|
| **mtproxy** | [](https://ag.hexor.cy/applications/argocd/mtproxy) |
|
||||||
| **n8n** | [](https://ag.hexor.cy/applications/argocd/n8n) |
|
| **n8n** | [](https://ag.hexor.cy/applications/argocd/n8n) |
|
||||||
| **ollama** | [](https://ag.hexor.cy/applications/argocd/ollama) |
|
| **ollama** | [](https://ag.hexor.cy/applications/argocd/ollama) |
|
||||||
| **paperless** | [](https://ag.hexor.cy/applications/argocd/paperless) |
|
| **paperless** | [](https://ag.hexor.cy/applications/argocd/paperless) |
|
||||||
|
|||||||
33
k8s/apps/mtproxy/Dockerfile
Normal file
33
k8s/apps/mtproxy/Dockerfile
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
FROM debian:bookworm-slim AS builder
|
||||||
|
|
||||||
|
RUN apt-get update && apt-get install -y \
|
||||||
|
git curl build-essential libssl-dev zlib1g-dev \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
RUN git clone https://github.com/TelegramMessenger/MTProxy.git /src
|
||||||
|
WORKDIR /src
|
||||||
|
RUN make -j$(nproc)
|
||||||
|
|
||||||
|
FROM debian:bookworm-slim
|
||||||
|
|
||||||
|
ENV PROXY_PORT=30443
|
||||||
|
ENV STATS_PORT=8888
|
||||||
|
ENV WORKERS=1
|
||||||
|
ENV RUN_USER=nobody
|
||||||
|
|
||||||
|
RUN apt-get update && apt-get install -y \
|
||||||
|
curl libssl3 zlib1g xxd \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
COPY --from=builder /src/objs/bin/mtproto-proxy /usr/local/bin/mtproto-proxy
|
||||||
|
|
||||||
|
RUN curl -s https://core.telegram.org/getProxySecret -o /etc/mtproxy/proxy-secret --create-dirs && \
|
||||||
|
curl -s https://core.telegram.org/getProxyConfig -o /etc/mtproxy/proxy-multi.conf
|
||||||
|
|
||||||
|
ENTRYPOINT mtproto-proxy \
|
||||||
|
-u ${RUN_USER} \
|
||||||
|
-p ${STATS_PORT} \
|
||||||
|
-H ${PROXY_PORT} \
|
||||||
|
-M ${WORKERS} \
|
||||||
|
--aes-pwd /etc/mtproxy/proxy-secret \
|
||||||
|
/etc/mtproxy/proxy-multi.conf
|
||||||
71
k8s/apps/mtproxy/daemonset.yaml
Normal file
71
k8s/apps/mtproxy/daemonset.yaml
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: DaemonSet
|
||||||
|
metadata:
|
||||||
|
name: mtproxy
|
||||||
|
labels:
|
||||||
|
app: mtproxy
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: mtproxy
|
||||||
|
updateStrategy:
|
||||||
|
type: RollingUpdate
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: mtproxy
|
||||||
|
spec:
|
||||||
|
affinity:
|
||||||
|
nodeAffinity:
|
||||||
|
requiredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
nodeSelectorTerms:
|
||||||
|
- matchExpressions:
|
||||||
|
- key: mtproxy
|
||||||
|
operator: Exists
|
||||||
|
hostNetwork: true
|
||||||
|
dnsPolicy: ClusterFirstWithHostNet
|
||||||
|
containers:
|
||||||
|
- name: mtproxy
|
||||||
|
image: ultradesu/mtproxy:v0.02
|
||||||
|
imagePullPolicy: Always
|
||||||
|
ports:
|
||||||
|
- name: proxy
|
||||||
|
containerPort: 30443
|
||||||
|
protocol: TCP
|
||||||
|
command:
|
||||||
|
- /bin/sh
|
||||||
|
- -c
|
||||||
|
- >-
|
||||||
|
mtproto-proxy
|
||||||
|
-u nobody
|
||||||
|
-p 8888
|
||||||
|
-H $(PORT)
|
||||||
|
-M 1
|
||||||
|
-S $(SECRET)
|
||||||
|
--aes-pwd /etc/mtproxy/proxy-secret
|
||||||
|
/etc/mtproxy/proxy-multi.conf
|
||||||
|
env:
|
||||||
|
- name: SECRET
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: tgproxy-secret
|
||||||
|
key: SECRET
|
||||||
|
- name: PORT
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: tgproxy-secret
|
||||||
|
key: PORT
|
||||||
|
volumeMounts:
|
||||||
|
- name: data
|
||||||
|
mountPath: /data
|
||||||
|
#resources:
|
||||||
|
# requests:
|
||||||
|
# memory: "128Mi"
|
||||||
|
# cpu: "100m"
|
||||||
|
# limits:
|
||||||
|
# memory: "256Mi"
|
||||||
|
# cpu: "500m"
|
||||||
|
volumes:
|
||||||
|
- name: data
|
||||||
|
emptyDir: {}
|
||||||
@@ -1,49 +0,0 @@
|
|||||||
---
|
|
||||||
apiVersion: apps/v1
|
|
||||||
kind: Deployment
|
|
||||||
metadata:
|
|
||||||
name: mtproxy
|
|
||||||
labels:
|
|
||||||
app: mtproxy
|
|
||||||
spec:
|
|
||||||
replicas: 1
|
|
||||||
selector:
|
|
||||||
matchLabels:
|
|
||||||
app: mtproxy
|
|
||||||
template:
|
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
app: mtproxy
|
|
||||||
spec:
|
|
||||||
affinity:
|
|
||||||
nodeAffinity:
|
|
||||||
requiredDuringSchedulingIgnoredDuringExecution:
|
|
||||||
nodeSelectorTerms:
|
|
||||||
- matchExpressions:
|
|
||||||
- key: xray-node-address
|
|
||||||
operator: Exists
|
|
||||||
containers:
|
|
||||||
- name: mtproxy
|
|
||||||
image: telegrammessenger/proxy:latest
|
|
||||||
imagePullPolicy: Always
|
|
||||||
ports:
|
|
||||||
- name: proxy
|
|
||||||
containerPort: 443
|
|
||||||
protocol: TCP
|
|
||||||
env:
|
|
||||||
- name: SECRET
|
|
||||||
value: "00baadf00d15abad1deaa51abaadcafe"
|
|
||||||
volumeMounts:
|
|
||||||
- name: data
|
|
||||||
mountPath: /data
|
|
||||||
resources:
|
|
||||||
requests:
|
|
||||||
memory: "128Mi"
|
|
||||||
cpu: "100m"
|
|
||||||
limits:
|
|
||||||
memory: "256Mi"
|
|
||||||
cpu: "500m"
|
|
||||||
volumes:
|
|
||||||
- name: data
|
|
||||||
persistentVolumeClaim:
|
|
||||||
claimName: mtproxy-data
|
|
||||||
25
k8s/apps/mtproxy/external-secrets.yaml
Normal file
25
k8s/apps/mtproxy/external-secrets.yaml
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
---
|
||||||
|
apiVersion: external-secrets.io/v1
|
||||||
|
kind: ExternalSecret
|
||||||
|
metadata:
|
||||||
|
name: tgproxy-secret
|
||||||
|
spec:
|
||||||
|
target:
|
||||||
|
name: tgproxy-secret
|
||||||
|
deletionPolicy: Delete
|
||||||
|
template:
|
||||||
|
type: Opaque
|
||||||
|
data:
|
||||||
|
SECRET: |-
|
||||||
|
{{ .secret }}
|
||||||
|
PORT: 30443
|
||||||
|
data:
|
||||||
|
- secretKey: secret
|
||||||
|
sourceRef:
|
||||||
|
storeRef:
|
||||||
|
name: vaultwarden-login
|
||||||
|
kind: ClusterSecretStore
|
||||||
|
remoteRef:
|
||||||
|
key: 58a37daf-72d8-430d-86bd-6152aa8f888d
|
||||||
|
property: fields[0].value
|
||||||
|
|
||||||
@@ -3,6 +3,7 @@ kind: Kustomization
|
|||||||
|
|
||||||
resources:
|
resources:
|
||||||
- ./app.yaml
|
- ./app.yaml
|
||||||
- ./deployment.yaml
|
- ./daemonset.yaml
|
||||||
- ./service.yaml
|
- ./external-secrets.yaml
|
||||||
- ./storage.yaml
|
# - ./storage.yaml
|
||||||
|
# - ./service.yaml
|
||||||
|
|||||||
@@ -10,5 +10,7 @@ spec:
|
|||||||
ports:
|
ports:
|
||||||
- name: proxy
|
- name: proxy
|
||||||
port: 30443
|
port: 30443
|
||||||
targetPort: 443
|
targetPort: 30443
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
|
nodePort: 30443
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user