Repository navigation
Development
github-actions[bot] edited this page May 24, 2026
·
6 revisions
Guide for developers and contributors who want to build TeleCloud from source or contribute translations. Hướng dẫn dành cho nhà phát triển và người đóng góp muốn tự build TeleCloud hoặc đóng góp bản dịch.
Docker xử lý toàn bộ quá trình build mà không cần cài đặt Go hay Bun trên máy.
- Clone dự án:
git clone --recursive https://github.com/dabeecao/telecloud-go.git - Build image:
sudo docker build --build-arg DEFAULT_API_ID=your_api_id --build-arg DEFAULT_API_HASH=your_api_hash -t telecloud:local . - Chạy image vừa build:
sudo docker run -d -p 8091:8091 -v "$(pwd)/data:/app/data" --env-file .env telecloud:local
- Cài đặt Golang (1.26+) và Bun (https://bun.com).
- Clone với
--recursive(Bắt buộc để lấy code frontend):git clone --recursive https://github.com/dabeecao/telecloud-go.git - Build Frontend:
cd web bun install bun run build.js cd .. # Hoặc đơn giản là chạy `make frontend` ở thư mục gốc
- Build Backend:
go mod tidy go build -o telecloud
Để tránh bị lộ thông tin API nhạy cảm khi đẩy code lên GitHub, TeleCloud hỗ trợ tự động nạp thông tin này từ file .env cục bộ (được bỏ qua bởi Git).
- Khai báo
API_IDvàAPI_HASHtrong tệp.env. - Sử dụng các công cụ build:
-
Bằng Makefile: Chạy lệnh
makehoặcmake build. Script sẽ tự động lấy API từ tệp.envđể nhúng lúc biên dịch. -
Bằng Script build test: Chạy lệnh
./build-test.sh. Script cũng sẽ tự đọc.env, hoặc hiển thị hộp thoại yêu cầu nhập nếu không tìm thấy. -
Bằng lệnh thủ công:
go build -ldflags="-X telecloud/config.DefaultAPIIDStr=YOUR_API_ID -X telecloud/config.DefaultAPIHash=YOUR_API_HASH" -o telecloud
-
Bằng Makefile: Chạy lệnh
Mã nguồn frontend nằm ở repo: dabeecao/telecloud-frontend.
- Tìm tệp bản dịch trong
static/locales/(VD:vi.json). - Tạo tệp mới (VD:
fr.json) và dịch từen.json. - Thêm ngôn ngữ vào
availableLangstrongstatic/js/common.js. - Gửi Pull Request vào repository frontend.
git clone --recursive https://github.com/dabeecao/telecloud-go.gitsudo docker build --build-arg DEFAULT_API_ID=your_api_id --build-arg DEFAULT_API_HASH=your_api_hash -t telecloud:local .
- Install Golang (1.26+) and Bun (https://bun.com).
- Build frontend in
web/usingbun install && bun run build.js(ormake frontendin root). - Run
go mod tidyandgo build -o telecloudin root.
To prevent exposing sensitive API credentials in Git history, TeleCloud supports loading them dynamically from a local .env file (which is ignored by Git).
- Define
API_IDandAPI_HASHin your.envfile. - Build using helper tools:
-
Using Makefile: Run
makeormake build. It will extract credentials from.envand embed them. -
Using Test Script: Run
./build-test.sh. It also reads from.envor prompts for inputs if missing. -
Manually:
go build -ldflags="-X telecloud/config.DefaultAPIIDStr=YOUR_API_ID -X telecloud/config.DefaultAPIHash=YOUR_API_HASH" -o telecloud
-
Using Makefile: Run
Frontend source: dabeecao/telecloud-frontend.
- Edit JSON files in
static/locales/. - Add the language to
availableLangsinstatic/js/common.js. - Submit a Pull Request.