Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/muhlba91/homelab-node-red-backup
Homelab: Python application for backing up and restoring Node-RED via its API
https://github.com/muhlba91/homelab-node-red-backup
homelab node-red
Last synced: about 1 month ago
JSON representation
Homelab: Python application for backing up and restoring Node-RED via its API
- Host: GitHub
- URL: https://github.com/muhlba91/homelab-node-red-backup
- Owner: muhlba91
- License: mit
- Created: 2023-06-18T11:26:03.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-22T07:56:52.000Z (8 months ago)
- Last Synced: 2024-05-22T19:58:00.844Z (8 months ago)
- Topics: homelab, node-red
- Language: Python
- Homepage:
- Size: 151 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Homelab: Node-RED Backup & Restore
[![](https://img.shields.io/github/license/muhlba91/homelab-node-red-backup?style=for-the-badge)](LICENSE)
[![](https://img.shields.io/github/actions/workflow/status/muhlba91/homelab-node-red-backup/verify.yml?style=for-the-badge)](https://github.com/muhlba91/homelab-node-red-backup/actions/workflows/verify.yml)
[![](https://api.scorecard.dev/projects/github.com/muhlba91/homelab-node-red-backup/badge?style=for-the-badge)](https://scorecard.dev/viewer/?uri=github.com/muhlba91/homelab-node-red-backup)
[![](https://img.shields.io/pypi/pyversions/homelab-node-red-backup?style=for-the-badge)](https://pypi.org/project/homelab-node-red-backup/)
[![](https://img.shields.io/pypi/v/homelab-node-red-backup?style=for-the-badge)](https://pypi.org/project/homelab-node-red-backup/)
[![](https://img.shields.io/github/release-date/muhlba91/homelab-node-red-backup?style=for-the-badge)](https://github.com/muhlba91/homelab-node-red-backup/releases)
[![](https://img.shields.io/pypi/dm/homelab-node-red-backup?style=for-the-badge)](https://pypi.org/project/homelab-node-red-backup/)This repository contains Python scripts leveraging the [Node-RED Admin API](https://nodered.org/docs/api/admin/methods/) endpoints to create and restore backups.
**Attention:** the Node-RED installation must either be unsecured or secured by OAuth!
---
## Installation
The package is published in **(Test)PyPi** and can be installed via:
```bash
pip install homelab-node-red-backup
```## Configuration
The following arguments are available:
- `--endpoint` / `-e`: the Node-RED endpoint
- `--file` / `-f`: the JSON file
- `--jwt-token` / `-jwt`: the JWT token to authenticate with## Credentials
Credentials are detected, retrieved, and merged to the output JSON file.
The following credential types are recognized:- `servers`: e.g. a Home Assistant server with an access token
- `telegram bot`: Telegram bot with a token## Usage
The following commands are available, and all commands require the arguments `--endpoint`, and, optionally, `--jwt-token` set.
- `check`: checks if data exists for a backup (return code `0` if data exists, else `1`)
- `backup`: creates a backup
- requires: `--file`
- `restore`: restores from a backup
- requires: `--file`
- `auto`: performs a `check` and either creates a backup to or restores a backup from the given `--file`
- requires: `--file`### Examples
```bash
# checking if data exists
homelab-node-red-backup check -e http://localhost:1880 -jwt# creating a backup
homelab-node-red-backup backup -e http://localhost:1880 -jwt -f backup.json# restoring from the backup
homelab-node-red-backup restore -e http://localhost:1880 -jwt -f backup.json
```---
## Supporting
If you enjoy the application and want to support my efforts, please feel free to buy me a coffe. :)