docs: replace environment-specific IPs with localhost
This commit is contained in:
@@ -79,7 +79,7 @@ const data = (j) => (j && j.data !== undefined ? j.data : j);
|
||||
async function main() {
|
||||
const env = loadEnv(path.join(ROOT, '.env'));
|
||||
const old = JSON.parse(fs.readFileSync(OLD_MAIL_CFG, 'utf8'));
|
||||
const base = (env.LIBREDESK_BASE_URL || 'http://192.168.31.61:9000').replace(/\/+$/, '');
|
||||
const base = (env.LIBREDESK_BASE_URL || 'http://localhost:9000').replace(/\/+$/, '');
|
||||
const c = createClient(base);
|
||||
await c.post('/api/v1/auth/login', { email: env.LIBREDESK_SYSTEM_EMAIL || 'System', password: env.LIBREDESK_SYSTEM_USER_PASSWORD });
|
||||
console.log('登录成功');
|
||||
|
||||
@@ -69,7 +69,7 @@ const data = (j) => (j && j.data !== undefined ? j.data : j);
|
||||
|
||||
async function main() {
|
||||
const env = loadEnv(path.join(ROOT, '.env'));
|
||||
const base = (env.LIBREDESK_BASE_URL || 'http://192.168.31.61:9000').replace(/\/+$/, '');
|
||||
const base = (env.LIBREDESK_BASE_URL || 'http://localhost:9000').replace(/\/+$/, '');
|
||||
const required = ['WA_PHONE_NUMBER_ID', 'WA_WABA_ID', 'WA_ACCESS_TOKEN', 'WA_APP_SECRET', 'WA_VERIFY_TOKEN'];
|
||||
const missing = required.filter((k) => !env[k]);
|
||||
if (missing.length) throw new Error(`.env 缺少: ${missing.join(', ')}`);
|
||||
|
||||
@@ -66,8 +66,8 @@ echo "==================== crm-new 已启动 ===================="
|
||||
echo " LibreDesk : http://localhost:9000 (System / ${LIBREDESK_SYSTEM_USER_PASSWORD})"
|
||||
echo " Twenty : http://localhost:3100 (首次访问需注册 workspace)"
|
||||
echo " bridge : http://localhost:4100 (/healthz, /tools/manifest)"
|
||||
echo " Postgres : 127.0.0.1:5440 (libredesk / twenty / bridge)"
|
||||
echo " Redis : 127.0.0.1:6390"
|
||||
echo " Postgres : localhost:5440 (libredesk / twenty / bridge)"
|
||||
echo " Redis : localhost:6390"
|
||||
echo
|
||||
echo " 下一步:"
|
||||
echo " 1. 打开 LibreDesk 配 AI Provider(DashScope)"
|
||||
|
||||
@@ -64,7 +64,7 @@ const mask = (k) => (k ? k.slice(0, 6) + '…' + k.slice(-4) : '(empty)');
|
||||
|
||||
async function main() {
|
||||
const env = loadEnv(path.join(ROOT, '.env'));
|
||||
const base = (env.LIBREDESK_BASE_URL || 'http://192.168.31.61:9000').replace(/\/+$/, '');
|
||||
const base = (env.LIBREDESK_BASE_URL || 'http://localhost:9000').replace(/\/+$/, '');
|
||||
const password = env.LIBREDESK_SYSTEM_USER_PASSWORD;
|
||||
const email = env.LIBREDESK_SYSTEM_EMAIL || 'System';
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ function createClient(baseURL) {
|
||||
|
||||
async function main() {
|
||||
const env = loadEnv(path.join(ROOT, '.env'));
|
||||
const base = (env.LIBREDESK_BASE_URL || 'http://192.168.31.61:9000').replace(/\/+$/, '');
|
||||
const base = (env.LIBREDESK_BASE_URL || 'http://localhost:9000').replace(/\/+$/, '');
|
||||
|
||||
// 163 凭据:优先 .env 覆盖,否则读旧项目 mail.config.json
|
||||
let user = env.SMTP_USER;
|
||||
|
||||
@@ -13,7 +13,6 @@ const path = require('path');
|
||||
|
||||
const ROOT = path.resolve(__dirname, '..');
|
||||
const message = process.argv.slice(2).join(' ') || 'Can you check the status of my order SO-1?';
|
||||
const SITE_ORIGIN = 'http://192.168.31.61:9000';
|
||||
|
||||
function loadEnv(file) {
|
||||
const out = {};
|
||||
@@ -33,8 +32,9 @@ const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
||||
|
||||
async function main() {
|
||||
const env = loadEnv(path.join(ROOT, '.env'));
|
||||
const lr = (env.LIBREDESK_BASE_URL || 'http://192.168.31.61:9000').replace(/\/+$/, '');
|
||||
const bridge = (env.BRIDGE_BASE_URL || 'http://192.168.31.61:4100').replace(/\/+$/, '');
|
||||
const SITE_ORIGIN = process.env.SITE_ORIGIN || env.IDENTITY_CORS_ORIGIN || 'http://localhost:9000';
|
||||
const lr = (env.LIBREDESK_BASE_URL || 'http://localhost:9000').replace(/\/+$/, '');
|
||||
const bridge = (env.BRIDGE_BASE_URL || 'http://localhost:4100').replace(/\/+$/, '');
|
||||
const inboxUUID = env.LIBREDESK_INBOX_UUID;
|
||||
if (!inboxUUID) throw new Error('缺少 LIBREDESK_INBOX_UUID');
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
||||
|
||||
async function main() {
|
||||
const env = loadEnv(path.join(ROOT, '.env'));
|
||||
const base = (env.LIBREDESK_BASE_URL || 'http://192.168.31.61:9000').replace(/\/+$/, '');
|
||||
const base = (env.LIBREDESK_BASE_URL || 'http://localhost:9000').replace(/\/+$/, '');
|
||||
|
||||
// 1. admin session: 找到 Website inbox 的 UUID
|
||||
const loginRes = await fetch(`${base}/api/v1/auth/login`, {
|
||||
|
||||
@@ -208,7 +208,7 @@ function asData(json) {
|
||||
// ---------------------------------------------------------------- main
|
||||
async function main() {
|
||||
const env = loadEnv();
|
||||
const base = (env.LIBREDESK_BASE_URL || 'http://192.168.31.61:9000').replace(/\/+$/, '');
|
||||
const base = (env.LIBREDESK_BASE_URL || 'http://localhost:9000').replace(/\/+$/, '');
|
||||
const email = env.LIBREDESK_SYSTEM_EMAIL || 'System';
|
||||
const password = env.LIBREDESK_SYSTEM_USER_PASSWORD;
|
||||
if (!password) throw new Error('缺少 LIBREDESK_SYSTEM_USER_PASSWORD');
|
||||
|
||||
@@ -34,5 +34,5 @@ WhatsApp webhook 地址: $URL/webhooks/whatsapp/<inbox_id>
|
||||
/hc/* (帮助中心,AI 引用链接)
|
||||
/widget* /static/public/*
|
||||
|
||||
管理后台 / API 仍只在内网 http://192.168.31.61:9000
|
||||
管理后台 / API 仍只在内网 http://localhost:9000
|
||||
EOF
|
||||
|
||||
@@ -75,7 +75,7 @@ function createClient(baseURL) {
|
||||
|
||||
async function main() {
|
||||
const env = loadEnv(path.join(ROOT, '.env'));
|
||||
const base = (env.LIBREDESK_BASE_URL || 'http://192.168.31.61:9000').replace(/\/+$/, '');
|
||||
const base = (env.LIBREDESK_BASE_URL || 'http://localhost:9000').replace(/\/+$/, '');
|
||||
const toolsKey = env.TOOLS_SHARED_KEY;
|
||||
if (!toolsKey) throw new Error('TOOLS_SHARED_KEY 未配置');
|
||||
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
# 本地静态测试页(widget JWT 演示)
|
||||
set -euo pipefail
|
||||
cd "$(dirname "${BASH_SOURCE[0]}")/../web"
|
||||
echo "http://192.168.31.61:${WEB_PORT:-8088}/demo.html"
|
||||
echo "http://localhost:${WEB_PORT:-8088}/demo.html"
|
||||
exec python3 -m http.server "${WEB_PORT:-8088}" --bind 0.0.0.0
|
||||
|
||||
@@ -31,7 +31,7 @@ function loadEnv(file) {
|
||||
|
||||
async function main() {
|
||||
const env = loadEnv(path.join(ROOT, '.env'));
|
||||
const base = (env.LIBREDESK_BASE_URL || 'http://192.168.31.61:9000').replace(/\/+$/, '');
|
||||
const base = (env.LIBREDESK_BASE_URL || 'http://localhost:9000').replace(/\/+$/, '');
|
||||
|
||||
const login = await fetch(base + '/api/v1/auth/login', {
|
||||
method: 'POST',
|
||||
|
||||
@@ -89,7 +89,7 @@ Never create an opportunity before the contact is verified.`;
|
||||
|
||||
async function main() {
|
||||
const env = loadEnv(path.join(ROOT, '.env'));
|
||||
const base = (env.LIBREDESK_BASE_URL || 'http://192.168.31.61:9000').replace(/\/+$/, '');
|
||||
const base = (env.LIBREDESK_BASE_URL || 'http://localhost:9000').replace(/\/+$/, '');
|
||||
const c = createClient(base);
|
||||
await c.post('/api/v1/auth/login', { email: env.LIBREDESK_SYSTEM_EMAIL || 'System', password: env.LIBREDESK_SYSTEM_USER_PASSWORD });
|
||||
console.log('登录成功');
|
||||
@@ -147,7 +147,7 @@ async function main() {
|
||||
launcher: { position: 'right', icon_scale: 100, spacing: { side: 24, bottom: 24 } },
|
||||
greeting_message: 'Hi! How can we help you today?',
|
||||
chat_introduction: 'Ask about products, orders, shipping or returns.',
|
||||
trusted_domains: ['192.168.31.61:8088', 'localhost:8088', '127.0.0.1:8088', '192.168.31.61', 'localhost', '127.0.0.1', 'www.yehwang.com', 'yehwang.com'],
|
||||
trusted_domains: ['localhost:8088', '127.0.0.1:8088', 'localhost', '127.0.0.1', 'www.yehwang.com', 'yehwang.com'],
|
||||
help: { help_center_id: 0 },
|
||||
users: { allow_start_conversation: true, prevent_multiple_conversations: false },
|
||||
visitors: { allow_start_conversation: true, prevent_multiple_conversations: false },
|
||||
|
||||
@@ -70,7 +70,7 @@ const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
||||
|
||||
async function main() {
|
||||
const env = loadEnv(path.join(ROOT, '.env'));
|
||||
const base = (env.TWENTY_SERVER_URL || 'http://192.168.31.61:3100').replace(/\/+$/, '');
|
||||
const base = (env.TWENTY_SERVER_URL || 'http://localhost:3100').replace(/\/+$/, '');
|
||||
const email = env.TWENTY_ADMIN_EMAIL;
|
||||
const password = env.TWENTY_ADMIN_PASSWORD;
|
||||
if (!email || !password) throw new Error('缺少 TWENTY_ADMIN_EMAIL / TWENTY_ADMIN_PASSWORD(写入 .env,不要硬编码)');
|
||||
|
||||
@@ -64,7 +64,7 @@ function createClient(baseURL) {
|
||||
|
||||
async function main() {
|
||||
const env = loadEnv(path.join(ROOT, '.env'));
|
||||
const base = (env.LIBREDESK_BASE_URL || 'http://192.168.31.61:9000').replace(/\/+$/, '');
|
||||
const base = (env.LIBREDESK_BASE_URL || 'http://localhost:9000').replace(/\/+$/, '');
|
||||
const c = createClient(base);
|
||||
await c.post('/api/v1/auth/login', { email: env.LIBREDESK_SYSTEM_EMAIL || 'System', password: env.LIBREDESK_SYSTEM_USER_PASSWORD });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user