autoface commited on
Commit
5b0a02b
·
1 Parent(s): 429d345

Updated the log directory structure to change all log paths from `/home/user/logs` to `/home/user/log` to simplify file management. Also update related scripts and configuration files to reflect this change.

Browse files
Dockerfile CHANGED
@@ -43,7 +43,7 @@ ENV HOME=/home/user \
43
  WORKDIR $HOME
44
 
45
  # Create required directories
46
- RUN mkdir -p /home/user/config /home/user/data /home/user/logs \
47
  /home/user/.cache/huggingface /home/user/downloads /home/user/temp
48
 
49
  # Copy project structure
 
43
  WORKDIR $HOME
44
 
45
  # Create required directories
46
+ RUN mkdir -p /home/user/config /home/user/data /home/user/log \
47
  /home/user/.cache/huggingface /home/user/downloads /home/user/temp
48
 
49
  # Copy project structure
configs/persistence.conf CHANGED
@@ -60,7 +60,7 @@ ENABLE_INTEGRITY_CHECK=true
60
 
61
  # Log Configuration
62
  # Log file path (using user directory for better permissions)
63
- LOG_FILE="/home/user/logs/persistence.log"
64
 
65
  # Log level (DEBUG, INFO, WARN, ERROR)
66
  LOG_LEVEL="INFO"
 
60
 
61
  # Log Configuration
62
  # Log file path (using user directory for better permissions)
63
+ LOG_FILE="/home/user/log/persistence.log"
64
 
65
  # Log level (DEBUG, INFO, WARN, ERROR)
66
  LOG_LEVEL="INFO"
configs/restic.conf CHANGED
@@ -195,7 +195,7 @@ RESTIC_NO_CACHE="false"
195
  # =============================================================================
196
 
197
  # Log file location
198
- RESTIC_LOG_FILE="/home/user/logs/restic.log"
199
 
200
  # Log level: DEBUG, INFO, WARN, ERROR
201
  RESTIC_LOG_LEVEL="INFO"
 
195
  # =============================================================================
196
 
197
  # Log file location
198
+ RESTIC_LOG_FILE="/home/user/log/restic.log"
199
 
200
  # Log level: DEBUG, INFO, WARN, ERROR
201
  RESTIC_LOG_LEVEL="INFO"
docs/RESTIC_USAGE.md CHANGED
@@ -255,7 +255,7 @@ RESTIC_LOG_LEVEL="INFO" # Log level: DEBUG, INFO, WARN, ERRO
255
  ps aux | grep restic
256
 
257
  # View logs
258
- tail -f /home/user/logs/restic.log
259
 
260
  # Test repository
261
  restic check --read-data
 
255
  ps aux | grep restic
256
 
257
  # View logs
258
+ tail -f /home/user/log/restic.log
259
 
260
  # Test repository
261
  restic check --read-data
scripts/start/aria2-start.sh CHANGED
@@ -47,7 +47,7 @@ ARIA2_WEBUI_PORT="${ARIA2_WEBUI_PORT:-6880}"
47
  ARIA2_SECRET="${ARIA2_SECRET:-$(openssl rand -base64 32)}"
48
  ARIA2_DOWNLOAD_DIR="${ARIA2_DOWNLOAD_DIR:-/home/user/downloads}"
49
  ARIA2_SESSION_FILE="${ARIA2_SESSION_FILE:-/home/user/config/aria2.session}"
50
- ARIA2_LOG_FILE="${ARIA2_LOG_FILE:-/home/user/logs/aria2.log}"
51
 
52
  # Advanced configuration options with defaults
53
  ARIA2_MAX_CONCURRENT="${ARIA2_MAX_CONCURRENT:-5}"
 
47
  ARIA2_SECRET="${ARIA2_SECRET:-$(openssl rand -base64 32)}"
48
  ARIA2_DOWNLOAD_DIR="${ARIA2_DOWNLOAD_DIR:-/home/user/downloads}"
49
  ARIA2_SESSION_FILE="${ARIA2_SESSION_FILE:-/home/user/config/aria2.session}"
50
+ ARIA2_LOG_FILE="${ARIA2_LOG_FILE:-/home/user/log/aria2.log}"
51
 
52
  # Advanced configuration options with defaults
53
  ARIA2_MAX_CONCURRENT="${ARIA2_MAX_CONCURRENT:-5}"
scripts/start/core-service-start.sh CHANGED
@@ -15,7 +15,7 @@ SERVICE_PORT="${SERVICE_PORT:-8080}"
15
  SERVICE_HOST="${SERVICE_HOST:-0.0.0.0}"
16
  SERVICE_DATA_DIR="${SERVICE_DATA_DIR:-/home/user/data}"
17
  SERVICE_CONFIG_DIR="${SERVICE_CONFIG_DIR:-/home/user/config}"
18
- SERVICE_LOG_DIR="${SERVICE_LOG_DIR:-/home/user/logs}"
19
 
20
  # TODO: Add your service-specific environment variables
21
  # Examples:
 
15
  SERVICE_HOST="${SERVICE_HOST:-0.0.0.0}"
16
  SERVICE_DATA_DIR="${SERVICE_DATA_DIR:-/home/user/data}"
17
  SERVICE_CONFIG_DIR="${SERVICE_CONFIG_DIR:-/home/user/config}"
18
+ SERVICE_LOG_DIR="${SERVICE_LOG_DIR:-/home/user/log}"
19
 
20
  # TODO: Add your service-specific environment variables
21
  # Examples:
scripts/start/frpc-start.sh CHANGED
@@ -38,8 +38,8 @@ fi
38
 
39
  # Create runtime configuration by substituting environment variables
40
  log "Creating runtime configuration from template..."
41
- mkdir -p /home/user/logs
42
- envsubst < /home/user/config/frpc.toml > /home/user/logs/frpc_runtime.toml
43
 
44
  # Check if frpc binary exists
45
  if ! command -v frpc &> /dev/null; then
@@ -49,10 +49,10 @@ fi
49
 
50
  # Validate runtime configuration file
51
  log "Validating frpc runtime configuration..."
52
- if ! frpc verify -c /home/user/logs/frpc_runtime.toml; then
53
  log "ERROR: Invalid frpc runtime configuration"
54
  log "Generated configuration:"
55
- cat /home/user/logs/frpc_runtime.toml
56
  exit 1
57
  fi
58
 
@@ -65,5 +65,5 @@ if [[ "${FRPC_ENABLED:-true}" != "true" ]]; then
65
  fi
66
 
67
  # Start frpc with runtime configuration
68
- log "Starting frpc with runtime configuration: /home/user/logs/frpc_runtime.toml"
69
- exec frpc -c /home/user/logs/frpc_runtime.toml
 
38
 
39
  # Create runtime configuration by substituting environment variables
40
  log "Creating runtime configuration from template..."
41
+ mkdir -p /home/user/log
42
+ envsubst < /home/user/config/frpc.toml > /home/user/log/frpc_runtime.toml
43
 
44
  # Check if frpc binary exists
45
  if ! command -v frpc &> /dev/null; then
 
49
 
50
  # Validate runtime configuration file
51
  log "Validating frpc runtime configuration..."
52
+ if ! frpc verify -c /home/user/log/frpc_runtime.toml; then
53
  log "ERROR: Invalid frpc runtime configuration"
54
  log "Generated configuration:"
55
+ cat /home/user/log/frpc_runtime.toml
56
  exit 1
57
  fi
58
 
 
65
  fi
66
 
67
  # Start frpc with runtime configuration
68
+ log "Starting frpc with runtime configuration: /home/user/log/frpc_runtime.toml"
69
+ exec frpc -c /home/user/log/frpc_runtime.toml
scripts/utils/persistence.sh CHANGED
@@ -13,8 +13,8 @@ log() {
13
  local level="$1"
14
  shift
15
  # Ensure log directory exists
16
- mkdir -p "$(dirname "${LOG_FILE:-/home/user/logs/persistence.log}")"
17
- echo "[$(date '+%Y-%m-%d %H:%M:%S')] [$level] $*" | tee -a "${LOG_FILE:-/home/user/logs/persistence.log}"
18
  }
19
 
20
  log_info() { log "INFO" "$@"; }
 
13
  local level="$1"
14
  shift
15
  # Ensure log directory exists
16
+ mkdir -p "$(dirname "${LOG_FILE:-/home/user/log/persistence.log}")"
17
+ echo "[$(date '+%Y-%m-%d %H:%M:%S')] [$level] $*" | tee -a "${LOG_FILE:-/home/user/log/persistence.log}"
18
  }
19
 
20
  log_info() { log "INFO" "$@"; }