π₯ π₯ π₯ A Free & Self-hostable Airtable Alternative
TypeScript airtableairtable-alternativeautomatic-apihacktoberfestlow-codeno-codeno-code-databaseno-code-platformpostgresqlrest-apirestful-apispreadsheetsqliteswagger
add TODO on s3 for path style add comment on preprocessor and remove uploaded param
Fendy Heryantoa7e36dc869bd
diff --git a/packages/nocodb/src/db/BaseModelSqlv2/attachment-url-upload-preparator.ts b/packages/nocodb/src/db/BaseModelSqlv2/attachment-url-upload-preparator.tsindex b943c63a2d..400b8e4792 100644--- a/packages/nocodb/src/db/BaseModelSqlv2/attachment-url-upload-preparator.ts+++ b/packages/nocodb/src/db/BaseModelSqlv2/attachment-url-upload-preparator.ts@@ -68,9 +68,10 @@ export class AttachmentUrlUploadPreparator {const uploadedPath = storageAdapter.getUploadedPath(filePaths.storageDest,);- // TODO: insert a fileReference, or simply generate the id? (id collision risk)const id = await FileReference.insert(baseModel.context, {storage: storageAdapter.name,+ // currently a placeholder+ // it will be replaced after upload successfile_url: uploadedPath.url ?? uploadedPath.path,file_size: null,fk_user_id: req?.user?.id ?? 'anonymous',@@ -84,7 +85,6 @@ export class AttachmentUrlUploadPreparator {id,url: attr.url,status: 'uploading',- uploaded: uploadedPath,...filePaths,};} else {diff --git a/packages/nocodb/src/plugins/s3/S3.ts b/packages/nocodb/src/plugins/s3/S3.tsindex ca02b75133..2c005fd29a 100644--- a/packages/nocodb/src/plugins/s3/S3.ts+++ b/packages/nocodb/src/plugins/s3/S3.ts@@ -95,6 +95,8 @@ export default class S3 extends GenericS3 implements IStorageAdapterV2 {override getUploadedPath(path: string): { path?: string; url?: string } {const usePath = path.startsWith('/') ? path.replace(/$\/+/, '') : path;+ // TODO: more configurable urls, like using path-styles and CNAME+ // https://docs.aws.amazon.com/AmazonS3/latest/userguide/VirtualHosting.htmlreturn {url: `https://${this.input.bucket}.s3.${this.input.region}.amazonaws.com/${usePath}`,};