migrate privoxy-docker from standalone repo (same registry tags)
This commit is contained in:
1 parent
b823333d5d
commit
8afa3a51cc
5 files changed
+164
No files matched your search
@@ -0,0 +1,68 @@
|
|||||||
|
name: privoxy-docker image
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
paths:
|
||||||
|
- privoxy-docker/**
|
||||||
|
schedule:
|
||||||
|
- cron: '0 3 * * 0' # 03:00 sáng Chủ nhật (UTC), lệch giờ với image khác
|
||||||
|
workflow_dispatch: # Cho phép chạy tay nếu cần
|
||||||
|
|
||||||
|
env:
|
||||||
|
IMAGE_REPO: git.thuanle.me/public/privoxy-docker
|
||||||
|
IMAGE: privoxy-docker
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
arch:
|
||||||
|
- amd64
|
||||||
|
- arm64
|
||||||
|
runs-on: ${{ matrix.arch }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v7
|
||||||
|
|
||||||
|
- name: Login to Docker Registry
|
||||||
|
uses: docker/login-action@v4
|
||||||
|
with:
|
||||||
|
registry: git.thuanle.me
|
||||||
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Build Docker images
|
||||||
|
run: |
|
||||||
|
echo "Building image ${{ env.IMAGE }} for architecture: ${{ matrix.arch }}"
|
||||||
|
|
||||||
|
docker build \
|
||||||
|
-f ${{ env.IMAGE }}/Dockerfile \
|
||||||
|
-t ${{ env.IMAGE_REPO }}:${{ matrix.arch }}-latest \
|
||||||
|
--label "build_date=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \
|
||||||
|
--label "commit_sha=${{ github.sha }}" \
|
||||||
|
${{ env.IMAGE }}
|
||||||
|
|
||||||
|
docker push ${{ env.IMAGE_REPO }}:${{ matrix.arch }}-latest
|
||||||
|
|
||||||
|
amend-manifest:
|
||||||
|
runs-on: linux
|
||||||
|
needs: [build]
|
||||||
|
steps:
|
||||||
|
- name: Login to Docker Registry
|
||||||
|
uses: docker/login-action@v4
|
||||||
|
with:
|
||||||
|
registry: git.thuanle.me
|
||||||
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Push Docker manifest
|
||||||
|
run: |
|
||||||
|
echo "Delete existing manifest"
|
||||||
|
docker manifest rm ${{ env.IMAGE_REPO }}:latest || true
|
||||||
|
|
||||||
|
echo "Create new manifest"
|
||||||
|
docker manifest create ${{ env.IMAGE_REPO }}:latest \
|
||||||
|
${{ env.IMAGE_REPO }}:amd64-latest \
|
||||||
|
${{ env.IMAGE_REPO }}:arm64-latest
|
||||||
|
|
||||||
|
docker manifest push ${{ env.IMAGE_REPO }}:latest
|
||||||
@@ -32,6 +32,15 @@ docker run --rm git.thuanle.me/public/gitea-mcp:latest --help
|
|||||||
- Chỉ build cho `amd64` (dành cho server có GPU NVIDIA, hiện là `ta`)
|
- Chỉ build cho `amd64` (dành cho server có GPU NVIDIA, hiện là `ta`)
|
||||||
- Build lại mỗi Chủ nhật lúc 02:30 UTC với `--pull` để lấy binary agent mới nhất; server tiêu thụ qua watchtower
|
- Build lại mỗi Chủ nhật lúc 02:30 UTC với `--pull` để lấy binary agent mới nhất; server tiêu thụ qua watchtower
|
||||||
|
|
||||||
|
### privoxy-docker
|
||||||
|
|
||||||
|
- Registry: `git.thuanle.me/public/privoxy-docker:latest`
|
||||||
|
- Dockerfile: [privoxy-docker/Dockerfile](privoxy-docker/Dockerfile)
|
||||||
|
- Privoxy HTTP proxy chạy không-daemon, user non-root — chi tiết xem [privoxy-docker/README.md](privoxy-docker/README.md)
|
||||||
|
- Hỗ trợ kiến trúc: `amd64`, `arm64`
|
||||||
|
- Gộp từ repo riêng `public/privoxy-docker`, giữ nguyên tag registry
|
||||||
|
- Build lại mỗi Chủ nhật lúc 03:00 UTC
|
||||||
|
|
||||||
## Update
|
## Update
|
||||||
|
|
||||||
- Repo được build lại hàng tuần theo cron của từng workflow.
|
- Repo được build lại hàng tuần theo cron của từng workflow.
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
FROM alpine:latest
|
||||||
|
|
||||||
|
RUN apk add --no-cache privoxy
|
||||||
|
|
||||||
|
COPY config /etc/privoxy/
|
||||||
|
|
||||||
|
RUN chown -R 1000:1000 /etc/privoxy /var/log/privoxy
|
||||||
|
|
||||||
|
USER 1000:1000
|
||||||
|
|
||||||
|
CMD ["privoxy", "--no-daemon", "/etc/privoxy/config"]
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
# Privoxy Docker
|
||||||
|
|
||||||
|
Đây là một Docker image cho Privoxy, có thể chạy bằng Docker Compose.
|
||||||
|
|
||||||
|
> Đã gộp từ repo riêng `public/privoxy-docker` vào `public/image` (giữ nguyên tag registry).
|
||||||
|
|
||||||
|
## Nêu dùng `docker-compose.yml`
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
services:
|
||||||
|
privoxy:
|
||||||
|
image: git.thuanle.me/public/privoxy-docker:latest
|
||||||
|
container_name: privoxy
|
||||||
|
ports:
|
||||||
|
- "8118:8118"
|
||||||
|
volumes:
|
||||||
|
- ./privoxy:/etc/privoxy
|
||||||
|
user: "1000:1000" # ✅ Set user theo sở hữu
|
||||||
|
restart: unless-stopped
|
||||||
|
labels:
|
||||||
|
- "com.centurylinklabs.watchtower.enable=true" # Cho phép Watchtower tự động cập nhật container khi cần
|
||||||
|
```
|
||||||
|
|
||||||
|
## Hướng dẫn chuỗi hành động
|
||||||
|
|
||||||
|
1. **Tạo thư mục cho mình:**
|
||||||
|
|
||||||
|
Tạo thư mục `privoxy` trong cùng thư mục chứa file `docker-compose.yml` để lưu file cấu hình riêng của bạn.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
mkdir -p privoxy
|
||||||
|
```
|
||||||
|
|
||||||
|
2. **Chỉnh sửa file cấu hình Privoxy:**
|
||||||
|
|
||||||
|
- Tạo file `privoxy/config` với nội dung mình muốn
|
||||||
|
```
|
||||||
|
listen-address 0.0.0.0:8118
|
||||||
|
|
||||||
|
toggle 1
|
||||||
|
enable-remote-toggle 0
|
||||||
|
enable-edit-actions 0
|
||||||
|
enforce-blocks 1
|
||||||
|
buffer-limit 4096
|
||||||
|
|
||||||
|
logfile /dev/stdout
|
||||||
|
```
|
||||||
|
|
||||||
|
- Hãy copy file cấu hình mình tạo vào container (nếu chưa có mount config folder):
|
||||||
|
```sh
|
||||||
|
docker cp privoxy:/etc/privoxy/config ./privoxy/config
|
||||||
|
```
|
||||||
|
|
||||||
|
3. **Chạy docker lên:**
|
||||||
|
|
||||||
|
```sh
|
||||||
|
docker-compose up -d
|
||||||
|
```
|
||||||
|
|
||||||
|
4. **Thử cặp proxy:**
|
||||||
|
|
||||||
|
- Proxy sẽ lắng nghe tại địa chỉ `localhost:8118`.
|
||||||
|
- Cấu hình trình duyệt hoặc ứng dụng của bạn để sử dụng HTTP Proxy qua địa chỉ trên.
|
||||||
|
|
||||||
|
## Thông tin thêm
|
||||||
|
- Image được build mỗi Chủ nhật lúc 03:00 UTC, cho mọi kiến trúc (amd64, arm64).
|
||||||
|
- Để build và push image, xem file [build workflow](../.gitea/workflows/privoxy-docker.yml).
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
listen-address 0.0.0.0:8118
|
||||||
|
|
||||||
|
toggle 1
|
||||||
|
enable-remote-toggle 0
|
||||||
|
enable-edit-actions 0
|
||||||
|
enforce-blocks 1
|
||||||
|
buffer-limit 4096
|
||||||
|
|
||||||
|
logfile /dev/stdout
|
||||||
Reference in new issue
Block a user