Skip to content

Commit 043cdee

Browse files
committed
feat(server): 开发模式下禁用防火墙和验证中间件
- 在开发模式下禁用 CC 防火墙 - 在开发模式下禁用匿名访问检查中间件 - 在开发模式下禁用首次访问验证码 - 添加开发模式警告日志输出
1 parent 94157af commit 043cdee

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/main/java/org/b3log/symphony/Server.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,13 @@ public static void main(final String[] args) throws Exception {
323323
ChatRoomBot.sendBotMsg("#### 维护完毕:sparkles:\n社区已结束维护,可以开始聊天啦 :smile:\nRhythm 启动时间 " + ClockEmojiMapper.getClockEmojiCode(LocalTime.now()) + " " + startupTime + "\nRhythm 编译版本 :dart: " + staticResourceVersion);
324324
});
325325

326+
if (Latkes.getRuntimeMode() == Latkes.RuntimeMode.DEVELOPMENT) {
327+
org.b3log.symphony.util.Firewall.setEnabled(false);
328+
org.b3log.symphony.processor.middleware.AnonymousViewCheckMidware.setEnabled(false);
329+
org.b3log.symphony.processor.middleware.AnonymousViewCheckMidware.setFirstVisitCaptchaEnabled(false);
330+
LOGGER.warn("Development mode: CC firewall and verification shield are disabled.");
331+
}
332+
326333
System.out.println(">>> Quick boot mode requirements is ready!");
327334

328335
final String unixDomainSocketPath = commandLine.getOptionValue("unix_domain_socket_path");

0 commit comments

Comments
 (0)