chore: Add warning for problematic selfhosted config, closes #8025

This commit is contained in:
Tom Moor
2024-11-29 11:07:23 -05:00
parent c98d6aa33a
commit b2d6c40ea8

View File

@@ -230,6 +230,9 @@ export default class S3Storage extends BaseStorage {
if (env.AWS_S3_UPLOAD_BUCKET_NAME) {
const url = new URL(env.AWS_S3_UPLOAD_BUCKET_URL);
if (url.hostname.startsWith(env.AWS_S3_UPLOAD_BUCKET_NAME + ".")) {
Logger.warn(
"AWS_S3_UPLOAD_BUCKET_URL contains the bucket name, this configuration combination will always point to AWS.\nRename your bucket or hostname if not using AWS S3.\nSee: https://github.com/outline/outline/issues/8025"
);
return undefined;
}
}