ngrok server 简单部署

  • ngrok下载
  • 生成网站证书
    1
    2
    3
    4
    5
    openssl genrsa -out rootCA.key 4096
    openssl req -x509 -new -nodes -key rootCA.key -subj "/CN=kebyn.cc" -days 36500 -out rootCA.pem
    openssl genrsa -out device.key 4096
    openssl req -new -key device.key -subj "/CN=kebyn.cc" -out device.csr
    openssl x509 -req -in device.csr -CA rootCA.pem -CAkey rootCA.key -CAcreateserial -out device.crt -days 36500
  • 替换 ngrok 默认证书
    1
    2
    3
    cp rootCA.pem ../assets/client/tls/ngrokroot.crt
    cp device.crt ../assets/server/tls/snakeoil.crt
    cp device.key ../assets/server/tls/snakeoil.key
  • 非 root 用户
    1
    sudo GOOS=darwin GOARCH=386 make release-all && sudo GOOS=darwin GOARCH=amd64 make release-all &&sudo GOOS=linux GOARCH=386 make release-all && sudo GOOS=linux GOARCH=amd64 make release-all &&sudo GOOS=linux GOARCH=arm make release-all && sudo GOOS=linux GOARCH=arm64 make release-all &&sudo GOOS=windows GOARCH=386 make release-all && sudo GOOS=windows GOARCH=amd64 make release-all
  • root 用户
    1
    GOOS=darwin GOARCH=386 make release-all && GOOS=darwin GOARCH=amd64 make release-all && GOOS=linux GOARCH=386 make release-all && GOOS=linux GOARCH=amd64 make release-all && GOOS=linux GOARCH=arm make release-all && GOOS=linux GOARCH=arm64 make release-all && GOOS=windows GOARCH=386 make release-all && GOOS=windows GOARCH=amd64 make release-all