feat: add MIN_ADDRESS_LEN && MAX_ADDRESS_LEN (#304)

This commit is contained in:
Dream Hunter
2024-06-06 21:44:22 +08:00
committed by GitHub
parent 6225f6521a
commit 0db611bb3e
11 changed files with 50 additions and 11 deletions

View File

@@ -1,6 +1,6 @@
import { Hono } from 'hono'
import { getDomains, getPasswords, getBooleanValue } from './utils';
import { getDomains, getPasswords, getBooleanValue, getIntValue } from './utils';
import { CONSTANTS } from './constants';
import { HonoCustomType } from './types';
import { isS3Enabled } from './mails_api/s3_attachment';
@@ -18,6 +18,8 @@ api.get('/open_api/settings', async (c) => {
return c.json({
"title": c.env.TITLE,
"prefix": c.env.PREFIX,
"minAddressLen": getIntValue(c.env.MIN_ADDRESS_LEN, 1),
"maxAddressLen": getIntValue(c.env.MAX_ADDRESS_LEN, 30),
"domains": getDomains(c),
"needAuth": needAuth,
"adminContact": c.env.ADMIN_CONTACT,