From 959f04400cb5d90efb7ce28b99263032a31628f2 Mon Sep 17 00:00:00 2001
From: BetterAndBetterII <1176445047@qq.com>
Date: Mon, 18 Aug 2025 20:31:28 +0800
Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20.gitignore=20=E6=96=87?=
=?UTF-8?q?=E4=BB=B6=E4=BB=A5=E5=BF=BD=E7=95=A5=20.htpasswd=20=E6=96=87?=
=?UTF-8?q?=E4=BB=B6=EF=BC=8C=E6=B7=BB=E5=8A=A0=E7=AE=80=E5=8D=95=E5=AF=86?=
=?UTF-8?q?=E7=A0=81=E8=AE=A4=E8=AF=81=E7=9A=84=E4=BD=BF=E7=94=A8=E8=AF=B4?=
=?UTF-8?q?=E6=98=8E=E5=88=B0=20README=20=E6=96=87=E4=BB=B6=E4=B8=AD?=
=?UTF-8?q?=EF=BC=8C=E5=8C=85=E5=90=AB=E7=A4=BA=E4=BE=8B=E5=91=BD=E4=BB=A4?=
=?UTF-8?q?=E5=92=8C=E9=85=8D=E7=BD=AE=E6=AD=A5=E9=AA=A4=EF=BC=8C=E5=A2=9E?=
=?UTF-8?q?=E5=BC=BA=E6=96=87=E6=A1=A3=E7=9A=84=E5=8F=AF=E8=AF=BB=E6=80=A7?=
=?UTF-8?q?=E5=92=8C=E5=AE=9E=E7=94=A8=E6=80=A7=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.gitignore | 1 +
README.md | 27 +++++++++++++++++++++++++++
README_zh.md | 26 ++++++++++++++++++++++++++
3 files changed, 54 insertions(+)
diff --git a/.gitignore b/.gitignore
index 7c31eca..a9e4618 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,3 +11,4 @@ node_modules
*.db
data/
.idea
+.htpasswd
diff --git a/README.md b/README.md
index 553728a..ca820b5 100644
--- a/README.md
+++ b/README.md
@@ -53,6 +53,33 @@ docker compose up -d
The server will start, and you can access the application at `http://localhost:3002`.
+
+
+
+Use Simple Password Authentication(Dex OIDC)
+
+```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
+```
+
+
+
+
## Configuration
Configuration is managed via environment variables. For a full template, see the `.env.example` section below.
diff --git a/README_zh.md b/README_zh.md
index 6e66c4e..53e7a4f 100644
--- a/README_zh.md
+++ b/README_zh.md
@@ -53,6 +53,32 @@ docker compose up -d
服务器将启动,您可以在 `http://localhost:3002` 访问该应用。
+
+
+使用简单密码认证(Dex OIDC)
+
+```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
+```
+
+
+
+
## 配置
配置通过环境变量进行管理。有关完整模板,请参阅下面的 `.env.example` 部分。