feat: add ANNOUNCEMENT (#357)

This commit is contained in:
Dream Hunter
2024-07-22 13:01:38 +08:00
committed by GitHub
parent 384eb9b041
commit 60dda7e3fe
11 changed files with 29 additions and 6 deletions

View File

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

View File

@@ -1,5 +1,5 @@
export const CONSTANTS = {
VERSION: 'v0.6.0',
VERSION: 'v0.6.1',
// DB settings
ADDRESS_BLOCK_LIST_KEY: 'address_block_list',

View File

@@ -13,6 +13,7 @@ export type Bindings = {
// config
TITLE: string | undefined
ANNOUNCEMENT: string | undefined | null
PREFIX: string | undefined
MIN_ADDRESS_LEN: string | number | undefined
MAX_ADDRESS_LEN: string | number | undefined