Modular configuration file

pull/1/head
Dct Mei 2020-03-29 13:55:10 +08:00
parent a54bf41ae7
commit 0a4d5782ea
No known key found for this signature in database
GPG Key ID: 50BF8B712DCAD7EA
2 changed files with 27 additions and 9 deletions

View File

@ -9,7 +9,17 @@ installed: /usr/local/lib/v2ray/v2ray
installed: /usr/local/lib/v2ray/v2ctl installed: /usr/local/lib/v2ray/v2ctl
installed: /usr/local/lib/v2ray/geoip.dat installed: /usr/local/lib/v2ray/geoip.dat
installed: /usr/local/lib/v2ray/geosite.dat installed: /usr/local/lib/v2ray/geosite.dat
installed: /usr/local/etc/v2ray/config.json installed: /usr/local/etc/v2ray/00_base.json
installed: /usr/local/etc/v2ray/01_log.json
installed: /usr/local/etc/v2ray/02_api.json
installed: /usr/local/etc/v2ray/03_dns.json
installed: /usr/local/etc/v2ray/04_routing.json
installed: /usr/local/etc/v2ray/05_policy.json
installed: /usr/local/etc/v2ray/06_inbounds.json
installed: /usr/local/etc/v2ray/07_outbounds.json
installed: /usr/local/etc/v2ray/08_transport.json
installed: /usr/local/etc/v2ray/09_stats.json
installed: /usr/local/etc/v2ray/10_reverse.json
installed: /var/log/v2ray/ installed: /var/log/v2ray/
installed: /etc/systemd/system/v2ray.service installed: /etc/systemd/system/v2ray.service
installed: /etc/systemd/system/v2ray@.service installed: /etc/systemd/system/v2ray@.service

View File

@ -328,16 +328,24 @@ installV2Ray(){
installFile geoip.dat installFile geoip.dat
installFile geosite.dat installFile geosite.dat
# Install V2Ray server config to /usr/local/etc/v2ray/ # Install V2Ray configuration file to /usr/local/etc/v2ray/
if [[ ! -d '/usr/local/etc/v2ray/' ]]; then if [[ ! -d '/usr/local/etc/v2ray/' ]]; then
install -d /usr/local/etc/v2ray/ install -d /usr/local/etc/v2ray/
install -m 644 "${TMP_DIRECTORY}vpoint_vmess_freedom.json" /usr/local/etc/v2ray/config.json echo '{' > /usr/local/etc/v2ray/00_base.json
echo ' "log": {},' >> /usr/local/etc/v2ray/00_base.json
let PORT="$RANDOM+10000" echo ' "api": {},' >> /usr/local/etc/v2ray/00_base.json
UUID="$(cat /proc/sys/kernel/random/uuid)" echo ' "dns": {},' >> /usr/local/etc/v2ray/00_base.json
echo ' "routing": {},' >> /usr/local/etc/v2ray/00_base.json
sed -i "s/10086/$PORT/g" /usr/local/etc/v2ray/config.json echo ' "policy": {},' >> /usr/local/etc/v2ray/00_base.json
sed -i "s/23ad6b10-8d1a-40f7-8ad0-e3e35cd38297/$UUID/g" /usr/local/etc/v2ray/config.json echo ' "inbounds": [],' >> /usr/local/etc/v2ray/00_base.json
echo ' "outbounds": [],' >> /usr/local/etc/v2ray/00_base.json
echo ' "transport": {},' >> /usr/local/etc/v2ray/00_base.json
echo ' "stats": {},' >> /usr/local/etc/v2ray/00_base.json
echo ' "reverse": {}' >> /usr/local/etc/v2ray/00_base.json
echo '}' >> /usr/local/etc/v2ray/00_base.json
for BASE in 01_log 02_api 03_dns 04_routing 05_policy 06_inbounds 07_outbounds 08_transport 09_stats 10_reverse; do
touch "/usr/local/etc/v2ray/$BASE.json"
done
fi fi
# Used to store V2Ray log files # Used to store V2Ray log files