更新 .gitignore 文件以忽略 .htpasswd 文件,添加简单密码认证的使用说明到 README 文件中,包含示例命令和配置步骤,增强文档的可读性和实用性。

This commit is contained in:
BetterAndBetterII
2025-08-18 20:31:28 +08:00
committed by Yuzhong Zhang
parent 3f10e749aa
commit 959f04400c
3 changed files with 54 additions and 0 deletions
+1
View File
@@ -11,3 +11,4 @@ node_modules
*.db
data/
.idea
.htpasswd
+27
View File
@@ -53,6 +53,33 @@ docker compose up -d
The server will start, and you can access the application at `http://localhost:3002`.
<!-- Summary Folded -->
<details>
<summary>Use Simple Password Authentication(Dex OIDC)</summary>
```bash
# Example for Linux
git clone https://github.com/BetterAndBetterII/excalidraw-full.git
cd excalidraw-full
mv .env.example .env
touch ./excalidraw.db # IMPORTANT: Initialize the SQLite DB, OTHERWISE IT WILL NOT START
docker compose -f docker-compose.dex.yml up -d
```
Change your password in `.env` file.
```bash
# apt install apache2-utils
# Generate the password hash
echo YOUR_NEW_PASSWORD | htpasswd -BinC 10 admin | cut -d: -f2 > .htpasswd
# Update your .env file
sed -i 's/ADMIN_PASSWORD_HASH=.*/ADMIN_PASSWORD_HASH=$(cat .htpasswd)/' .env
```
</details>
## Configuration
Configuration is managed via environment variables. For a full template, see the `.env.example` section below.
+26
View File
@@ -53,6 +53,32 @@ docker compose up -d
服务器将启动,您可以在 `http://localhost:3002` 访问该应用。
<!-- Summary Folded -->
<details>
<summary>使用简单密码认证(Dex OIDC)</summary>
```bash
# 示例
git clone https://github.com/BetterAndBetterII/excalidraw-full.git
cd excalidraw-full
mv .env.example .env
touch ./excalidraw.db # 重要:初始化 SQLite 数据库,否则无法启动
docker compose -f docker-compose.dex.yml up -d
```
修改 `.env` 文件中的密码。
```bash
# apt install apache2-utils
# 生成密码哈希
echo YOUR_NEW_PASSWORD | htpasswd -BinC 10 admin | cut -d: -f2 > .htpasswd
# 更新 .env 文件
sed -i 's/ADMIN_PASSWORD_HASH=.*/ADMIN_PASSWORD_HASH=$(cat .htpasswd)/' .env
```
</details>
## 配置
配置通过环境变量进行管理。有关完整模板,请参阅下面的 `.env.example` 部分。