This commit is contained in:
wenyongda 2025-07-23 17:28:36 +08:00
parent fe95f27dbb
commit f02b6bace7
46 changed files with 322 additions and 41 deletions

View File

@ -122,23 +122,23 @@ git stash list
> id_rsa.pub是公钥 > id_rsa.pub是公钥
5. SourceTree配置 5. SourceTree配置
![image-20250416142637966](http://minio.wenyongdalucky.club:9000/hexo/image-20250416142637966.png) ![image-20250416142637966](D:\source\repos\XiaodaBlogSource\source\_posts\Git\image-20250416142637966.png)
启动 **PuTTY Key Generator** 启动 **PuTTY Key Generator**
6. 依次点击 6. 依次点击
![image-20250416151051085](http://minio.wenyongdalucky.club:9000/hexo/image-20250416151051085.png) ![image-20250416151051085](D:\source\repos\XiaodaBlogSource\source\_posts\Git\image-20250416151051085.png)
7. PPKfile version 选择 2 7. PPKfile version 选择 2
![image-20250416151128595](http://minio.wenyongdalucky.club:9000/hexo/image-20250416151128595.png) ![image-20250416151128595](D:\source\repos\XiaodaBlogSource\source\_posts\Git\image-20250416151128595.png)
8. 选择之前生成的id_rsa 8. 选择之前生成的id_rsa
![image-20250416151307312](http://minio.wenyongdalucky.club:9000/hexo/image-20250416151307312.png) ![image-20250416151307312](D:\source\repos\XiaodaBlogSource\source\_posts\Git\image-20250416151307312.png)
9. 出现如下,选择 **Save private key** 保存秘钥 9. 出现如下,选择 **Save private key** 保存秘钥
![image-20250416151416275](http://minio.wenyongdalucky.club:9000/hexo/image-20250416151416275.png) ![image-20250416151416275](D:\source\repos\XiaodaBlogSource\source\_posts\Git\image-20250416151416275.png)
10. 保存到 ~/.ssh 目录即可 10. 保存到 ~/.ssh 目录即可
![image-20250416151503685](http://minio.wenyongdalucky.club:9000/hexo/image-20250416151503685.png) ![image-20250416151503685](D:\source\repos\XiaodaBlogSource\source\_posts\Git\image-20250416151503685.png)
11. 在 **Sourcetree****工具** -> **选项** 中选择刚刚保存的 ppk文件即可 11. 在 **Sourcetree****工具** -> **选项** 中选择刚刚保存的 ppk文件即可
@ -216,10 +216,10 @@ git config --global https.proxy 'http://127.0.0.1:代理的port'
5. 右侧下拉框 **Generate new token (classic)** 5. 右侧下拉框 **Generate new token (classic)**
6. 按以下配置 6. 按以下配置
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/2ceb11682cc7230cf1220ecb78e548b5.png) ![在这里插入图片描述](D:\source\repos\XiaodaBlogSource\source\_posts\Git\2ceb11682cc7230cf1220ecb78e548b5.png)
7. 得到 token 7. 得到 token
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/76ad4bb4370c7ae798f7b92c25859901.png) ![在这里插入图片描述](D:\source\repos\XiaodaBlogSource\source\_posts\Git\76ad4bb4370c7ae798f7b92c25859901.png)
8. 修改现有项目的url 8. 修改现有项目的url
```shell ```shell

Binary file not shown.

After

Width:  |  Height:  |  Size: 131 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

178
source/_posts/React.md Normal file
View File

@ -0,0 +1,178 @@
---
title: React
date: 2025-07-23 15:56:46
tags:
---
# 父子组件传递事件
## 子组件是模态框确定按钮需要增加loading状态
### **子组件:增加 `confirmLoading` 状态并优化 `handleOk` 方法**
```tsx
import React, { useState } from 'react';
import { Modal, Checkbox, Input, message } from 'antd';
import { useTranslation } from 'react-i18next'
const { TextArea } = Input;
interface FeedbackModalProps {
open: boolean;
onOk: (selectedOption: number | null, feedbackText: string) => Promise<void>;
onCancel: () => void;
}
const FeedbackModal: React.FC<FeedbackModalProps> = ({ open, onOk, onCancel }) => {
const [selectedOption, setSelectedOption] = useState<number | null>(null);
const [feedbackText, setFeedbackText] = useState<string>('');
const { t } = useTranslation()
const [confirmLoading, setConfirmLoading] = useState(false);
const handleOk = async () => {
if (!feedbackText) {
message.warning('请填写反馈建议');
return;
}
setConfirmLoading(true)
try {
await onOk(selectedOption, feedbackText);
} finally {
setConfirmLoading(false)
}
};
return (
<Modal
title="反馈"
open={open}
onOk={handleOk}
onCancel={onCancel}
okText={`${t('common.operation.confirm')}`}
cancelText={`${t('common.operation.cancel')}`}
confirmLoading={confirmLoading}
>
{/* <div>
<Checkbox
checked={selectedOption === 0}
onChange={() => setSelectedOption(0)}
>
新增
</Checkbox>
<Checkbox
checked={selectedOption === 1}
onChange={() => setSelectedOption(1)}
>
修改
</Checkbox>
</div> */}
<TextArea
rows={4}
placeholder="请输入您的反馈建议"
value={feedbackText}
onChange={(e) => setFeedbackText(e.target.value)}
/>
</Modal>
);
};
export default FeedbackModal;
```
### **父组件:确保 `handleFeedbackSubmit` 返回 Promise**
```tsx
const handleFeedbackSubmit = useCallback(
async (selectedOption: number | null, feedbackText: string) => {
console.log(currentMessageId);
console.log(currentFeedback);
try {
// 构造请求参数
const requestBody = {
operationType: currentFeedback!.rating, // 0 或 1
feedbackText, // 用户反馈建议
conversationId: currentConversationId, // 会话 ID
messageId: currentMessageId, // 消息 ID
username: getCookieValue('username'), // 用户名
};
// 调用 Java 接口
const javaResponse = await fetch(
`/dev-api/api/conversation/feedback`,
{
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(requestBody),
}
);
// 调用原有的 updateFeedback 函数
await updateFeedback(
{
url: `/messages/${currentMessageId}/feedbacks`,
body: { rating: currentFeedback!.rating },
},
// isInstalledApp,
// appId
);
// 显示成功通知
notify({ type: "success", message: t("common.api.success") });
if (resolveFeedback) {
resolveFeedback(true); // 用户取消了反馈
setResolveFeedback(null);
}
// 关闭对话框
setIsFeedbackModalVisible(false);
} catch (error) {
console.error("Error:", error);
notify({ type: "error", message: t("common.api.failed") });
} finally {
setIsSubmittingNow(false);
}
},
[
currentMessageId,
currentFeedback,
currentConversationId,
isInstalledApp,
appId,
notify,
t,
]
);
```
父组件调用子组件部分
```tsx
<FeedbackModal
open={isFeedbackModalVisible}
onOk={handleFeedbackSubmit}
onCancel={() => {
if (resolveFeedback) {
resolveFeedback(false); // 用户取消了反馈
setResolveFeedback(null);
}
setIsFeedbackModalVisible(false)
}}
/>
```
### **关键点说明**
1. **子组件内部管理加载状态**
通过 `useState` 创建 `isLoading` 状态,并在 `handleOk` 中控制其值。点击按钮时,`isLoading` 变为 `true`,请求结束后变为 `false`
2. **`okButtonProps` 绑定加载状态**
Ant Design 的 `Modal` 组件支持通过 `okButtonProps` 自定义按钮属性,这里将 `loading` 绑定到 `isLoading` 状态。
3. **`onOk` 作为异步函数传递**
父组件的 `handleFeedbackSubmit``async` 函数,返回 Promise。子组件通过 `await onOk()` 确保加载状态在请求结束后更新。
4. **错误处理不影响加载状态**
使用 `try...finally` 确保无论请求成功或失败,`isLoading` 都会被重置。

View File

@ -46,7 +46,7 @@ top_img: https://gcore.jsdelivr.net/gh/volantis-x/cdn-wallpaper/abstract/B951AE1
## 设置引用图片存储路径 ## 设置引用图片存储路径
![image-20221118150139161](http://markdownhexo.oss-cn-hangzhou.aliyuncs.com/img/image-20221118150139161.png) ![image-20221118150139161](D:\source\repos\XiaodaBlogSource\source\_posts\Typora\image-20221118150139161.png)
## Typora添加右键新建Markdown文件 ## Typora添加右键新建Markdown文件
@ -98,7 +98,7 @@ Windows Registry Editor Version 5.00
删除多余的文件尤其是有一个什么Markdown File只保留如下的两项。然后关闭注册表即可修复bug 删除多余的文件尤其是有一个什么Markdown File只保留如下的两项。然后关闭注册表即可修复bug
![img](http://markdownhexo.oss-cn-hangzhou.aliyuncs.com/img/img) ![img](D:\source\repos\XiaodaBlogSource\source\_posts\Typora\regedit.png)
@ -125,9 +125,9 @@ Windows Registry Editor Version 5.00
``` ```
![image-20221121130426162](https://markdownhexo.oss-cn-hangzhou.aliyuncs.com/img/image-20221121130426162.png) ![image-20221121130426162](D:\source\repos\XiaodaBlogSource\source\_posts\Typora\image-20221121130426162.png)
![image-20221121130857072](https://markdownhexo.oss-cn-hangzhou.aliyuncs.com/img/image-20221121130857072.png) ![image-20221121130857072](D:\source\repos\XiaodaBlogSource\source\_posts\Typora\image-20221121130857072.png)
## 上传图片至Minio ## 上传图片至Minio
@ -191,7 +191,7 @@ picgo upload /path/to/your/image.png
### Typora设置 ### Typora设置
![image-20250416154513069](http://minio.wenyongdalucky.club:9000/hexo/image-20250416154513069.png) ![image-20250416154513069](D:\source\repos\XiaodaBlogSource\source\_posts\Typora\image-20250416154513069.png)
## 主题 ## 主题

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 147 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -10,106 +10,106 @@ tags:
默认选中「Try or Install Ubuntu Server」安装选项回车或等待 30 秒后),等待系统镜像自检并进行安装初始化。 默认选中「Try or Install Ubuntu Server」安装选项回车或等待 30 秒后),等待系统镜像自检并进行安装初始化。
![image-20250509094634889](http://minio.wenyongdalucky.club:9000/hexo/image-20250509094634889.png) ![image-20250509094634889](https://rustfs.wenyongdalucky.club:443/hexo/image-20250509094634889.png)
### 选择语言English ### 选择语言English
![image-20250509100201646](http://minio.wenyongdalucky.club:9000/hexo/image-20250509100201646.png) ![image-20250509100201646](D:\source\repos\XiaodaBlogSource\source\_posts\ubuntu\image-20250509100201646.png)
### 键盘默认English ### 键盘默认English
![image-20250509100212670](http://minio.wenyongdalucky.club:9000/hexo/image-20250509100212670.png) ![image-20250509100212670](D:\source\repos\XiaodaBlogSource\source\_posts\ubuntu\image-20250509100212670.png)
### 安装类型Ubuntu Server ### 安装类型Ubuntu Server
选择默认第一个(会自带一些组件,方便使用) 选择默认第一个(会自带一些组件,方便使用)
![image-20250509100247973](http://minio.wenyongdalucky.club:9000/hexo/image-20250509100247973.png) ![image-20250509100247973](D:\source\repos\XiaodaBlogSource\source\_posts\ubuntu\image-20250509100247973.png)
### 网络配置 ### 网络配置
使用 DHCP 或者 静态IP (建议这里设置好 静态IP如果选择 DHCP则在此界面直接选择Done 后即可) 使用 DHCP 或者 静态IP (建议这里设置好 静态IP如果选择 DHCP则在此界面直接选择Done 后即可)
![image-20250509100604701](http://minio.wenyongdalucky.club:9000/hexo/image-20250509100604701.png) ![image-20250509100604701](D:\source\repos\XiaodaBlogSource\source\_posts\ubuntu\image-20250509100604701.png)
静态IP 选择 Edit IPv4 静态IP 选择 Edit IPv4
![image-20250509100656239](http://minio.wenyongdalucky.club:9000/hexo/image-20250509100656239.png) ![image-20250509100656239](D:\source\repos\XiaodaBlogSource\source\_posts\ubuntu\image-20250509100656239.png)
然后选择 Manual 然后选择 Manual
![image-20250509100804038](http://minio.wenyongdalucky.club:9000/hexo/image-20250509100804038.png) ![image-20250509100804038](D:\source\repos\XiaodaBlogSource\source\_posts\ubuntu\image-20250509100804038.png)
![image-20250509102609874](http://minio.wenyongdalucky.club:9000/hexo/image-20250509102609874.png) ![image-20250509102609874](D:\source\repos\XiaodaBlogSource\source\_posts\ubuntu\image-20250509102609874.png)
### 代理配置 ### 代理配置
**Configure proxy配置页面的Proxy address无需配置** **Configure proxy配置页面的Proxy address无需配置**
![image-20250509102734539](http://minio.wenyongdalucky.club:9000/hexo/image-20250509102734539.png) ![image-20250509102734539](D:\source\repos\XiaodaBlogSource\source\_posts\ubuntu\image-20250509102734539.png)
### 镜像源配置 ### 镜像源配置
默认清华源 默认清华源
![image-20250509102858753](http://minio.wenyongdalucky.club:9000/hexo/image-20250509102858753.png) ![image-20250509102858753](D:\source\repos\XiaodaBlogSource\source\_posts\ubuntu\image-20250509102858753.png)
### 安装磁盘配置 ### 安装磁盘配置
**选择安装磁盘,直接回车默认自动分配,需要手动分区的话选择 [custom storage layout]** **选择安装磁盘,直接回车默认自动分配,需要手动分区的话选择 [custom storage layout]**
![image-20250509111350269](http://minio.wenyongdalucky.club:9000/hexo/image-20250509111350269.png) ![image-20250509111350269](D:\source\repos\XiaodaBlogSource\source\_posts\ubuntu\image-20250509111350269.png)
选择 **custom storage layout** 选择 **custom storage layout**
![image-20250509112338500](http://minio.wenyongdalucky.club:9000/hexo/image-20250509112338500.png) ![image-20250509112338500](D:\source\repos\XiaodaBlogSource\source\_posts\ubuntu\image-20250509112338500.png)
![image-20250509112354306](http://minio.wenyongdalucky.club:9000/hexo/image-20250509112354306.png) ![image-20250509112354306](D:\source\repos\XiaodaBlogSource\source\_posts\ubuntu\image-20250509112354306.png)
首先分配swap分区一般基于物理内存的 2-4倍 首先分配swap分区一般基于物理内存的 2-4倍
![image-20250509112453286](http://minio.wenyongdalucky.club:9000/hexo/image-20250509112453286.png) ![image-20250509112453286](D:\source\repos\XiaodaBlogSource\source\_posts\ubuntu\image-20250509112453286.png)
/boot 分区一般2G足以 /boot 分区一般2G足以
/ 根分区,分配剩余空间 / 根分区,分配剩余空间
![image-20250509112822681](http://minio.wenyongdalucky.club:9000/hexo/image-20250509112822681.png) ![image-20250509112822681](https://rustfs.wenyongdalucky.club:443/hexo/image-20250509112822681.png)
### 设置计算机名及用户名 ### 设置计算机名及用户名
![image-20250509113002925](http://minio.wenyongdalucky.club:9000/hexo/image-20250509113002925.png) ![image-20250509113002925](https://rustfs.wenyongdalucky.club:443/hexo/image-20250509113002925.png)
### 是否升级 Ubuntu Pro ### 是否升级 Ubuntu Pro
直接默认跳过即可 直接默认跳过即可
![image-20250509121748189](http://minio.wenyongdalucky.club:9000/hexo/image-20250509121748189.png) ![image-20250509121748189](https://rustfs.wenyongdalucky.club:443/hexo/image-20250509121748189.png)
### 安装 OpenSSH 服务 ### 安装 OpenSSH 服务
![image-20250509121806128](http://minio.wenyongdalucky.club:9000/hexo/image-20250509121806128.png) ![image-20250509121806128](D:\source\repos\XiaodaBlogSource\source\_posts\ubuntu\image-20250509121806128.png)
### 选择预置环境 ### 选择预置环境
按需选取,不需要则直接选择 Done 回车继续 按需选取,不需要则直接选择 Done 回车继续
![image-20250509121923077](http://minio.wenyongdalucky.club:9000/hexo/image-20250509121923077.png) ![image-20250509121923077](D:\source\repos\XiaodaBlogSource\source\_posts\ubuntu\image-20250509121923077.png)
安装系统中 安装系统中
![image-20250509122057921](http://minio.wenyongdalucky.club:9000/hexo/image-20250509122057921.png) ![image-20250509122057921](D:\source\repos\XiaodaBlogSource\source\_posts\ubuntu\image-20250509122057921.png)
安装完成后重启即可 安装完成后重启即可
![image-20250509122413007](http://minio.wenyongdalucky.club:9000/hexo/image-20250509122413007.png) ![image-20250509122413007](D:\source\repos\XiaodaBlogSource\source\_posts\ubuntu\image-20250509122413007.png)
重启完成,进入系统 重启完成,进入系统
![image-20250509123500684](http://minio.wenyongdalucky.club:9000/hexo/image-20250509123500684.png) ![image-20250509123500684](D:\source\repos\XiaodaBlogSource\source\_posts\ubuntu\image-20250509123500684.png)
## 配置网络 ## 配置网络
![image-20250509124052044](http://minio.wenyongdalucky.club:9000/hexo/image-20250509124052044.png) ![image-20250509124052044](D:\source\repos\XiaodaBlogSource\source\_posts\ubuntu\image-20250509124052044.png)
```shell ```shell
cd /etc/netplan cd /etc/netplan
@ -130,17 +130,17 @@ network:
在VirtualBox中工具->网络中 增加仅主机(Host-Only)网络 在VirtualBox中工具->网络中 增加仅主机(Host-Only)网络
![image-20250509124733922](http://minio.wenyongdalucky.club:9000/hexo/image-20250509124733922.png) ![image-20250509124733922](D:\source\repos\XiaodaBlogSource\source\_posts\ubuntu\image-20250509124733922.png)
网卡如果要是DHCP就选自动配置网卡否则手动分配就选手动配置网卡 网卡如果要是DHCP就选自动配置网卡否则手动分配就选手动配置网卡
如果选DHCP还需要启动服务器 如果选DHCP还需要启动服务器
![image-20250509124838460](http://minio.wenyongdalucky.club:9000/hexo/image-20250509124838460.png) ![image-20250509124838460](D:\source\repos\XiaodaBlogSource\source\_posts\ubuntu\image-20250509124838460.png)
配置好后,在对应虚拟机中,添加好网卡,连接方式选择仅主机(Host-Only)网络,名称选择刚刚在工具中配置的 配置好后,在对应虚拟机中,添加好网卡,连接方式选择仅主机(Host-Only)网络,名称选择刚刚在工具中配置的
![image-20250509125003457](http://minio.wenyongdalucky.club:9000/hexo/image-20250509125003457.png) ![image-20250509125003457](D:\source\repos\XiaodaBlogSource\source\_posts\ubuntu\image-20250509125003457.png)
以上修改需要先重启虚拟机 以上修改需要先重启虚拟机
@ -173,7 +173,7 @@ sudo netplan apply
若不报错,则修改成功,再执行`ip a`查看网卡信息 若不报错,则修改成功,再执行`ip a`查看网卡信息
![image-20250509125542444](http://minio.wenyongdalucky.club:9000/hexo/image-20250509125542444.png) ![image-20250509125542444](D:\source\repos\XiaodaBlogSource\source\_posts\ubuntu\image-20250509125542444.png)
ip地址已经生效可以在主机里 ping 一下 ip地址已经生效可以在主机里 ping 一下
@ -388,6 +388,22 @@ sudo service slim start
通过按**F1**在GUI之间切换。该界面将在会话或GUI之间切换。切换到所选的GUI后登录。 通过按**F1**在GUI之间切换。该界面将在会话或GUI之间切换。切换到所选的GUI后登录。
### 关闭与打开GUI
#### 关闭
```shell
sudo systemctl set-default multi-user.target
sudo reboot
```
#### 打开
```shell
sudo systemctl set-default graphical.target
sudo reboot
```
## 远程桌面配置 ## 远程桌面配置
### RDP ### RDP
@ -442,7 +458,7 @@ systemctl status xrdp
sudo ufw allow from any to any port 3389 proto tcp sudo ufw allow from any to any port 3389 proto tcp
``` ```
![image-20250721085911086](D:\source\repos\XiaodaBlogSource\source\_posts\ubuntu\image-20250721085911086.png) ![image-20250721085911086](D:\source\repos\XiaodaBlogSource\source\_posts\ubuntu\image-20250721085911086-1753248149581-28.png)
**接下来**,查看你的 Ubuntu 系统的 IP 地址,并在某处记下它。在您的终端上运行: **接下来**,查看你的 Ubuntu 系统的 IP 地址,并在某处记下它。在您的终端上运行:

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

Before

Width:  |  Height:  |  Size: 129 KiB

After

Width:  |  Height:  |  Size: 129 KiB

View File

@ -0,0 +1,87 @@
---
title: 对象存储
date: 2025-07-23 14:27:11
tags:
---
# RustFS
## 安装
### Docker
新建rustfs目录
```shell
mkdir ~/rustfs
cd ~/rustfs
```
编辑docker-compose.yml文件
```shell
vim docker-compose.yml
```
新增以下内容
```yaml
services:
rustfs:
image: 'rustfs/rustfs:latest'
container_name: 'rustfs'
restart: always
environment:
- 'TZ:Asia/Shanghai'
- 'RUSTFS_ACCESS_KEY=rustfsadmin'
- 'RUSTFS_SECRET_KEY=rustfsadmin'
- 'RUSTFS_CONSOLE_ENABLE=true'
- 'RUSTFS_TLS_PATH=/certs'
ports:
- '9000:9000'
volumes:
- /etc/localtime:/etc/localtime:ro
- /mnt/rustfs/data:/data
- /usr/ssl:/certs
command:
- "rustfs"
- "--console-enable"
- "--server-domains"
- "rustfs.wenyongdalucky.club"
```
:wq保存后退出
建立数据挂载目录
```shell
sudo mkdir -p /mnt/rustfs/data
```
`~/rustfs` 目录下使用Docker Compose启动容器
```shell
docker compose up -d
```
查看日志
```shell
docker logs rustfs -f
```
使用密钥登录的方式,输入账号、密钥
这里查看之前 docker-compose.yml文件中的 RUSTFS_ACCESS_KEY、RUSTFS_SECRET_KEY 进行登录即可。
这里就都输入 rustfsadmin登录
进入到控制台
创建存储桶 hexo
![image-20250723145626454](https://rustfs.wenyongdalucky.club:443/hexo/image-20250723145626454.png)
需将桶配置中的访问策略改为 公有防止无法通过Markdown访问
![image-20250723145728392](https://rustfs.wenyongdalucky.club:443/hexo/image-20250723145728392.png)