File size: 1,293 Bytes
430f660 01016cf 747871c 4074c5f a77b8fc 4074c5f fbf2acc 4330f2f a77b8fc 4330f2f a77b8fc 4074c5f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
#!/bin/sh
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" |