diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000000..3658054ae45 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,22 @@ +FROM centos:latest + +# 安装依赖 +RUN yum install -y \ + gcc gcc-c++ \ + pcre pcre-devel \ + openssl openssl-devel \ + zlib zlib-devel git corntabs + +# 添加用户 +RUN useradd jsproxy -g nobody && su jsproxy + +# 添加文件夹 +ADD . /home/jsproxy/server + +# 安装服务器 +RUN bash /home/jsproxy/server/setup-nginx.sh + +EXPOSE 8080 8443 + +# 启动服务 +CMD ["/home/jsproxy/openresty/nginx/sbin/nginx","-c","/home/jsproxy/server/nginx.conf","-p","/home/jsproxy/server/nginx","-g","daemon off;"] \ No newline at end of file diff --git a/README.md b/README.md index 169004288aa..b52f75c84c4 100644 --- a/README.md +++ b/README.md @@ -132,6 +132,19 @@ https://zjcqoo.github.io/-----https://www.google.com 虽然依旧简陋,但比之前好。提供了线路切换、预加载的功能。 +### 懒人模式 + +懒人模式提供自动生成CF certificate 并且使用docker进行一键启动服务器 + +```bash +# 执行命令生成需要的配置文件 +bash genConf.sh +# 生成docker镜像 +docker build -t jsproxy . +运行镜像 +docker run -d -p 8080:8080 -p 8443:8443 jsproxy +``` + # License MIT \ No newline at end of file diff --git a/allowed-sites.conf b/allowed-sites.conf index 2d6c9aff72f..00b3a427f33 100644 --- a/allowed-sites.conf +++ b/allowed-sites.conf @@ -7,4 +7,4 @@ # http://localhost 'lo'; https://etherdream.github.io 'gh-eth'; -https://zjcqoo.github.io 'gh-qoo'; \ No newline at end of file +https://zjcqoo.github.io 'gh-qoo'; diff --git a/genConf.sh b/genConf.sh new file mode 100755 index 00000000000..332a6174f09 --- /dev/null +++ b/genConf.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +# CF 证书配置 +echo "请输入CF域名"; +read domain; +echo "请输入CF信箱"; +read mail; +echo "请输入CF 密钥"; +read token; + +echo "请输加入入允许访问域名"; +read allowedDomain; + +curl https://get.acme.sh | sh + +cat > ./gen-cert/dnsconf <> allowed-sites.conf +echo "生成完毕 请使用Docker进行后续工作" \ No newline at end of file diff --git a/nginx.conf b/nginx.conf index 81b115a4ed2..941e1c68cac 100644 --- a/nginx.conf +++ b/nginx.conf @@ -1,9 +1,9 @@ http { server { - # server_name example.com; - # ssl_certificate cert/example.com/ecc.cer; - # ssl_certificate_key cert/example.com/ecc.key; - # listen 8443 ssl http2; + server_name example.com; + ssl_certificate cert/example.com/ecc.cer; + ssl_certificate_key cert/example.com/ecc.key; + listen 8443 ssl http2; listen 8080; include api.conf; }