Updates
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
REPO_DIR=/home/pi/repos/homeAutomation
|
REPO_DIR=/home/willem/repos/homeAutomation
|
||||||
|
|
||||||
# Make sure docker user has read/write access on this folder
|
# Make sure docker user has read/write access on this folder
|
||||||
STORAGE_DIR=/etc
|
STORAGE_DIR=/etc
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ services:
|
|||||||
- traefik.http.routers.dashboard.rule=Host(`traefik.pladijs`)
|
- traefik.http.routers.dashboard.rule=Host(`traefik.pladijs`)
|
||||||
- traefik.http.services.dashboard.loadbalancer.server.port=8080
|
- traefik.http.services.dashboard.loadbalancer.server.port=8080
|
||||||
volumes:
|
volumes:
|
||||||
- ${REPO_DIR}/configurations/traefik/traefik.yml:/etc/traefik/traefik.yml
|
- ${REPO_DIR}/configurations/traefik/traefik.yml:/etc/traefik/traefik.yml:ro
|
||||||
- ${STORAGE_DIR}/certificates:/var/lib/certificates
|
- ${STORAGE_DIR}/traefik/certificates:/var/lib/certificates
|
||||||
- /var/run/docker.sock:/var/run/docker.sock
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
ports:
|
ports:
|
||||||
- 80:80
|
- 80:80
|
||||||
@@ -31,13 +31,14 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- ${STORAGE_DIR}/mariadb:/var/lib/mysql
|
- ${STORAGE_DIR}/mariadb:/var/lib/mysql
|
||||||
homeassistant:
|
homeassistant:
|
||||||
image: "ghcr.io/home-assistant/home-assistant:stable"
|
build:
|
||||||
|
context: ./home-assistant
|
||||||
|
dockerfile: home-assistant.Dockerfile
|
||||||
labels:
|
labels:
|
||||||
- traefik.http.routers.homeassistant.rule=Host(`homeassistant.pladijs`)
|
- traefik.http.routers.homeassistant.rule=Host(`homeassistant.pladijs`)
|
||||||
- traefik.http.services.homeassistant.loadbalancer.server.port=8123
|
- traefik.http.services.homeassistant.loadbalancer.server.port=8123
|
||||||
volumes:
|
volumes:
|
||||||
- ${STORAGE_DIR}/homeassistant:/config
|
- ${STORAGE_DIR}/homeassistant:/config
|
||||||
- ${REPO_DIR}/configurations/home-assistant/configuration-production.yaml:/config/configuration.yaml
|
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
env_file:
|
env_file:
|
||||||
- environment-variables/local.env
|
- environment-variables/local.env
|
||||||
|
|||||||
3
home-server/home-assistant/home-assistant.Dockerfile
Normal file
3
home-server/home-assistant/home-assistant.Dockerfile
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
FROM ghcr.io/home-assistant/home-assistant:stable
|
||||||
|
|
||||||
|
COPY ./configuration/configuration-production.yaml /config/configuration.yaml
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Backup Home Assistant
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
ExecStart=/home/willem/.bun/bin/bun /home/willem/repos/homeAutomation/home-server/homeassistant-backup/homeassistant-backup/index.ts
|
||||||
|
WorkingDirectory=/home/willem/repos/homeAutomation/home-server/homeassistant-backup/homeassistant-backup
|
||||||
|
Restart=on-failure
|
||||||
|
User=willem
|
||||||
|
Environment=PATH=/usr/bin:/usr/local/bin
|
||||||
|
Environment=NODE_ENV=production
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
11
home-server/homeassistant-backup/homeassistant-backup.timer
Normal file
11
home-server/homeassistant-backup/homeassistant-backup.timer
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Run Home assistant backup Service every hour
|
||||||
|
|
||||||
|
[Timer]
|
||||||
|
OnBootSec=1min
|
||||||
|
OnUnitActiveSec=1hour
|
||||||
|
Persistent=true
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=timers.target
|
||||||
|
|
||||||
34
home-server/homeassistant-backup/homeassistant-backup/.gitignore
vendored
Normal file
34
home-server/homeassistant-backup/homeassistant-backup/.gitignore
vendored
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
# dependencies (bun install)
|
||||||
|
node_modules
|
||||||
|
|
||||||
|
# output
|
||||||
|
out
|
||||||
|
dist
|
||||||
|
*.tgz
|
||||||
|
|
||||||
|
# code coverage
|
||||||
|
coverage
|
||||||
|
*.lcov
|
||||||
|
|
||||||
|
# logs
|
||||||
|
logs
|
||||||
|
_.log
|
||||||
|
report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json
|
||||||
|
|
||||||
|
# dotenv environment variable files
|
||||||
|
.env
|
||||||
|
.env.development.local
|
||||||
|
.env.test.local
|
||||||
|
.env.production.local
|
||||||
|
.env.local
|
||||||
|
|
||||||
|
# caches
|
||||||
|
.eslintcache
|
||||||
|
.cache
|
||||||
|
*.tsbuildinfo
|
||||||
|
|
||||||
|
# IntelliJ based IDEs
|
||||||
|
.idea
|
||||||
|
|
||||||
|
# Finder (MacOS) folder config
|
||||||
|
.DS_Store
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
# homeassistant-backup
|
||||||
|
|
||||||
|
To install dependencies:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
bun install
|
||||||
|
```
|
||||||
|
|
||||||
|
To run:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
bun run index.ts
|
||||||
|
```
|
||||||
|
|
||||||
|
This project was created using `bun init` in bun v1.2.15. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime.
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
{
|
||||||
|
"lockfileVersion": 1,
|
||||||
|
"workspaces": {
|
||||||
|
"": {
|
||||||
|
"name": "homeassistant-backup",
|
||||||
|
"devDependencies": {
|
||||||
|
"@types/bun": "latest",
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"typescript": "^5",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"packages": {
|
||||||
|
"@types/bun": ["@types/bun@1.2.15", "", { "dependencies": { "bun-types": "1.2.15" } }, "sha512-U1ljPdBEphF0nw1MIk0hI7kPg7dFdPyM7EenHsp6W5loNHl7zqy6JQf/RKCgnUn2KDzUpkBwHPnEJEjII594bA=="],
|
||||||
|
|
||||||
|
"@types/node": ["@types/node@22.15.30", "", { "dependencies": { "undici-types": "~6.21.0" } }, "sha512-6Q7lr06bEHdlfplU6YRbgG1SFBdlsfNC4/lX+SkhiTs0cpJkOElmWls8PxDFv4yY/xKb8Y6SO0OmSX4wgqTZbA=="],
|
||||||
|
|
||||||
|
"bun-types": ["bun-types@1.2.15", "", { "dependencies": { "@types/node": "*" } }, "sha512-NarRIaS+iOaQU1JPfyKhZm4AsUOrwUOqRNHY0XxI8GI8jYxiLXLcdjYMG9UKS+fwWasc1uw1htV9AX24dD+p4w=="],
|
||||||
|
|
||||||
|
"typescript": ["typescript@5.8.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ=="],
|
||||||
|
|
||||||
|
"undici-types": ["undici-types@6.21.0", "", {}, "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ=="],
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
console.log("Hello via Bun!");
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"name": "homeassistant-backup",
|
||||||
|
"module": "index.ts",
|
||||||
|
"type": "module",
|
||||||
|
"private": true,
|
||||||
|
"devDependencies": {
|
||||||
|
"@types/bun": "latest"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"typescript": "^5"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
// Environment setup & latest features
|
||||||
|
"lib": ["ESNext"],
|
||||||
|
"target": "ESNext",
|
||||||
|
"module": "Preserve",
|
||||||
|
"moduleDetection": "force",
|
||||||
|
"jsx": "react-jsx",
|
||||||
|
"allowJs": true,
|
||||||
|
|
||||||
|
// Bundler mode
|
||||||
|
"moduleResolution": "bundler",
|
||||||
|
"allowImportingTsExtensions": true,
|
||||||
|
"verbatimModuleSyntax": true,
|
||||||
|
"noEmit": true,
|
||||||
|
|
||||||
|
// Best practices
|
||||||
|
"strict": true,
|
||||||
|
"skipLibCheck": true,
|
||||||
|
"noFallthroughCasesInSwitch": true,
|
||||||
|
"noUncheckedIndexedAccess": true,
|
||||||
|
"noImplicitOverride": true,
|
||||||
|
|
||||||
|
// Some stricter flags (disabled by default)
|
||||||
|
"noUnusedLocals": false,
|
||||||
|
"noUnusedParameters": false,
|
||||||
|
"noPropertyAccessFromIndexSignature": false
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user