iobroker.script-restore 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +62 -116
- package/admin/index_m.html +1 -1
- package/admin/script-restore.svg +114 -0
- package/admin/tab_m.html +121 -0
- package/admin/words.js +27 -0
- package/build/main.js +5 -5
- package/build/main.js.map +2 -2
- package/io-package.json +119 -93
- package/package.json +5 -4
- package/admin/script-restore.png +0 -0
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-

|
|
2
2
|
# ioBroker.script-restore
|
|
3
3
|
|
|
4
4
|
[](https://www.npmjs.com/package/iobroker.script-restore)
|
|
@@ -12,127 +12,73 @@
|
|
|
12
12
|
|
|
13
13
|
## script-restore adapter for ioBroker
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
##
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
###
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
|
66
|
-
|
|
67
|
-
| `
|
|
68
|
-
| `
|
|
69
|
-
| `
|
|
70
|
-
| `
|
|
71
|
-
|
|
72
|
-
### Configuring the compilation
|
|
73
|
-
The adapter template uses [esbuild](https://esbuild.github.io/) to compile TypeScript and/or React code. You can configure many compilation settings
|
|
74
|
-
either in `tsconfig.json` or by changing options for the build tasks. These options are described in detail in the
|
|
75
|
-
[`@iobroker/adapter-dev` documentation](https://github.com/ioBroker/adapter-dev#compile-adapter-files).
|
|
76
|
-
|
|
77
|
-
### Writing tests
|
|
78
|
-
When done right, testing code is invaluable, because it gives you the
|
|
79
|
-
confidence to change your code while knowing exactly if and when
|
|
80
|
-
something breaks. A good read on the topic of test-driven development
|
|
81
|
-
is https://hackernoon.com/introduction-to-test-driven-development-tdd-61a13bc92d92.
|
|
82
|
-
Although writing tests before the code might seem strange at first, but it has very
|
|
83
|
-
clear upsides.
|
|
84
|
-
|
|
85
|
-
The template provides you with basic tests for the adapter startup and package files.
|
|
86
|
-
It is recommended that you add your own tests into the mix.
|
|
87
|
-
|
|
88
|
-
### Publishing the adapter
|
|
89
|
-
Using GitHub Actions, you can enable automatic releases on npm whenever you push a new git tag that matches the form
|
|
90
|
-
`v<major>.<minor>.<patch>`. We **strongly recommend** that you do. The necessary steps are described in `.github/workflows/test-and-release.yml`.
|
|
91
|
-
|
|
92
|
-
Since you installed the release script, you can create a new
|
|
93
|
-
release simply by calling:
|
|
94
|
-
```bash
|
|
95
|
-
npm run release
|
|
96
|
-
```
|
|
97
|
-
Additional command line options for the release script are explained in the
|
|
98
|
-
[release-script documentation](https://github.com/AlCalzone/release-script#command-line).
|
|
99
|
-
|
|
100
|
-
To get your adapter released in ioBroker, please refer to the documentation
|
|
101
|
-
of [ioBroker.repositories](https://github.com/ioBroker/ioBroker.repositories#requirements-for-adapter-to-get-added-to-the-latest-repository).
|
|
102
|
-
|
|
103
|
-
### Test the adapter manually on a local ioBroker installation
|
|
104
|
-
In order to install the adapter locally without publishing, the following steps are recommended:
|
|
105
|
-
1. Create a GitHub repository for your adapter if you haven't already
|
|
106
|
-
1. Push your code to the GitHub repository
|
|
107
|
-
1. Use the ioBroker Admin interface or command line to install the adapter from GitHub:
|
|
108
|
-
* **Via Admin UI**: Go to the "Adapters" tab, click on "Custom Install" (GitHub icon), and enter your repository URL:
|
|
109
|
-
```
|
|
110
|
-
https://github.com/ipod86/ioBroker.script-restore
|
|
111
|
-
```
|
|
112
|
-
You can also install from a specific branch by adding `#branchname` at the end:
|
|
113
|
-
```
|
|
114
|
-
https://github.com/ipod86/ioBroker.script-restore#dev
|
|
115
|
-
```
|
|
116
|
-
* **Via Command Line**: Install using the `iob` command:
|
|
117
|
-
```bash
|
|
118
|
-
iob url https://github.com/ipod86/ioBroker.script-restore
|
|
119
|
-
```
|
|
120
|
-
Or from a specific branch:
|
|
121
|
-
```bash
|
|
122
|
-
iob url https://github.com/ipod86/ioBroker.script-restore#dev
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
For later updates:
|
|
126
|
-
1. Push your changes to GitHub
|
|
127
|
-
1. Repeat the installation steps above (via Admin UI or `iob url` command) to update the adapter
|
|
15
|
+
Browse and recover individual scripts from ioBroker backup archives — without restoring the entire backup.
|
|
16
|
+
|
|
17
|
+
## Description
|
|
18
|
+
|
|
19
|
+
The script-restore adapter adds a tab to the ioBroker admin interface that lets you open backup archives and browse all contained JavaScript, TypeScript, Blockly and Rules scripts. You can view the source code of each script and download or copy it individually.
|
|
20
|
+
|
|
21
|
+
The archive is parsed entirely in the browser — no files are written to disk during browsing.
|
|
22
|
+
|
|
23
|
+
**Note:** This adapter does not automatically restore scripts into ioBroker. It only allows you to view and download them so you can manually re-import them via the JavaScript adapter.
|
|
24
|
+
|
|
25
|
+
## Features
|
|
26
|
+
|
|
27
|
+
- Browse backup archives directly from the ioBroker admin tab
|
|
28
|
+
- Load local backup files from the backup directory (default: `/opt/iobroker/backups`)
|
|
29
|
+
- Upload archive files directly from your computer
|
|
30
|
+
- Supported formats: `.tar.gz`, `.tar`, `.json`, `.jsonl`
|
|
31
|
+
- Tree view of all scripts organized by folder
|
|
32
|
+
- Search across all script names
|
|
33
|
+
- View source code with syntax highlighting (JS/TS/Blockly/Rules)
|
|
34
|
+
- Copy source code to clipboard or download as file
|
|
35
|
+
- Fully browser-based parsing — no server roundtrip for uploads
|
|
36
|
+
|
|
37
|
+
## Configuration
|
|
38
|
+
|
|
39
|
+
| Setting | Description | Default |
|
|
40
|
+
|---------|-------------|---------|
|
|
41
|
+
| Backup path | Directory where ioBroker backup files are stored | `/opt/iobroker/backups` |
|
|
42
|
+
|
|
43
|
+
## Usage
|
|
44
|
+
|
|
45
|
+
### Loading a local backup file
|
|
46
|
+
|
|
47
|
+
1. Open the **Script Restore** tab in ioBroker admin
|
|
48
|
+
2. Click the **Local files** dropdown
|
|
49
|
+
3. Select a backup file from the list — scripts are loaded automatically
|
|
50
|
+
|
|
51
|
+
### Uploading a backup file
|
|
52
|
+
|
|
53
|
+
1. Open the **Script Restore** tab in ioBroker admin
|
|
54
|
+
2. Click **Upload archive** and select a file from your computer
|
|
55
|
+
3. The archive is parsed in the browser and all scripts are displayed
|
|
56
|
+
|
|
57
|
+
### Viewing and downloading scripts
|
|
58
|
+
|
|
59
|
+
- Click a script in the tree to view its source code
|
|
60
|
+
- Use the **Copy** button to copy the source to the clipboard
|
|
61
|
+
- Use the **Download** button to save the script as a file
|
|
62
|
+
|
|
63
|
+
## Supported backup formats
|
|
64
|
+
|
|
65
|
+
| Format | Description |
|
|
66
|
+
|--------|-------------|
|
|
67
|
+
| `.tar.gz` | Standard ioBroker backup (`iobroker_YYYY-MM-DD-HH-mm_SS_backupiobroker.tar.gz`) |
|
|
68
|
+
| `.tar` | Uncompressed tar archive |
|
|
69
|
+
| `.json` | JavaScript adapter script export |
|
|
70
|
+
| `.jsonl` | ioBroker objects export (JSON lines) |
|
|
128
71
|
|
|
129
72
|
## Changelog
|
|
73
|
+
|
|
130
74
|
<!--
|
|
131
75
|
Placeholder for the next version (at the beginning of the line):
|
|
132
76
|
### **WORK IN PROGRESS**
|
|
133
77
|
-->
|
|
134
|
-
|
|
135
78
|
### **WORK IN PROGRESS**
|
|
79
|
+
* (ipod86) update README, fix SVG icon dimensions, add full language translations
|
|
80
|
+
|
|
81
|
+
### 0.0.1 (2026-04-06)
|
|
136
82
|
* (ipod86) initial release
|
|
137
83
|
|
|
138
84
|
## License
|
|
@@ -156,4 +102,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
156
102
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
157
103
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
158
104
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
159
|
-
SOFTWARE.
|
|
105
|
+
SOFTWARE.
|