mirror of https://github.com/XTLS/Xray-install
Reduce log directory permissions and remove incorrect comments (#90)
* Remove incorrect comments * Reduce log directory permissionsmain
parent
0529a022f9
commit
8b77f22eaf
|
@ -12,7 +12,6 @@ check_alpine() {
|
|||
}
|
||||
|
||||
check_if_running_as_root() {
|
||||
# If you want to run as another user, please modify $EUID to be owned by this user
|
||||
if [ "$(id -u)" -eq 0 ]; then
|
||||
return 0
|
||||
else
|
||||
|
@ -154,10 +153,15 @@ install_confdir() {
|
|||
install_log() {
|
||||
LOG='0'
|
||||
if [ ! -d '/var/log/xray/' ]; then
|
||||
install -d -o nobody -g nobody /var/log/xray/
|
||||
install -d -m 755 -o 0 -g 0 /var/log/xray/
|
||||
install -m 600 -o nobody -g nobody /dev/null /var/log/xray/access.log
|
||||
install -m 600 -o nobody -g nobody /dev/null /var/log/xray/error.log
|
||||
LOG='1'
|
||||
else
|
||||
chown 0:0 /var/log/xray/
|
||||
chmod 755 /var/log/xray/
|
||||
chown nobody:nobody /var/log/xray/*.log
|
||||
chmod 600 /var/log/xray/*.log
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
|
@ -116,7 +116,6 @@ systemd_cat_config() {
|
|||
}
|
||||
|
||||
check_if_running_as_root() {
|
||||
# If you want to run as another user, please modify $EUID to be owned by this user
|
||||
if [[ "$(id -u)" -eq 0 ]]; then
|
||||
return 0
|
||||
else
|
||||
|
@ -511,12 +510,15 @@ install_xray() {
|
|||
# Used to store Xray log files
|
||||
if [[ "$NO_LOGFILES" -eq '0' ]]; then
|
||||
if [[ ! -d '/var/log/xray/' ]]; then
|
||||
install -d -m 700 -o "$INSTALL_USER_UID" -g "$INSTALL_USER_GID" /var/log/xray/
|
||||
install -d -m 755 -o 0 -g 0 /var/log/xray/
|
||||
install -m 600 -o "$INSTALL_USER_UID" -g "$INSTALL_USER_GID" /dev/null /var/log/xray/access.log
|
||||
install -m 600 -o "$INSTALL_USER_UID" -g "$INSTALL_USER_GID" /dev/null /var/log/xray/error.log
|
||||
LOG='1'
|
||||
else
|
||||
chown -R "$INSTALL_USER_UID:$INSTALL_USER_GID" /var/log/xray/
|
||||
chown 0:0 /var/log/xray/
|
||||
chmod 755 /var/log/xray/
|
||||
chown "$INSTALL_USER_UID:$INSTALL_USER_GID" /var/log/xray/*.log
|
||||
chmod 600 /var/log/xray/*.log
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue