Skip to content

Commit d79eec2

Browse files
committed
Add GitHub Actions workflow for pre-built telemt Docker images
Multi-arch (amd64 + arm64) build from pinned telemt commit. Publishes to ghcr.io/samnet-dev/mtproxymax-telemt.
0 parents  commit d79eec2

5 files changed

Lines changed: 3334 additions & 0 deletions

File tree

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
* text=auto
2+
*.sh text eol=lf
3+
LICENSE text eol=lf

.github/workflows/build-engine.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Build Telemt Engine
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
telemt_commit:
7+
description: 'Telemt commit hash to build from'
8+
required: true
9+
default: '43990c9'
10+
version_tag:
11+
description: 'Version tag (e.g. 3.0.0-43990c9)'
12+
required: true
13+
default: '3.0.0-43990c9'
14+
15+
env:
16+
REGISTRY: ghcr.io
17+
IMAGE_NAME: ${{ github.repository_owner }}/mtproxymax-telemt
18+
19+
jobs:
20+
build:
21+
runs-on: ubuntu-latest
22+
permissions:
23+
contents: read
24+
packages: write
25+
26+
steps:
27+
- name: Set up QEMU (for ARM builds)
28+
uses: docker/setup-qemu-action@v3
29+
30+
- name: Set up Docker Buildx
31+
uses: docker/setup-buildx-action@v3
32+
33+
- name: Log in to GitHub Container Registry
34+
uses: docker/login-action@v3
35+
with:
36+
registry: ${{ env.REGISTRY }}
37+
username: ${{ github.actor }}
38+
password: ${{ secrets.GITHUB_TOKEN }}
39+
40+
- name: Create Dockerfile
41+
run: |
42+
cat > Dockerfile << 'EOF'
43+
FROM rust:1-bookworm AS builder
44+
ARG TELEMT_REPO=telemt/telemt
45+
ARG TELEMT_COMMIT
46+
RUN apt-get update && apt-get install -y --no-install-recommends git && \
47+
rm -rf /var/lib/apt/lists/*
48+
RUN git clone "https://github.com/${TELEMT_REPO}.git" /build
49+
WORKDIR /build
50+
RUN git checkout "${TELEMT_COMMIT}"
51+
RUN cargo build --release && \
52+
strip target/release/telemt 2>/dev/null || true && \
53+
cp target/release/telemt /telemt
54+
55+
FROM debian:bookworm-slim
56+
RUN apt-get update && \
57+
apt-get install -y --no-install-recommends ca-certificates && \
58+
rm -rf /var/lib/apt/lists/*
59+
COPY --from=builder /telemt /usr/local/bin/telemt
60+
RUN chmod +x /usr/local/bin/telemt
61+
STOPSIGNAL SIGINT
62+
ENTRYPOINT ["telemt"]
63+
EOF
64+
65+
- name: Build and push multi-arch image
66+
uses: docker/build-push-action@v6
67+
with:
68+
context: .
69+
platforms: linux/amd64,linux/arm64
70+
push: true
71+
build-args: |
72+
TELEMT_COMMIT=${{ github.event.inputs.telemt_commit }}
73+
tags: |
74+
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.event.inputs.version_tag }}
75+
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
76+
cache-from: type=gha
77+
cache-to: type=gha,mode=max

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 SamNet Technologies LLC
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

install.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/bash
2+
# MTProxyMax Installer — SamNet Technologies LLC
3+
# Usage: curl -sL https://raw.githubusercontent.com/SamNet-dev/MTProxyMax/main/install.sh | sudo bash
4+
set -e
5+
6+
REPO="SamNet-dev/MTProxyMax"
7+
BRANCH="main"
8+
INSTALL_DIR="/opt/mtproxymax"
9+
SCRIPT_URL="https://raw.githubusercontent.com/${REPO}/${BRANCH}/mtproxymax.sh"
10+
11+
echo ""
12+
echo " Installing MTProxyMax..."
13+
echo ""
14+
15+
# Root check
16+
if [ "$(id -u)" -ne 0 ]; then
17+
echo "ERROR: Run as root: sudo bash -c \"\$(curl -sL ${SCRIPT_URL})\"" >&2
18+
exit 1
19+
fi
20+
21+
# Download and run
22+
mkdir -p "$INSTALL_DIR"
23+
curl -fsSL "$SCRIPT_URL" -o "${INSTALL_DIR}/mtproxymax"
24+
chmod +x "${INSTALL_DIR}/mtproxymax"
25+
26+
# Execute installer
27+
exec bash "${INSTALL_DIR}/mtproxymax" install

0 commit comments

Comments
 (0)