upgrade and patch zipline
This commit is contained in:
parent
81d442200b
commit
2e7c178862
5 changed files with 59 additions and 11 deletions
|
@ -15,18 +15,12 @@ in
|
|||
services.zipline = {
|
||||
enable = true;
|
||||
settings = {
|
||||
CORE_HOSTNAME = "127.0.0.1";
|
||||
CORE_PORT = 3001;
|
||||
DATASOURCE_TYPE = "s3";
|
||||
DATASOURCE_S3_ENDPOINT = "e3e97aac307d106a7becea43cef8fcbd.r2.cloudflarestorage.com";
|
||||
DATASOURCE_S3_ENDPOINT = "https://e3e97aac307d106a7becea43cef8fcbd.r2.cloudflarestorage.com";
|
||||
DATASOURCE_S3_BUCKET = "zipline";
|
||||
DATASOURCE_S3_REGION = "auto";
|
||||
DATASOURCE_S3_USE_SSL = "true";
|
||||
DATASOURCE_S3_FORCE_S3_PATH = "false";
|
||||
FEATURES_THUMBNAILS = "true";
|
||||
EXIF_REMOVE_GPS = "true";
|
||||
CHUNKS_CHUNKS_SIZE = "50mb";
|
||||
CHUNKS_MAX_SIZE = "95mb";
|
||||
FEATURES_OAUTH_REGISTRATION = "true";
|
||||
};
|
||||
environmentFiles = [ config.sops.secrets."zipline/env".path ];
|
||||
};
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
let
|
||||
overlays = [
|
||||
./attic
|
||||
./zipline
|
||||
];
|
||||
importedOverlays = map (m: import m) overlays;
|
||||
in
|
||||
|
|
8
overlay/zipline/default.nix
Normal file
8
overlay/zipline/default.nix
Normal file
|
@ -0,0 +1,8 @@
|
|||
final: prev:
|
||||
{
|
||||
zipline = prev.zipline.overrideAttrs {
|
||||
patches = [
|
||||
./no-check-bucket.patch
|
||||
];
|
||||
};
|
||||
}
|
45
overlay/zipline/no-check-bucket.patch
Normal file
45
overlay/zipline/no-check-bucket.patch
Normal file
|
@ -0,0 +1,45 @@
|
|||
diff --git a/src/lib/datasource/S3.ts b/src/lib/datasource/S3.ts
|
||||
index 089dd64..39dd8f4 100644
|
||||
--- a/src/lib/datasource/S3.ts
|
||||
+++ b/src/lib/datasource/S3.ts
|
||||
@@ -4,7 +4,6 @@ import {
|
||||
DeleteObjectCommand,
|
||||
DeleteObjectsCommand,
|
||||
GetObjectCommand,
|
||||
- ListBucketsCommand,
|
||||
ListObjectsCommand,
|
||||
PutObjectCommand,
|
||||
S3Client,
|
||||
@@ -38,32 +37,6 @@ export class S3Datasource extends Datasource {
|
||||
endpoint: this.options.endpoint ?? undefined,
|
||||
forcePathStyle: this.options.forcePathStyle ?? false,
|
||||
});
|
||||
-
|
||||
- this.ensureBucketExists();
|
||||
- }
|
||||
-
|
||||
- private async ensureBucketExists() {
|
||||
- try {
|
||||
- const res = await this.client.send(new ListBucketsCommand());
|
||||
- if (res.$metadata.httpStatusCode !== 200) {
|
||||
- this.logger
|
||||
- .error('there was an error while listing buckets', res.$metadata as Record<string, unknown>)
|
||||
- .error('zipline will now exit');
|
||||
- process.exit(1);
|
||||
- }
|
||||
-
|
||||
- if (!res.Buckets?.find((bucket) => bucket.Name === this.options.bucket)) {
|
||||
- this.logger.error(`bucket ${this.options.bucket} does not exist`).error('zipline will now exit');
|
||||
- process.exit(1);
|
||||
- }
|
||||
- } catch (e) {
|
||||
- this.logger
|
||||
- .error('there was an error while listing buckets', e as Record<string, unknown>)
|
||||
- .error('zipline will now exit');
|
||||
- process.exit(1);
|
||||
- } finally {
|
||||
- this.logger.debug(`bucket ${this.options.bucket} exists`);
|
||||
- }
|
||||
}
|
||||
|
||||
public async get(file: string): Promise<Readable | null> {
|
|
@ -1,5 +1,5 @@
|
|||
zipline:
|
||||
env: ENC[AES256_GCM,data:lsR/+bET/C7ssik0xv5IBITT+KEnoyqNjSZ9jvkkb7lmNAQzow6dCm1nprfimiJC0EF2LyiEPm0wchdtrLTNEtUkJWkworEJXeWGrGGbHgZW0/HC1BSERqlLmZTPyLWkhsl3rObvuhRoTKlUN5EMwtK8x06aOX6PcxLdwVjps7UxkBXej712IcKPvHVSJIQMvVHP2lqSppJc+sEMt4u3Vnf1ZYGsQS3bWnI7w40sOdGR8LGBadfmWwIj0/3XTaG7S7Lhi4AOFGZtpdyOmxxIH3Vd5qesfiqPHm0nTmu/JxPftYm+F/hDnbJHrbg7cNVlJahDFtQp8QdlVvdMU3ccNptpRXGWIwFOz3JtuzDo7pxkYRqO2dKqYbKhOknrMW0PYuB48XEKj3e4Q+T8tUhFTsOHfqT0J8ati26dQaUO5wvw22o=,iv:QeR8fU9bRVO5OuqjbEeiC1vihbLxrNgnR0k0K/mRmSw=,tag:6x2XELOlJ9JWeOuVBBHNpg==,type:str]
|
||||
env: ENC[AES256_GCM,data:5n056AoWvM4PXBCxm+tk2G9qOugRpA/n5YRrxTtB7XBBQmRQNaP2a6AbAnWX665yFGQsB0iHdSER3sY78RqUL0gFKupVq1UAT8A2Wi0HqcFMqUs2drXjIksdmI6hTLk9TCxtPy0VbPieIshO2VEYesUqitTZ01i8Hj5CyF8yFC6t9eQ2L9iKLm5gje80MoqQT4IFx+V5B4ExP3fzhcpfr8StGHKHvG59nc40KQAW38i/95H3nncScOBfSQSNH61wLnDjecr8srxELO/j2iOKD9JzmqYLQr8TLKNw7KIIhDMAmuNeQhG1YXtj7/nj6gHN6cHpcHPgUdWID/Y6MHcndDCIJnyC2Qeod5ShOn53IjL7C8VZ940o9LfwNz22sx1SYZEwRGktIhUY0c4IL/4bUvhxwTcMH9ITYU8eVfG/QSnr8B4=,iv:juf0dRagztirDN89Jj+v8k62BBl9TU12A8TdR/m8qDA=,tag:WakN+bOYfF4YrleIsAg+OQ==,type:str]
|
||||
sops:
|
||||
kms: []
|
||||
gcp_kms: []
|
||||
|
@ -24,8 +24,8 @@ sops:
|
|||
WHZSeVJIaGRldmhmcWZvT3YzL3hPbFEKVUtCU1l/RhFOlwdjE0ejW/Ym+cMVNxIW
|
||||
AdvVcWoilMGTsDJIIlLu7fPbhmGotPvqGjxMC2yEpEgJUt/rsz2vPA==
|
||||
-----END AGE ENCRYPTED FILE-----
|
||||
lastmodified: "2025-02-14T03:37:09Z"
|
||||
mac: ENC[AES256_GCM,data:KViPAUWWpE5UTZOp55f3QeXhHkXBvyl9Np/Tlj5bY7t3qt1U370OLq1yL87WWbvRWa/K/ZYN2gjN16dgfp5o834VniSJM6dnw+vC76QNaXjCfE2HKozRx6NlHFMflzzV8TXvqzJvuPa43E8DRaBctY2a7aIbJ4DJki1dfmrrO3Y=,iv:vPeMWOWQNZX3t4BoYzpuI74tZJ3rCXwbxmqcRAW5ZXY=,tag:i4ZjIXg0JOj2U2jMwurChw==,type:str]
|
||||
lastmodified: "2025-02-23T21:43:15Z"
|
||||
mac: ENC[AES256_GCM,data:nI7xnLUMtseY9q8XZ3owb6qtRBtaRmmNNK4Z5ELHaI85VowdItZXMFN9faCVuCVTzhKp/4WC8jm96k7eWxytzW6r6KRvKDrUaRV27UweraK2Oe8et7u+oIEPh6HkNuZFB+qPiFYdfc+qQeTIKwayEVLeVWyvQKVDBhBxZd9UArg=,iv:q4hRQVat+LHVbYnF6QLE8iBdBeacJVUBKmMe4tbU8YU=,tag:6m4+SU1BFXMPORqe9vgXAw==,type:str]
|
||||
pgp: []
|
||||
unencrypted_suffix: _unencrypted
|
||||
version: 3.9.4
|
||||
|
|
Loading…
Add table
Reference in a new issue