Reduce cache time and Remove chown
This commit is contained in:
@ -15,7 +15,7 @@ import (
|
|||||||
const (
|
const (
|
||||||
listenAddr = "127.0.0.1:28262"
|
listenAddr = "127.0.0.1:28262"
|
||||||
usersFile = "/etc/hysteria/users.json"
|
usersFile = "/etc/hysteria/users.json"
|
||||||
cacheTTL = 15 * time.Second
|
cacheTTL = 5 * time.Second
|
||||||
)
|
)
|
||||||
|
|
||||||
type User struct {
|
type User struct {
|
||||||
|
|||||||
@ -15,7 +15,6 @@ compile_auth_binary() {
|
|||||||
go mod init hysteria-auth >/dev/null 2>&1
|
go mod init hysteria-auth >/dev/null 2>&1
|
||||||
go mod tidy >/dev/null 2>&1
|
go mod tidy >/dev/null 2>&1
|
||||||
if go build -o user_auth .; then
|
if go build -o user_auth .; then
|
||||||
chown hysteria:hysteria user_auth
|
|
||||||
chmod +x user_auth
|
chmod +x user_auth
|
||||||
echo "Authentication binary compiled successfully."
|
echo "Authentication binary compiled successfully."
|
||||||
else
|
else
|
||||||
|
|||||||
@ -48,8 +48,7 @@ After=network.target
|
|||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
User=hysteria
|
User=root
|
||||||
Group=hysteria
|
|
||||||
ExecStart=/etc/hysteria/core/scripts/auth/user_auth
|
ExecStart=/etc/hysteria/core/scripts/auth/user_auth
|
||||||
Restart=always
|
Restart=always
|
||||||
RestartSec=5
|
RestartSec=5
|
||||||
|
|||||||
@ -43,7 +43,6 @@ install_go_and_compile_auth() {
|
|||||||
go mod init hysteria_auth >/dev/null 2>&1
|
go mod init hysteria_auth >/dev/null 2>&1
|
||||||
go mod tidy >/dev/null 2>&1
|
go mod tidy >/dev/null 2>&1
|
||||||
if go build -o user_auth .; then
|
if go build -o user_auth .; then
|
||||||
chown hysteria:hysteria user_auth
|
|
||||||
chmod +x user_auth
|
chmod +x user_auth
|
||||||
success "Authentication binary compiled successfully."
|
success "Authentication binary compiled successfully."
|
||||||
else
|
else
|
||||||
@ -124,7 +123,6 @@ info "Setting ownership and permissions..."
|
|||||||
chown hysteria:hysteria "$HYSTERIA_INSTALL_DIR/ca.key" "$HYSTERIA_INSTALL_DIR/ca.crt"
|
chown hysteria:hysteria "$HYSTERIA_INSTALL_DIR/ca.key" "$HYSTERIA_INSTALL_DIR/ca.crt"
|
||||||
chmod 640 "$HYSTERIA_INSTALL_DIR/ca.key" "$HYSTERIA_INSTALL_DIR/ca.crt"
|
chmod 640 "$HYSTERIA_INSTALL_DIR/ca.key" "$HYSTERIA_INSTALL_DIR/ca.crt"
|
||||||
chown -R hysteria:hysteria "$HYSTERIA_INSTALL_DIR/core/scripts/telegrambot"
|
chown -R hysteria:hysteria "$HYSTERIA_INSTALL_DIR/core/scripts/telegrambot"
|
||||||
chmod +x "$HYSTERIA_INSTALL_DIR/core/scripts/hysteria2/auth_server.py"
|
|
||||||
chmod +x "$HYSTERIA_INSTALL_DIR/core/scripts/hysteria2/kick.py"
|
chmod +x "$HYSTERIA_INSTALL_DIR/core/scripts/hysteria2/kick.py"
|
||||||
|
|
||||||
# ========== Virtual Environment ==========
|
# ========== Virtual Environment ==========
|
||||||
|
|||||||
Reference in New Issue
Block a user