From 0226c4406c07730491af4016b72db396025358df Mon Sep 17 00:00:00 2001 From: Imran Remtulla Date: Sat, 25 Oct 2025 05:53:52 -0400 Subject: [PATCH] Add FRP --- frpc.toml | 23 +++++++++++++++++++++++ frps.toml | 4 ++++ proxy.docker-compose.yaml | 10 ++++++++++ server.docker-compose.yaml | 18 +++++++++++++++--- 4 files changed, 52 insertions(+), 3 deletions(-) create mode 100644 frpc.toml create mode 100644 frps.toml create mode 100644 proxy.docker-compose.yaml diff --git a/frpc.toml b/frpc.toml new file mode 100644 index 0000000..f645f0f --- /dev/null +++ b/frpc.toml @@ -0,0 +1,23 @@ +serverAddr = "137.220.35.151" +serverPort = 7000 +auth.additionalScopes = ["HeartBeats", "NewWorkConns"] +auth.method = "token" +auth.token = "mysupersecrettoken" + +[[proxies]] +name = "http" +type = "tcp" +localIP = "127.0.0.1" +localPort = 80 +remotePort = 80 +transport.useEncryption = true +transport.proxyProtocolVersion = "v2" + +[[proxies]] +name = "https" +type = "tcp" +localIP = "127.0.0.1" +localPort = 443 +remotePort = 443 +transport.useEncryption = true +transport.proxyProtocolVersion = "v2" \ No newline at end of file diff --git a/frps.toml b/frps.toml new file mode 100644 index 0000000..8f0e5bd --- /dev/null +++ b/frps.toml @@ -0,0 +1,4 @@ +bindPort = 7000 +auth.additionalScopes = ["HeartBeats", "NewWorkConns"] +auth.method = "token" +auth.token = "mysupersecrettoken" \ No newline at end of file diff --git a/proxy.docker-compose.yaml b/proxy.docker-compose.yaml new file mode 100644 index 0000000..0ee1e33 --- /dev/null +++ b/proxy.docker-compose.yaml @@ -0,0 +1,10 @@ +services: + + frps: # https://github.com/fatedier/frp + image: fatedier/frps:v0.65.0 + container_name: frps + restart: always + volumes: + - ./frps.toml:/frps.toml + network_mode: host + command: "-c /frps.toml" \ No newline at end of file diff --git a/server.docker-compose.yaml b/server.docker-compose.yaml index 7cdd0d0..db93c65 100644 --- a/server.docker-compose.yaml +++ b/server.docker-compose.yaml @@ -1,5 +1,14 @@ services: + frpc: # https://github.com/fatedier/frp + image: fatedier/frpc:v0.65.0 + container_name: frpc + restart: always + volumes: + - ./frpc.toml:/frpc.toml + network_mode: host + command: "-c /frpc.toml" + traefik: # https://github.com/traefik/traefik image: traefik:latest container_name: traefik @@ -19,14 +28,16 @@ services: - "--entrypoints.web.http.redirections.entrypoint.permanent=true" - "--entryPoints.websecure=true" - "--entryPoints.websecure.address=:443" + - "--entryPoints.websecure.proxyProtocol.trustedIPs=172.19.0.1/32" ports: - "80:80" - "443:443" volumes: - /var/run/docker.sock:/var/run/docker.sock + - traefik_acme:/acme labels: - "traefik.enable=true" - - "traefik.http.routers.api.rule=Host(`traefik.imranr.cloud`)" # Add to /etc/hosts + - "traefik.http.routers.api.rule=Host(`traefik.imranr.cloud`)" - "traefik.http.routers.api.entryPoints=websecure" - "traefik.http.routers.api.service=api@internal" - "traefik.http.routers.api.tls=true" @@ -48,13 +59,14 @@ services: - traefik labels: - "traefik.enable=true" - - "traefik.http.routers.filebrowser.rule=Host(`files.imranr.cloud`)" # Add to /etc/hosts + - "traefik.http.routers.filebrowser.rule=Host(`files.imranr.cloud`)" - "traefik.http.routers.filebrowser.entrypoints=websecure" - "traefik.http.routers.filebrowser.tls=true" - "traefik.http.services.filebrowser.loadbalancer.server.port=80" volumes: - filebrowser_db: + filebrowser_db: + traefik_acme: networks: traefik: