diff --git a/Pasted image 20250526174733.png b/Pasted image 20250526174733.png new file mode 100644 index 0000000..108a2d0 Binary files /dev/null and b/Pasted image 20250526174733.png differ diff --git a/Pasted image 20250526175221.png b/Pasted image 20250526175221.png new file mode 100644 index 0000000..5d2eb50 Binary files /dev/null and b/Pasted image 20250526175221.png differ diff --git a/Pasted image 20250526175236.png b/Pasted image 20250526175236.png new file mode 100644 index 0000000..6fabd80 Binary files /dev/null and b/Pasted image 20250526175236.png differ diff --git a/Pasted image 20250526175250.png b/Pasted image 20250526175250.png new file mode 100644 index 0000000..4a9010c Binary files /dev/null and b/Pasted image 20250526175250.png differ diff --git a/Pasted image 20250526175431.png b/Pasted image 20250526175431.png new file mode 100644 index 0000000..7f3430c Binary files /dev/null and b/Pasted image 20250526175431.png differ diff --git a/Pasted image 20250527095510.png b/Pasted image 20250527095510.png new file mode 100644 index 0000000..cd06585 Binary files /dev/null and b/Pasted image 20250527095510.png differ diff --git a/Pasted image 20250527095621.png b/Pasted image 20250527095621.png new file mode 100644 index 0000000..08f65c5 Binary files /dev/null and b/Pasted image 20250527095621.png differ diff --git a/Pasted image 20250527155030.png b/Pasted image 20250527155030.png new file mode 100644 index 0000000..0ef3bb0 Binary files /dev/null and b/Pasted image 20250527155030.png differ diff --git a/Pasted image 20250527155131.png b/Pasted image 20250527155131.png new file mode 100644 index 0000000..f8bf53a Binary files /dev/null and b/Pasted image 20250527155131.png differ diff --git a/Pasted image 20250530162217.png b/Pasted image 20250530162217.png new file mode 100644 index 0000000..07c4810 Binary files /dev/null and b/Pasted image 20250530162217.png differ diff --git a/Pasted image 20250530162310.png b/Pasted image 20250530162310.png new file mode 100644 index 0000000..2c6b700 Binary files /dev/null and b/Pasted image 20250530162310.png differ diff --git a/Pasted image 20250530162340.png b/Pasted image 20250530162340.png new file mode 100644 index 0000000..d4135d6 Binary files /dev/null and b/Pasted image 20250530162340.png differ diff --git a/Pasted image 20250530162359.png b/Pasted image 20250530162359.png new file mode 100644 index 0000000..655ff75 Binary files /dev/null and b/Pasted image 20250530162359.png differ diff --git a/Pasted image 20250530162528.png b/Pasted image 20250530162528.png new file mode 100644 index 0000000..bfe0454 Binary files /dev/null and b/Pasted image 20250530162528.png differ diff --git a/Pasted image 20250530162804.png b/Pasted image 20250530162804.png new file mode 100644 index 0000000..d5068fc Binary files /dev/null and b/Pasted image 20250530162804.png differ diff --git a/Pasted image 20250530162949.png b/Pasted image 20250530162949.png new file mode 100644 index 0000000..b49d90f Binary files /dev/null and b/Pasted image 20250530162949.png differ diff --git a/Pasted image 20250530163109.png b/Pasted image 20250530163109.png new file mode 100644 index 0000000..066813a Binary files /dev/null and b/Pasted image 20250530163109.png differ diff --git a/Pasted image 20250530163244.png b/Pasted image 20250530163244.png new file mode 100644 index 0000000..b20de31 Binary files /dev/null and b/Pasted image 20250530163244.png differ diff --git a/Pasted image 20250530163530.png b/Pasted image 20250530163530.png new file mode 100644 index 0000000..0cb15eb Binary files /dev/null and b/Pasted image 20250530163530.png differ diff --git a/Pasted image 20250530163611.png b/Pasted image 20250530163611.png new file mode 100644 index 0000000..f403a61 Binary files /dev/null and b/Pasted image 20250530163611.png differ diff --git a/Pasted image 20250530163747.png b/Pasted image 20250530163747.png new file mode 100644 index 0000000..0726e2d Binary files /dev/null and b/Pasted image 20250530163747.png differ diff --git a/sureness.yml b/sureness.yml new file mode 100644 index 0000000..d846c6a --- /dev/null +++ b/sureness.yml @@ -0,0 +1,131 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +## -- sureness.yml account source -- ## + +# config the resource restful api that need auth protection, base rbac +# rule: api===method===role +# eg: /api/v1/source1===get===[admin] means /api/v2/host===post support role[admin] access. +# eg: /api/v1/source2===get===[] means /api/v1/source2===get can not access by any role. +resourceRole: + - /api/account/auth/refresh===post===[admin,user,guest] + - /api/apps/**===get===[admin,user,guest] + - /api/monitor/**===get===[admin,user,guest] + - /api/monitor/**===post===[admin,user] + - /api/monitor/**===put===[admin,user] + - /api/monitor/**===delete==[admin] + - /api/monitors/**===get===[admin,user,guest] + - /api/monitors/**===post===[admin,user] + - /api/monitors/**===put===[admin,user] + - /api/monitors/**===delete===[admin] + - /api/alert/**===get===[admin,user,guest] + - /api/alert/**===post===[admin,user] + - /api/alert/**===put===[admin,user] + - /api/alert/**===delete===[admin] + - /api/alerts/**===get===[admin,user,guest] + - /api/alerts/**===post===[admin,user] + - /api/alerts/**===put===[admin,user] + - /api/alerts/**===delete===[admin] + - /api/notice/**===get===[admin,user,guest] + - /api/notice/**===post===[admin,user] + - /api/notice/**===put===[admin,user] + - /api/notice/**===delete===[admin] + - /api/tag/**===get===[admin,user,guest] + - /api/tag/**===post===[admin,user] + - /api/tag/**===put===[admin,user] + - /api/tag/**===delete===[admin] + - /api/summary/**===get===[admin,user,guest] + - /api/summary/**===post===[admin,user] + - /api/summary/**===put===[admin,user] + - /api/summary/**===delete===[admin] + - /api/collector/**===get===[admin,user,guest] + - /api/collector/**===post===[admin,user] + - /api/collector/**===put===[admin,user] + - /api/collector/**===delete===[admin] + - /api/status/page/**===get===[admin,user,guest] + - /api/status/page/**===post===[admin,user] + - /api/status/page/**===put===[admin,user] + - /api/status/page/**===delete===[admin] + - /api/grafana/**===get===[admin,user,guest] + - /api/grafana/**===post===[admin,user] + - /api/grafana/**===put===[admin,user] + - /api/grafana/**===delete===[admin] + - /api/bulletin/**===get===[admin,user,guest] + - /api/bulletin/**===post===[admin,user] + - /api/bulletin/**===put===[admin,user] + - /api/bulletin/**===delete===[admin] + +# config the resource restful api that need bypass auth protection +# rule: api===method +# eg: /api/v1/source3===get means /api/v1/source3===get can be access by anyone, no need auth. +excludedResource: + - /api/alerts/report/**===* + - /api/alert/sse/**===* + - /api/account/auth/**===* + - /api/i18n/**===get + - /api/apps/hierarchy===get + - /api/push/**===* + - /api/status/page/public/**===* + - /api/manager/sse/**===* + # web ui resource + - /===get + - /assets/**===get + - /dashboard/**===get + - /monitors/**===get + - /alert/**===get + - /account/**===get + - /setting/**===get + - /passport/**===get + - /status/**===get + - /**/*.html===get + - /**/*.js===get + - /**/*.css===get + - /**/*.ico===get + - /**/*.ttf===get + - /**/*.png===get + - /**/*.gif===get + - /**/*.jpg===get + - /**/*.svg===get + - /**/*.json===get + - /**/*.woff===get + - /**/*.eot===get + # swagger ui resource + - /swagger-resources/**===get + - /v2/api-docs===get + - /v3/api-docs===get + # h2 database + - /h2-console/**===* + +# account info config +# eg: admin has role [admin,user], password is hertzbeat +# eg: tom has role [user], password is hertzbeat +# eg: lili has role [guest], plain password is lili, salt is 123, salted password is 1A676730B0C7F54654B0E09184448289 +account: + - appId: admin + credential: hertzbeat + role: [admin] + - appId: tom + credential: hertzbeat + role: [user] + - appId: guest + credential: hertzbeat + role: [guest] + - appId: lili + # credential = MD5(password + salt) + # plain password: hertzbeat + # attention: digest authentication does not support salted encrypted password accounts + credential: 94C6B34E7A199A9F9D4E1F208093B489 + salt: 123 + role: [user] diff --git a/work常用/linux/GIT操作.md b/work常用/linux/GIT操作.md index dc8b8f4..05274d0 100644 --- a/work常用/linux/GIT操作.md +++ b/work常用/linux/GIT操作.md @@ -6,11 +6,11 @@ git add README.md git commit -m "first commit" git remote add origin http://x.x.x.x:1314/X6738/yfzx-yn-cloudmirror-group-v3.0.git - git push -u origin master + git push -u origin main # 从命令行推送已经创建的仓库 git remote add origin http://x.x.x.x:1314/X6738/yfzx-yn-cloudmirror-group-v3.0.git - git push -u -f origin master + git push -u -f origin main ``` * 常用命令 diff --git a/work常用/python/UV 常用命令.md b/work常用/python/UV 常用命令.md new file mode 100644 index 0000000..2f9d66a --- /dev/null +++ b/work常用/python/UV 常用命令.md @@ -0,0 +1,31 @@ +## 一、项目相关 + ++ 创建或初始化项目 +```shell +mkdir projectName +cd projectName && uv init --python 指定版本 +``` +目录结构如下 +```text +. +├── .venv +│ ├── bin +│ ├── lib +│ └── pyvenv.cfg +├── .python-version +├── README.md +├── hello.py +├── pyproject.toml +└── uv.lock +``` ++ 初始化虚拟环境,自动创建.venv文件夹 +```shell +uv run main.py +``` ++ 修改python包源,编辑`pyproject.toml`文件,增加如下内容 +```text +[[tool.uv.index]] +name = "private-pypi" +url = "https://mirrors.aliyun.com/pypi/simple/" +default = true +``` diff --git a/work常用/中间件/hertzbeat/1.开发环境搭建(1.7.x版本).md b/work常用/中间件/hertzbeat/1.开发环境搭建(1.7.x版本).md new file mode 100644 index 0000000..818f36c --- /dev/null +++ b/work常用/中间件/hertzbeat/1.开发环境搭建(1.7.x版本).md @@ -0,0 +1,30 @@ +https://hertzbeat.apache.org/zh-cn/docs/community/development +## 一、后端 +1. 安装jdk17 +2. 启动 +![[Pasted image 20250526174733.png]] +3. 打包 + 在项目根目录运行: `mvn clean package -Prelease` + ++ springboot 配置 +![[Pasted image 20250527095510.png]] + +https://arrow.apache.ac.cn/docs/java/install.html +![[Pasted image 20250527095621.png]] +```shell +# 高版本JDK需要加入, +--add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED +``` + +## 二、前端 +1. 依赖安装 +![[Pasted image 20250526175221.png]] +2. 启动 +![[Pasted image 20250526175236.png]] +3. 打包 +![[Pasted image 20250526175250.png]] + + +## 三、采样器 +1. 打包 +![[Pasted image 20250526175431.png]] \ No newline at end of file diff --git a/work常用/中间件/hertzbeat/2.单点改造.md b/work常用/中间件/hertzbeat/2.单点改造.md new file mode 100644 index 0000000..09f7565 --- /dev/null +++ b/work常用/中间件/hertzbeat/2.单点改造.md @@ -0,0 +1,28 @@ +## 一、源码说明 +登陆功能接口:/api/account/auth/form +由 AccountController 控制器的 authGetToken 方法处理 +![[Pasted image 20250527155030.png]] + +实现代码如下: +![[Pasted image 20250527155131.png]] + +处理逻辑: +1. 校验账号,用 sureness.yml 中配置的默认账号进行校验 +2. 校验密码 +3. 获取角色并生成 token 返回 + +*需要熟悉 Sureness 框架 + +## 二、改造方案 + +*重写过滤器并覆盖原有的 Sureness 过滤器 + +1. 新增过滤器 +![[Pasted image 20250530162217.png]] + +2. 新增sureness 配置 +![[Pasted image 20250530162359.png]] +由于原项目引入了自动配置,这里必须注释,不然会有默认的过滤器 +![[Pasted image 20250530162340.png]] +再单独引入sureness +![[Pasted image 20250530162528.png]] diff --git a/work常用/中间件/hertzbeat/3.环境部署.md b/work常用/中间件/hertzbeat/3.环境部署.md new file mode 100644 index 0000000..162e271 --- /dev/null +++ b/work常用/中间件/hertzbeat/3.环境部署.md @@ -0,0 +1,27 @@ +## 一、后端 +1. 打包后上传服务器,并解压 +![[Pasted image 20250530162804.png]] + +2. 在解压后的目录新建java文件夹并放入jdk17 +![[Pasted image 20250530162949.png]] + +3. 修改配置文件,位于解压目录/conf/ +![[Pasted image 20250530163109.png]] + +4. 回到解压路径 /bin 执行startup.sh 启动,观察是否启动成功,如果不成功需要查看日志 +## 二、前端 +1. 打包后放在指定目录并解压 +![[Pasted image 20250530163530.png]] +2. 配置nginx , vim /usr/local/nginx/conf/nginx.conf + +增加如下配置 +![[Pasted image 20250530163611.png]] + +3. 配置权限系统 +![[Pasted image 20250530163747.png]] + +## 三、踩坑 +对于springboot 来说,环境变量值优先级大于配置文件,所以安装前一定要执行`env` 命令查看是否存在如下配置(红色标记) +![[Pasted image 20250530163244.png]] + +如果存在一定要删除,使用`unset` 命令。否则会覆盖application文件中的配置 \ No newline at end of file diff --git a/本机环境/jenv.md b/本机环境/jenv.md new file mode 100644 index 0000000..8b9fd73 --- /dev/null +++ b/本机环境/jenv.md @@ -0,0 +1,23 @@ + ++ 列出所有安装的版本 +```shell +jenv versions +``` + ++ 当前生效的版本 +```shell +jenv version +``` + ++ 添加版本 +```shell +jenv add /path/to/java/home +``` + ++ 版本切换 +```shell +# 全局 +jenv global 1.8 +# 当前目录 +jenv local 11 +``` diff --git a/项目/盛视科技/中山港数据中台.md b/项目/盛视科技/中山港数据中台.md index 348328c..7c97d83 100644 --- a/项目/盛视科技/中山港数据中台.md +++ b/项目/盛视科技/中山港数据中台.md @@ -1,3 +1,4 @@ + http://172.31.51.140:8081/ddh/#/login admin/admin123 禅道:http://172.31.51.246:81/zentao/project-task-91.html