diff --git a/.github/renovate.json b/.github/renovate.json index f3ebe3d79..7c4068d6d 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -82,14 +82,6 @@ { "matchPackageNames": ["photoprism/photoprism"], "versioning": "regex:^(?\\d{2})(?\\d{2})(?\\d{2})$" - }, - { - "fileMatch": ["^docker-compose.yml$"], - "matchStrings": [ - "image:\\s?ghcr\\.io/umami-software/umami:[^\\s]+" - ], - "datasourceTemplate": "docker", - "versioningTemplate": "docker" } ], "prCreation": "immediate" diff --git a/apps/umami/2.12.1/data.yml b/apps/umami-mysql/2.13.0/data.yml similarity index 84% rename from apps/umami/2.12.1/data.yml rename to apps/umami-mysql/2.13.0/data.yml index 7f3339e67..ec593ab70 100644 --- a/apps/umami/2.12.1/data.yml +++ b/apps/umami-mysql/2.13.0/data.yml @@ -5,16 +5,14 @@ additionalProperties: envKey: PANEL_DB_HOST required: true type: service - default: postgresql + default: mysql edit: true envKey: PANEL_DB_TYPE - labelZh: 数据库 服务 (前置检查) + labelZh: MySQL 服务 (前置检查) labelEn: Database Service (Pre-check) required: true type: apps values: - - label: PostgreSQL - value: postgresql - label: MySQL value: mysql - label: MariaDB @@ -71,18 +69,6 @@ additionalProperties: value: "1" - label: 关闭 value: "0" - - default: postgresql - edit: true - envKey: DATABASE_TYPE - labelZh: 数据库 类型 - labelEn: Database Type - required: true - type: select - values: - - label: PostgreSQL - value: postgresql - - label: MySQL (MariaDB, Percona) - value: mysql - default: "127.0.0.1" edit: true envKey: DB_HOSTNAME @@ -90,7 +76,7 @@ additionalProperties: labelEn: Database Host required: true type: text - - default: 5432 + - default: 3306 edit: true envKey: DB_PORT labelZh: 数据库 端口 diff --git a/apps/umami-mysql/2.13.0/docker-compose.yml b/apps/umami-mysql/2.13.0/docker-compose.yml new file mode 100644 index 000000000..4f8ef7b09 --- /dev/null +++ b/apps/umami-mysql/2.13.0/docker-compose.yml @@ -0,0 +1,25 @@ +version: "3.8" + +networks: + 1panel-network: + external: true + +services: + umami-mysql: + image: ghcr.io/umami-software/umami:mysql-v2.13.0 + container_name: ${CONTAINER_NAME} + labels: + createdBy: "Apps" + restart: always + networks: + - 1panel-network + ports: + - ${PANEL_APP_PORT_HTTP}:3000 + env_file: + - /etc/1panel/envs/global.env + - ${ENV_FILE:-/etc/1panel/envs/default.env} + environment: + - DISABLE_TELEMETRY = 1 + - REMOVE_TRAILING_SLASH = 1 + - DATABASE_TYPE=mysql + - DATABASE_URL=mysql://${DB_USERNAME}:${DB_PASSWORD}@${DB_HOSTNAME}:${DB_PORT}/${DB_DATABASE_NAME} diff --git a/apps/umami/2.12.1/scripts/init.sh b/apps/umami-mysql/2.13.0/scripts/init.sh similarity index 100% rename from apps/umami/2.12.1/scripts/init.sh rename to apps/umami-mysql/2.13.0/scripts/init.sh diff --git a/apps/umami/2.12.1/scripts/uninstall.sh b/apps/umami-mysql/2.13.0/scripts/uninstall.sh similarity index 100% rename from apps/umami/2.12.1/scripts/uninstall.sh rename to apps/umami-mysql/2.13.0/scripts/uninstall.sh diff --git a/apps/umami/2.12.1/scripts/upgrade.sh b/apps/umami-mysql/2.13.0/scripts/upgrade.sh similarity index 100% rename from apps/umami/2.12.1/scripts/upgrade.sh rename to apps/umami-mysql/2.13.0/scripts/upgrade.sh diff --git a/apps/umami-mysql/README.md b/apps/umami-mysql/README.md new file mode 100644 index 000000000..75708657c --- /dev/null +++ b/apps/umami-mysql/README.md @@ -0,0 +1,142 @@ +# Umami MySQL版本 + +为速度和效率而构建的网站分析 + +Umami 网站分析提供您实时做出决策所需的数据。 + +![Umami](https://file.lifebus.top/imgs/umami_cover.jpg) + +![](https://img.shields.io/badge/%E6%96%B0%E7%96%86%E8%90%8C%E6%A3%AE%E8%BD%AF%E4%BB%B6%E5%BC%80%E5%8F%91%E5%B7%A5%E4%BD%9C%E5%AE%A4-%E6%8F%90%E4%BE%9B%E6%8A%80%E6%9C%AF%E6%94%AF%E6%8C%81-blue) + +## 简介 + +Umami 让您轻松分析数据 + ++ 便于使用 + +Umami 功能强大而简单,易于使用和理解,不需要复杂的设置或标签配置。 + ++ UTM 和自定义事件 + +Umami 会自动理解带有 UTM 参数的链接,并让您根据 UTM 查看和过滤您的网站数据。此外,您还可以跟踪网站上的任何事件,例如按钮点击、表单提交、购买、新闻通讯注册等。 + ++ 没有 Cookie 横幅 + +所有数据均经过 Umami 匿名处理,并且不会收集您网站用户的任何个人信息。您无需选择加入 Cookie +横幅即可跟踪网站的性能,从而为您的用户提供更好、更值得信赖的体验。 +默认情况下,Umami 符合 GDPRP 和 CCPA。 + +## 环境准备 + ++ 数据库支持 + + `MySQL` 版本:`5.7+` + + `PostgreSQL` 版本:`12.14+` + +## 安装说明 + +> 默认管理员帐户 +> +> 用户名: admin +> +> 密码: umami + +## 反向代理 + +> Nginx + +如果您的请求头中存在自定义字段,请修改: + +```text +add_header Access-Control-Allow-Headers '*' +``` + +以下配置修复 ipv6 地址无法收集的问题: + +```nginx +server { + ... + + add_header Content-Security-Policy 'frame-ancestors *'; + add_header Access-Control-Allow-Origin '*'; + add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS'; + add_header Access-Control-Allow-Headers 'x-umami-cache,DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization'; + if ($request_method = 'OPTIONS') { + return 204; + } + + location /api/send { + content_by_lua_block { + local cjson = require "cjson" + + local function is_ipv6_address(hostname) + local match = hostname:match("^[%x:]+$") + return match ~= nil + end + + ngx.req.read_body() + local data = ngx.req.get_body_data() + + if data then + local decoded_data = cjson.decode(data) + local hostname = decoded_data.payload.hostname + + if is_ipv6_address(hostname) then + local new_hostname = "127.0.0.1" + decoded_data.payload.hostname = new_hostname + + local modified_data = cjson.encode(decoded_data) + ngx.req.set_body_data(modified_data) + end + end + + ngx.exec("@proxy") + } + } + + location / { + proxy_hide_header 'Access-Control-Allow-Origin'; + proxy_hide_header 'Content-Security-Policy'; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_pass http://127.0.0.1:3000; + } + + location @proxy { + proxy_hide_header 'Access-Control-Allow-Origin'; + proxy_hide_header 'Content-Security-Policy'; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_pass http://127.0.0.1:3000; + } +} +``` + +极简配置: + +```nginx +add_header Content-Security-Policy 'frame-ancestors *'; +add_header Access-Control-Allow-Origin '*'; +add_header Access-Control-Allow-Methods '*'; +add_header Access-Control-Allow-Headers '*'; +if ($request_method = 'OPTIONS') { + return 204; +} + +location / { + proxy_hide_header 'Access-Control-Allow-Origin'; + proxy_hide_header 'Content-Security-Policy'; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_pass http://127.0.0.1:3000; +} +``` + +--- + +![Ms Studio](https://file.lifebus.top/imgs/ms_blank_001.png) diff --git a/apps/umami-mysql/data.yml b/apps/umami-mysql/data.yml new file mode 100644 index 000000000..2bd8494b5 --- /dev/null +++ b/apps/umami-mysql/data.yml @@ -0,0 +1,20 @@ +name: Umami MySQL版 +title: Umami MySQL版 +description: 为速度和效率而构建的网站分析 +additionalProperties: + key: umami-mysql + name: Umami MySQL版 + tags: + - WebSite + - Database + - Middleware + - Runtime + - Local + shortDescZh: 为速度和效率而构建的网站分析 + shortDescEn: A website analytics tool that is built for speed and efficiency + type: website + crossVersionUpdate: true + limit: 0 + website: https://umami.is/ + github: https://github.com/umami-software/umami/ + document: https://umami.is/docs/ diff --git a/apps/umami-mysql/logo.png b/apps/umami-mysql/logo.png new file mode 100644 index 000000000..9ede937a0 Binary files /dev/null and b/apps/umami-mysql/logo.png differ diff --git a/apps/umami/2.13.0/data.yml b/apps/umami/2.13.0/data.yml new file mode 100644 index 000000000..e93c2b180 --- /dev/null +++ b/apps/umami/2.13.0/data.yml @@ -0,0 +1,104 @@ +additionalProperties: + formFields: + - child: + default: "" + envKey: PANEL_POSTGRES_SERVICE + required: true + type: service + default: postgresql + envKey: PANEL_POSTGRES_TYPE + labelZh: Postgres 服务 (前置检查) + labelEn: Postgres Service (Pre-check) + required: true + type: apps + values: + - label: PostgreSQL + value: postgresql + - default: "/home/umami" + edit: true + envKey: UMAMI_ROOT_PATH + labelZh: 数据持久化路径 + labelEn: Data persistence path + required: true + type: text + - default: 3000 + edit: true + envKey: PANEL_APP_PORT_HTTP + labelZh: 连接端口 + labelEn: Connection Port + required: true + rule: paramPort + type: number + - default: "" + edit: true + envKey: APP_SECRET + labelZh: 应用密钥 + labelEn: Application Secret + random: true + required: false + rule: paramComplexity + type: password + - default: "/" + edit: true + envKey: BASE_PATH + labelZh: 基础路径 + labelEn: Base Path + required: true + type: text + - default: "" + edit: true + envKey: ALLOWED_FRAME_URLS + labelZh: 允许的 frame 地址 + labelEn: Allowed frame urls + required: false + type: text + - default: "0" + edit: true + envKey: DISABLE_BOT_CHECK + labelZh: 禁用机器人检测 + labelEn: Disable bot detection + required: true + type: select + values: + - label: 开启 + value: "1" + - label: 关闭 + value: "0" + - default: "127.0.0.1" + edit: true + envKey: DB_HOSTNAME + labelZh: 数据库 主机地址 + labelEn: Database Host + required: true + type: text + - default: 5432 + edit: true + envKey: DB_PORT + labelZh: 数据库 端口 + labelEn: Database Port + required: true + rule: paramPort + type: number + - default: "umami" + edit: true + envKey: DB_USERNAME + labelZh: 数据库 用户名 + labelEn: Database User + required: true + type: text + - default: "" + edit: true + envKey: DB_PASSWORD + labelEn: Database Password + labelZh: 数据库 密码 + random: true + required: true + rule: paramComplexity + type: password + - default: "umami" + edit: true + envKey: DB_DATABASE_NAME + labelZh: 数据库 名称 + labelEn: Database Name + required: true + type: text diff --git a/apps/umami/2.12.1/docker-compose.yml b/apps/umami/2.13.0/docker-compose.yml similarity index 67% rename from apps/umami/2.12.1/docker-compose.yml rename to apps/umami/2.13.0/docker-compose.yml index f15620d1b..d3ea95acf 100644 --- a/apps/umami/2.12.1/docker-compose.yml +++ b/apps/umami/2.13.0/docker-compose.yml @@ -4,7 +4,7 @@ networks: services: umami: - image: ghcr.io/umami-software/umami:${DATABASE_TYPE}-v2.12.1 + image: ghcr.io/umami-software/umami:postgresql-v2.13.0 container_name: ${CONTAINER_NAME} labels: createdBy: "Apps" @@ -19,4 +19,5 @@ services: environment: - DISABLE_TELEMETRY = 1 - REMOVE_TRAILING_SLASH = 1 - - DATABASE_URL=${DATABASE_TYPE}://${DB_USERNAME}:${DB_PASSWORD}@${DB_HOSTNAME}:${DB_PORT}/${DB_DATABASE_NAME} + - DATABASE_TYPE=postgresql + - DATABASE_URL=postgresql://${DB_USERNAME}:${DB_PASSWORD}@${DB_HOSTNAME}:${DB_PORT}/${DB_DATABASE_NAME} diff --git a/apps/umami/2.13.0/scripts/init.sh b/apps/umami/2.13.0/scripts/init.sh new file mode 100644 index 000000000..77b849120 --- /dev/null +++ b/apps/umami/2.13.0/scripts/init.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +if [ -f .env ]; then + source .env + + # setup-1 add default values + CURRENT_DIR=$(pwd) + sed -i '/^ENV_FILE=/d' .env + echo "ENV_FILE=${CURRENT_DIR}/.env" >> .env + + echo "Check Finish." + +else + echo "Error: .env file not found." +fi diff --git a/apps/umami/2.13.0/scripts/uninstall.sh b/apps/umami/2.13.0/scripts/uninstall.sh new file mode 100644 index 000000000..c86c4fbca --- /dev/null +++ b/apps/umami/2.13.0/scripts/uninstall.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +if [ -f .env ]; then + source .env + + echo "Check Finish." + +else + echo "Error: .env file not found." +fi diff --git a/apps/umami/2.13.0/scripts/upgrade.sh b/apps/umami/2.13.0/scripts/upgrade.sh new file mode 100644 index 000000000..77b849120 --- /dev/null +++ b/apps/umami/2.13.0/scripts/upgrade.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +if [ -f .env ]; then + source .env + + # setup-1 add default values + CURRENT_DIR=$(pwd) + sed -i '/^ENV_FILE=/d' .env + echo "ENV_FILE=${CURRENT_DIR}/.env" >> .env + + echo "Check Finish." + +else + echo "Error: .env file not found." +fi diff --git a/apps/umami/README.md b/apps/umami/README.md index 56b5f00f0..41302725a 100644 --- a/apps/umami/README.md +++ b/apps/umami/README.md @@ -8,6 +8,12 @@ Umami 网站分析提供您实时做出决策所需的数据。 ![](https://img.shields.io/badge/%E6%96%B0%E7%96%86%E8%90%8C%E6%A3%AE%E8%BD%AF%E4%BB%B6%E5%BC%80%E5%8F%91%E5%B7%A5%E4%BD%9C%E5%AE%A4-%E6%8F%90%E4%BE%9B%E6%8A%80%E6%9C%AF%E6%94%AF%E6%8C%81-blue) +## 声明 + +> 该应用默认使用 `PostgreSQL` 作为基础数据库,原使用 `MySQL` 数据库的用户需要进行卸载重新安装 `MySQL` 版本。 +> +> 卸载重装请注意参数保持一致,持久化目录也必须保持一致。 + ## 简介 Umami 让您轻松分析数据 diff --git a/apps/umami/data.yml b/apps/umami/data.yml index b94e9cca2..190e8d30f 100644 --- a/apps/umami/data.yml +++ b/apps/umami/data.yml @@ -1,5 +1,5 @@ name: Umami -title: 为速度和效率而构建的网站分析 +title: Umami - 网站分析 description: 为速度和效率而构建的网站分析 additionalProperties: key: umami