A regular BIOS update turned into a pain in the a**

Just found out that my 3-year-old Intel NUC8 has got a new BIOS release 0090 recently. I downloaded and upgraded it without think twice (which is going to waste some of my time later.)

I have two OS installed and dual boot configured on the hard drive. Windows 10 alongside with Ubuntu Desktop. By default, it will boot into GRUB menu by default, where I can choose whether or not to boot into Windows.

I have done BIOS update for this NUC several times before. But this time, after the new BIOS update, the machine boot directly into Windows without showing the GRUB menu. I tried to hit F10 on-boot to bring up the Boot selection menu to choose another EFI boot-loader — but something weird is: There is only one “Windows Boot Manager” up there, the “ubuntu” boot entry is missing.

Continue reading A regular BIOS update turned into a pain in the a**

Issues when trying to get Let’s Encrypt certificate signed for a website behind Cloudflare CDN.

[ 浏览本文的中文版. ]

Recently I enabled Cloudflare CDN for a website. At the beginning, everything went fine. Until there is one day, I was trying to renew the Let’s Encrypt certificate for the domain by using the acme_tiny.py program, which I always use. However, this time it fails again and again, on the error: cannot download http://****/.well-known/acme-challenge/**** .

In short, before issuer (Let’s Encrypt) signs the certificate, this program will generate a challenge file in a specified path under the domain. Then issuer will try to fetch the challenge file, to make sure the requester is the real owner of the domain.

I tried use wget to download the challenge file, and got a 404 error. By break down the wget output, I found that, when request the challenge file via http, the request was redirected to https, that is the cause of the error. Because the origin server only have acme-challenge configured on port 80, so when you trying to access it from https the only thing you will get is the 404 error.

Because I always use the program to renew certificates, so this time I wonder if it is the CDN caused the error.

In addition, one thing makes me feel weird is, the origin server not have https rewrite configured for the acme-challenge path, so why the http request is being redirected to https automatically? After some digging around, trying to adjust some Cloudflare options, finally, I found out: the option “Always Use HTTPS” (under the SSL/TLS –> Edge Certificates section) is the root cause of this error. With this option turned on will redirect all http requests to https automatically. That is why the http request to fetch acme-challenge file got redirected to https.

After turned off this option, the acme_tiny.py program worked flawlessly like before and I got the Let’s Encrypt certificate renewed successfully.

Conclusion for this time, when have CDN enabled for a website; the configurations of the CDN might cause some unexpected issues to happen, like this time. When the origin server is not the cause of the problem, should turn to investigating CDN’s configurations, to figure out whether the CDN is the causing the problem.

Cloudflare option under SSL/TLS -> Edge Certificates: always use HTTPS.

在使用 Cloudflare 的网站上,签发 Let’s Encrypt 证书的问题

[ Browse English version of this post. ]

最近对一个网站启用了Cloudflare CDN之后,起初一切顺利,不过在某天准备使用以往一直使用的 acme_tiny.py 进行Let’s Encrypt证书续签的时候出错。之前没有使用CDN的时候,一直是定期使用这个程序进行证书签发,然而这回却失败了,尝试数次均卡在 cannot download http://****/.well-known/acme-challenge/**** . 这个错误上。

简而言之就是,在证书签发之前,这个程序会在待签发的域名下的一个指定路径,临时生成一个challenge文件,然后签发方(Let’s Encrypt)尝试下载这个文件,用于验证请求者是否是域名所有人。

尝试直接用 wget 下载这个文件,最后是404错误。看了详细经过可以发现,在尝试通过http方式下载challenge文件的时候,被直接重定向到了https,因此产生了问题。由于源服务器仅在80端口配置了acme-challenge,所以当从https访问的时候就得到了404错误。

因为之前一直是OK的,所以这次想会不会是CDN的原因造成了这个错误。

而且源服务器端并未在这个acme-challenge路径上配置https rewrite,那么究竟是为什么访问会被自动重定向到https呢?经过一番调查,尝试了Cloudflare中的数个选项,发现原来是 SSL/TLS –> Edge Certificates下面的 “Always Use HTTPS”这个选项的关系。当打开了这个后,会直接重定向全部http请求到https。这就是为什么会造成acme-challenge被重定向的原因。

当关闭了这个选项后,通过acme_tiny.py签发Let’s Encrypt证书便可如同往常一样正常进行。

这回的总结就是,当网站使用了CDN之后,可能会因为CDN配置的关系,导致一些意想不到的问题发生。当源服务器配置并不是造成问题的原因后,就应转向调查CDN的配置是否是造成问题的原因。

SSL/TLS -> Edge Certificates: always use HTTPS.

File System directory of Chrome browser took a lot of disk space

When I was cleaning up my computer’s disk space, I noticed that the Chrome directory under AppData\Local\Google took almost 10 GB spaces, especially the directory File System, which is using 7.87 GB of disk space. In the File System directory, one largest directory used most of the space named 017. In this directory there are 9 very large files in it, each one is around 900 MB, and all of them were created on last November.

The “File System” directory used 7.87 GB of disk space.

After googling around, I found this article is useful:

https://www.ghacks.net/2015/06/24/hard-drive-filling-up-check-chromes-file-system-folder/

Quote: “Chrome (and Chromium) use the folder to store files stored with the help of the File System API which is part of HTML5.”

So, it looks like some web service were using File System API stored these data on the disk. But I can’t remember which website I used could take up almost 8 GB data on my disk.

Only thing I can do now is to delete these files, and monitor the File System directory frequently to see if there is any unusual amount of space used by this directory.