File tree 6 files changed +74
-5
lines changed
6 files changed +74
-5
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ SECRET_KEY=secret_key # generate a secret key with `openssl rand -base64 32`
5
5
LOG_LEVEL = info
6
6
LOG_QUERY = false
7
7
BEHIND_PROXY = false
8
- LISTEN_PORT = 3000 # if BEHIND_PROXY=true used as port for the server
8
+ LISTEN_PORT = 3000
9
9
# Setting ALLOW_PRIVATE_ADDRESS to true disables SSRF (Server-Side Request Forgery) protection
10
10
# Set to true to test in local network
11
11
# Will be replaced by list of allowed IPs once https://github.com/dahlia/fedify/issues/157
Original file line number Diff line number Diff line change @@ -9,6 +9,10 @@ Hollo is configured using environment variables. You can set them in an *.env*
9
9
file in the root directory of the project, or you can set them using Docker's
10
10
` -e ` /` --env ` option or Railway's environment variables.
11
11
12
+ ### ` LISTEN_PORT ` <Badge text = " Optional" /> <Badge text = " Unused in Railway" variant = " tip" />
13
+
14
+ The port number to listen on. 3000 by default.
15
+
12
16
### ` DATABASE_URL ` <Badge text = " Unused in Railway" variant = " tip" />
13
17
14
18
The URL of the PostgreSQL database, e.g.,
@@ -67,6 +71,19 @@ Turned off by default.
67
71
security reasons.
68
72
</Aside >
69
73
74
+ ### ` ALLOW_PRIVATE_ADDRESS ` <Badge text = " Optional" />
75
+
76
+ Setting this to ` true ` disables SSRF (Server-Side Request Forgery) protection.
77
+
78
+ Turn on to test in local network.
79
+
80
+ Turned off by default.
81
+
82
+ <Aside >
83
+ Turning on this option is dangerous security-wise. Only use this option in
84
+ a trusted environment and never in production.
85
+ </Aside >
86
+
70
87
### ` S3_REGION ` <Badge text = " Optional" />
71
88
72
89
The region of the S3-compatible object storage, e.g., ` us-east-1 ` . On some
Original file line number Diff line number Diff line change @@ -10,6 +10,10 @@ Holloは環境変数を使って設定を行います。
10
10
Dockerの` -e ` /` --env ` オプションを使うか、
11
11
Railwayのenvironment variablesメニューから設定できます。
12
12
13
+ ### ` LISTEN_PORT ` <Badge text = " オプション" /> <Badge text = " Railwayでは使われない" variant = " tip" />
14
+
15
+ サーバーが受信するポート番号。デフォルトは3000です。
16
+
13
17
### ` DATABASE_URL ` <Badge text = " Railwayでは使われない" variant = " tip" />
14
18
15
19
PostgreSQLのデータベースのURL。例:` postgresql://hollo:password@localhost/hollo `
@@ -67,6 +71,19 @@ HolloがL7ロードバランサーの後ろにある場合(通常はそうす
67
71
この動作はセキュリティ上注意が必要です。
68
72
</Aside >
69
73
74
+ ### ` ALLOW_PRIVATE_ADDRESS ` <Badge text = " オプション" />
75
+
76
+ このオプションを` true ` に設定すると、サーバーサイドリクエストフォージェリ(SSRF)攻撃の防止を解除します。
77
+
78
+ ローカルネットワークでテストする場合は、このオプションをオンにする必要がある場合があります。
79
+
80
+ デフォルトではオフになっています。
81
+
82
+ <Aside >
83
+ このオプションをオンにすることはセキュリティ上危険です。
84
+ 信頼できる環境でのみ使用し、本番環境では使用しないでください。
85
+ </Aside >
86
+
70
87
### ` S3_REGION ` <Badge text = " オプション" />
71
88
72
89
S3互換オブジェクトストレージのリージョン。例:` us-east-1 `
Original file line number Diff line number Diff line change @@ -10,6 +10,10 @@ Hollo는 환경 변수를 통해 여러 가지 설정을 할 수 있습니다.
10
10
Docker의 ` -e ` /` --env ` 옵션을 쓰거나,
11
11
Railway의 environment variables 메뉴에서 설정할 수 있습니다.
12
12
13
+ ### ` LISTEN_PORT ` <Badge text = " 선택" /> <Badge text = " Railway에서는 안 쓰임" variant = " tip" />
14
+
15
+ 서버가 수신할 포트 번호. 기본값은 3000입니다.
16
+
13
17
### ` DATABASE_URL ` <Badge text = " Railway에서는 안 쓰임" variant = " tip" />
14
18
15
19
PostgreSQL 데이터베이스의 URL. 예: ` postgresql://hollo:password@localhost/hollo ` .
@@ -66,6 +70,19 @@ Hollo가 L7 로드 밸런서 뒤에 위치할 경우 (일반적으로 그래야
66
70
이 동작은 보안상 주의를 기울여야 합니다.
67
71
</Aside >
68
72
73
+ ### ` ALLOW_PRIVATE_ADDRESS ` <Badge text = " 선택" />
74
+
75
+ 이 옵션을 ` true ` 로 설정하면 서버 측 요청 위조(SSRF) 공격 방지를 풉니다.
76
+
77
+ 로컬 네트워크에서 테스트할 때 이 옵션을 켜야 할 수 있습니다.
78
+
79
+ 기본적으로는 꺼져 있습니다.
80
+
81
+ <Aside >
82
+ 이 옵션을 켜는 것은 보안상 위험할 수 있습니다. 신뢰할 수 있는 환경에서만 사용하고,
83
+ 프로덕션 환경에서는 사용하지 마세요.
84
+ </Aside >
85
+
69
86
### ` S3_REGION ` <Badge text = " 선택" />
70
87
71
88
S3 호환 오브젝트 스토리지의 지역. 예: ` us-east-1 ` .
Original file line number Diff line number Diff line change @@ -7,6 +7,10 @@ import { Aside, Badge } from '@astrojs/starlight/components';
7
7
8
8
Hollo是通过环境变量进行配置的。你可以在项目根目录的 * .env* 文件中设置它们,或者使用Docker的` -e ` /` --env ` 选项或Railway的环境变量进行设置。
9
9
10
+ ### ` LISTEN_PORT ` <Badge text = " 可选" /> <Badge text = " Railway中未使用" variant = " tip" />
11
+
12
+ 服务器监听的端口号。默认为3000。
13
+
10
14
### ` DATABASE_URL ` <Badge text = " Railway中未使用" variant = " tip" />
11
15
12
16
PostgreSQL数据库的URL,例如:` postgresql://hollo:password@localhost/hollo ` 。
@@ -57,6 +61,19 @@ openssl rand -hex 32
57
61
启用此选项后,Hollo将信任来自反向代理的` X-Forwarded-For ` 、` X-Forwarded-Proto ` 和` X-Forwarded-Host ` 头。这对于安全来说非常重要。
58
62
</Aside >
59
63
64
+ ### ` ALLOW_PRIVATE_ADDRESS ` <Badge text = " 可选" />
65
+
66
+ 将此选项设置为` true ` 将禁用 SSRF(服务器端请求伪造)保护。
67
+
68
+ 打开此选项可在本地网络中进行测试。
69
+
70
+ 默认情况下关闭。
71
+
72
+ <Aside >
73
+ 启用此选项存在严重的安全隐患。
74
+ 仅在受信任的环境下使用此选项,切勿在生产环境中使用。
75
+ </Aside >
76
+
60
77
### ` S3_REGION ` <Badge text = " 可选" />
61
78
62
79
S3兼容对象存储的区域,例如:` us-east-1 ` 。在某些非S3服务中,可以省略此项。默认为` auto ` 。
Original file line number Diff line number Diff line change @@ -21,8 +21,9 @@ app.get("/nodeinfo/2.0", (c) => c.redirect("/nodeinfo/2.1"));
21
21
// biome-ignore lint/complexity/useLiteralKeys: tsc complains about this (TS4111)
22
22
const BEHIND_PROXY = process . env [ "BEHIND_PROXY" ] === "true" ;
23
23
// biome-ignore lint/complexity/useLiteralKeys: tsc complains about this (TS4111)
24
- const HOLLO_PORT = Number . parseInt ( process . env [ "LISTEN_PORT" ] ?? "3000" , 10 ) ;
24
+ const LISTEN_PORT = Number . parseInt ( process . env [ "LISTEN_PORT" ] ?? "3000" , 10 ) ;
25
25
26
- export default BEHIND_PROXY
27
- ? { fetch : behindProxy ( app . fetch . bind ( app ) ) , port : HOLLO_PORT }
28
- : app ;
26
+ export default {
27
+ fetch : BEHIND_PROXY ? behindProxy ( app . fetch . bind ( app ) ) : app . fetch . bind ( app ) ,
28
+ port : LISTEN_PORT ,
29
+ } ;
You can’t perform that action at this time.
0 commit comments