querysub 0.545.0 → 0.546.0
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/appSecrets.ts +2 -3
- package/package.json +1 -1
- package/src/-a-archives/archives2.ts +11 -3
package/appSecrets.ts
CHANGED
|
@@ -74,9 +74,8 @@ export const getCloudflareCreds = lazy(async (): Promise<{ key: string; email: s
|
|
|
74
74
|
|
|
75
75
|
/** Serves the secret keys sliftutils' getSecret expects, reading them the way querysub already does: backblaze creds off disk (getBackblazePath), cloudflare creds from the keys archives bucket (with its local file fallback). */
|
|
76
76
|
export async function getAppSecret(key: string): Promise<string | undefined> {
|
|
77
|
-
//
|
|
78
|
-
|
|
79
|
-
// Querysub;
|
|
77
|
+
// Import query sub so our logs go to our actual log server. Otherwise we won't know if we get any errors.
|
|
78
|
+
Querysub;
|
|
80
79
|
if (key.startsWith("backblaze.json.")) {
|
|
81
80
|
let creds = JSON.parse(fs.readFileSync(getBackblazePath(), "utf8")) as { applicationKeyId?: string; applicationKey?: string };
|
|
82
81
|
if (key === "backblaze.json.applicationKeyId") return creds.applicationKeyId;
|
package/package.json
CHANGED
|
@@ -3,6 +3,7 @@ import { createArchives } from "sliftutils/storage/remoteStorage/createArchives"
|
|
|
3
3
|
import { cache, cacheJSONArgsEqual } from "socket-function/src/caching";
|
|
4
4
|
import { formatDateTime } from "socket-function/src/formatting/format";
|
|
5
5
|
import { getDomain } from "../config";
|
|
6
|
+
import { timeInMinute } from "socket-function/src/misc";
|
|
6
7
|
|
|
7
8
|
function createSourceWindows(
|
|
8
9
|
overrides: Partial<RemoteConfigBase>,
|
|
@@ -39,8 +40,8 @@ function archiveBuilder(bucket: string, overrides: Partial<RemoteConfigBase>) {
|
|
|
39
40
|
{
|
|
40
41
|
startTime: 0,
|
|
41
42
|
sources: [
|
|
42
|
-
{ type: "remote", url: ONTARIO, route: [0.5
|
|
43
|
-
{ type: "remote", url: HETZNER, route: [0,
|
|
43
|
+
{ type: "remote", url: ONTARIO, route: [0, 0.5], },
|
|
44
|
+
{ type: "remote", url: HETZNER, route: [0.5, 1], },
|
|
44
45
|
{ type: "remote", url: ONTARIO, },
|
|
45
46
|
{ type: "remote", url: HETZNER, },
|
|
46
47
|
{ type: "backblaze", url: BACKBLAZE, },
|
|
@@ -61,7 +62,7 @@ function archiveBuilder(bucket: string, overrides: Partial<RemoteConfigBase>) {
|
|
|
61
62
|
]);
|
|
62
63
|
|
|
63
64
|
return createArchives({
|
|
64
|
-
version:
|
|
65
|
+
version: 13,
|
|
65
66
|
sources,
|
|
66
67
|
});
|
|
67
68
|
}
|
|
@@ -100,6 +101,13 @@ function getSafeDomain() {
|
|
|
100
101
|
export function getArchives2(folder: string) {
|
|
101
102
|
return nestBucket(folder, archivesBuilderCache(getSafeDomain(), { noFullSync: true, }));
|
|
102
103
|
}
|
|
104
|
+
|
|
105
|
+
/** The rights are buffered server-side, so if you do many writes at once, it won't slow down the disk and it won't result in many writes to back backblades. Of course, this does mean if the server crashes, you do lose some data.
|
|
106
|
+
*/
|
|
107
|
+
export function getArchives2Buffered(folder: string, bufferDelay = timeInMinute * 5) {
|
|
108
|
+
return nestBucket(folder, archivesBuilderCache(getSafeDomain() + "-fast", { noFullSync: true, fast: true, writeDelay: bufferDelay }));
|
|
109
|
+
}
|
|
110
|
+
|
|
103
111
|
export function getArchives2PrivateImmutable(folder: string) {
|
|
104
112
|
return nestBucket(folder, archivesBuilderCache(getSafeDomain() + "-private-immutable", { noFullSync: true, immutable: true }));
|
|
105
113
|
}
|