airdcpp-share-backup 1.0.3 → 1.0.5
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 +22 -187
- package/dist/main.js +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -6,13 +6,12 @@ local backup file. Optionally run automatically on configurable days of
|
|
|
6
6
|
the week, with automatic cleanup of old backups.
|
|
7
7
|
|
|
8
8
|
This is a backup of the file *listing* only, not the files themselves --
|
|
9
|
-
but it
|
|
10
|
-
the output is a real, valid filelist you could load in "Open
|
|
11
|
-
|
|
12
|
-
needed to.
|
|
9
|
+
but it is the exact same XML format AirDC++ itself uses for filelists, so
|
|
10
|
+
the output is a real, valid filelist you could load in or "Open filelist"
|
|
11
|
+
in AirDC++ or most other DC++ clients, if you ever needed to.
|
|
13
12
|
|
|
14
13
|
By default the backup is saved as a plain, uncompressed `.xml` file --
|
|
15
|
-
that
|
|
14
|
+
that is already a fully valid, directly-openable filelist, and writing it
|
|
16
15
|
is fast regardless of share size. Turning on the **Compress backups to
|
|
17
16
|
bz2** setting instead produces a smaller `.xml.bz2`, matching what AirDC++
|
|
18
17
|
itself writes for filelists, at the cost of extra time (see "Self-verified
|
|
@@ -37,7 +36,7 @@ also affects scheduled backups).
|
|
|
37
36
|
a plain `.xml` file: already directly openable, and fast to write no
|
|
38
37
|
matter how large your share is. Turn this on to instead compress to
|
|
39
38
|
`.xml.bz2` (smaller file, matches AirDC++'s own filelist format exactly),
|
|
40
|
-
which takes noticeably longer -- see
|
|
39
|
+
which takes noticeably longer -- see [Self-verified compression](#Self-verified-compression) below.
|
|
41
40
|
- **Your AirDC++ nickname** -- leave empty to auto-detect from a currently
|
|
42
41
|
connected hub (falls back to your global nick there). Fill this in only
|
|
43
42
|
if you want to force a specific name instead, e.g. if you use different
|
|
@@ -72,7 +71,7 @@ version first and only falls back to an uncompressed one if no `.bz2`
|
|
|
72
71
|
exists, so a plain `.xml` opens exactly the same way -- compression is
|
|
73
72
|
purely about file size, never about whether it can be opened.
|
|
74
73
|
|
|
75
|
-
Since the filename
|
|
74
|
+
Since the filename cannot carry a time/counter suffix without breaking that
|
|
76
75
|
recognition, a second backup (manual or scheduled) on the same day
|
|
77
76
|
overwrites that day's file rather than creating a second one. This is now
|
|
78
77
|
called out explicitly in the system log ("...overwrote the previous backup
|
|
@@ -81,11 +80,11 @@ already saved today") instead of happening silently.
|
|
|
81
80
|
## Self-verified compression
|
|
82
81
|
|
|
83
82
|
This only applies when the **Compress backups to bz2** setting is turned
|
|
84
|
-
on (off by default -- see
|
|
83
|
+
on (off by default -- see [Settings](#Settings) above).
|
|
85
84
|
|
|
86
|
-
There
|
|
85
|
+
There is no native bzip2 module available to a Node.js extension, so
|
|
87
86
|
compression uses a pure-JavaScript bzip2 encoder. This is a large part of
|
|
88
|
-
why it
|
|
87
|
+
why it is slower than AirDC++'s own filelist compression, which uses a
|
|
89
88
|
native C++ implementation instead. Real-world testing on large shares
|
|
90
89
|
(tens of millions of files) also found that the pure-JS encoder can,
|
|
91
90
|
rarely, write one corrupt block in an otherwise-fine file -- invisible
|
|
@@ -118,16 +117,16 @@ triggered by AirDC++ starting up):
|
|
|
118
117
|
- Before an automatic backup actually begins, the extension checks
|
|
119
118
|
AirDC++'s hashing status and waits (polling periodically, up to 20
|
|
120
119
|
minutes) for it to go idle, logging a clear message while it waits. If
|
|
121
|
-
it
|
|
120
|
+
it is still busy after that cap, the backup starts anyway rather than
|
|
122
121
|
being skipped -- it may just include a few not-yet-refreshed entries.
|
|
123
122
|
|
|
124
123
|
Manual `/sharebackup` is never delayed or gated by any of this -- typing
|
|
125
|
-
the command always starts the backup immediately, since that
|
|
124
|
+
the command always starts the backup immediately, since that is an explicit
|
|
126
125
|
request.
|
|
127
126
|
|
|
128
127
|
None of this timing is affected by the **Compress backups to bz2**
|
|
129
128
|
setting -- that only changes what happens after the share walk finishes
|
|
130
|
-
(compress or
|
|
129
|
+
(compress or do not compress), not when the backup starts.
|
|
131
130
|
|
|
132
131
|
## How it works
|
|
133
132
|
|
|
@@ -135,19 +134,19 @@ This walks your share using AirDC++'s own stateless Share API (real disk
|
|
|
135
134
|
paths: `GET /share_roots` + `POST /share/directories/by_real/content`),
|
|
136
135
|
builds the filelist XML itself, and -- only if compression is turned on --
|
|
137
136
|
bzip2-compresses it in a worker thread so the compression (which can take
|
|
138
|
-
a few minutes on a large share, since there
|
|
139
|
-
available to an extension)
|
|
137
|
+
a few minutes on a large share, since there is no native bzip2 module
|
|
138
|
+
available to an extension) does not freeze the connection to AirDC++.
|
|
140
139
|
|
|
141
140
|
Multiple real share roots added under the same virtual name are merged
|
|
142
141
|
into one folder, the same way AirDC++ merges them in its own filelist --
|
|
143
142
|
this is handled explicitly during the walk rather than relying on a
|
|
144
143
|
browsing session to do it.
|
|
145
144
|
|
|
146
|
-
|
|
145
|
+
## Why not AirDC++'s own `/generatelist`?
|
|
147
146
|
|
|
148
147
|
AirDC++ has a real, hidden hub command, `/generatelist`, that does this
|
|
149
148
|
same job natively and produces a genuine filelist in its own Settings
|
|
150
|
-
folder. It
|
|
149
|
+
folder. It is confirmed by an AirDC++ developer and works when typed
|
|
151
150
|
directly into a hub's chat window.
|
|
152
151
|
|
|
153
152
|
Two earlier versions of this extension tried to use it instead of the
|
|
@@ -166,177 +165,13 @@ Share API, and both were tested against a real AirDC++ install:
|
|
|
166
165
|
|
|
167
166
|
The Share API approach in this version has no session to corrupt and no
|
|
168
167
|
dependency on an undocumented, API-unreachable command -- every call is a
|
|
169
|
-
plain, independent request keyed by a real disk path, and it
|
|
168
|
+
plain, independent request keyed by a real disk path, and it is fully
|
|
170
169
|
public, documented API surface.
|
|
171
170
|
|
|
172
|
-
##
|
|
171
|
+
## What is new in each version
|
|
172
|
+
[Changelog](https://github.com/sharefixxers/airdcpp-share-backup/blob/master/CHANGELOG.md)
|
|
173
173
|
|
|
174
|
-
|
|
174
|
+
## Troubleshooting
|
|
175
|
+
Enable extension debug mode from application settings and check the extension error logs
|
|
176
|
+
`(Settings\Extensions\airdcpp-share-backup\logs)` for additional information.
|
|
175
177
|
|
|
176
|
-
## Notes (1.0.0)
|
|
177
|
-
|
|
178
|
-
First release!
|
|
179
|
-
|
|
180
|
-
## Notes (b0.1.2 / b0.1.3)
|
|
181
|
-
|
|
182
|
-
b0.1.0 introduced a bug that made **every setting disappear from the
|
|
183
|
-
Settings tab, and eventually crashed the whole extension**: the new
|
|
184
|
-
"Compress backups to bz2" definition had an `optional: true` field that
|
|
185
|
-
only makes sense on string-type settings, not booleans. AirDC++'s API
|
|
186
|
-
rejected the whole settings-definitions request with `Field of type
|
|
187
|
-
boolean can't be optional` because of that one bad field, and the
|
|
188
|
-
extension's settings library silently swallows a rejection like that (it
|
|
189
|
-
only writes to this extension's own `error.log`, not the visible system
|
|
190
|
-
log) -- so nothing in the UI hinted at what went wrong. With settings
|
|
191
|
-
never actually loaded, the very next scheduled-backup timer tick then
|
|
192
|
-
crashed the entire extension process with `Cannot read properties of
|
|
193
|
-
undefined (reading 'schedule_days')`, since that check ran directly in a
|
|
194
|
-
setInterval/setTimeout callback -- which Node.js does not wrap in any
|
|
195
|
-
try/catch of its own. Fixed in b0.1.2 (removed the bad field) and b0.1.3
|
|
196
|
-
(that scheduled-backup check is now wrapped so a problem there is logged
|
|
197
|
-
instead of ever taking the whole extension down again).
|
|
198
|
-
|
|
199
|
-
As a safety net for the future, if settings registration with AirDC++ ever
|
|
200
|
-
fails again for any reason, this now posts a clear warning to the system
|
|
201
|
-
log on startup ("settings registration...appears to have failed") instead
|
|
202
|
-
of failing silently.
|
|
203
|
-
|
|
204
|
-
Also new in b0.1.2: overwriting a same-day backup (see "Backup filenames"
|
|
205
|
-
above) is now called out explicitly in the system log, instead of
|
|
206
|
-
happening silently.
|
|
207
|
-
|
|
208
|
-
## Notes (b0.1.4 / b0.1.7)
|
|
209
|
-
|
|
210
|
-
b0.1.4 briefly switched "Folder to save backups in" to AirDC++'s
|
|
211
|
-
`directory_path` setting type, which adds a native Browse button next to
|
|
212
|
-
the field. b0.1.7 reverted this back to plain `string` (no Browse button)
|
|
213
|
-
-- AirDC++ itself has a bug in that Browse dialog (clicking Browse, then
|
|
214
|
-
Cancel, requires clicking Browse twice to open it again), confirmed to
|
|
215
|
-
also affect the same button on airdcpp-sfv-folder-checker's "Default
|
|
216
|
-
folder to scan" setting, so it's not specific to this extension. No
|
|
217
|
-
behavior change otherwise -- leaving the field empty still uses the
|
|
218
|
-
extension's own log folder.
|
|
219
|
-
|
|
220
|
-
## Notes (b0.1.9)
|
|
221
|
-
|
|
222
|
-
Removed the "Share profile Token to back up" setting entirely. It never
|
|
223
|
-
supported more than one profile at a time (a comma-separated list of
|
|
224
|
-
Tokens was compared as one literal string, matching nothing), and backing
|
|
225
|
-
up everything is the simpler, expected default -- so the setting is gone
|
|
226
|
-
and every backup now always includes every shared folder, regardless of
|
|
227
|
-
share profile.
|
|
228
|
-
|
|
229
|
-
## Notes (0.1.10-beta)
|
|
230
|
-
|
|
231
|
-
Added `repository` and `bugs` fields to `package.json` (placeholder
|
|
232
|
-
GitHub URL -- replace `YOUR-USERNAME-HERE` with the real account/repo
|
|
233
|
-
before actually running `npm publish`), and flipped `private` from
|
|
234
|
-
`true` back to `false` in preparation for an eventual real npm publish.
|
|
235
|
-
Until that publish actually happens, this brings back the npmjs.org
|
|
236
|
-
update-check 404 that `private: true` had deliberately silenced --
|
|
237
|
-
harmless, just a log line, and easy to re-suppress by setting `private`
|
|
238
|
-
back to `true` for anyone installing from source/zip rather than a real
|
|
239
|
-
npm publish.
|
|
240
|
-
|
|
241
|
-
## Notes (0.1.11-beta)
|
|
242
|
-
|
|
243
|
-
Renamed the package from `airdcpp-share-backup` to `airdcpp-share-backup`.
|
|
244
|
-
AirDC++'s official extension spec says a package name "must start with
|
|
245
|
-
airdcpp-", but that turned out to only apply to extensions published
|
|
246
|
-
through npm's own registry and picked up via AirDC++'s in-app update
|
|
247
|
-
checker -- a locally-installed or FulDC++-catalogue extension with a
|
|
248
|
-
non-`airdcpp-`-prefixed name loads and runs identically (confirmed with
|
|
249
|
-
a small purpose-built test extension, installed manually and via
|
|
250
|
-
`dce-tiny-fileserver`'s auto-install, in real AirDC++ 4.30). Since this
|
|
251
|
-
whole family is only ever installed that way, `dce-` (Direct Connect
|
|
252
|
-
Extension) reads better than a name implying it only works with one
|
|
253
|
-
specific client. No functional change otherwise.
|
|
254
|
-
|
|
255
|
-
## Notes (0.1.12-beta)
|
|
256
|
-
|
|
257
|
-
Reverted the 0.1.11-beta rename: back to airdcpp-share-backup. Turns
|
|
258
|
-
out the official "name must start with airdcpp-" requirement is real
|
|
259
|
-
after all, just narrower than a quick test had suggested -- a minimal
|
|
260
|
-
test extension with no settings (dce-hello-fixxer) loaded, ran, and
|
|
261
|
-
handled chat commands fine under a non-airdcpp--prefixed name, which
|
|
262
|
-
looked like proof the whole requirement was obsolete. But every real
|
|
263
|
-
extension in this family uses settings, and AirDC++ rejects the
|
|
264
|
-
settings-registration API call (POST extensions/<name>/settings/
|
|
265
|
-
definitions) for a non-airdcpp--prefixed name -- confirmed with an
|
|
266
|
-
isolated one-line diff (only name/version changed, nothing else) that
|
|
267
|
-
reproduced a clean crash: a 400 on that endpoint, silently swallowed by
|
|
268
|
-
the settings library, followed by a hard crash the moment any setting
|
|
269
|
-
was read. Confirmed consistent even after a full AirDC++ restart, so
|
|
270
|
-
not a one-time registration race either. Back to airdcpp- for good. No
|
|
271
|
-
functional change otherwise.
|
|
272
|
-
|
|
273
|
-
## Notes (0.1.18-beta)
|
|
274
|
-
|
|
275
|
-
Wording fix only: the help text and docs said the backup file is
|
|
276
|
-
"openable directly with 'Open filelist' in AirDC++", which read as if
|
|
277
|
-
only AirDC++ could open it -- it's the standard DC++ filelist XML
|
|
278
|
-
format, so most other DC++ clients can open it too. Wording generalized
|
|
279
|
-
in the `/sharebackup help` text and in this README. No functional
|
|
280
|
-
change.
|
|
281
|
-
|
|
282
|
-
## Notes (0.1.17-beta)
|
|
283
|
-
|
|
284
|
-
Two changes, both purely to how help text is shown -- no backup logic
|
|
285
|
-
changed:
|
|
286
|
-
|
|
287
|
-
- `/sharebackup help` and `/sharebackuphelp` now reply in the same hub
|
|
288
|
-
or private-chat window the command was typed in, instead of the
|
|
289
|
-
general system log -- matching how `/rvalidator help` already
|
|
290
|
-
behaved in airdcpp-release-fixxer.
|
|
291
|
-
- The help text itself is now a short list of commands, one per line,
|
|
292
|
-
instead of a single long paragraph.
|
|
293
|
-
|
|
294
|
-
## Notes (0.1.16-beta)
|
|
295
|
-
|
|
296
|
-
Fixed a bug where `/sharebackup help` was silently treated as a literal
|
|
297
|
-
share-relative path (`help`), instead of showing usage -- resulted in a
|
|
298
|
-
confusing "Could not find a share root named help" failure. The
|
|
299
|
-
separate `/sharebackuphelp` command already worked correctly and is
|
|
300
|
-
unchanged; this just also catches the more natural `<command> help`
|
|
301
|
-
typing pattern (only when "help" is the entire argument -- a real path
|
|
302
|
-
is still free to contain the word). Same class of bug found and fixed
|
|
303
|
-
at the same time in airdcpp-sample-proof-checker and
|
|
304
|
-
airdcpp-sfv-folder-checker.
|
|
305
|
-
|
|
306
|
-
Also fixed, while in there: the internal `EXTENSION_VERSION` constant
|
|
307
|
-
(used only in the startup log line and in the XML "Generator" attribute
|
|
308
|
-
of each backup file) had drifted to "0.1.14-beta" -- two releases behind
|
|
309
|
-
package.json -- because the 0.1.15-beta repository/bugs/private change
|
|
310
|
-
didn't update it. Same desync bug as the one already fixed once for this
|
|
311
|
-
extension (see "Notes (0.1.14-beta)" below) and, separately, for
|
|
312
|
-
tiny-fileserver; back in sync now. No other functional change.
|
|
313
|
-
|
|
314
|
-
## Notes (0.1.14-beta)
|
|
315
|
-
|
|
316
|
-
Fixed the same version-desync bug found in tiny-fileserver: this
|
|
317
|
-
extension's startup log line said "v0.1.9-beta" for the last five
|
|
318
|
-
releases (0.1.10 through 0.1.13-beta) because a separate internal
|
|
319
|
-
EXTENSION_VERSION constant had fallen out of sync with package.json --
|
|
320
|
-
confirmed live via a user-reported system log showing "Extension
|
|
321
|
-
started (v0.1.9-beta)" right after auto-installing 0.1.13-beta. Back in
|
|
322
|
-
sync now (0.1.14-beta). No other functional change.
|
|
323
|
-
|
|
324
|
-
## Notes (0.1.13-beta)
|
|
325
|
-
|
|
326
|
-
Added a "files": ["dist"] field to package.json. Without it, `npm pack`
|
|
327
|
-
(or an eventual `npm publish`) would include the entire source tree
|
|
328
|
-
(src/, everything) since this extension has no .npmignore at all --
|
|
329
|
-
none of which is needed at runtime, since `dist/main.js` is a
|
|
330
|
-
self-contained webpack bundle. Packaging is smaller and cleaner now; no
|
|
331
|
-
functional change.
|
|
332
|
-
|
|
333
|
-
## Building from source
|
|
334
|
-
|
|
335
|
-
```
|
|
336
|
-
npm install
|
|
337
|
-
npm run build
|
|
338
|
-
```
|
|
339
|
-
|
|
340
|
-
Produces `dist/main.js`. Copy this project's folder (with `dist/main.js`
|
|
341
|
-
and `package.json`) into your AirDC++ extensions folder, or zip it up the
|
|
342
|
-
way the packaged release is structured.
|