| APP_DATA_DIR="/tmp/data" | |
| echo "Entrypoint wrapper: Attempting to create necessary directories in ephemeral FS..." | |
| echo "Ensuring directory $APP_DATA_DIR exists (for SQLite or other app data)..." | |
| mkdir -p "$APP_DATA_DIR" | |
| mkdir -p "$APP_DATA_DIR/logs" | |
| if [ $? -ne 0 ]; then | |
| echo "ERROR: Failed to create $APP_DATA_DIR. Application data storage might fail." | |
| else | |
| echo "$APP_DATA_DIR was created or already exists." | |
| echo "Listing permissions for /tmp:" | |
| ls -ld /tmp | |
| echo "Listing permissions for $APP_DATA_DIR:" | |
| ls -ld "$APP_DATA_DIR" | |
| echo "Attempting to create a test file in $APP_DATA_DIR:" | |
| touch "$APP_DATA_DIR/test_writable.txt" | |
| if [ $? -eq 0 ]; then | |
| echo "$APP_DATA_DIR is writable, test file created." | |
| rm "$APP_DATA_DIR/test_writable.txt" | |
| else | |
| echo "$APP_DATA_DIR is NOT writable directly by this script for creating files." | |
| fi | |
| fi | |
| # 设置跳过证书验证的MySQL连接字符串 | |
| export SQL_DSN="avnadmin:AVNS_Kjgd0Bc4gfcBqzKSStj@tcp(new-api-bangban-3033.e.aivencloud.com:19593)/new-api?tls=skip-verify" | |
| echo "Entrypoint wrapper: Starting application with MySQL connection (TLS skip-verify)" | |
| echo "Using database: MySQL with TLS certificate verification disabled" | |
| exec /one-api -log-dir "$APP_DATA_DIR/logs" |