refactor docker
This commit is contained in:
17
Dockerfile
17
Dockerfile
@@ -1,17 +0,0 @@
|
|||||||
FROM alpine:latest
|
|
||||||
ENV CONFIG='https://raw.githubusercontent.com/ircfspace/warpsub/main/export/warp#WARP%20(IRCF)'
|
|
||||||
ENV VERSION=v0.17.8
|
|
||||||
WORKDIR /opt
|
|
||||||
RUN apk add wget tar gzip libc6-compat
|
|
||||||
RUN export ARCH=$(apk --print-arch) && if [ "$ARCH" = "i386" ]; then ARCH="386"; elif [ "$ARCH" = "x86_64" ]; then ARCH="amd64"; fi && wget https://github.com/hiddify/hiddify-next-core/releases/download/${VERSION}/hiddify-cli-linux-$ARCH.tar.gz -O hiddify-cli.tar.gz
|
|
||||||
RUN tar -xzf hiddify-cli.tar.gz && rm hiddify-cli.tar.gz
|
|
||||||
COPY hiddify.sh .
|
|
||||||
COPY hiddify.json .
|
|
||||||
RUN chmod +x hiddify.sh
|
|
||||||
|
|
||||||
EXPOSE 2334
|
|
||||||
EXPOSE 6756
|
|
||||||
EXPOSE 6450
|
|
||||||
|
|
||||||
|
|
||||||
ENTRYPOINT [ "/opt/hiddify.sh" ]
|
|
||||||
2
Makefile
2
Makefile
@@ -1,3 +1,4 @@
|
|||||||
|
.ONESHELL:
|
||||||
PRODUCT_NAME=libcore
|
PRODUCT_NAME=libcore
|
||||||
BASENAME=$(PRODUCT_NAME)
|
BASENAME=$(PRODUCT_NAME)
|
||||||
BINDIR=bin
|
BINDIR=bin
|
||||||
@@ -105,6 +106,7 @@ release: # Create a new tag for release.
|
|||||||
echo "version: $${VERSION_STR}+$${BUILD_NUMBER}" && \
|
echo "version: $${VERSION_STR}+$${BUILD_NUMBER}" && \
|
||||||
sed -i -e "s|<key>CFBundleVersion</key>\s*<string>[^<]*</string>|<key>CFBundleVersion</key><string>$${VERSION_STR}</string>|" Info.plist &&\
|
sed -i -e "s|<key>CFBundleVersion</key>\s*<string>[^<]*</string>|<key>CFBundleVersion</key><string>$${VERSION_STR}</string>|" Info.plist &&\
|
||||||
sed -i -e "s|<key>CFBundleShortVersionString</key>\s*<string>[^<]*</string>|<key>CFBundleShortVersionString</key><string>$${VERSION_STR}</string>|" Info.plist &&\
|
sed -i -e "s|<key>CFBundleShortVersionString</key>\s*<string>[^<]*</string>|<key>CFBundleShortVersionString</key><string>$${VERSION_STR}</string>|" Info.plist &&\
|
||||||
|
sed -i "s|ENV VERSION=.*|ENV VERSION=v$${TAG}|g" docker/Dockerfile && \
|
||||||
git add Info.plist && \
|
git add Info.plist && \
|
||||||
git commit -m "release: version $${TAG}" && \
|
git commit -m "release: version $${TAG}" && \
|
||||||
echo "creating git tag : v$${TAG}" && \
|
echo "creating git tag : v$${TAG}" && \
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ func DefaultConfigOptions() *ConfigOptions {
|
|||||||
},
|
},
|
||||||
InboundOptions: InboundOptions{
|
InboundOptions: InboundOptions{
|
||||||
EnableTun: false,
|
EnableTun: false,
|
||||||
SetSystemProxy: true,
|
SetSystemProxy: false,
|
||||||
MixedPort: 2334,
|
MixedPort: 2334,
|
||||||
LocalDnsPort: 16450,
|
LocalDnsPort: 16450,
|
||||||
MTU: 9000,
|
MTU: 9000,
|
||||||
|
|||||||
25
docker/Dockerfile
Normal file
25
docker/Dockerfile
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
FROM alpine:latest
|
||||||
|
ENV CONFIG='https://raw.githubusercontent.com/ircfspace/warpsub/main/export/warp#WARP%20(IRCF)'
|
||||||
|
ENV VERSION=0.17.8
|
||||||
|
WORKDIR /hiddify
|
||||||
|
RUN apk add wget tar gzip libc6-compat
|
||||||
|
|
||||||
|
RUN case "$(apk --print-arch)" in \
|
||||||
|
x86_64) ARCH=amd64 ;; \
|
||||||
|
i386) ARCH=386 ;; \
|
||||||
|
armv7l) ARCH=arm ;; \
|
||||||
|
aarch64) ARCH=arm64 ;; \
|
||||||
|
*) echo "Unsupported architecture: $(apk --print-arch) $(uname -m)" && exit 1 ;; \
|
||||||
|
esac && \
|
||||||
|
curl -l -o hiddify-cli.tar.gz https://github.com/hiddify/hiddify-next-core/releases/download/${VERSION}/hiddify-cli-linux-$ARCH.tar.gz && \
|
||||||
|
tar -xzf hiddify-cli.tar.gz && rm hiddify-cli.tar.gz
|
||||||
|
COPY hiddify.sh .
|
||||||
|
RUN chmod +x hiddify.sh
|
||||||
|
COPY hiddify.json ./data/
|
||||||
|
|
||||||
|
EXPOSE 2334
|
||||||
|
EXPOSE 6756
|
||||||
|
EXPOSE 6450
|
||||||
|
|
||||||
|
|
||||||
|
ENTRYPOINT [ "/opt/hiddify.sh" ]
|
||||||
14
docker/docker-compose.yml
Normal file
14
docker/docker-compose.yml
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
version: '3.8'
|
||||||
|
|
||||||
|
services:
|
||||||
|
hiddify:
|
||||||
|
image: ghcr.io/hiddify/hiddify-next-core/cli:latest
|
||||||
|
ports:
|
||||||
|
- "2334:2334"
|
||||||
|
- "6756:6756"
|
||||||
|
- "6450:6450"
|
||||||
|
environment:
|
||||||
|
CONFIG: "https://raw.githubusercontent.com/ircfspace/warpsub/main/export/warp#WARP%20(IRCF)"
|
||||||
|
volumes:
|
||||||
|
- ./data/:/hiddify/data/
|
||||||
|
command: ["/opt/hiddify.sh"]
|
||||||
@@ -1,41 +1,41 @@
|
|||||||
{
|
{
|
||||||
"service-mode": "proxy",
|
"service-mode": "proxy",
|
||||||
"log-level": "info",
|
"log-level": "info",
|
||||||
"resolve-destination": true,
|
"resolve-destination": true,
|
||||||
"ipv6-mode": "prefer_ipv4",
|
"ipv6-mode": "prefer_ipv4",
|
||||||
"remote-dns-address": "tcp://1.1.1.1",
|
"remote-dns-address": "tcp://1.1.1.1",
|
||||||
"remote-dns-domain-strategy": "",
|
"remote-dns-domain-strategy": "",
|
||||||
"direct-dns-address": "1.1.1.1",
|
"direct-dns-address": "1.1.1.1",
|
||||||
"direct-dns-domain-strategy": "",
|
"direct-dns-domain-strategy": "",
|
||||||
"mixed-port": 2334,
|
"mixed-port": 2334,
|
||||||
"local-dns-port": 6450,
|
"local-dns-port": 6450,
|
||||||
"tun-implementation": "mixed",
|
"tun-implementation": "mixed",
|
||||||
"mtu": 9000,
|
"mtu": 9000,
|
||||||
"strict-route": false,
|
"strict-route": false,
|
||||||
"connection-test-url": "https://www.gstatic.com/generate_204",
|
"connection-test-url": "https://www.gstatic.com/generate_204",
|
||||||
"url-test-interval": 600,
|
"url-test-interval": 600,
|
||||||
"enable-clash-api": true,
|
"enable-clash-api": true,
|
||||||
"clash-api-port": 6756,
|
"clash-api-port": 6756,
|
||||||
"bypass-lan": false,
|
"bypass-lan": false,
|
||||||
"allow-connection-from-lan": true,
|
"allow-connection-from-lan": true,
|
||||||
"enable-fake-dns": false,
|
"enable-fake-dns": false,
|
||||||
"enable-dns-routing": true,
|
"enable-dns-routing": true,
|
||||||
"independent-dns-cache": true,
|
"independent-dns-cache": true,
|
||||||
"enable-tls-fragment": false,
|
"enable-tls-fragment": false,
|
||||||
"tls-fragment-size": "20-70",
|
"tls-fragment-size": "20-70",
|
||||||
"tls-fragment-sleep": "10-30",
|
"tls-fragment-sleep": "10-30",
|
||||||
"enable-tls-mixed-sni-case": false,
|
"enable-tls-mixed-sni-case": false,
|
||||||
"enable-tls-padding": false,
|
"enable-tls-padding": false,
|
||||||
"tls-padding-size": "15-30",
|
"tls-padding-size": "15-30",
|
||||||
"enable-mux": false,
|
"enable-mux": false,
|
||||||
"mux-padding": false,
|
"mux-padding": false,
|
||||||
"mux-max-streams": 4,
|
"mux-max-streams": 4,
|
||||||
"mux-protocol": "h2mux",
|
"mux-protocol": "h2mux",
|
||||||
"enable-warp": false,
|
"enable-warp": false,
|
||||||
"warp-detour-mode": "outbound",
|
"warp-detour-mode": "outbound",
|
||||||
"warp-license-key": "",
|
"warp-license-key": "",
|
||||||
"warp-clean-ip": "auto",
|
"warp-clean-ip": "auto",
|
||||||
"warp-port": 0,
|
"warp-port": 0,
|
||||||
"warp-noise": "5-10",
|
"warp-noise": "5-10",
|
||||||
"warp-noise-delay": "20-200"
|
"warp-noise-delay": "20-200"
|
||||||
}
|
}
|
||||||
6
docker/hiddify.sh
Normal file
6
docker/hiddify.sh
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
if [ -f "/opt/hiddify.json" ]; then
|
||||||
|
/hiddify/HiddifyCli run --config "$CONFIG" -h /hiddify/data/hiddify.json
|
||||||
|
else
|
||||||
|
/hiddify/HiddifyCli run --config "$CONFIG"
|
||||||
|
fi
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
/opt/HiddifyCli run --config $CONFIG -h /opt/hiddify.json
|
|
||||||
Reference in New Issue
Block a user