Skip to content

Commit c982ddf

Browse files
committed
Make S3_REGION required if DRIVE_DISK=s3
Fix #95
1 parent b4e42cb commit c982ddf

File tree

6 files changed

+15
-13
lines changed

6 files changed

+15
-13
lines changed

CHANGES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ To be released.
4040
- On profile page, the favicon is now switched between light and dark mode
4141
according to the user's preference. [[#101]]
4242

43+
- The `S3_REGION` environment variable became required if `DRIVE_DISK` is set
44+
to `s3`. [[#95]]
45+
46+
[#95]: https://github.com/fedify-dev/hollo/issues/95
4347
[#99]: https://github.com/fedify-dev/hollo/issues/99
4448
[#100]: https://github.com/fedify-dev/hollo/pull/100
4549
[#101]: https://github.com/fedify-dev/hollo/issues/101

docs/src/content/docs/install/env.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,10 +193,10 @@ The public URL base of the asset storage, e.g.,
193193
- Must be publicly accessible for federation to work correctly.
194194
</Aside>
195195

196-
#### `S3_REGION` <Badge text="Optional" />
196+
#### `S3_REGION` <Badge text="Required with S3 driver" variant="caution" />
197197

198198
The region of the S3-compatible object storage, e.g., `us-east-1`. On some
199-
non-S3 services, this can be omitted. `auto` by default.
199+
non-S3 services, this can be omitted.
200200

201201
#### `S3_BUCKET` <Badge text="Required with S3 driver" variant="caution" />
202202

docs/src/content/docs/ja/install/env.mdx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,14 +193,12 @@ Holloでアバター、カスタム絵文字、
193193
- 公開的にアクセス可能でなければ、連合が正しく動作しません。
194194
</Aside>
195195

196-
#### `S3_REGION` <Badge text="オプション" />
196+
#### `S3_REGION` <Badge text="S3ドライバで必須" variant="caution" />
197197

198198
S3互換オブジェクトストレージのリージョン。例:`us-east-1`
199199

200200
一部の非AWS S3互換サービスでは、この値が必要ないかもしれません。
201201

202-
デフォルトは`auto`です。
203-
204202
#### `S3_BUCKET` <Badge text="S3ドライバで必須" variant="caution" />
205203

206204
S3互換オブジェクトストレージのバケット名。例:`hollo`

docs/src/content/docs/ko/install/env.mdx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,13 +191,11 @@ Hollo에서 프로필 사진, 커스텀 에모지, 기타 미디어와 같은
191191
- 공개적으로 접근 가능해야 연합이 올바르게 작동합니다.
192192
</Aside>
193193

194-
#### `S3_REGION` <Badge text="선택" />
194+
#### `S3_REGION` <Badge text="S3 드라이버에서 필수" variant="caution" />
195195

196196
S3 호환 오브젝트 스토리지의 지역. 예: `us-east-1`.
197197
몇몇 AWS가 아닌 S3 호환 서비스에서는 이 값이 필요 없을 수 있습니다.
198198

199-
기본값은 `auto`입니다.
200-
201199
#### `S3_BUCKET` <Badge text="S3 드라이버에서 필수" variant="caution" />
202200

203201
S3 호환 오브젝트 스토리지의 버킷 이름. 예: `hollo`.

docs/src/content/docs/zh-cn/install/env.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,9 @@ Sentry项目的DSN,用于发送错误报告和跟踪信息。
176176
- 必须可公开访问,联盟才能正常工作。
177177
</Aside>
178178

179-
#### `S3_REGION` <Badge text="可选" />
179+
#### `S3_REGION` <Badge text="S3 驱动程序必填" variant="caution" />
180180

181-
S3兼容对象存储的区域,例如:`us-east-1`。在某些非S3服务中,可以省略此项。默认为`auto`
181+
S3兼容对象存储的区域,例如:`us-east-1`。在某些非S3服务中,可以省略此项。
182182

183183
#### `S3_BUCKET` <Badge text="S3 驱动程序必填" variant="caution" />
184184

src/storage.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,17 @@ switch (DRIVE_DISK) {
9191
break;
9292
case "s3":
9393
if (bucket == null) throw new Error("S3_BUCKET is required");
94+
if (region == null) throw new Error("S3_REGION is required");
9495
if (accessKeyId == null) throw new Error("AWS_ACCESS_KEY_ID is required");
95-
if (secretAccessKey == null)
96+
if (secretAccessKey == null) {
9697
throw new Error("AWS_SECRET_ACCESS_KEY is required");
98+
}
9799

98100
driver = new S3Driver({
99101
credentials: fromEnv(),
100-
region: region == null || region === "" ? "auto" : region,
102+
region,
101103
endpoint: endpointUrl,
102-
bucket: bucket,
104+
bucket,
103105
// biome-ignore lint/complexity/useLiteralKeys: tsc complains about this (TS4111)
104106
forcePathStyle: process.env["S3_FORCE_PATH_STYLE"] === "true",
105107
visibility: "public",

0 commit comments

Comments
 (0)