From 41f3dc77a2dbf73c44c5d4bbb2420cfd7232aa59 Mon Sep 17 00:00:00 2001 From: okxlin Date: Thu, 14 Dec 2023 23:02:22 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=B7=BB=E5=8A=A0headscale-webui=E5=88=B0?= =?UTF-8?q?=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/headscale-webui/README.md | 82 +++++++++++++++++ apps/headscale-webui/data.yml | 20 +++++ apps/headscale-webui/latest/.env.sample | 12 +++ apps/headscale-webui/latest/data.yml | 84 ++++++++++++++++++ .../headscale-webui/latest/docker-compose.yml | 28 ++++++ apps/headscale-webui/logo.png | Bin 0 -> 3185 bytes 6 files changed, 226 insertions(+) create mode 100644 apps/headscale-webui/README.md create mode 100644 apps/headscale-webui/data.yml create mode 100644 apps/headscale-webui/latest/.env.sample create mode 100644 apps/headscale-webui/latest/data.yml create mode 100644 apps/headscale-webui/latest/docker-compose.yml create mode 100644 apps/headscale-webui/logo.png diff --git a/apps/headscale-webui/README.md b/apps/headscale-webui/README.md new file mode 100644 index 00000000..319e4a64 --- /dev/null +++ b/apps/headscale-webui/README.md @@ -0,0 +1,82 @@ +# 使用说明 + +## 数据文件夹授权 + +- 1、**必要操作:** 首次安装完成后,进入已安装应用界面,点击跳转数据目录,修改目录下的`data`文件夹为`1000`用户和用户组。 + +命令行修改则类似如下,路径按需修改: +``` +chown -R 1000:1000 /opt/1panel/apps/local/headscale-webui/headscale-webui/data +``` + +- 2、回到已安装应用界面,重建应用。 + + +# 原始相关 +*** +

+ + + +

+ +

Headscale-WebUI

+ +

+ A simple Headscale web UI for small-scale deployments. +

+

+ Screenshots | Installation | Issues +

+ +--- +# Features +1. Enable/Disable routes and exit nodes + * Manage failover routes as well +2. Add, move, rename, and remove machines +3. Add and remove users/namespaces +4. Add and expire PreAuth keys +5. Add and remove machine tags +6. View machine details + * Hostname + * User associated with the machine + * IP addresses in the Tailnet + * Last seen by the control server + * Last update with the control server + * Creation date + * Expiration date (will also display a badge when nearing expiration) + * PreAuth key associated with the machine + * Enable / disable routes and exit nodes + * Add and delete machine tags +7. Basic and OIDC Authentication + * OIDC Authentication tested with Authelia and Keycloak +8. Change your color theme! See MaterializeCSS Documentation for Colors for examples. +9. Search your machines and users. + * Machines have tags you can use to filter search: + * `tag:tagname` Searches only for specific tags + * `machine:machine-name` Searches only for specific machines + * `user:user-name` Searches only for specific users + + +--- +# Installation +* See [SETUP.md](SETUP.md) for installation and configuration instructions. + +--- +# Screenshots: +![Overview](https://github.com/iFargle/headscale-webui/raw/main/screenshots/overview.png) +![Routes](https://github.com/iFargle/headscale-webui/raw/main/screenshots/routes.png) +![Machines](https://github.com/iFargle/headscale-webui/raw/main/screenshots/machines.png) +![Users](https://github.com/iFargle/headscale-webui/raw/main/screenshots/users.png) +![Settings](https://github.com/iFargle/headscale-webui/raw/main/screenshots/settings.png) + +--- +# Tech used: +* Python - [Link](https://www.python.org/) +* Poetry - [Link](https://python-poetry.org/) +* MaterializeCSS - [Link](https://github.com/Dogfalo/materialize) +* jQuery - [Link](https://jquery.com/) + +For Python libraries, see [pyproject.toml](https://github.com/iFargle/headscale-webui/blob/main/pyproject.toml) + +If you use this project, please reach out! It keeps me motivated! Thank you! \ No newline at end of file diff --git a/apps/headscale-webui/data.yml b/apps/headscale-webui/data.yml new file mode 100644 index 00000000..16b09bd8 --- /dev/null +++ b/apps/headscale-webui/data.yml @@ -0,0 +1,20 @@ +name: Headscale-WebUI +tags: + - 工具 +title: 适用于小规模部署的简单 Headscale 网络用户界面 +type: 工具 +description: 适用于小规模部署的简单 Headscale 网络用户界面 +additionalProperties: + key: headscale-webui + name: Headscale-WebUI + tags: + - Tool + shortDescZh: 适用于小规模部署的简单 Headscale 网络用户界面 + shortDescEn: A simple Headscale web UI for small-scale deployments + type: tool + crossVersionUpdate: true + limit: 0 + recommend: 0 + website: https://github.com/iFargle/headscale-webui + github: https://github.com/iFargle/headscale-webui + document: https://github.com/iFargle/headscale-webui diff --git a/apps/headscale-webui/latest/.env.sample b/apps/headscale-webui/latest/.env.sample new file mode 100644 index 00000000..8fff0243 --- /dev/null +++ b/apps/headscale-webui/latest/.env.sample @@ -0,0 +1,12 @@ +CONTAINER_NAME="headscale-webui" +PANEL_APP_PORT_HTTP="40185" +AUTH_TYPE="Basic" +DATA_PATH="./data" +External_URL="https://hs.example.com" +HEADSCALE_PATH="/opt/1panel/apps/local/headscale/headscale/data/config" +HS_SERVER="http://172.18.0.241:8080" +HTTP_PWD="password_PhbfKw" +HTTP_USER="user" +SECRET_KEY="TvMhk7FDnAfaIwp0RDRsq3AVNdrYBuhNT0NTPNw4vIQ=" +TIME_ZONE="Asia/Shanghai" +URL_PATH="/admin" diff --git a/apps/headscale-webui/latest/data.yml b/apps/headscale-webui/latest/data.yml new file mode 100644 index 00000000..e49df8b3 --- /dev/null +++ b/apps/headscale-webui/latest/data.yml @@ -0,0 +1,84 @@ +additionalProperties: + formFields: + - default: 40185 + edit: true + envKey: PANEL_APP_PORT_HTTP + labelEn: Port + labelZh: 端口 + required: true + rule: paramPort + type: number + - default: ./data + edit: true + envKey: DATA_PATH + labelEn: Data folder path + labelZh: 数据文件夹路径 + required: true + type: text + - default: '/opt/1panel/apps/local/headscale/headscale/data/config' + edit: true + envKey: HEADSCALE_PATH + labelEn: Headscale configuration file path + labelZh: Headscale 配置文件路径 + required: true + type: text + - default: http://172.18.0.241:8080 + edit: true + envKey: HS_SERVER + labelEn: Headscale server url + labelZh: Headscale 服务器链接 + required: true + rule: paramExtUrl + type: text + - default: https://hs.example.com + edit: true + envKey: External_URL + labelEn: External URL (Domain URL) + labelZh: 外部访问地址 (域名地址) + required: true + rule: paramExtUrl + type: text + - default: /admin + edit: true + envKey: URL_PATH + labelEn: Admin console path + labelZh: 后台管理路径 + required: true + type: text + - default: Asia/Shanghai + edit: true + envKey: TIME_ZONE + labelEn: Time zone + labelZh: 时区 + required: true + type: text + - default: 'TvMhk7FDnAfaIwp0RDRsq3AVNdrYBuhNT0NTPNw4vIQ=' + edit: true + envKey: SECRET_KEY + labelEn: Secret key (Obtained by running 'openssl rand -base64 32') + labelZh: 加密密钥 (终端执行'openssl rand -base64 32'获得) + required: true + type: text + - default: Basic + edit: true + envKey: AUTH_TYPE + labelEn: Authentication method (leave blank without http validation) + labelZh: 验证方式 (留空无 http 验证) + required: false + type: text + - default: user + edit: true + envKey: HTTP_USER + labelEn: http auth user + labelZh: HTTP 用户 + required: false + type: text + - default: password + edit: true + envKey: HTTP_PWD + labelEn: http auth password + labelZh: HTTP 密码 + random: true + required: false + rule: paramComplexity + type: password diff --git a/apps/headscale-webui/latest/docker-compose.yml b/apps/headscale-webui/latest/docker-compose.yml new file mode 100644 index 00000000..9c7b9738 --- /dev/null +++ b/apps/headscale-webui/latest/docker-compose.yml @@ -0,0 +1,28 @@ +version: '3' +services: + headscale-webui: + container_name: ${CONTAINER_NAME} + restart: always + networks: + - 1panel-network + ports: + - "${PANEL_APP_PORT_HTTP}:5000" + volumes: + - ${DATA_PATH}:/data + - ${HEADSCALE_PATH}:/etc/headscale/:ro + environment: + - TZ=${TIME_ZONE} + - HS_SERVER=${HS_SERVER} + - DOMAIN_NAME=${External_URL} + - SCRIPT_NAME=${URL_PATH} + - AUTH_TYPE=${AUTH_TYPE} + - BASIC_AUTH_USER=${HTTP_USER} + - BASIC_AUTH_PASS=${HTTP_PWD} + - KEY=${SECRET_KEY} + image: ifargle/headscale-webui:latest + labels: + createdBy: "Apps" + +networks: + 1panel-network: + external: true diff --git a/apps/headscale-webui/logo.png b/apps/headscale-webui/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..544221900e90795406557ba9f27d3f4891e20eee GIT binary patch literal 3185 zcmds)`8yP98^>qKzSc=3M3OqTgTXK~Ws8WA$dOJc&Z!T9^lmFrq(n|M-# zQr_e|Ub73#z?40ZR|Z|3g$Gw_2ewTOW2)j2kKH-GmaX%C-_e5s+XuITf% zA1fkRkpIk)1+^aBf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