sync build tree from private myoffice
This commit is contained in:
@@ -10,12 +10,19 @@ On the Proxmox host:
|
|||||||
bash -c "$(curl -fsSL https://mygit.ase.com.ua/alexandr/myoffice_public/raw/branch/master/proxmox/myoffice.sh)"
|
bash -c "$(curl -fsSL https://mygit.ase.com.ua/alexandr/myoffice_public/raw/branch/master/proxmox/myoffice.sh)"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
If the CT cannot reach Gitea by DNS (hairpin), pass the nginx/proxy LAN IP as an argument — it is written into the CT `/etc/hosts` for `mygit.ase.com.ua`:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
bash -c "$(curl -fsSL https://mygit.ase.com.ua/alexandr/myoffice_public/raw/branch/master/proxmox/myoffice.sh)" 192.168.100.10
|
||||||
|
```
|
||||||
|
|
||||||
Creates an LXC with PostgreSQL + ASP.NET runtime, downloads the latest release, starts the app on port **9100**. Point your nginx LXC at `http://<ct-ip>:9100`.
|
Creates an LXC with PostgreSQL + ASP.NET runtime, downloads the latest release, starts the app on port **9100**. Point your nginx LXC at `http://<ct-ip>:9100`.
|
||||||
|
|
||||||
Optional overrides:
|
Optional overrides:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
export RELEASE_TAG="latest" # or v1.2.3
|
export RELEASE_TAG="latest" # or v1.2.3
|
||||||
|
export GITEA_HOSTS_IP="192.168.100.10" # same as the trailing arg
|
||||||
```
|
```
|
||||||
|
|
||||||
Details: [proxmox/README.md](proxmox/README.md).
|
Details: [proxmox/README.md](proxmox/README.md).
|
||||||
@@ -35,7 +42,7 @@ Local development:
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
dotnet build MyOffice.Web/MyOffice.Web.csproj
|
dotnet build MyOffice.Web/MyOffice.Web.csproj
|
||||||
cd MyOffice.SPA && npm install && npm start # http://localhost:4300
|
cd MyOffice.SPA && npm start # after npm install; http://localhost:4300
|
||||||
# Run MyOffice.Web (API http://localhost:9100); set FrontEnd:Host to the SPA origin
|
# Run MyOffice.Web (API http://localhost:9100); set FrontEnd:Host to the SPA origin
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -28,6 +28,8 @@ Shown on the **public** repo `README.md` after sync. Example for this instance:
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
bash -c "$(curl -fsSL https://mygit.ase.com.ua/alexandr/myoffice_public/raw/branch/master/proxmox/myoffice.sh)"
|
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`).
|
Optional env before the command: `GITEA_URL`, `GITEA_OWNER`, `GITEA_REPO`, `GITEA_BRANCH`, `RELEASE_TAG` (`latest` or `v1.2.3`).
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ unset LANGUAGE LC_TIME LC_MESSAGES 2>/dev/null || true
|
|||||||
|
|
||||||
msg() { echo -e " ==> $*"; }
|
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() {
|
ensure_gitea_hosts() {
|
||||||
if [[ -z "${GITEA_HOSTS_IP:-}" ]]; then
|
if [[ -z "${GITEA_HOSTS_IP:-}" ]]; then
|
||||||
return 0
|
return 0
|
||||||
@@ -209,7 +209,7 @@ GITEA_HOSTS_IP=${GITEA_HOSTS_IP:-}
|
|||||||
GITEA_HOSTS_NAME=${GITEA_HOSTS_NAME:-mygit.ase.com.ua}
|
GITEA_HOSTS_NAME=${GITEA_HOSTS_NAME:-mygit.ase.com.ua}
|
||||||
EOF
|
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 daemon-reload
|
||||||
systemctl enable myoffice-api
|
systemctl enable myoffice-api
|
||||||
|
|||||||
+19
-7
@@ -1,7 +1,10 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# MyOffice Proxmox LXC installer (community-scripts style).
|
# 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.
|
# 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).
|
# 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_TAG="${RELEASE_TAG:-latest}"
|
||||||
RELEASE_ASSET_URL="${RELEASE_ASSET_URL:-}"
|
RELEASE_ASSET_URL="${RELEASE_ASSET_URL:-}"
|
||||||
GITEA_TOKEN="${GITEA_TOKEN:-}"
|
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}"
|
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
|
if [[ -z "${REPO_RAW_BASE:-}" ]]; then
|
||||||
REPO_RAW_BASE="${GITEA_URL%/}/${GITEA_OWNER}/${GITEA_REPO}/raw/branch/${GITEA_BRANCH}"
|
REPO_RAW_BASE="${GITEA_URL%/}/${GITEA_OWNER}/${GITEA_REPO}/raw/branch/${GITEA_BRANCH}"
|
||||||
fi
|
fi
|
||||||
@@ -427,7 +439,7 @@ wait_for_network() {
|
|||||||
exit 1
|
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() {
|
ensure_ct_gitea_hosts() {
|
||||||
if [[ -z "${GITEA_HOSTS_IP}" ]]; then
|
if [[ -z "${GITEA_HOSTS_IP}" ]]; then
|
||||||
return 0
|
return 0
|
||||||
|
|||||||
Reference in New Issue
Block a user