Domain Locker
The Central Hub for all your Domain Names
🌐domain-locker.com
CLIENT
SSR --> API
end
app -.- domainlockernetwork
```
### 选项 3:非官方应用
- [](https://artifacthub.io/packages/helm/domain-locker/domain-locker)
- [](https://hub.docker.com/r/lissy93/domain-locker)
- [](https://apps.umbrel.com/app/domain-locker)
- [](https://github.com/Lissy93/dl-sb-iac)
- [](https://community-scripts.github.io/ProxmoxVE/scripts?id=domain-locker)
- [](https://apps.truenas.com/catalog/domain-locker/)
- [](https://domain-locker.com/about/self-hosting/deploying-on-easypanel-io) _(待定)_
- [](https://domain-locker.com/about/self-hosting/deploying-on-unraid) _(计划中)_
## 开发
#### 项目设置
```
git clone git@github.com:Lissy93/domain-locker.git # Get the code
cd domain-locker # Navigate into directory
npm install --legacy-peer-deps # Install dependencies
cp .env.example .env # Set environmental variables
npm run dev # Start the dev server
```
- **前置条件**
- 您需要在系统上安装 Git 和 Node。
- **配置**
- `.env.sample` 示例文件包含了我们 Supabase 开发实例的公共凭据
- 要使用其他数据库,请参阅下面的[数据库](#database)部分以配置 Postgres
- **部署**
- 您可以使用 `npm run build` 构建代码,然后使用 `npm start` 运行
- 或者,使用 Docker 通过 `docker build -t domain-locker .` 构建容器
- 请勿在生产环境中使用开发版 Supabase 实例,因为它会被频繁清除
## 应用架构
#### 技术栈
Domain Locker 由应用、数据库和一些 API 端点组成。
- **该应用** 使用 Angular 构建,搭配 Analog+Nitro 和 PrimeNg 组件,并使用 Tailwind 进行样式设计
- **服务器** 是一系列使用 Typescript 函数的 Deno 端点
- **数据库** 可以是 Postgres 或 Supabase
虽然自托管实例旨在独立部署,但托管版本依赖于一些额外的第三方服务,您可以在下面看到它们,[相关文档在这里](https://domain-locker.com/about/developing/third-party-docs)。
为什么
为什么选择 Angular?就像是对未来的我开的一个病态玩笑,因为以后需要维护它的也是我。
You can view docs for the technologies and services used here
#### 架构
该架构非常简单。
我们有一个应用(由前端和 API 端点组成),用户可以在其中(通过适配器)对数据库进行读写。然后,一个 cron 服务会定期调用 API 端点以保持域名数据最新、追踪更改、监控健康状况,并在发生特定更改(根据用户偏好)或即将到期时触发通知。
```
graph TD;
subgraph User Interactions
User[👤 User] -->|Enter domain| WebApp[🌐 Frontend];
WebApp -->|Send API request| API[⚙️ Nitro API];
API -->|Auth Check| Auth[🔐 Auth Service];
API -->|Store domain info| Database[🗄️ PostgreSQL / Supabase];
end
subgraph Automated Cron Jobs
CronService[⏳ Cron Service] -->|Trigger Updates| EdgeFunctions[⚡ Edge Functions];
EdgeFunctions -->|Fetch WHOIS, DNS, SSL| ExternalAPIs[🌎 Analysis Services];
EdgeFunctions -->|Store Data| Database;
CronService -->|Monitor Uptime| WebsiteMonitor[📡 Uptime Monitor];
WebsiteMonitor -->|Store Metrics| Database;
CronService -->|Check Expirations| ExpiryChecker[📆 Expiration Check];
ExpiryChecker -->|Update Status| Database;
CronService -->|Send Notifications| NotificationService[🔔 Notification System];
NotificationService -->|Email| Resend[📧 Resend];
NotificationService -->|SMS| Twilio[📱 Twilio];
end
Database -->|Serve Data| WebApp;
```
#### 数据库
需要一个数据库来存储您所有的域名及相关信息。
Domain Locker 支持 Supabase 和标准 Postgres 用于存储数据。
使用的数据库将取决于设置了哪些环境变量。
- **Supabase**:遵循 Supabase [自托管文档](https://supabase.com/docs/guides/self-hosting),然后使用 [dl-sb-iac](https://github.com/lissy93/dl-sb-iac) 导入模式并配置身份验证、边缘函数、电子邮件等。
- 然后设置:`SUPABASE_URL` 和 `SUPABASE_ANON_KEY` 环境变量
- **Postgres**:部署一个 Postgres 实例,然后应用 [`schema.sql`](https://github.com/Lissy93/domain-locker/blob/main/db/schema.sql)
- 如果数据库已存在:`psql -h $DL_PG_HOST -U $DL_PG_USER -d $DL_PG_NAME -f ./db/schema.sql`
- 如果是从头开始创建:使用 [`setup-postgres.sh`](https://github.com/Lissy93/domain-locker/blob/main/db/setup-postgres.sh)(需要超级用户访问权限)
- 然后设置:`DL_PG_HOST`、`DL_PG_PORT`、`DL_PG_USER`、`DL_PG_PASSWORD`、`DL_PG_NAME`
```
classDiagram
class users {
uuid id
text email
timestamp created_at
timestamp updated_at
}
class domains {
uuid id
uuid user_id
text domain_name
date expiry_date
text notes
timestamp created_at
timestamp updated_at
uuid registrar_id
timestamp registration_date
timestamp updated_date
}
class registrars {
uuid id
text name
text url
uuid user_id
}
class tags {
uuid id
text name
text color
text description
text icon
uuid user_id
}
class domain_tags {
uuid domain_id
uuid tag_id
}
class notifications {
uuid id
uuid user_id
uuid domain_id
text change_type
text message
boolean sent
boolean read
timestamp created_at
}
class billing {
uuid id
uuid user_id
text current_plan
timestamp next_payment_due
text billing_method
timestamp created_at
timestamp updated_at
jsonb meta
}
class dns_records {
uuid id
uuid domain_id
text record_type
text record_value
timestamp created_at
timestamp updated_at
}
class domain_costings {
uuid id
uuid domain_id
numeric purchase_price
numeric current_value
numeric renewal_cost
boolean auto_renew
timestamp created_at
timestamp updated_at
}
class domain_hosts {
uuid domain_id
uuid host_id
}
class domain_links {
uuid id
uuid domain_id
text link_name
text link_url
timestamp created_at
timestamp updated_at
text link_description
}
class domain_statuses {
uuid id
uuid domain_id
text status_code
timestamp created_at
}
class domain_updates {
uuid id
uuid domain_id
uuid user_id
text change
text change_type
text old_value
text new_value
timestamp date
}
class uptime {
uuid id
uuid domain_id
timestamp checked_at
boolean is_up
integer response_code
numeric response_time_ms
numeric dns_lookup_time_ms
numeric ssl_handshake_time_ms
timestamp created_at
}
class ssl_certificates {
uuid id
uuid domain_id
text issuer
text issuer_country
text subject
date valid_from
date valid_to
text fingerprint
integer key_size
text signature_algorithm
timestamp created_at
timestamp updated_at
}
class whois_info {
uuid id
uuid domain_id
text country
text state
text name
text organization
text street
text city
text postal_code
}
class user_info {
uuid id
uuid user_id
jsonb notification_channels
timestamp created_at
timestamp updated_at
text current_plan
}
class hosts {
uuid id
inet ip
numeric lat
numeric lon
text isp
text org
text as_number
text city
text region
text country
uuid user_id
}
class ip_addresses {
uuid id
uuid domain_id
inet ip_address
boolean is_ipv6
timestamp created_at
timestamp updated_at
}
class notification_preferences {
uuid id
uuid domain_id
text notification_type
boolean is_enabled
timestamp created_at
timestamp updated_at
}
class sub_domains {
uuid id
uuid domain_id
text name
timestamp created_at
timestamp updated_at
jsonb sd_info
}
users --> domains : user_id
registrars --> domains : registrar_id
users --> registrars : user_id
users --> tags : user_id
domains --> domain_tags : domain_id
tags --> domain_tags : tag_id
users --> notifications : user_id
domains --> notifications : domain_id
users --> billing : user_id
domains --> dns_records : domain_id
domains --> domain_costings : domain_id
domains --> domain_hosts : domain_id
hosts --> domain_hosts : host_id
domains --> domain_links : domain_id
domains --> domain_statuses : domain_id
domains --> domain_updates : domain_id
users --> domain_updates : user_id
domains --> uptime : domain_id
domains --> ssl_certificates : domain_id
domains --> whois_info : domain_id
users --> user_info : user_id
users --> hosts : user_id
domains --> ip_addresses : domain_id
domains --> notification_preferences : domain_id
domains --> sub_domains : domain_id
```
您可以从 db/schema.sql 下载模式
## 致谢
## 许可证
展开许可证
```
The MIT License (MIT)
Copyright (c) Alicia Sykes
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sub-license, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included install
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANT ABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
```
© Alicia Sykes 2025
Licensed under MIT

Thanks for visiting :)