(core) make it easier to enable Azure storage without setting GRIST_DOCS_S3_BUCKET

Summary:
Previously, absence of `GRIST_DOCS_S3_BUCKET` was equated with absence
of external storage, but that is no longer true now that Azure is
available. Azure could be used by setting `GRIST_DOCS_S3_BUCKET`
but the alternative `GRIST_AZURE_CONTAINER` flag is friendlier.

Test Plan:
confirmed manually that Azure can be configured and
used now without `GRIST_DOCS_S3_BUCKET`

Reviewers: alexmojaki

Reviewed By: alexmojaki

Subscribers: alexmojaki

Differential Revision: https://phab.getgrist.com/D3448
This commit is contained in:
Paul Fitzpatrick
2022-06-03 10:54:49 -04:00
parent acddd25cfd
commit 1c6f80f956
6 changed files with 240 additions and 38 deletions

View File

@@ -34,7 +34,7 @@ interface ServerOptions extends FlexServerOptions {
logToConsole?: boolean; // If set, messages logged to console (default: false)
// (but if options are not given at all in call to main,
// logToConsole is set to true)
s3?: boolean; // If set, documents saved to s3 (default is to check environment
externalStorage?: boolean; // If set, documents saved to external storage such as s3 (default is to check environment
// variables, which get set in various ways in dev/test entry points)
}
@@ -59,7 +59,7 @@ export async function main(port: number, serverTypes: ServerType[],
}
if (options.logToConsole) { server.addLogging(); }
if (options.s3 === false) { server.disableS3(); }
if (options.externalStorage === false) { server.disableExternalStorage(); }
await server.loadConfig();
if (includeDocs) {