From 6b201a907b01312214c57ef4bb6434f71fea25fa Mon Sep 17 00:00:00 2001 From: okxlin Date: Tue, 4 Jul 2023 22:58:37 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=B7=BB=E5=8A=A0yourls=E5=88=B0=E5=88=97?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/yourls/1.9.2/.env.sample | 12 ++++ apps/yourls/1.9.2/data.yml | 12 +++- apps/yourls/1.9.2/docker-compose.yml | 4 +- apps/yourls/README.md | 15 +++- apps/yourls/{data.yml.bak => data.yml} | 0 apps/yourls/latest/.env.sample | 12 ++++ apps/yourls/latest/data.yml | 94 ++++++++++++++++++++++++++ apps/yourls/latest/docker-compose.yml | 27 ++++++++ 8 files changed, 171 insertions(+), 5 deletions(-) create mode 100644 apps/yourls/1.9.2/.env.sample rename apps/yourls/{data.yml.bak => data.yml} (100%) create mode 100644 apps/yourls/latest/.env.sample create mode 100644 apps/yourls/latest/data.yml create mode 100644 apps/yourls/latest/docker-compose.yml diff --git a/apps/yourls/1.9.2/.env.sample b/apps/yourls/1.9.2/.env.sample new file mode 100644 index 00000000..ec6e176a --- /dev/null +++ b/apps/yourls/1.9.2/.env.sample @@ -0,0 +1,12 @@ +CONTAINER_NAME="yourls" +DATA_PATH="./data" +PANEL_APP_PORT_HTTP="40037" +PANEL_DB_HOST="mysql" +PANEL_DB_NAME="yourls_PXHwjZ" +PANEL_DB_PREFIX="yourls_" +PANEL_DB_USER="yourls_Ytnm8T" +PANEL_DB_USER_PASSWORD="yourls_yyX7PP" +PASSWORD="yourls_4CWtCw" +USERNAME="yourls_hYC4zp" +YOURLS_DB_PORT="3306" +YOURLS_EXTERNAL_URL="http://localhost:40037" diff --git a/apps/yourls/1.9.2/data.yml b/apps/yourls/1.9.2/data.yml index 6a6eaedf..4a490b84 100644 --- a/apps/yourls/1.9.2/data.yml +++ b/apps/yourls/1.9.2/data.yml @@ -62,6 +62,13 @@ additionalProperties: required: true rule: paramPort type: number + - default: ./data + edit: true + envKey: DATA_PATH + labelEn: Data folder path + labelZh: 数据文件夹路径 + required: true + type: text - default: yourls envKey: USERNAME labelEn: User @@ -78,10 +85,9 @@ additionalProperties: required: true rule: paramComplexity type: password - - - default: http://localhost:40020 + - default: http://localhost:40037 edit: true - envKey: FLARUM_EXTERNAL_URL + envKey: YOURLS_EXTERNAL_URL labelEn: External URL labelZh: 外部访问地址 required: true diff --git a/apps/yourls/1.9.2/docker-compose.yml b/apps/yourls/1.9.2/docker-compose.yml index 55b2c982..0ad3d144 100644 --- a/apps/yourls/1.9.2/docker-compose.yml +++ b/apps/yourls/1.9.2/docker-compose.yml @@ -7,6 +7,8 @@ services: - 1panel-network ports: - "${PANEL_APP_PORT_HTTP}:80" + volumes: + - "${DATA_PATH}:/var/www/html" environment: - YOURLS_SITE=${YOURLS_EXTERNAL_URL} - YOURLS_USER=${USERNAME} @@ -16,7 +18,7 @@ services: - YOURLS_DB_USER=${PANEL_DB_USER} - YOURLS_DB_PASS=${PANEL_DB_USER_PASSWORD} - YOURLS_DB_PREFIX=${PANEL_DB_PREFIX} - image: yourls:1.9.2-fpm-alpine + image: yourls:1.9.2 labels: createdBy: "Apps" diff --git a/apps/yourls/README.md b/apps/yourls/README.md index ad74448b..b14666d7 100644 --- a/apps/yourls/README.md +++ b/apps/yourls/README.md @@ -1,6 +1,19 @@ +# 使用说明 + +- 初始化设置 + +注意:首次实例化时,访问根文件夹将生成错误。通过路径 `/admin/` 访问 `YOURLS` 管理界面 + +假如外部访问地址设置为`http://localhost:40020`, + +那么需要访问`http://localhost:40020/admin/`进行初始化设置 + + +# 原始相关 +

- YOURLS + YOURLS

diff --git a/apps/yourls/data.yml.bak b/apps/yourls/data.yml similarity index 100% rename from apps/yourls/data.yml.bak rename to apps/yourls/data.yml diff --git a/apps/yourls/latest/.env.sample b/apps/yourls/latest/.env.sample new file mode 100644 index 00000000..ec6e176a --- /dev/null +++ b/apps/yourls/latest/.env.sample @@ -0,0 +1,12 @@ +CONTAINER_NAME="yourls" +DATA_PATH="./data" +PANEL_APP_PORT_HTTP="40037" +PANEL_DB_HOST="mysql" +PANEL_DB_NAME="yourls_PXHwjZ" +PANEL_DB_PREFIX="yourls_" +PANEL_DB_USER="yourls_Ytnm8T" +PANEL_DB_USER_PASSWORD="yourls_yyX7PP" +PASSWORD="yourls_4CWtCw" +USERNAME="yourls_hYC4zp" +YOURLS_DB_PORT="3306" +YOURLS_EXTERNAL_URL="http://localhost:40037" diff --git a/apps/yourls/latest/data.yml b/apps/yourls/latest/data.yml new file mode 100644 index 00000000..4a490b84 --- /dev/null +++ b/apps/yourls/latest/data.yml @@ -0,0 +1,94 @@ +additionalProperties: + formFields: + - child: + default: "" + envKey: PANEL_DB_HOST + labelEn: Database Service + labelZh: 数据库服务 + required: true + type: service + default: mysql + labelEn: Database Service + labelZh: 数据库服务 + params: + - envKey: YOURLS_DB_PORT + key: mysql + type: param + value: "3306" + - envKey: YOURLS_DB_PORT + key: postgresql + type: param + value: "5432" + required: true + type: apps + values: + - label: MySQL + value: mysql + - default: yourls + envKey: PANEL_DB_NAME + labelEn: Database + labelZh: 数据库名 + random: true + required: true + rule: paramCommon + type: text + - default: yourls + envKey: PANEL_DB_USER + labelEn: User + labelZh: 数据库用户 + random: true + required: true + rule: paramCommon + type: text + - default: yourls + envKey: PANEL_DB_USER_PASSWORD + labelEn: Password + labelZh: 数据库用户密码 + random: true + required: true + rule: paramComplexity + type: password + - default: yourls_ + envKey: PANEL_DB_PREFIX + labelEn: Database prefix + labelZh: 数据库前缀 + required: true + type: text + - default: 40037 + 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: yourls + envKey: USERNAME + labelEn: User + labelZh: 用户 + random: true + required: true + rule: paramCommon + type: text + - default: yourls + envKey: PASSWORD + labelEn: Password + labelZh: 用户密码 + random: true + required: true + rule: paramComplexity + type: password + - default: http://localhost:40037 + edit: true + envKey: YOURLS_EXTERNAL_URL + labelEn: External URL + labelZh: 外部访问地址 + required: true + type: text \ No newline at end of file diff --git a/apps/yourls/latest/docker-compose.yml b/apps/yourls/latest/docker-compose.yml new file mode 100644 index 00000000..dc5dd7a9 --- /dev/null +++ b/apps/yourls/latest/docker-compose.yml @@ -0,0 +1,27 @@ +version: '3' +services: + yourls: + container_name: ${CONTAINER_NAME} + restart: always + networks: + - 1panel-network + ports: + - "${PANEL_APP_PORT_HTTP}:80" + volumes: + - "${DATA_PATH}:/var/www/html" + environment: + - YOURLS_SITE=${YOURLS_EXTERNAL_URL} + - YOURLS_USER=${USERNAME} + - YOURLS_PASS=${PASSWORD} + - YOURLS_DB_HOST=${PANEL_DB_HOST}:${YOURLS_DB_PORT} + - YOURLS_DB_NAME=${PANEL_DB_NAME} + - YOURLS_DB_USER=${PANEL_DB_USER} + - YOURLS_DB_PASS=${PANEL_DB_USER_PASSWORD} + - YOURLS_DB_PREFIX=${PANEL_DB_PREFIX} + image: yourls:latest + labels: + createdBy: "Apps" + +networks: + 1panel-network: + external: true