Skip to content

Commit 1149c33

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

3 files changed

Lines changed: 54 additions & 0 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ node_modules
1010
*/build/*
1111
*.db
1212
data/
13+
.htpasswd

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,33 @@ docker compose up -d
5353

5454
The server will start, and you can access the application at `http://localhost:3002`.
5555

56+
57+
<!-- Summary Folded -->
58+
<details>
59+
<summary>Use Simple Password Authentication(Dex OIDC)</summary>
60+
61+
```bash
62+
# Example for Linux
63+
git clone https://github.com/BetterAndBetterII/excalidraw-full.git
64+
cd excalidraw-full
65+
mv .env.example .env
66+
touch ./excalidraw.db # IMPORTANT: Initialize the SQLite DB, OTHERWISE IT WILL NOT START
67+
docker compose -f docker-compose.dex.yml up -d
68+
```
69+
70+
Change your password in `.env` file.
71+
72+
```bash
73+
# apt install apache2-utils
74+
# Generate the password hash
75+
echo YOUR_NEW_PASSWORD | htpasswd -BinC 10 admin | cut -d: -f2 > .htpasswd
76+
# Update your .env file
77+
sed -i 's/ADMIN_PASSWORD_HASH=.*/ADMIN_PASSWORD_HASH=$(cat .htpasswd)/' .env
78+
```
79+
80+
</details>
81+
82+
5683
## Configuration
5784

5885
Configuration is managed via environment variables. For a full template, see the `.env.example` section below.

README_zh.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,32 @@ docker compose up -d
5353

5454
服务器将启动,您可以在 `http://localhost:3002` 访问该应用。
5555

56+
<!-- Summary Folded -->
57+
<details>
58+
<summary>使用简单密码认证(Dex OIDC)</summary>
59+
60+
```bash
61+
# 示例
62+
git clone https://github.com/BetterAndBetterII/excalidraw-full.git
63+
cd excalidraw-full
64+
mv .env.example .env
65+
touch ./excalidraw.db # 重要:初始化 SQLite 数据库,否则无法启动
66+
docker compose -f docker-compose.dex.yml up -d
67+
```
68+
69+
修改 `.env` 文件中的密码。
70+
71+
```bash
72+
# apt install apache2-utils
73+
# 生成密码哈希
74+
echo YOUR_NEW_PASSWORD | htpasswd -BinC 10 admin | cut -d: -f2 > .htpasswd
75+
# 更新 .env 文件
76+
sed -i 's/ADMIN_PASSWORD_HASH=.*/ADMIN_PASSWORD_HASH=$(cat .htpasswd)/' .env
77+
```
78+
79+
</details>
80+
81+
5682
## 配置
5783

5884
配置通过环境变量进行管理。有关完整模板,请参阅下面的 `.env.example` 部分。

0 commit comments

Comments
 (0)