deploy tar
1.0.0
이 도구를 사용하여 VPS를 통해 정적 웹사이트(예: Hugo, Hexo, Astro, Jekyll, VuePress....)를 배포하세요.
# build client
go build -o ./client/bin/deploy-tar ./client/main.go
배포-타르 구성은 yaml 파일입니다.
apiKey: 1111111111
server: http://127.0.0.1:8081/upload
webPath: /www/wwwroot/test123.com/
tarPath: /root/go-code/deploy-tar/test/
webSite: test123.com
> deplay-tar --config .deploy-tar.yaml
apiKey: use apikey to secure your system.
server: the server upload handler location.
webPath: Untargz to this directory, if you use docker, just volumes your real websit directory to this directory.
tarPath: can be **xxx.tar.gz** or a **directory**. if it's a directory, Package as tar.gz file first,then upload.
webSite: just a websit id tag.
# build server
go build -o ./server/bin/deploy-tar-server ./server/main.go
# build dockerfile
docker build --no-cache -t yestool/deploy-tar:v1 .
version: '3'
services:
deploy-tar:
image: yestool/deploy-tar:v1.0
ports:
- "8081:8080"
environment:
APP_APIKEY: 11111111
volumes:
- ./tars:/uploadfiles
- ./webs:/www/wwwroot
기본 구성:
apiKey: 123456
serverPort: 8080
keepFiles: 3
maxUploadSize: 104857600
funcHandle: /upload
ENV 표지를 사용할 수 있으며 ENV 접두사는 APP 입니다.
웹사이트 위치 뒤에 서버 숨기기:
location /upxyz123/ {
client_max_body_size 1024m;
proxy_set_header Host $host:$server_port;
proxy_set_header X-Real-Ip $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_connect_timeout 99999;
proxy_pass http://127.0.0.1:8081/;
}
이 구성에서 클라이언트 구성 서버는 https://xxxx.com/upxyz123/upload 입니다.