diff --git a/.env.local b/.env.local index 6e0b2e9..cb49f82 100644 --- a/.env.local +++ b/.env.local @@ -1,11 +1,20 @@ -# 本地调试 - 支付测试 1 元、zpay 渠道 -NEXT_PUBLIC_POCKETBASE_URL=https://pocketbase.hackrobot.cn -PAYMENT_API_URL=http://127.0.0.1:8007 +# Linux 生产环境 - nomadro.cn +ROOT_DOMAIN=nomadro.cn +NEXT_PUBLIC_ROOT_DOMAIN=nomadro.cn +NEXT_PUBLIC_POCKETBASE_URL=https://pocketbase.nomadro.cn +POCKETBASE_URL=http://127.0.0.1:8090 +PAYMENT_API_URL=https://api.nomadro.cn PAYMENT_PROVIDER=zpay PAYMENT_DEFAULT_AMOUNT=100 PAYMENT_JOIN_AMOUNT=100 NEXT_PUBLIC_SITE_ID=meetup -NEXT_PUBLIC_SITE_URL=http://localhost:3001 +NEXT_PUBLIC_SITE_URL=https://nomadro.cn +NEXT_PUBLIC_API_BASE_URL=/api + +# MinIO +MINIO_ENDPOINT=minio.nomadro.cn +MINIO_PORT=443 +MINIO_USE_SSL=true # PocketBase 管理员(check-user、ensure-user、vip 需要) POCKETBASE_EMAIL=xiaoshuang.eric@gmail.com diff --git a/.env.local.bak.20260606212903 b/.env.local.bak.20260606212903 new file mode 100644 index 0000000..6e0b2e9 --- /dev/null +++ b/.env.local.bak.20260606212903 @@ -0,0 +1,12 @@ +# 本地调试 - 支付测试 1 元、zpay 渠道 +NEXT_PUBLIC_POCKETBASE_URL=https://pocketbase.hackrobot.cn +PAYMENT_API_URL=http://127.0.0.1:8007 +PAYMENT_PROVIDER=zpay +PAYMENT_DEFAULT_AMOUNT=100 +PAYMENT_JOIN_AMOUNT=100 +NEXT_PUBLIC_SITE_ID=meetup +NEXT_PUBLIC_SITE_URL=http://localhost:3001 + +# PocketBase 管理员(check-user、ensure-user、vip 需要) +POCKETBASE_EMAIL=xiaoshuang.eric@gmail.com +POCKETBASE_PASSWORD=Xiao4669805@ diff --git a/.gitignore b/.gitignore index 59c9787..2f23f3c 100644 --- a/.gitignore +++ b/.gitignore @@ -51,5 +51,8 @@ build /data/ /backend/uploads/ /backend/.env +/backend/.venv/ +__pycache__/ +*.py[cod] /tools/pocketbase/ /tools/pocketbase.zip diff --git a/backend/__pycache__/__init__.cpython-312.pyc b/backend/__pycache__/__init__.cpython-312.pyc index 86cb54a..7eec73b 100644 Binary files a/backend/__pycache__/__init__.cpython-312.pyc and b/backend/__pycache__/__init__.cpython-312.pyc differ diff --git a/backend/__pycache__/enhanced_seed.cpython-312.pyc b/backend/__pycache__/enhanced_seed.cpython-312.pyc index 53a56e7..fefd0ca 100644 Binary files a/backend/__pycache__/enhanced_seed.cpython-312.pyc and b/backend/__pycache__/enhanced_seed.cpython-312.pyc differ diff --git a/backend/__pycache__/init_db.cpython-312.pyc b/backend/__pycache__/init_db.cpython-312.pyc index 5b5c2e7..daa8e11 100644 Binary files a/backend/__pycache__/init_db.cpython-312.pyc and b/backend/__pycache__/init_db.cpython-312.pyc differ diff --git a/backend/__pycache__/main.cpython-312.pyc b/backend/__pycache__/main.cpython-312.pyc index 38b82ca..b3aeab4 100644 Binary files a/backend/__pycache__/main.cpython-312.pyc and b/backend/__pycache__/main.cpython-312.pyc differ diff --git a/backend/__pycache__/pb_client.cpython-312.pyc b/backend/__pycache__/pb_client.cpython-312.pyc index 97a4447..fd86ef1 100644 Binary files a/backend/__pycache__/pb_client.cpython-312.pyc and b/backend/__pycache__/pb_client.cpython-312.pyc differ diff --git a/backend/__pycache__/seed_data.cpython-312.pyc b/backend/__pycache__/seed_data.cpython-312.pyc index 02c18f7..94daa43 100644 Binary files a/backend/__pycache__/seed_data.cpython-312.pyc and b/backend/__pycache__/seed_data.cpython-312.pyc differ diff --git a/backend/__pycache__/settings.cpython-312.pyc b/backend/__pycache__/settings.cpython-312.pyc index 1b51145..21cdf0d 100644 Binary files a/backend/__pycache__/settings.cpython-312.pyc and b/backend/__pycache__/settings.cpython-312.pyc differ diff --git a/cnomadcna.sh b/cnomadcna.sh old mode 100644 new mode 100755 index c3448a5..0af3caf --- a/cnomadcna.sh +++ b/cnomadcna.sh @@ -1,3 +1,11 @@ #!/bin/bash -export PORT=4002 -exec npm run start +set -euo pipefail + +cd "$(dirname "$0")" + +export PATH="/usr/local/bin:/usr/bin:/bin" +export NODE_ENV=production +export HOSTNAME="${NEXT_HOSTNAME:-0.0.0.0}" +export PORT="${PORT:-4002}" + +exec pnpm start diff --git a/codex-config.sh b/codex-config.sh new file mode 100644 index 0000000..aeab099 --- /dev/null +++ b/codex-config.sh @@ -0,0 +1,54 @@ +#!/bin/bash + +# Prompt for API KEY +while true; do + read -p "Please enter your API KEY: " API_KEY + if [ -n "$API_KEY" ]; then + break + else + echo "Error: API KEY cannot be empty. Please try again." + fi +done + +# Check if config files exist and backup if necessary +CONFIG_FILE=~/.codex/config.toml +AUTH_FILE=~/.codex/auth.json +BACKUP_FILE=~/codex-config.backup.tar.gz + +if [ -f "$CONFIG_FILE" ] || [ -f "$AUTH_FILE" ]; then + echo "Existing configuration files found. Creating backup..." + tar -czf "$BACKUP_FILE" -C ~/.codex $(ls ~/.codex/ | grep -E '^(config\.toml|auth\.json)$' 2>/dev/null) + echo "Backup created: $BACKUP_FILE" +fi + +# Create ~/.codex directory if it doesn't exist +mkdir -p ~/.codex + +# Create config.toml +cat > "$CONFIG_FILE" << 'EOF' +model_provider = "codex-for-me" +model = "gpt-5.3-codex" +model_reasoning_effort = "xhigh" +disable_response_storage = true +sandbox_mode = "danger-full-access" + +[model_providers.codex-for-me] +name = "codex-for-me" +base_url = "https://blackaicoding.com/v1" +wire_api = "responses" +requires_openai_auth = true +EOF + +# Create auth.json with user-provided API KEY +cat > "$AUTH_FILE" << EOF +{ +"OPENAI_API_KEY": "$API_KEY" +} +EOF + +echo "" +echo "Configuration completed successfully!" +echo "" +echo "To restore previous configuration, run:" +echo " tar -xzf ~/codex-config.backup.tar.gz -C ~/.codex" +echo "" diff --git a/next.config.ts b/next.config.ts index 2c41525..d247f8f 100644 --- a/next.config.ts +++ b/next.config.ts @@ -1,6 +1,15 @@ import type { NextConfig } from "next"; const nextConfig: NextConfig = { + async rewrites() { + return [ + { + source: + "/api/:path((?:health|cities|content|notifications|recommendations|routes|services|downloads|meetups|discussions|gigs|profiles|matches|feedback|stats|ai).*)", + destination: "http://127.0.0.1:8000/api/:path", + }, + ]; + }, allowedDevOrigins: [ "localhost", "localhost:3000",