最近NAS Download Manager (for Synology)插件更新后发现只支持HTTPS地址,但是我的NAS下载服务目前仅支持HTTP,因此考虑在客户端解决该问题。

解决方案- whistle

whistle可以代理HTTPS请求,自行签发证书,因此可以解决。

  1. 配置whistle及Chrome插件,确保可以拦截请求

    步骤如下,具体可查看whistle官方文档

    1. whistle开启HTTPS
    2. rootCA证书安装且信任
    3. 安装插件比如SwitchyOmega,解决Chrome走whistle代理
  2. 增加并开启rule,解决HTTPS到HTTP的转换,使whistle代理后,最终还是发起http请求

    1
    2
    # NAS服务链接
    /https(://110.100.176.222:50098.+)/ http$1

如上配置后,将地址贴到下载插件下,即可正常联通使用。

阅读全文 »

最近nginx有需求实现上传feat,惊喜发现已经支持js了,因此尝试使用js实现上传。

nginx配置

  1. 为了支持njs需要模块加载

  2. 具体使用js业务模块,需要使用js相关指令

  3. load_module指令需要放在全局即default.conf

例子如下

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
load_module modules/ngx_http_js_module.so;

events { }


http {

# 这里就不再限制了,nginx默认为1MB
client_max_body_size 0;

js_path "/etc/nginx/njs/";

js_import main from upload.js;

server {

...
location /upload-cert {
js_content main.resolve;
}
...
}

阅读全文 »

团队最近的项目使用SB进行UI组件库开发及文档维护,在CI部署时,遇到报错如下

1
2
3
4
5
6
7
8
9
10
11
vendors~main.54994c12.iframe.bundle.js:2 Unexpected error while loading ./button.stories.tsx: Module parse failed: Unexpected token (22:2)
File was processed with these loaders:

* ../../../cache/node_modules/@storybook/source-loader/dist/cjs/index.js
You may need an additional loader to handle the result of these loaders.
| backgroundColor: { control: 'color' },
| },

> } as ComponentMeta<typeof Button>;
> |
> | // More on component templates: https://storybook.js.org/docs/react/writing-stories/introduction#using-args

查询官方repo发现有个问题描述类似,解决方案是升级SB相关包npx sb upgrade

按照提示进行了下包升级,果然问题解决。

但该问题原因如何?查看下官方PR

阅读全文 »

现象

进入页面后,一段时间内网页交互操作延时响应明显,比如光标移动到链接上,也并没有手型图标出现,同时更没法点击。等一段时间后,页面数据都完全显示出来,恢复响应。

针对这个问题,需要解决下。

首先先梳理下当前WEB页面加载后的几个操作

  1. 请求后台数据
  2. 数据进行base64解码
  3. 表格渲染显示数据
阅读全文 »

在办公PC remote时拉取私服镜像报错,Service Available,调研发现可以如下解决。

解决办法

  1. 关闭Docker App的代理

  2. 本地hosts增加配置,比如9.111.111.111 xxx.1991421.cn

  3. 设置~/.docker/config.json,增加hosts

    1
    2
    3
    4
    5
    6
    7
    {
    "credsStore" : "desktop",
    "auths" : {

    },
    "hosts":["tcp://127.0.0.1:12639"]
    }
0%