fix remote ubuntu server
This commit is contained in:
@@ -63,12 +63,21 @@ def get_settings() -> Settings:
|
||||
robot_package_base_url = os.getenv("ROBOT_PACKAGE_BASE_URL", "https://package.pnkr.cloud").rstrip("/")
|
||||
return Settings(
|
||||
agent_version=os.getenv("AGENT_VERSION", "1.0.0"),
|
||||
host=os.getenv("AGENT_HOST", "127.0.0.1"),
|
||||
host=os.getenv("AGENT_HOST", "0.0.0.0"),
|
||||
port=int(os.getenv("AGENT_PORT", "5010")),
|
||||
robot_package_base_url=robot_package_base_url,
|
||||
allowed_origins=_csv(
|
||||
os.getenv("ALLOWED_ORIGINS"),
|
||||
["https://app.pnkr.cloud", "https://package.pnkr.cloud", "http://localhost:3000", "http://localhost:5173"],
|
||||
[
|
||||
"https://app.pnkr.cloud",
|
||||
"https://package.pnkr.cloud",
|
||||
"http://localhost:3000",
|
||||
"http://127.0.0.1:3000",
|
||||
"http://localhost:5173",
|
||||
"http://127.0.0.1:5173",
|
||||
"http://localhost:8080",
|
||||
"http://127.0.0.1:8080",
|
||||
],
|
||||
),
|
||||
allowed_download_hosts=_csv(
|
||||
os.getenv("ALLOWED_DOWNLOAD_HOSTS"),
|
||||
|
||||
@@ -4,7 +4,7 @@ After=network.target
|
||||
|
||||
[Service]
|
||||
WorkingDirectory=/opt/local-installer-agent
|
||||
ExecStart=/opt/local-installer-agent/venv/bin/python -m uvicorn app.main:app --host 127.0.0.1 --port 5010
|
||||
ExecStart=/opt/local-installer-agent/venv/bin/python -m uvicorn app.main:app --host ${AGENT_HOST} --port ${AGENT_PORT}
|
||||
Restart=always
|
||||
User=root
|
||||
EnvironmentFile=/etc/local-installer-agent/agent.env
|
||||
|
||||
@@ -3,6 +3,8 @@ set -euo pipefail
|
||||
|
||||
VERSION="${VERSION:-1.0.0}"
|
||||
ARCH="${ARCH:-amd64}"
|
||||
AGENT_HOST="${AGENT_HOST:-0.0.0.0}"
|
||||
AGENT_PORT="${AGENT_PORT:-5010}"
|
||||
DEB_COMPRESSION="${DEB_COMPRESSION:-gzip}"
|
||||
PKG_NAME="local-installer-agent"
|
||||
BUILD_ROOT="${BUILD_ROOT:-build}"
|
||||
@@ -53,10 +55,10 @@ chmod 755 "${BUILD_DIR}/DEBIAN"
|
||||
|
||||
cat > "${BUILD_DIR}/etc/local-installer-agent/agent.env" <<EOF
|
||||
AGENT_VERSION=${VERSION}
|
||||
AGENT_HOST=127.0.0.1
|
||||
AGENT_PORT=5010
|
||||
AGENT_HOST=${AGENT_HOST}
|
||||
AGENT_PORT=${AGENT_PORT}
|
||||
ROBOT_PACKAGE_BASE_URL=https://package.pnkr.cloud
|
||||
ALLOWED_ORIGINS=https://app.pnkr.cloud,https://package.pnkr.cloud,http://localhost:3000,http://localhost:5173
|
||||
ALLOWED_ORIGINS=https://app.pnkr.cloud,https://package.pnkr.cloud,http://localhost:3000,http://127.0.0.1:3000,http://localhost:5173,http://127.0.0.1:5173,http://localhost:8080,http://127.0.0.1:8080
|
||||
ALLOWED_DOWNLOAD_HOSTS=package.pnkr.cloud
|
||||
ALLOWED_DOCKER_REGISTRIES=registry.robot.package,docker.io
|
||||
CACHE_DIR=/var/cache/local-installer-agent/packages
|
||||
|
||||
Reference in New Issue
Block a user