sync build tree from private myoffice

This commit is contained in:
myoffice-sync
2026-08-05 14:50:39 +00:00
parent eb475decaf
commit 1bec37657e
4 changed files with 31 additions and 10 deletions
+2
View File
@@ -28,6 +28,8 @@ Shown on the **public** repo `README.md` after sync. Example for this instance:
```bash
bash -c "$(curl -fsSL https://mygit.ase.com.ua/alexandr/myoffice_public/raw/branch/master/proxmox/myoffice.sh)"
# Optional trailing IP → CT /etc/hosts for mygit (when hairpin DNS fails):
# bash -c "$(curl -fsSL …/proxmox/myoffice.sh)" 192.168.100.10
```
Optional env before the command: `GITEA_URL`, `GITEA_OWNER`, `GITEA_REPO`, `GITEA_BRANCH`, `RELEASE_TAG` (`latest` or `v1.2.3`).
+2 -2
View File
@@ -27,7 +27,7 @@ unset LANGUAGE LC_TIME LC_MESSAGES 2>/dev/null || true
msg() { echo -e " ==> $*"; }
# TEMPORARY: map Gitea hostname → nginx LAN (override with GITEA_HOSTS_IP= to disable)
# Optional: map Gitea hostname → LAN IP (GITEA_HOSTS_IP); skip if unset.
ensure_gitea_hosts() {
if [[ -z "${GITEA_HOSTS_IP:-}" ]]; then
return 0
@@ -209,7 +209,7 @@ GITEA_HOSTS_IP=${GITEA_HOSTS_IP:-}
GITEA_HOSTS_NAME=${GITEA_HOSTS_NAME:-mygit.ase.com.ua}
EOF
# TEMPORARY hosts also persisted above in env; already applied at start via ensure_gitea_hosts
# hosts already applied at start via ensure_gitea_hosts when GITEA_HOSTS_IP is set
systemctl daemon-reload
systemctl enable myoffice-api
+19 -7
View File
@@ -1,7 +1,10 @@
#!/usr/bin/env bash
# MyOffice Proxmox LXC installer (community-scripts style).
# One-liner (env optional — defaults match public repo):
# bash -c "$(curl -fsSL https://mygit.ase.com.ua/alexandr/myoffice_public/raw/branch/master/proxmox/myoffice.sh)"
#
# One-liner (optional arg = IP for CT /etc/hosts → mygit hostname, when hairpin DNS fails):
# bash -c "$(curl -fsSL https://mygit.ase.com.ua/alexandr/myoffice_public/raw/branch/master/proxmox/myoffice.sh)" 192.168.100.10
# Or: curl -fsSL …/myoffice.sh | bash -s -- 192.168.100.10
# Or: export GITEA_HOSTS_IP=192.168.100.10 then run without arg
#
# Creates one LXC with PostgreSQL + ASP.NET runtime + app from Gitea Release.
# No Docker, no nginx, no git/SDK/Node in the CT (use your existing proxy LXC in front).
@@ -15,12 +18,21 @@ GITEA_BRANCH="${GITEA_BRANCH:-master}"
RELEASE_TAG="${RELEASE_TAG:-latest}"
RELEASE_ASSET_URL="${RELEASE_ASSET_URL:-}"
GITEA_TOKEN="${GITEA_TOKEN:-}"
# TEMPORARY: CT often resolves mygit to a public IP (hairpin fails). Map to nginx LAN.
# Remove when CT DNS/routing reaches Gitea correctly. Override: GITEA_HOSTS_IP= (empty = skip)
GITEA_HOSTS_IP="${GITEA_HOSTS_IP:-192.168.100.10}"
GITEA_HOSTS_NAME="${GITEA_HOSTS_NAME:-mygit.ase.com.ua}"
# Optional CT hosts override: env, or positional IP.
# bash -c "…" IP → IP is $0 ; bash -s -- IP → IP is $1
is_ipv4() { [[ "${1:-}" =~ ^([0-9]{1,3}\.){3}[0-9]{1,3}$ ]]; }
if [[ -z "${GITEA_HOSTS_IP:-}" ]]; then
if is_ipv4 "${1:-}"; then
GITEA_HOSTS_IP="$1"
elif is_ipv4 "${0:-}"; then
GITEA_HOSTS_IP="$0"
else
GITEA_HOSTS_IP=""
fi
fi
if [[ -z "${REPO_RAW_BASE:-}" ]]; then
REPO_RAW_BASE="${GITEA_URL%/}/${GITEA_OWNER}/${GITEA_REPO}/raw/branch/${GITEA_BRANCH}"
fi
@@ -427,7 +439,7 @@ wait_for_network() {
exit 1
}
# TEMPORARY hosts override inside CT (see GITEA_HOSTS_IP).
# Optional CT /etc/hosts: GITEA_HOSTS_IP → GITEA_HOSTS_NAME (skip if empty).
ensure_ct_gitea_hosts() {
if [[ -z "${GITEA_HOSTS_IP}" ]]; then
return 0