mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) give preliminary support in core for storing snapshots in S3-compatible stores via minio-js client
Summary: This is a first pass at snapshot support using the MinIO client, suitable for use against a MinIO server or other S3-compatible storage (including the original AWS S3). In Grist Labs monorepo tests, it is run against AWS S3. It can be manually configured to run again a MinIO server, and these tests pass. There are no core tests just yet. Next step would be to move external storage tests to core, and configure workflow to run tests against a transient MinIO server. Test Plan: applied same tests as for Azure and S3 (via AWS client) Reviewers: georgegevoian Reviewed By: georgegevoian Differential Revision: https://phab.getgrist.com/D3729
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { isAffirmative } from 'app/common/gutil';
|
||||
import { isAffirmative, isNumber } from 'app/common/gutil';
|
||||
|
||||
/**
|
||||
* A bundle of settings for the application. May contain
|
||||
@@ -23,6 +23,22 @@ export class AppSettings {
|
||||
return (this._value !== undefined) ? isAffirmative(this._value) : undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Access the setting as an integer using parseInt. Undefined if not set.
|
||||
* Throws an error if not numberlike.
|
||||
*/
|
||||
public getAsInt(): number|undefined {
|
||||
if (this._value === undefined) { return undefined; }
|
||||
const datum = this._value?.valueOf();
|
||||
if (typeof datum === 'number') {
|
||||
return datum;
|
||||
}
|
||||
if (isNumber(String(datum))) {
|
||||
return parseInt(String(datum), 10);
|
||||
}
|
||||
throw new Error(`${datum} does not look like a number`);
|
||||
}
|
||||
|
||||
/**
|
||||
* Try to read the setting from the environment. Even if
|
||||
* we fail, we record information about how we tried to
|
||||
|
||||
Reference in New Issue
Block a user