separate conf

This commit is contained in:
quackerd 2021-04-16 05:02:16 -04:00
parent 8eb5d4709f
commit d36a573db4
7 changed files with 7 additions and 82 deletions

View File

@ -15,9 +15,6 @@ steps:
commands:
- echo -n "$VERSION,latest" > .tags
- sed -i -E "s/var_VERSION/$VERSION/" Dockerfile
- apk add openssl
- chmod +x ./gen_upload.sh
- ./gen_upload.sh
- name: build
image: plugins/docker
@ -26,17 +23,4 @@ steps:
from_secret: docker_username
password:
from_secret: docker_password
repo: quackerd/d2ray
- name: upload
image: plugins/s3
settings:
bucket: 3bd6b2ce5101e791b665d709aa8518ce
access_key:
from_secret: s3_username
secret_key:
from_secret: s3_password
source: uploads/*
target: config/
strip_prefix: uploads/
region: us-west-1
repo: quackerd/d2ray

View File

@ -6,7 +6,6 @@ ENV URL https://github.com/XTLS/Xray-core/releases/download/v${VERSION}/Xray-lin
COPY ./run.sh /opt/run.sh
COPY ./nginx /opt/nginx
COPY ./nginx.conf /opt/nginx.conf
COPY ./crontab /var/spool/cron/crontabs/root
RUN set -xe && \
@ -26,7 +25,7 @@ RUN set -xe && \
apk del unzip wget && \
addgroup www && \
adduser -H -D -S -s /bin/false www -G www && \
chown -R www:www /opt/nginx /opt/nginx.conf
chown -R www:www /opt/nginx
EXPOSE 80 443

View File

@ -1,46 +0,0 @@
{
"log": {
"loglevel": "debug",
"access": "/opt/config/logs/xray/access.log",
"error": "/opt/config/logs/xray/error.log"
},
"inbounds": [
{
"port": 443,
"protocol": "vless",
"settings": {
"clients": [
{
"id": "zsy",
"flow": "xtls-rprx-direct"
}
],
"decryption": "none",
"fallbacks": [
{
"dest": "localhost:80"
}
]
},
"streamSettings": {
"network": "tcp",
"security": "xtls",
"xtlsSettings": {
"alpn": ["http/1.1", "h2"],
"certificates": [
{
"certificateFile": "/etc/letsencrypt/live/concerto.quacker.net/fullchain.pem",
"keyFile": "/etc/letsencrypt/live/concerto.quacker.net/privkey.pem"
}
]
}
}
}
],
"outbounds": [
{
"protocol": "freedom",
"settings": {}
}
]
}

View File

@ -1,13 +0,0 @@
#!/bin/sh
set +e
SALT=md5md5
mkdir -p ./uploads
for filename in ./confs/*; do
fname=$(basename $filename)
fhash=$(echo -n $fname.$SALT | openssl dgst -md5 | sed -E 's/\(stdin\)= (.*)/\1/')
openssl aes-256-cbc -md sha512 -pbkdf2 -in $filename -out ./uploads/$fhash.conf -k sergeygorbunov
done

View File

@ -21,7 +21,7 @@ http {
return 301 https://$host$request_uri;
}
root /opt/nginx;
root /opt/nginx/webroot;
index index.html;
}
}

7
run.sh
View File

@ -48,13 +48,14 @@ echo ""
echo "===== Downloading configuration file ====="
hash=$(echo -n "$FQDN.$SALT" | openssl dgst -md5 | sed -E 's/\(stdin\)= (.*)/\1/')
echo "Host hash is $hash"
wget http://$BUCKET_HASH.s3-website-us-west-1.amazonaws.com/config/$hash.conf -O /opt/$hash.conf
openssl aes-256-cbc -d -md sha512 -pbkdf2 -in /opt/$hash.conf -out /opt/$FQDN.json -k $KEY
wget -q http://$BUCKET_HASH.s3-website-us-west-1.amazonaws.com/config/$hash -O /opt/$hash
openssl aes-256-cbc -d -md sha512 -pbkdf2 -in /opt/$hash -out /opt/$FQDN.json -k $KEY
rm /opt/$hash
echo ""
echo "===== Starting services ====="
crond -L /opt/config/logs/crond/log.txt
nginx -c /opt/nginx.conf
nginx -c /opt/nginx/nginx.conf
echo ""
echo "===== Starting xray ====="