chore: remove app config env
This commit is contained in:
@@ -27,12 +27,6 @@ LinuxDo_CLIENT_SECRET=
|
||||
RESEND_API_KEY=
|
||||
RESEND_FROM_EMAIL="wrdo <support@wr.do>"
|
||||
|
||||
# Open Signup
|
||||
NEXT_PUBLIC_OPEN_SIGNUP=1
|
||||
|
||||
# Enable subdomain apply, default is false(0). If set to 1, will enable subdomain apply
|
||||
NEXT_PUBLIC_ENABLE_SUBDOMAIN_APPLY=0
|
||||
|
||||
# Google Analytics
|
||||
NEXT_PUBLIC_GOOGLE_ID=
|
||||
|
||||
|
||||
+1
-1
@@ -73,7 +73,7 @@ WR.DO 是一个一站式网络工具平台,集成短链服务、临时邮箱
|
||||
|
||||
### 使用 Vercel 部署
|
||||
|
||||
[](https://vercel.com/new/clone?repository-url=https://github.com/oiov/wr.do.git&project-name=wrdo&env=DATABASE_URL&env=AUTH_SECRET&env=RESEND_API_KEY&env=NEXT_PUBLIC_EMAIL_R2_DOMAIN&env=NEXT_PUBLIC_OPEN_SIGNUP&env=GITHUB_TOKEN)
|
||||
[](https://vercel.com/new/clone?repository-url=https://github.com/oiov/wr.do.git&project-name=wrdo&env=DATABASE_URL&env=AUTH_SECRET&env=RESEND_API_KEY&env=NEXT_PUBLIC_EMAIL_R2_DOMAIN&env=GITHUB_TOKEN)
|
||||
|
||||
记得填写必要的环境变量。
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ See step by step installation tutorial at [Quick Start for Developer](https://wr
|
||||
|
||||
### Deploy with Vercel
|
||||
|
||||
[](https://vercel.com/new/clone?repository-url=https://github.com/oiov/wr.do.git&project-name=wrdo&env=DATABASE_URL&env=AUTH_SECRET&env=RESEND_API_KEY&env=NEXT_PUBLIC_EMAIL_R2_DOMAIN&env=NEXT_PUBLIC_OPEN_SIGNUP&env=GITHUB_TOKEN)
|
||||
[](https://vercel.com/new/clone?repository-url=https://github.com/oiov/wr.do.git&project-name=wrdo&env=DATABASE_URL&env=AUTH_SECRET&env=RESEND_API_KEY&env=NEXT_PUBLIC_EMAIL_R2_DOMAIN&env=GITHUB_TOKEN)
|
||||
|
||||
Remember to fill in the necessary environment variables.
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@ import { getMultipleConfigs } from "@/lib/dto/system-config";
|
||||
import { checkUserStatus } from "@/lib/dto/user";
|
||||
import { getCurrentUser } from "@/lib/session";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
export async function GET(req: NextRequest) {
|
||||
try {
|
||||
const user = checkUserStatus(await getCurrentUser());
|
||||
|
||||
@@ -2,9 +2,7 @@ import { SidebarNavItem, SiteConfig } from "types";
|
||||
import { env } from "@/env.mjs";
|
||||
|
||||
const site_url = env.NEXT_PUBLIC_APP_URL || "http://localhost:3000";
|
||||
const open_signup = env.NEXT_PUBLIC_OPEN_SIGNUP;
|
||||
const email_r2_domain = env.NEXT_PUBLIC_EMAIL_R2_DOMAIN || "";
|
||||
const enable_subdomain_apply = env.NEXT_PUBLIC_ENABLE_SUBDOMAIN_APPLY || "0";
|
||||
|
||||
export const siteConfig: SiteConfig = {
|
||||
name: "WR.DO",
|
||||
@@ -20,9 +18,7 @@ export const siteConfig: SiteConfig = {
|
||||
oichat: "https://oi.wr.do",
|
||||
},
|
||||
mailSupport: "support@wr.do",
|
||||
openSignup: open_signup === "1" ? true : false,
|
||||
emailR2Domain: email_r2_domain,
|
||||
enableSubdomainApply: enable_subdomain_apply === "1" ? true : false,
|
||||
};
|
||||
|
||||
export const footerLinks: SidebarNavItem[] = [
|
||||
|
||||
@@ -11,7 +11,7 @@ description: 选择你的部署方式
|
||||
|
||||
## 使用 Vercel 部署(推荐)
|
||||
|
||||
[](https://vercel.com/new/clone?repository-url=https://github.com/oiov/wr.do.git&project-name=wrdo&env=DATABASE_URL&env=AUTH_SECRET&env=RESEND_API_KEY&env=NEXT_PUBLIC_EMAIL_R2_DOMAIN&env=NEXT_PUBLIC_OPEN_SIGNUP&env=GITHUB_TOKEN)
|
||||
[](https://vercel.com/new/clone?repository-url=https://github.com/oiov/wr.do.git&project-name=wrdo&env=DATABASE_URL&env=AUTH_SECRET&env=RESEND_API_KEY&env=NEXT_PUBLIC_EMAIL_R2_DOMAIN&env=GITHUB_TOKEN)
|
||||
|
||||
## 使用 Docker Compose 部署
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ description: Choose your deployment method
|
||||
|
||||
## Deploy with Vercel (Recommended)
|
||||
|
||||
[](https://vercel.com/new/clone?repository-url=https://github.com/oiov/wr.do.git&project-name=wrdo&env=DATABASE_URL&env=AUTH_SECRET&env=RESEND_API_KEY&env=NEXT_PUBLIC_EMAIL_R2_DOMAIN&env=NEXT_PUBLIC_OPEN_SIGNUP&env=GITHUB_TOKEN)
|
||||
[](https://vercel.com/new/clone?repository-url=https://github.com/oiov/wr.do.git&project-name=wrdo&env=DATABASE_URL&env=AUTH_SECRET&env=RESEND_API_KEY&env=NEXT_PUBLIC_EMAIL_R2_DOMAIN&env=GITHUB_TOKEN)
|
||||
|
||||
Remember to fill in the necessary environment variables.
|
||||
|
||||
|
||||
@@ -59,7 +59,6 @@ pnpm install
|
||||
| RESEND\_API\_KEY | `123465` | Resend 的 API 密钥。 |
|
||||
| RESEND\_FROM\_EMAIL | `"you <support@your-domain.com>"` | 用于发送邮件的邮箱地址。 |
|
||||
| NEXT\_PUBLIC\_OPEN\_SIGNUP | `1` | 开放注册。 |
|
||||
| NEXT_PUBLIC_ENABLE_SUBDOMAIN_APPLY | `0` | 启用子域名申请模式 |
|
||||
| SCREENSHOTONE\_BASE\_URL | `https://api.example.com` | 待补充 |
|
||||
| GITHUB\_TOKEN | `ghp_sscsfarwetqet` | [https://github.com/settings/tokens](https://github.com/settings/tokens) |
|
||||
| SKIP_DB_CHECK | `false` | 跳过数据库连接检测 |
|
||||
|
||||
@@ -59,9 +59,7 @@ Copy/paste the `.env.example` in the `.env` file:
|
||||
| GITHUB_SECRET | `123465` | The secret of the GitHub OAuth client. |
|
||||
| RESEND_API_KEY | `123465` | The API key for Resend. |
|
||||
| RESEND_FROM_EMAIL | `"you <support@your-domain.com>"` | The email address to send emails from. |
|
||||
| NEXT_PUBLIC_OPEN_SIGNUP | `1` | Open signup. |
|
||||
| NEXT_PUBLIC_ENABLE_SUBDOMAIN_APPLY | `0` | Enable subdomain apply. |
|
||||
| SCREENSHOTONE_BASE_URL | `https://api.example.com` | pending |
|
||||
| SCREENSHOTONE_BASE_URL | `https://api.example.com` | The base URL of the screenshotone API. |
|
||||
| GITHUB_TOKEN | `ghp_sscsfarwetqet` | https://github.com/settings/tokens |
|
||||
| SKIP_DB_CHECK | `false` | Skip database check. |
|
||||
| SKIP_DB_MIGRATION | `false` | Skip database migration. |
|
||||
|
||||
@@ -166,16 +166,7 @@ https://dash.cloudflare.com/[account_id]/r2/default/buckets/[bucket]/settings
|
||||
NEXT_PUBLIC_EMAIL_R2_DOMAIN=https://email-attachment.wr.do
|
||||
```
|
||||
|
||||
## 4. 添加业务配置
|
||||
|
||||
```js title=".env"
|
||||
# 允许任何人注册
|
||||
NEXT_PUBLIC_OPEN_SIGNUP=1
|
||||
# 子域名申请模式,默认关闭(0 关闭, 1 开启),若设置为1,用户创建子域名后需要等待管理员审核,才能解析到 cloudflare
|
||||
NEXT_PUBLIC_ENABLE_SUBDOMAIN_APPLY=0
|
||||
```
|
||||
|
||||
## 5. 添加 SCREENSHOTONE\_BASE\_URL 环境变量
|
||||
## 4. 添加 SCREENSHOTONE\_BASE\_URL 环境变量
|
||||
|
||||
这是 screenshotone API 的基础地址。
|
||||
|
||||
@@ -186,7 +177,7 @@ NEXT_PUBLIC_ENABLE_SUBDOMAIN_APPLY=0
|
||||
SCREENSHOTONE_BASE_URL=https://api.screenshotone.com
|
||||
```
|
||||
|
||||
## 6. 添加 GITHUB\_TOKEN 环境变量
|
||||
## 5. 添加 GITHUB\_TOKEN 环境变量
|
||||
|
||||
通过 [https://github.com/settings/tokens](https://github.com/settings/tokens) 获取你的 token:
|
||||
|
||||
@@ -194,7 +185,7 @@ SCREENSHOTONE_BASE_URL=https://api.screenshotone.com
|
||||
GITHUB_TOKEN=
|
||||
```
|
||||
|
||||
## 7. 启动开发服务器
|
||||
## 6. 启动开发服务器
|
||||
|
||||
```bash
|
||||
pnpm dev
|
||||
@@ -202,7 +193,7 @@ pnpm dev
|
||||
|
||||
通过浏览器访问:[http://localhost:3000](http://localhost:3000)
|
||||
|
||||
## 8. 设置系统
|
||||
## 7. 设置系统
|
||||
|
||||
#### 创建第一个账号并将账号权限更改为 ADMIN
|
||||
|
||||
@@ -222,7 +213,7 @@ pnpm dev
|
||||
<strong>你必须至少添加一个域名,才能使用短链接、邮件或子域名管理等功能。</strong>
|
||||
</Callout>
|
||||
|
||||
## 9. 部署
|
||||
## 8. 部署
|
||||
|
||||
详见:[部署指南](/docs/developer/deploy)
|
||||
|
||||
|
||||
@@ -156,16 +156,7 @@ Via:
|
||||
NEXT_PUBLIC_EMAIL_R2_DOMAIN=https://email-attachment.wr.do
|
||||
```
|
||||
|
||||
## 4. Add the Bussiness Configs
|
||||
|
||||
```js title=".env"
|
||||
# Allow anyone to sign up
|
||||
NEXT_PUBLIC_OPEN_SIGNUP=1
|
||||
# The default is closed (0 closed, 1 open), if set to 1, the user needs to wait for the administrator to approve the subdomain after creating a subdomain
|
||||
NEXT_PUBLIC_ENABLE_SUBDOMAIN_APPLY=0
|
||||
```
|
||||
|
||||
## 5. Add the SCREENSHOTONE_BASE_URL Environment Variable
|
||||
## 4. Add the SCREENSHOTONE_BASE_URL Environment Variable
|
||||
|
||||
It's the base URL for the screenshotone API.
|
||||
|
||||
@@ -176,7 +167,7 @@ Deploy docs via [here](https://jasonraimondi.github.io/url-to-png/)
|
||||
SCREENSHOTONE_BASE_URL=https://api.screenshotone.com
|
||||
```
|
||||
|
||||
## 6. Add the GITHUB_TOKEN Environment Variable
|
||||
## 5. Add the GITHUB_TOKEN Environment Variable
|
||||
|
||||
Via https://github.com/settings/tokens to get your token.
|
||||
|
||||
@@ -184,14 +175,14 @@ Via https://github.com/settings/tokens to get your token.
|
||||
GITHUB_TOKEN=
|
||||
```
|
||||
|
||||
## 7. Start the Dev Server
|
||||
## 6. Start the Dev Server
|
||||
|
||||
```bash
|
||||
pnpm dev
|
||||
```
|
||||
Via [http://localhost:3000](http://localhost:3000)
|
||||
|
||||
## 8. Setup System
|
||||
## 7. Setup System
|
||||
|
||||
#### Create the first account and Change the account's role to ADMIN
|
||||
|
||||
@@ -211,7 +202,7 @@ Follow the steps below:
|
||||
<strong>You must add at least one domain to start using short links, email or subdomain management features.</strong>
|
||||
</Callout>
|
||||
|
||||
## 9. Deploy
|
||||
## 8. Deploy
|
||||
|
||||
See [Deploy Guide](/docs/developer/deploy).
|
||||
|
||||
|
||||
@@ -9,8 +9,6 @@ services:
|
||||
DATABASE_URL: postgres://postgres:postgres@postgres:5432/wrdo
|
||||
AUTH_SECRET: ${AUTH_SECRET:-your-auth-secret}
|
||||
NEXT_PUBLIC_APP_URL: ${NEXT_PUBLIC_APP_URL}
|
||||
NEXT_PUBLIC_OPEN_SIGNUP: ${NEXT_PUBLIC_OPEN_SIGNUP}
|
||||
NEXT_PUBLIC_ENABLE_SUBDOMAIN_APPLY: ${NEXT_PUBLIC_ENABLE_SUBDOMAIN_APPLY}
|
||||
GOOGLE_CLIENT_ID: ${GOOGLE_CLIENT_ID}
|
||||
GOOGLE_CLIENT_SECRET: ${GOOGLE_CLIENT_SECRET}
|
||||
GITHUB_ID: ${GITHUB_ID}
|
||||
|
||||
@@ -10,8 +10,6 @@ services:
|
||||
AUTH_SECRET: ${AUTH_SECRET:-your-auth-secret}
|
||||
AUTH_URL: ${AUTH_URL}
|
||||
NEXT_PUBLIC_APP_URL: ${NEXT_PUBLIC_APP_URL}
|
||||
NEXT_PUBLIC_OPEN_SIGNUP: ${NEXT_PUBLIC_OPEN_SIGNUP}
|
||||
NEXT_PUBLIC_ENABLE_SUBDOMAIN_APPLY: ${NEXT_PUBLIC_ENABLE_SUBDOMAIN_APPLY}
|
||||
GOOGLE_CLIENT_ID: ${GOOGLE_CLIENT_ID}
|
||||
GOOGLE_CLIENT_SECRET: ${GOOGLE_CLIENT_SECRET}
|
||||
GITHUB_ID: ${GITHUB_ID}
|
||||
|
||||
@@ -19,9 +19,7 @@ export const env = createEnv({
|
||||
},
|
||||
client: {
|
||||
NEXT_PUBLIC_APP_URL: z.string().optional(),
|
||||
NEXT_PUBLIC_OPEN_SIGNUP: z.string().default("1"),
|
||||
NEXT_PUBLIC_EMAIL_R2_DOMAIN: z.string().optional(),
|
||||
NEXT_PUBLIC_ENABLE_SUBDOMAIN_APPLY: z.string().default("0"),
|
||||
},
|
||||
runtimeEnv: {
|
||||
NEXTAUTH_URL: process.env.NEXTAUTH_URL,
|
||||
@@ -34,10 +32,7 @@ export const env = createEnv({
|
||||
RESEND_API_KEY: process.env.RESEND_API_KEY,
|
||||
RESEND_FROM_EMAIL: process.env.RESEND_FROM_EMAIL,
|
||||
NEXT_PUBLIC_APP_URL: process.env.NEXT_PUBLIC_APP_URL,
|
||||
NEXT_PUBLIC_OPEN_SIGNUP: process.env.NEXT_PUBLIC_OPEN_SIGNUP,
|
||||
NEXT_PUBLIC_EMAIL_R2_DOMAIN: process.env.NEXT_PUBLIC_EMAIL_R2_DOMAIN,
|
||||
NEXT_PUBLIC_ENABLE_SUBDOMAIN_APPLY:
|
||||
process.env.NEXT_PUBLIC_ENABLE_SUBDOMAIN_APPLY,
|
||||
SCREENSHOTONE_BASE_URL: process.env.SCREENSHOTONE_BASE_URL,
|
||||
GITHUB_TOKEN: process.env.GITHUB_TOKEN,
|
||||
LinuxDo_CLIENT_ID: process.env.LinuxDo_CLIENT_ID,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:mobile="http://www.google.com/schemas/sitemap-mobile/1.0" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">
|
||||
<url><loc>https://wr.do/api/feature</loc><lastmod>2025-06-11T07:11:44.287Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
|
||||
<url><loc>https://wr.do/robots.txt</loc><lastmod>2025-06-11T07:11:44.288Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
|
||||
<url><loc>https://wr.do/manifest.json</loc><lastmod>2025-06-11T07:11:44.288Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
|
||||
<url><loc>https://wr.do/opengraph-image.jpg</loc><lastmod>2025-06-11T07:11:44.288Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
|
||||
<url><loc>https://wr.do/api/feature</loc><lastmod>2025-06-11T09:48:19.047Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
|
||||
<url><loc>https://wr.do/robots.txt</loc><lastmod>2025-06-11T09:48:19.047Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
|
||||
<url><loc>https://wr.do/manifest.json</loc><lastmod>2025-06-11T09:48:19.047Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
|
||||
<url><loc>https://wr.do/opengraph-image.jpg</loc><lastmod>2025-06-11T09:48:19.047Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
|
||||
</urlset>
|
||||
+1
-101
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Vendored
-2
@@ -16,9 +16,7 @@ export type SiteConfig = {
|
||||
discord: string;
|
||||
oichat: string;
|
||||
};
|
||||
openSignup: boolean;
|
||||
emailR2Domain: string;
|
||||
enableSubdomainApply: boolean;
|
||||
};
|
||||
|
||||
export type NavItem = {
|
||||
|
||||
Reference in New Issue
Block a user