Compare commits
2 Commits
45b8533f18
...
60214a7c92
| Author | SHA1 | Date | |
|---|---|---|---|
| 60214a7c92 | |||
| 45673bb066 |
@@ -142,9 +142,10 @@ jobs:
|
|||||||
name: Deploy auf TrueNAS (Custom App)
|
name: Deploy auf TrueNAS (Custom App)
|
||||||
# Laeuft auf dem vorhandenen containerisierten Gitea-Runner (Label ubuntu-latest).
|
# Laeuft auf dem vorhandenen containerisierten Gitea-Runner (Label ubuntu-latest).
|
||||||
# Der Runner hat KEINEN Host-Dateisystem-/midclt-Zugriff, daher: per SSH zum NAS-Host
|
# Der Runner hat KEINEN Host-Dateisystem-/midclt-Zugriff, daher: per SSH zum NAS-Host
|
||||||
# verbinden, die Deploy-Dateien nach /opt/gerbilmanager kopieren und dort
|
# verbinden, die Deploy-Dateien in das App-Home auf dem Pool kopieren und dort
|
||||||
# truenas-deploy.sh ausfuehren (legt die TrueNAS "Custom App" an bzw. rollt sie neu
|
# truenas-deploy.sh ausfuehren (legt die TrueNAS "Custom App" an bzw. rollt sie neu
|
||||||
# aus via `midclt` — die App bleibt unter Apps sichtbar).
|
# aus via `midclt` — die App bleibt unter Apps sichtbar).
|
||||||
|
# Hinweis: / (inkl. /opt) ist auf TrueNAS Goldeye read-only -> App-Home auf dem Pool.
|
||||||
#
|
#
|
||||||
# Benoetigte Repo-Secrets (Gitea -> Einstellungen -> Actions -> Secrets):
|
# Benoetigte Repo-Secrets (Gitea -> Einstellungen -> Actions -> Secrets):
|
||||||
# NAS_SSH_HOST z. B. 192.168.2.115 (Host-LAN-IP der NAS)
|
# NAS_SSH_HOST z. B. 192.168.2.115 (Host-LAN-IP der NAS)
|
||||||
@@ -152,6 +153,8 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [build-and-push]
|
needs: [build-and-push]
|
||||||
if: github.ref == 'refs/heads/main' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
|
if: github.ref == 'refs/heads/main' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
|
||||||
|
env:
|
||||||
|
APP_HOME: /mnt/JailStorage/DockerVolumes/gerbilmanager
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
@@ -167,16 +170,16 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
NAS="root@${{ secrets.NAS_SSH_HOST }}"
|
NAS="root@${{ secrets.NAS_SSH_HOST }}"
|
||||||
SSH="ssh -i ~/.ssh/id_deploy -o StrictHostKeyChecking=accept-new"
|
SSH="ssh -i ~/.ssh/id_deploy -o StrictHostKeyChecking=accept-new"
|
||||||
$SSH "$NAS" 'mkdir -p /opt/gerbilmanager/deploy/truenas/scripts'
|
$SSH "$NAS" "mkdir -p $APP_HOME/deploy/truenas/scripts"
|
||||||
rsync -az -e "$SSH" \
|
rsync -az -e "$SSH" \
|
||||||
deploy/truenas/custom-app.compose.yaml \
|
deploy/truenas/custom-app.compose.yaml \
|
||||||
"$NAS":/opt/gerbilmanager/deploy/truenas/
|
"$NAS":"$APP_HOME"/deploy/truenas/
|
||||||
rsync -az -e "$SSH" \
|
rsync -az -e "$SSH" \
|
||||||
deploy/truenas/scripts/ \
|
deploy/truenas/scripts/ \
|
||||||
"$NAS":/opt/gerbilmanager/deploy/truenas/scripts/
|
"$NAS":"$APP_HOME"/deploy/truenas/scripts/
|
||||||
|
|
||||||
- name: Custom App neu ausrollen (midclt create/redeploy + Health-Check)
|
- name: Custom App neu ausrollen (midclt create/redeploy + Health-Check)
|
||||||
run: |
|
run: |
|
||||||
NAS="root@${{ secrets.NAS_SSH_HOST }}"
|
NAS="root@${{ secrets.NAS_SSH_HOST }}"
|
||||||
ssh -i ~/.ssh/id_deploy -o StrictHostKeyChecking=accept-new "$NAS" \
|
ssh -i ~/.ssh/id_deploy -o StrictHostKeyChecking=accept-new "$NAS" \
|
||||||
"sh /opt/gerbilmanager/deploy/truenas/scripts/truenas-deploy.sh"
|
"sh $APP_HOME/deploy/truenas/scripts/truenas-deploy.sh"
|
||||||
|
|||||||
@@ -16,7 +16,8 @@
|
|||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
APP_NAME=gerbilmanager
|
APP_NAME=gerbilmanager
|
||||||
COMPOSE_DIR="${COMPOSE_DIR:-/opt/gerbilmanager}"
|
# TrueNAS Goldeye: / (inkl. /opt) ist read-only -> App-Home liegt auf dem Pool.
|
||||||
|
COMPOSE_DIR="${COMPOSE_DIR:-/mnt/JailStorage/DockerVolumes/gerbilmanager}"
|
||||||
DEPLOY_DIR="$COMPOSE_DIR/deploy/truenas"
|
DEPLOY_DIR="$COMPOSE_DIR/deploy/truenas"
|
||||||
ENV_FILE="${ENV_FILE:-$DEPLOY_DIR/.env}"
|
ENV_FILE="${ENV_FILE:-$DEPLOY_DIR/.env}"
|
||||||
TEMPLATE="$DEPLOY_DIR/custom-app.compose.yaml"
|
TEMPLATE="$DEPLOY_DIR/custom-app.compose.yaml"
|
||||||
|
|||||||
@@ -32,14 +32,15 @@ export default function GerbilAcquisitionSection({ gerbilId }: { gerbilId: strin
|
|||||||
const [note, setNote] = useState('')
|
const [note, setNote] = useState('')
|
||||||
const [error, setError] = useState<string | null>(null)
|
const [error, setError] = useState<string | null>(null)
|
||||||
|
|
||||||
const save = useMutation((id: string | '') => {
|
const save = useMutation(async (id: string | '') => {
|
||||||
const body = {
|
const body = {
|
||||||
gerbilId,
|
gerbilId,
|
||||||
date: date || null,
|
date: date || null,
|
||||||
price: price.trim() === '' ? null : Number(price),
|
price: price.trim() === '' ? null : Number(price),
|
||||||
note: note.trim() || null,
|
note: note.trim() || null,
|
||||||
}
|
}
|
||||||
return id === '' ? createAcquisition(body) : updateAcquisition(id, body)
|
if (id === '') await createAcquisition(body)
|
||||||
|
else await updateAcquisition(id, body)
|
||||||
})
|
})
|
||||||
const removal = useMutation((id: string) => deleteAcquisition(id))
|
const removal = useMutation((id: string) => deleteAcquisition(id))
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ export async function fetchPushConfig(): Promise<{ enabled: boolean; publicKey:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function urlBase64ToUint8Array(base64: string): Uint8Array {
|
function urlBase64ToUint8Array(base64: string): Uint8Array<ArrayBuffer> {
|
||||||
const padding = '='.repeat((4 - (base64.length % 4)) % 4)
|
const padding = '='.repeat((4 - (base64.length % 4)) % 4)
|
||||||
const b64 = (base64 + padding).replace(/-/g, '+').replace(/_/g, '/')
|
const b64 = (base64 + padding).replace(/-/g, '+').replace(/_/g, '/')
|
||||||
const raw = atob(b64)
|
const raw = atob(b64)
|
||||||
|
|||||||
Reference in New Issue
Block a user