sliftutils 1.7.9 → 1.7.11
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/bin/storageserver.js +4 -0
- package/{teststorage → examplestorage}/browser.tsx +18 -22
- package/{teststorage/server.ts → examplestorage/exampleserver.ts} +4 -6
- package/index.d.ts +770 -84
- package/misc/dist/environment.ts.cache +3 -3
- package/misc/dist/getSecret.ts.cache +139 -0
- package/misc/dist/strings.ts.cache +13 -0
- package/misc/dist/zip.ts.cache +9 -0
- package/misc/getSecret.ts +38 -16
- package/misc/https/cloudflareHelpers.d.ts +19 -0
- package/misc/https/cloudflareHelpers.ts +69 -0
- package/misc/https/dist/certs.ts.cache +115 -179
- package/misc/https/dist/cloudflareHelpers.ts.cache +68 -0
- package/misc/https/dist/dns.ts.cache +112 -100
- package/misc/https/dist/hostServer.ts.cache +130 -0
- package/misc/https/dist/httpsCerts.ts.cache +24 -5
- package/misc/https/dist/persistentLocalStorage.ts.cache +3 -2
- package/misc/https/dns.d.ts +41 -8
- package/misc/https/dns.ts +104 -106
- package/misc/https/hostServer.d.ts +0 -3
- package/misc/https/hostServer.ts +12 -8
- package/package.json +3 -2
- package/render-utils/dist/observer.tsx.cache +3 -2
- package/spec.txt +0 -55
- package/storage/ArchivesDisk.d.ts +67 -0
- package/storage/ArchivesDisk.ts +369 -0
- package/storage/BulkDatabase2/dist/BulkDatabaseBase.ts.cache +1242 -0
- package/storage/BulkDatabase2/dist/BulkDatabaseFormat.ts.cache +513 -0
- package/storage/BulkDatabase2/dist/BulkDatabaseMerge.ts.cache +352 -0
- package/storage/BulkDatabase2/dist/BulkDatabaseReader.ts.cache +306 -0
- package/storage/BulkDatabase2/dist/LoadedIndex.ts.cache +435 -0
- package/storage/BulkDatabase2/dist/WriteOverlay.ts.cache +58 -0
- package/storage/BulkDatabase2/dist/blockCache.ts.cache +179 -0
- package/storage/BulkDatabase2/dist/mergeLock.ts.cache +149 -0
- package/storage/BulkDatabase2/dist/mergeMarkers.ts.cache +101 -0
- package/storage/BulkDatabase2/dist/streamLog.ts.cache +227 -0
- package/storage/BulkDatabase2/dist/syncClient.ts.cache +104 -0
- package/storage/IArchives.d.ts +127 -1
- package/storage/IArchives.ts +201 -1
- package/storage/backblaze.d.ts +29 -2
- package/storage/backblaze.ts +214 -78
- package/storage/dist/ArchivesDisk.ts.cache +373 -0
- package/storage/dist/FileFolderAPI.tsx.cache +508 -65
- package/storage/dist/IArchives.ts.cache +44 -0
- package/storage/dist/IndexedDBFileFolderAPI.ts.cache +8 -2
- package/storage/dist/JSONStorage.ts.cache +6 -2
- package/storage/dist/PendingManager.tsx.cache +1 -1
- package/storage/dist/TransactionStorage.ts.cache +231 -92
- package/storage/dist/backblaze.ts.cache +797 -0
- package/storage/dist/fileSystemPointer.ts.cache +36 -3
- package/storage/dist/remoteFileStorage.ts.cache +495 -0
- package/storage/remoteStorage/ArchivesRemote.d.ts +34 -18
- package/storage/remoteStorage/ArchivesRemote.ts +85 -65
- package/storage/remoteStorage/ArchivesUrl.d.ts +48 -0
- package/storage/remoteStorage/ArchivesUrl.ts +86 -0
- package/storage/remoteStorage/accessPage.tsx +111 -28
- package/storage/remoteStorage/blobStore.d.ts +128 -25
- package/storage/remoteStorage/blobStore.ts +757 -290
- package/storage/remoteStorage/cliArgs.d.ts +1 -0
- package/storage/remoteStorage/cliArgs.ts +9 -0
- package/storage/remoteStorage/createArchives.d.ts +85 -0
- package/storage/remoteStorage/createArchives.ts +612 -0
- package/storage/remoteStorage/dist/ArchivesRemote.ts.cache +197 -0
- package/storage/remoteStorage/dist/ArchivesUrl.ts.cache +85 -0
- package/storage/remoteStorage/dist/accessPage.tsx.cache +222 -0
- package/storage/remoteStorage/dist/blobStore.ts.cache +837 -0
- package/storage/remoteStorage/dist/cliArgs.ts.cache +16 -0
- package/storage/remoteStorage/dist/createArchives.ts.cache +610 -0
- package/storage/remoteStorage/dist/remoteConfig.ts.cache +206 -0
- package/storage/remoteStorage/dist/sourceWrapper.ts.cache +223 -0
- package/storage/remoteStorage/dist/storageController.ts.cache +500 -0
- package/storage/remoteStorage/dist/storageServer.ts.cache +106 -0
- package/storage/remoteStorage/dist/storageServerCli.ts.cache +39 -0
- package/storage/remoteStorage/dist/storageServerState.ts.cache +518 -0
- package/storage/remoteStorage/grantAccess.js +4 -0
- package/storage/remoteStorage/grantAccessCli.d.ts +1 -0
- package/storage/remoteStorage/grantAccessCli.ts +27 -0
- package/storage/remoteStorage/remoteConfig.d.ts +29 -0
- package/storage/remoteStorage/remoteConfig.ts +194 -0
- package/storage/remoteStorage/sourceWrapper.d.ts +41 -0
- package/storage/remoteStorage/sourceWrapper.ts +223 -0
- package/storage/remoteStorage/spec.md +31 -0
- package/storage/remoteStorage/storageController.d.ts +30 -27
- package/storage/remoteStorage/storageController.ts +297 -159
- package/storage/remoteStorage/storageServer.d.ts +6 -0
- package/storage/remoteStorage/storageServer.ts +88 -94
- package/storage/remoteStorage/storageServerCli.d.ts +1 -0
- package/storage/remoteStorage/storageServerCli.ts +38 -0
- package/storage/remoteStorage/storageServerState.d.ts +43 -0
- package/storage/remoteStorage/storageServerState.ts +540 -0
- package/testsite/server.ts +0 -2
- package/yarn.lock +11 -6
|
@@ -9,24 +9,18 @@ import { formatNumber, formatDateTime } from "socket-function/src/formatting/for
|
|
|
9
9
|
import { css } from "typesafecss";
|
|
10
10
|
import { InputLabel } from "../render-utils/InputLabel";
|
|
11
11
|
import { redButton, greenButton, errorMessage } from "../render-utils/colors";
|
|
12
|
-
import {
|
|
12
|
+
import { createArchives } from "../storage/remoteStorage/createArchives";
|
|
13
13
|
import { ArchiveFileInfo } from "../storage/IArchives";
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
-
const BUCKET = "testfiles";
|
|
15
|
+
// The bucket's routing URL: server, account ("example"), and bucket ("examplefiles") in one.
|
|
16
|
+
// Nothing else is needed - the first call creates the bucket if it doesn't exist yet.
|
|
17
|
+
const STORAGE_URL = "https://storage.vidgridweb.com:4444/file/example/examplefiles/storage/storagerouting.json";
|
|
19
18
|
const ACCESS_CHECK_INTERVAL = 1000 * 15;
|
|
20
19
|
|
|
21
|
-
const archives =
|
|
22
|
-
address: STORAGE_ADDRESS,
|
|
23
|
-
port: STORAGE_PORT,
|
|
24
|
-
account: ACCOUNT,
|
|
25
|
-
bucketName: BUCKET,
|
|
26
|
-
});
|
|
20
|
+
const archives = createArchives(STORAGE_URL);
|
|
27
21
|
|
|
28
22
|
@observer
|
|
29
|
-
class
|
|
23
|
+
class ExampleStoragePage extends preact.Component {
|
|
30
24
|
synced = observable({
|
|
31
25
|
files: [] as ArchiveFileInfo[],
|
|
32
26
|
loaded: false,
|
|
@@ -34,16 +28,16 @@ class TestStoragePage extends preact.Component {
|
|
|
34
28
|
content: "",
|
|
35
29
|
contentLoaded: false,
|
|
36
30
|
newFileName: "",
|
|
37
|
-
|
|
31
|
+
access: undefined as { link: string; machineId: string; ip: string } | undefined,
|
|
38
32
|
error: "",
|
|
39
33
|
});
|
|
40
34
|
|
|
41
35
|
componentDidMount() {
|
|
42
36
|
void (async () => {
|
|
43
37
|
while (true) {
|
|
44
|
-
let
|
|
45
|
-
this.synced.
|
|
46
|
-
if (!
|
|
38
|
+
let access = await archives.waitingForAccess();
|
|
39
|
+
this.synced.access = access;
|
|
40
|
+
if (!access) break;
|
|
47
41
|
await delay(ACCESS_CHECK_INTERVAL);
|
|
48
42
|
}
|
|
49
43
|
await this.refresh();
|
|
@@ -90,12 +84,14 @@ class TestStoragePage extends preact.Component {
|
|
|
90
84
|
render() {
|
|
91
85
|
let synced = this.synced;
|
|
92
86
|
return <div className={css.vbox(12).pad2(16)}>
|
|
93
|
-
<div>Storage
|
|
87
|
+
<div>Storage example site. Bucket {STORAGE_URL}</div>
|
|
94
88
|
{synced.error && <div className={errorMessage}>{synced.error}</div>}
|
|
95
|
-
{!synced.loaded && !synced.
|
|
96
|
-
{!synced.loaded && synced.
|
|
97
|
-
<div>This machine does not have access to the account yet
|
|
98
|
-
<
|
|
89
|
+
{!synced.loaded && !synced.access && <div>Loading files...</div>}
|
|
90
|
+
{!synced.loaded && synced.access && <div className={css.vbox(8)}>
|
|
91
|
+
<div>This machine does not have access to the account yet.</div>
|
|
92
|
+
<div>Machine: {synced.access.machineId}</div>
|
|
93
|
+
<div>IP: {synced.access.ip}</div>
|
|
94
|
+
<a href={synced.access.link} target="_blank">{synced.access.link}</a>
|
|
99
95
|
</div>}
|
|
100
96
|
{synced.loaded && <div className={css.hbox(24).alignItems("flex-start")}>
|
|
101
97
|
<div className={css.vbox(8)}>
|
|
@@ -142,7 +138,7 @@ class TestStoragePage extends preact.Component {
|
|
|
142
138
|
|
|
143
139
|
async function main() {
|
|
144
140
|
if (isNode()) return;
|
|
145
|
-
preact.render(<
|
|
141
|
+
preact.render(<ExampleStoragePage />, document.body);
|
|
146
142
|
}
|
|
147
143
|
|
|
148
144
|
main().catch(console.error);
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
process.env.NODE_ENV = "production";
|
|
2
|
-
import os from "os";
|
|
3
2
|
import path from "path";
|
|
4
3
|
import { SocketFunction } from "socket-function/SocketFunction";
|
|
5
4
|
import { RequireController } from "socket-function/require/RequireController";
|
|
@@ -7,10 +6,10 @@ import { hostServer } from "../misc/https/hostServer";
|
|
|
7
6
|
// Import browser code, so it is allowed to be required by the client
|
|
8
7
|
import "./browser";
|
|
9
8
|
|
|
10
|
-
// Static
|
|
9
|
+
// Static example site for the remote storage system (storage/remoteStorage). The browser talks to
|
|
11
10
|
// the storage server directly, so this server only serves the page.
|
|
12
11
|
|
|
13
|
-
const DOMAIN = "
|
|
12
|
+
const DOMAIN = "storageexample.vidgridweb.com";
|
|
14
13
|
const PORT = 4445;
|
|
15
14
|
|
|
16
15
|
process.on("unhandledRejection", (error) => {
|
|
@@ -24,17 +23,16 @@ async function main() {
|
|
|
24
23
|
RequireController.allowAllNodeModules();
|
|
25
24
|
SocketFunction.expose(RequireController);
|
|
26
25
|
SocketFunction.setDefaultHTTPCall(RequireController, "requireHTML", {
|
|
27
|
-
requireCalls: ["./
|
|
26
|
+
requireCalls: ["./examplestorage/browser.tsx"],
|
|
28
27
|
});
|
|
29
28
|
RequireController.addStaticRoot(path.resolve("."));
|
|
30
29
|
|
|
31
30
|
await hostServer({
|
|
32
31
|
domain: DOMAIN,
|
|
33
32
|
port: PORT,
|
|
34
|
-
cloudflareApiTokenPath: os.homedir() + "/vidgridweb.com.key",
|
|
35
33
|
setDNSRecord: true,
|
|
36
34
|
});
|
|
37
|
-
console.log(`Storage
|
|
35
|
+
console.log(`Storage example site running at https://${DOMAIN}:${PORT}`);
|
|
38
36
|
}
|
|
39
37
|
|
|
40
38
|
main().catch(e => {
|