Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a54b0a8f8e | |||
| 65426a6c67 | |||
| 6143d9afef | |||
| 690631ef9b | |||
| dfd6d33142 | |||
| c14c032081 | |||
| 487dcea5c1 | |||
| 0d9c92971c |
@@ -0,0 +1,9 @@
|
|||||||
|
# Default: normalize all text files to LF on commit
|
||||||
|
* text=auto
|
||||||
|
|
||||||
|
# Force LF for files that must be LF on Linux hosts
|
||||||
|
*.sh text eol=lf
|
||||||
|
*.yml text eol=lf
|
||||||
|
*.yaml text eol=lf
|
||||||
|
*.service text eol=lf
|
||||||
|
*.conf text eol=lf
|
||||||
@@ -71,7 +71,7 @@ jobs:
|
|||||||
run: tar -czf deepdrft-api.tar.gz -C DeepDrftAPI/publish .
|
run: tar -czf deepdrft-api.tar.gz -C DeepDrftAPI/publish .
|
||||||
|
|
||||||
- name: Upload artifacts (archive + bundle)
|
- name: Upload artifacts (archive + bundle)
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: deepdrft-api
|
name: deepdrft-api
|
||||||
path: |
|
path: |
|
||||||
@@ -90,7 +90,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Download artifacts
|
- name: Download artifacts
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: deepdrft-api
|
name: deepdrft-api
|
||||||
path: staging/
|
path: staging/
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ jobs:
|
|||||||
run: tar -czf deepdrft-manager.tar.gz -C DeepDrftManager/publish .
|
run: tar -czf deepdrft-manager.tar.gz -C DeepDrftManager/publish .
|
||||||
|
|
||||||
- name: Upload artifact
|
- name: Upload artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: deepdrft-manager
|
name: deepdrft-manager
|
||||||
path: deepdrft-manager.tar.gz
|
path: deepdrft-manager.tar.gz
|
||||||
@@ -49,7 +49,7 @@ jobs:
|
|||||||
DEPLOY_HOST: ${{ github.ref == 'refs/heads/master' && 'prod.cerebellumsoftworks.com' || 'dch7.cerebellumsoftworks.com' }}
|
DEPLOY_HOST: ${{ github.ref == 'refs/heads/master' && 'prod.cerebellumsoftworks.com' || 'dch7.cerebellumsoftworks.com' }}
|
||||||
steps:
|
steps:
|
||||||
- name: Download artifact
|
- name: Download artifact
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: deepdrft-manager
|
name: deepdrft-manager
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ jobs:
|
|||||||
run: tar -czf deepdrft-public.tar.gz -C DeepDrftPublic/publish .
|
run: tar -czf deepdrft-public.tar.gz -C DeepDrftPublic/publish .
|
||||||
|
|
||||||
- name: Upload artifact
|
- name: Upload artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: deepdrft-public
|
name: deepdrft-public
|
||||||
path: deepdrft-public.tar.gz
|
path: deepdrft-public.tar.gz
|
||||||
@@ -53,7 +53,7 @@ jobs:
|
|||||||
DEPLOY_HOST: ${{ github.ref == 'refs/heads/master' && 'prod.cerebellumsoftworks.com' || 'dch7.cerebellumsoftworks.com' }}
|
DEPLOY_HOST: ${{ github.ref == 'refs/heads/master' && 'prod.cerebellumsoftworks.com' || 'dch7.cerebellumsoftworks.com' }}
|
||||||
steps:
|
steps:
|
||||||
- name: Download artifact
|
- name: Download artifact
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: deepdrft-public
|
name: deepdrft-public
|
||||||
|
|
||||||
|
|||||||
@@ -26,3 +26,4 @@
|
|||||||
|
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
||||||
|
|||||||
@@ -17,3 +17,4 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
||||||
|
|||||||
@@ -120,3 +120,4 @@ fi
|
|||||||
chmod +x "${EXTRACT_DIR}/install.sh"
|
chmod +x "${EXTRACT_DIR}/install.sh"
|
||||||
exec bash "${EXTRACT_DIR}/install.sh"
|
exec bash "${EXTRACT_DIR}/install.sh"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -82,6 +82,15 @@ DOMAIN_PUBLIC="${DOMAIN_PUBLIC:-deepdrft.com}"
|
|||||||
read -rp " App subdomain [app.${DOMAIN_PUBLIC}]: " DOMAIN_APP
|
read -rp " App subdomain [app.${DOMAIN_PUBLIC}]: " DOMAIN_APP
|
||||||
DOMAIN_APP="${DOMAIN_APP:-app.${DOMAIN_PUBLIC}}"
|
DOMAIN_APP="${DOMAIN_APP:-app.${DOMAIN_PUBLIC}}"
|
||||||
|
|
||||||
|
read -rp " DeepDrftPublic port [5000]: " PORT_PUBLIC
|
||||||
|
PORT_PUBLIC="${PORT_PUBLIC:-5000}"
|
||||||
|
|
||||||
|
read -rp " DeepDrftManager port [5001]: " PORT_MANAGER
|
||||||
|
PORT_MANAGER="${PORT_MANAGER:-5001}"
|
||||||
|
|
||||||
|
read -rp " DeepDrftAPI port [5002]: " PORT_API
|
||||||
|
PORT_API="${PORT_API:-5002}"
|
||||||
|
|
||||||
CERTBOT_EMAIL=""
|
CERTBOT_EMAIL=""
|
||||||
while [[ -z "${CERTBOT_EMAIL}" ]]; do
|
while [[ -z "${CERTBOT_EMAIL}" ]]; do
|
||||||
read -rp " Email for certbot TLS cert (required): " CERTBOT_EMAIL
|
read -rp " Email for certbot TLS cert (required): " CERTBOT_EMAIL
|
||||||
@@ -103,6 +112,9 @@ printf " │ %-22s %-37s│\n" "DB_AUTH" "${DB_AUTH}"
|
|||||||
printf " │ %-22s %-37s│\n" "DOMAIN_PUBLIC" "${DOMAIN_PUBLIC}"
|
printf " │ %-22s %-37s│\n" "DOMAIN_PUBLIC" "${DOMAIN_PUBLIC}"
|
||||||
printf " │ %-22s %-37s│\n" "DOMAIN_APP" "${DOMAIN_APP}"
|
printf " │ %-22s %-37s│\n" "DOMAIN_APP" "${DOMAIN_APP}"
|
||||||
printf " │ %-22s %-37s│\n" "CERTBOT_EMAIL" "${CERTBOT_EMAIL}"
|
printf " │ %-22s %-37s│\n" "CERTBOT_EMAIL" "${CERTBOT_EMAIL}"
|
||||||
|
printf " │ %-22s %-37s│\n" "PORT_PUBLIC" "${PORT_PUBLIC}"
|
||||||
|
printf " │ %-22s %-37s│\n" "PORT_MANAGER" "${PORT_MANAGER}"
|
||||||
|
printf " │ %-22s %-37s│\n" "PORT_API" "${PORT_API}"
|
||||||
printf " │ %-22s %-37s│\n" "OPT_DIR" "${OPT_DIR}"
|
printf " │ %-22s %-37s│\n" "OPT_DIR" "${OPT_DIR}"
|
||||||
echo " └──────────────────────────────────────────────────────────────┘"
|
echo " └──────────────────────────────────────────────────────────────┘"
|
||||||
echo
|
echo
|
||||||
@@ -204,6 +216,10 @@ cp "${SCRIPT_DIR}/systemd/deepdrftpublic.service" "${APP_HOME}/.config/systemd/
|
|||||||
cp "${SCRIPT_DIR}/systemd/deepdrftmanager.service" "${APP_HOME}/.config/systemd/user/"
|
cp "${SCRIPT_DIR}/systemd/deepdrftmanager.service" "${APP_HOME}/.config/systemd/user/"
|
||||||
cp "${SCRIPT_DIR}/systemd/deepdrftapi.service" "${APP_HOME}/.config/systemd/user/"
|
cp "${SCRIPT_DIR}/systemd/deepdrftapi.service" "${APP_HOME}/.config/systemd/user/"
|
||||||
|
|
||||||
|
sed -i "s|__PORT_PUBLIC__|${PORT_PUBLIC}|g" "${APP_HOME}/.config/systemd/user/deepdrftpublic.service"
|
||||||
|
sed -i "s|__PORT_MANAGER__|${PORT_MANAGER}|g" "${APP_HOME}/.config/systemd/user/deepdrftmanager.service"
|
||||||
|
sed -i "s|__PORT_API__|${PORT_API}|g" "${APP_HOME}/.config/systemd/user/deepdrftapi.service"
|
||||||
|
|
||||||
chown -R "${APP_USER}:${APP_USER}" "${APP_HOME}/.config/systemd"
|
chown -R "${APP_USER}:${APP_USER}" "${APP_HOME}/.config/systemd"
|
||||||
|
|
||||||
# daemon-reload and enable. XDG_RUNTIME_DIR must be set explicitly — PAM may not
|
# daemon-reload and enable. XDG_RUNTIME_DIR must be set explicitly — PAM may not
|
||||||
@@ -237,6 +253,7 @@ else
|
|||||||
DB_AUTH="${DB_AUTH}" \
|
DB_AUTH="${DB_AUTH}" \
|
||||||
DOMAIN_PUBLIC="${DOMAIN_PUBLIC}" \
|
DOMAIN_PUBLIC="${DOMAIN_PUBLIC}" \
|
||||||
DOMAIN_APP="${DOMAIN_APP}" \
|
DOMAIN_APP="${DOMAIN_APP}" \
|
||||||
|
PORT_API="${PORT_API}" \
|
||||||
bash "${SCRIPT_DIR}/setup-step10-creds.sh"
|
bash "${SCRIPT_DIR}/setup-step10-creds.sh"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -371,10 +388,12 @@ step 9 "nginx"
|
|||||||
# Templates use __DOMAIN_PUBLIC__ and __DOMAIN_APP__ so the files in the tarball
|
# Templates use __DOMAIN_PUBLIC__ and __DOMAIN_APP__ so the files in the tarball
|
||||||
# don't contain real hostnames — substitution happens at install time.
|
# don't contain real hostnames — substitution happens at install time.
|
||||||
sed -e "s|__DOMAIN_PUBLIC__|${DOMAIN_PUBLIC}|g" \
|
sed -e "s|__DOMAIN_PUBLIC__|${DOMAIN_PUBLIC}|g" \
|
||||||
|
-e "s|__PORT_PUBLIC__|${PORT_PUBLIC}|g" \
|
||||||
"${SCRIPT_DIR}/nginx/deepdrft-public.conf" \
|
"${SCRIPT_DIR}/nginx/deepdrft-public.conf" \
|
||||||
> "/etc/nginx/sites-available/${DOMAIN_PUBLIC}.conf"
|
> "/etc/nginx/sites-available/${DOMAIN_PUBLIC}.conf"
|
||||||
|
|
||||||
sed -e "s|__DOMAIN_APP__|${DOMAIN_APP}|g" \
|
sed -e "s|__DOMAIN_APP__|${DOMAIN_APP}|g" \
|
||||||
|
-e "s|__PORT_MANAGER__|${PORT_MANAGER}|g" \
|
||||||
"${SCRIPT_DIR}/nginx/deepdrft-manager.conf" \
|
"${SCRIPT_DIR}/nginx/deepdrft-manager.conf" \
|
||||||
> "/etc/nginx/sites-available/${DOMAIN_APP}.conf"
|
> "/etc/nginx/sites-available/${DOMAIN_APP}.conf"
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ server {
|
|||||||
server_name __DOMAIN_APP__;
|
server_name __DOMAIN_APP__;
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
proxy_pass http://localhost:5001;
|
proxy_pass http://localhost:__PORT_MANAGER__;
|
||||||
proxy_http_version 1.1;
|
proxy_http_version 1.1;
|
||||||
|
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ server {
|
|||||||
server_name __DOMAIN_PUBLIC__;
|
server_name __DOMAIN_PUBLIC__;
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
proxy_pass http://localhost:5000;
|
proxy_pass http://localhost:__PORT_PUBLIC__;
|
||||||
proxy_http_version 1.1;
|
proxy_http_version 1.1;
|
||||||
|
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
|
|||||||
@@ -213,7 +213,7 @@ fi
|
|||||||
# ── 5. api-public.json — no prompts, static localhost URL ────────────────────
|
# ── 5. api-public.json — no prompts, static localhost URL ────────────────────
|
||||||
if need_cred "api-public"; then
|
if need_cred "api-public"; then
|
||||||
write_cred "api-public" \
|
write_cred "api-public" \
|
||||||
'{"Api":{"ContentApiUrl":"http://localhost:5002"}}'
|
"{\"Api\":{\"ContentApiUrl\":\"http://localhost:${PORT_API:-5002}\"}}"
|
||||||
else
|
else
|
||||||
echo "[setup-step10-creds] api-public.json already exists, skipping"
|
echo "[setup-step10-creds] api-public.json already exists, skipping"
|
||||||
fi
|
fi
|
||||||
@@ -226,7 +226,7 @@ if need_cred "api-manager"; then
|
|||||||
read -rp " Enter the API key: " API_KEY
|
read -rp " Enter the API key: " API_KEY
|
||||||
fi
|
fi
|
||||||
write_cred "api-manager" \
|
write_cred "api-manager" \
|
||||||
"{\"Api\":{\"ContentApiUrl\":\"http://localhost:5002\",\"ContentApiKey\":\"$(json_escape "${API_KEY}")\"}}"
|
"{\"Api\":{\"ContentApiUrl\":\"http://localhost:${PORT_API:-5002}\",\"ContentApiKey\":\"$(json_escape "${API_KEY}")\"}}"
|
||||||
unset API_KEY
|
unset API_KEY
|
||||||
else
|
else
|
||||||
echo "[setup-step10-creds] api-manager.json already exists, skipping"
|
echo "[setup-step10-creds] api-manager.json already exists, skipping"
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ ExecStart=%h/api/deepdrft/bin/DeepDrftAPI
|
|||||||
|
|
||||||
# Non-secret config — hardcoded; no plaintext file needed.
|
# Non-secret config — hardcoded; no plaintext file needed.
|
||||||
Environment=ASPNETCORE_ENVIRONMENT=Production
|
Environment=ASPNETCORE_ENVIRONMENT=Production
|
||||||
Environment=ASPNETCORE_URLS=http://localhost:5002
|
Environment=ASPNETCORE_URLS=http://localhost:__PORT_API__
|
||||||
|
|
||||||
# Secrets — loaded at startup into $CREDENTIALS_DIRECTORY/.
|
# Secrets — loaded at startup into $CREDENTIALS_DIRECTORY/.
|
||||||
# Files live at %h/.config/credentials/ (deepdrft:deepdrft 600).
|
# Files live at %h/.config/credentials/ (deepdrft:deepdrft 600).
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ ExecStart=%h/manager/bin/DeepDrftManager
|
|||||||
|
|
||||||
# Non-secret config — hardcoded; no plaintext file needed.
|
# Non-secret config — hardcoded; no plaintext file needed.
|
||||||
Environment=ASPNETCORE_ENVIRONMENT=Production
|
Environment=ASPNETCORE_ENVIRONMENT=Production
|
||||||
Environment=ASPNETCORE_URLS=http://localhost:5001
|
Environment=ASPNETCORE_URLS=http://localhost:__PORT_MANAGER__
|
||||||
|
|
||||||
# Secrets — loaded at startup into $CREDENTIALS_DIRECTORY/.
|
# Secrets — loaded at startup into $CREDENTIALS_DIRECTORY/.
|
||||||
# File lives at %h/.config/credentials/ (deepdrft:deepdrft 600).
|
# File lives at %h/.config/credentials/ (deepdrft:deepdrft 600).
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ ExecStart=%h/public/bin/DeepDrftPublic
|
|||||||
|
|
||||||
# Non-secret config — hardcoded; no plaintext file needed.
|
# Non-secret config — hardcoded; no plaintext file needed.
|
||||||
Environment=ASPNETCORE_ENVIRONMENT=Production
|
Environment=ASPNETCORE_ENVIRONMENT=Production
|
||||||
Environment=ASPNETCORE_URLS=http://localhost:5000
|
Environment=ASPNETCORE_URLS=http://localhost:__PORT_PUBLIC__
|
||||||
|
|
||||||
# Secrets — loaded at startup into $CREDENTIALS_DIRECTORY/.
|
# Secrets — loaded at startup into $CREDENTIALS_DIRECTORY/.
|
||||||
# File lives at %h/.config/credentials/ (deepdrft:deepdrft 600).
|
# File lives at %h/.config/credentials/ (deepdrft:deepdrft 600).
|
||||||
|
|||||||
Reference in New Issue
Block a user