chore reserve domain rule
This commit is contained in:
@@ -1,62 +0,0 @@
|
||||
name: Build and Push Docker Image to Docker Hub
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
tags:
|
||||
- "v*.*.*"
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
env:
|
||||
REGISTRY: docker.io
|
||||
IMAGE_NAME: oiovwr/wrdo
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
# 检出代码
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# 设置 Docker Buildx(支持多平台构建)
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
# 登录到 Docker Hub
|
||||
- name: Log in to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
# 提取 Docker 镜像元数据(标签、版本等)
|
||||
- name: Extract Docker metadata
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: ${{ env.IMAGE_NAME }}
|
||||
tags: |
|
||||
type=sha,format=short
|
||||
type=ref,event=branch,prefix=
|
||||
type=ref,event=tag
|
||||
type=raw,value=latest,enable={{is_default_branch}}
|
||||
|
||||
# 构建并推送 Docker 镜像
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
platforms: linux/amd64,linux/arm64 # 支持多平台构建
|
||||
build-args: |
|
||||
ENVIRONMENT=${{ github.event.inputs.environment || 'production' }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
@@ -43,6 +43,12 @@ export async function POST(req: Request) {
|
||||
id: generateSecret(16),
|
||||
};
|
||||
|
||||
if (reservedDomains.includes(record.name)) {
|
||||
return Response.json("Domain name is reserved", {
|
||||
status: 403,
|
||||
});
|
||||
}
|
||||
|
||||
let record_name = ["A", "CNAME", "AAAA"].includes(record.type)
|
||||
? record.name
|
||||
: `${record.name}.${record.zone_name}`;
|
||||
@@ -66,13 +72,6 @@ export async function POST(req: Request) {
|
||||
);
|
||||
}
|
||||
|
||||
// TODO
|
||||
if (reservedDomains.includes(record_name)) {
|
||||
return Response.json("Domain name is reserved", {
|
||||
status: 403,
|
||||
});
|
||||
}
|
||||
|
||||
const user_record = await getUserRecordByTypeNameContent(
|
||||
user.id,
|
||||
record.type,
|
||||
|
||||
@@ -53,7 +53,7 @@ export async function POST(req: Request) {
|
||||
id: generateSecret(16),
|
||||
};
|
||||
|
||||
let record_name = ["A", "CNAME"].includes(record.type)
|
||||
let record_name = ["A", "CNAME", "AAAA"].includes(record.type)
|
||||
? record.name
|
||||
: `${record.name}.${record.zone_name}`;
|
||||
|
||||
@@ -76,12 +76,6 @@ export async function POST(req: Request) {
|
||||
);
|
||||
}
|
||||
|
||||
if (reservedDomains.includes(record_name)) {
|
||||
return Response.json("Domain name is reserved", {
|
||||
status: 403,
|
||||
});
|
||||
}
|
||||
|
||||
const user_record = await getUserRecordByTypeNameContent(
|
||||
target_user.id,
|
||||
record.type,
|
||||
|
||||
@@ -31,7 +31,7 @@ export async function POST(req: Request) {
|
||||
});
|
||||
}
|
||||
|
||||
let record_name = ["A", "CNAME"].includes(record.type)
|
||||
let record_name = ["A", "CNAME", "AAAA"].includes(record.type)
|
||||
? record.name
|
||||
: `${record.name}.${record.zone_name}`;
|
||||
|
||||
|
||||
@@ -30,7 +30,14 @@ export async function POST(req: Request) {
|
||||
});
|
||||
}
|
||||
|
||||
let record_name = ["A", "CNAME"].includes(record.type)
|
||||
if (reservedDomains.includes(record.name)) {
|
||||
return Response.json("Domain name is reserved", {
|
||||
status: 403,
|
||||
statusText: "Reserved domain",
|
||||
});
|
||||
}
|
||||
|
||||
let record_name = ["A", "CNAME", "AAAA"].includes(record.type)
|
||||
? record.name
|
||||
: `${record.name}.${record.zone_name}`;
|
||||
|
||||
@@ -53,13 +60,6 @@ export async function POST(req: Request) {
|
||||
);
|
||||
}
|
||||
|
||||
if (reservedDomains.includes(record_name)) {
|
||||
return Response.json("Domain name is reserved", {
|
||||
status: 403,
|
||||
statusText: "Reserved domain",
|
||||
});
|
||||
}
|
||||
|
||||
const data = await updateDNSRecord(
|
||||
matchedZone.cf_zone_id,
|
||||
matchedZone.cf_api_key,
|
||||
|
||||
170
lib/enums.ts
170
lib/enums.ts
@@ -104,98 +104,98 @@ export const STATUS_ENUMS = [
|
||||
];
|
||||
|
||||
export const reservedDomains = [
|
||||
"www.wr.do",
|
||||
"api.wr.do",
|
||||
"dev.wr.do",
|
||||
"admin.wr.do",
|
||||
"mail.wr.do",
|
||||
"smtp.wr.do",
|
||||
"pop.wr.do",
|
||||
"imap.wr.do",
|
||||
"ftp.wr.do",
|
||||
"sftp.wr.do",
|
||||
"ns1.wr.do",
|
||||
"ns2.wr.do",
|
||||
"dns.wr.do",
|
||||
"vpn.wr.do",
|
||||
"cdn.wr.do",
|
||||
"proxy.wr.do",
|
||||
"gateway.wr.do",
|
||||
"server.wr.do",
|
||||
"host.wr.do",
|
||||
"staging.wr.do",
|
||||
"test.wr.do",
|
||||
"demo.wr.do",
|
||||
"www",
|
||||
"api",
|
||||
"dev",
|
||||
"admin",
|
||||
"mail",
|
||||
"smtp",
|
||||
"pop",
|
||||
"imap",
|
||||
"ftp",
|
||||
"sftp",
|
||||
"ns1",
|
||||
"ns2",
|
||||
"dns",
|
||||
"vpn",
|
||||
"cdn",
|
||||
"proxy",
|
||||
"gateway",
|
||||
"server",
|
||||
"host",
|
||||
"staging",
|
||||
"test",
|
||||
"demo",
|
||||
|
||||
"github.wr.do",
|
||||
"gitlab.wr.do",
|
||||
"bitbucket.wr.do",
|
||||
"heroku.wr.do",
|
||||
"vercel.wr.do",
|
||||
"netlify.wr.do",
|
||||
"cloudflare.wr.do",
|
||||
"azure.wr.do",
|
||||
"aws.wr.do",
|
||||
"gcp.wr.do",
|
||||
"github",
|
||||
"gitlab",
|
||||
"bitbucket",
|
||||
"heroku",
|
||||
"vercel",
|
||||
"netlify",
|
||||
"cloudflare",
|
||||
"azure",
|
||||
"aws",
|
||||
"gcp",
|
||||
|
||||
"facebook.wr.do",
|
||||
"twitter.wr.do",
|
||||
"instagram.wr.do",
|
||||
"linkedin.wr.do",
|
||||
"youtube.wr.do",
|
||||
"tiktok.wr.do",
|
||||
"whatsapp.wr.do",
|
||||
"telegram.wr.do",
|
||||
"discord.wr.do",
|
||||
"slack.wr.do",
|
||||
"facebook",
|
||||
"twitter",
|
||||
"instagram",
|
||||
"linkedin",
|
||||
"youtube",
|
||||
"tiktok",
|
||||
"whatsapp",
|
||||
"telegram",
|
||||
"discord",
|
||||
"slack",
|
||||
|
||||
"blog.wr.do",
|
||||
"shop.wr.do",
|
||||
"store.wr.do",
|
||||
"app.wr.do",
|
||||
"web.wr.do",
|
||||
"portal.wr.do",
|
||||
"auth.wr.do",
|
||||
"login.wr.do",
|
||||
"account.wr.do",
|
||||
"help.wr.do",
|
||||
"support.wr.do",
|
||||
"status.wr.do",
|
||||
"docs.wr.do",
|
||||
"wiki.wr.do",
|
||||
"blog",
|
||||
"shop",
|
||||
"store",
|
||||
"app",
|
||||
"web",
|
||||
"portal",
|
||||
"auth",
|
||||
"login",
|
||||
"account",
|
||||
"help",
|
||||
"support",
|
||||
"status",
|
||||
"docs",
|
||||
"wiki",
|
||||
|
||||
"security.wr.do",
|
||||
"secure.wr.do",
|
||||
"ssl.wr.do",
|
||||
"cert.wr.do",
|
||||
"phishing.wr.do",
|
||||
"spam.wr.do",
|
||||
"abuse.wr.do",
|
||||
"security",
|
||||
"secure",
|
||||
"ssl",
|
||||
"cert",
|
||||
"phishing",
|
||||
"spam",
|
||||
"abuse",
|
||||
|
||||
"dashboard.wr.do",
|
||||
"analytics.wr.do",
|
||||
"monitor.wr.do",
|
||||
"stats.wr.do",
|
||||
"metrics.wr.do",
|
||||
"logs.wr.do",
|
||||
"backup.wr.do",
|
||||
"git.wr.do",
|
||||
"svn.wr.do",
|
||||
"dashboard",
|
||||
"analytics",
|
||||
"monitor",
|
||||
"stats",
|
||||
"metrics",
|
||||
"logs",
|
||||
"backup",
|
||||
"git",
|
||||
"svn",
|
||||
|
||||
"zhihu.wr.do",
|
||||
"weibo.wr.do",
|
||||
"taobao.wr.do",
|
||||
"qq.wr.do",
|
||||
"wechat.wr.do",
|
||||
"weixin.wr.do",
|
||||
"alipay.wr.do",
|
||||
"baidu.wr.do",
|
||||
"zhihu",
|
||||
"weibo",
|
||||
"taobao",
|
||||
"qq",
|
||||
"wechat",
|
||||
"weixin",
|
||||
"alipay",
|
||||
"baidu",
|
||||
|
||||
"root.wr.do",
|
||||
"administrator.wr.do",
|
||||
"admin1.wr.do",
|
||||
"test1.wr.do",
|
||||
"demo1.wr.do",
|
||||
"root",
|
||||
"administrator",
|
||||
"admin1",
|
||||
"test1",
|
||||
"demo1",
|
||||
];
|
||||
|
||||
export const reservedAddressSuffix = [
|
||||
|
||||
@@ -49,9 +49,9 @@ const nextConfig = {
|
||||
},
|
||||
experimental: {
|
||||
serverComponentsExternalPackages: ["@prisma/client"],
|
||||
serverActions: {
|
||||
allowedOrigins: ["localhost:3000", process.env.NEXT_PUBLIC_APP_URL],
|
||||
},
|
||||
// serverActions: {
|
||||
// allowedOrigins: ["localhost:3000", process.env.NEXT_PUBLIC_APP_URL],
|
||||
// },
|
||||
},
|
||||
rewrites() {
|
||||
return [
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user