Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

卡在初始化界面 #16

Open
langyajiekou opened this issue Jul 1, 2021 · 3 comments
Open

卡在初始化界面 #16

langyajiekou opened this issue Jul 1, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@langyajiekou
Copy link

登录界面无法登入,纯内网环境搭建好后,机器不可出网,卡在初始化界面,仅看到Pro和下面的Ant Design。

@chennqqi
Copy link
Owner

经验证,你描述的情况没有复现。你打开F12 看下是哪个JS加载失败。7.1那几天CDN是有些干扰,可能会有几个js加载不上。你现在再试试,看看是不是cdn js没加载上。

@chennqqi
Copy link
Owner

问题已经定位了,markdown组件使用了cloudflare的js cdn,如果你当地cloudflare被屏蔽了就打不开了,可以暂时用ReplaceCDN解决,这个BUG后续版本会修复

@chennqqi chennqqi added the bug Something isn't working label Aug 10, 2021
@Phuker
Copy link

Phuker commented Jan 24, 2022

问题已经定位了,markdown组件使用了cloudflare的js cdn,如果你当地cloudflare被屏蔽了就打不开了,可以暂时用ReplaceCDN解决,这个BUG后续版本会修复

不是 Markdown 组件的事,前端使用了 cdn.jsdelivr.net 的 vue.js 等基础的库,在楼主的 纯内网环境 无法加载,则所有功能都无法使用

解决:作者在文档里推荐 ReplaceCDN 浏览器扩展程序,个人认为在纯内网环境搭建给大家用的话不太现实,每个人都装一遍太麻烦。我目前的绕过方法是在 Dockerfile 里魔改编译后的前端文件,这样大部分基础功能都能用了:

FROM sort/godnslog:0.7.0

COPY --chown=app:app cdn /app/dist/cdn

ARG CDN_MIRROR_PATH

RUN echo 'Modify static files ...' && \
sed -i 's#<head>#<head><meta name="referrer" content="same-origin">#g' /app/dist/index.html && \
sed -i "s#<script src=//cdn.jsdelivr.net#<script src=${CDN_MIRROR_PATH}/cdn.jsdelivr.net#g" /app/dist/index.html && \
echo 'Done'

其中 CDN_MIRROR_PATH 的值为 /cdn;顺手增加 <meta name="referrer" content="same-origin"> 标签是为了防止 Referer 信息泄露

cdn 目录建立镜像:

cdn
└── cdn.jsdelivr.net
    └── npm
        ├── [email protected]
        │   └── dist
        │       └── axios.min.js
        ├── [email protected]
        │   └── dist
        │       └── vue-router.min.js
        ├── [email protected]
        │   └── dist
        │       └── vue.min.js
        └── [email protected]
            └── dist
                └── vuex.min.js

建议:不要使用 CDN,或者提供一个选项,可以使用本地静态文件

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants