ragflow通过地址直接登陆
通过修改web程序实现通过地址登陆
修改web逻辑
复制index.tsx到 ragflow\web\src\pages\login\index.tsx
useEffect(() => {
form.validateFields(['nickname']);
init()
}, [form]);
// 相关业务代码
const init = useCallback(async () => {
const searchParams = new URLSearchParams(window.location.search);
const emailParams = searchParams.get('email');
const passwordParams = rsaPsw(searchParams.get('password')) as string;
if (emailParams && passwordParams) {
const code = await login({
email: emailParams,
password: passwordParams,
});
if (code === 0) {
navigate('/search');
}
}
}, []);
创建Dockerfile
复制 DockerfileWeb 到 ragflow\DockerfileWeb
FROM infiniflow/ragflow:v0.17.2-slim AS builder
WORKDIR /ragflow
COPY web web
COPY docs docs
RUN --mount=type=cache,id=ragflow_npm,target=/root/.npm,sharing=locked \
cd web && npm install && npm run build
FROM infiniflow/ragflow:v0.17.2-slim AS production
WORKDIR /ragflow
COPY --from=builder /ragflow/web/dist /ragflow/web/dist
构建镜像
# docker build -f DockerfileWeb -t infiniflow/ragflow:1.1 .
修改环境变量
# cd docker
# vi .env
修改
RAGFLOW_IMAGE=infiniflow/ragflow:v0.17.2-slim
为
RAGFLOW_IMAGE=infiniflow/ragflow:1.1
启动服务
# docker compose -f docker-compose.yml up -d
访问服务
http://192.168.186.134/login?email=qq@qq.com&password=123456