回退http被Chrome拒绝了?

2020-03-16 作者:

长话短说,今天想试图把wordpress用certbot-nginx直接升到https。

开始一切顺利,站点前台展示基本正常,Chrome继续说“不安全”,理由是图片资源没有走https。登后台发现编辑器无法加载文章,vm上php-fpm的cpu占用时而飙高。

就我这脾气来说,如果是工作项目,一则是测试环境上起码测过一轮再上生产,二则遇山开路逢水搭桥,毕竟靠逻辑吃饭的人。但就这么一块自留地而言,纯赔钱的货,投恁多精力不值当。何况wordpress这种退休返聘的blog engine,再撑几年还得看心情。于是把准备好的vm snapshot做回滚(QA习惯),零风险,服务起来后一切如初(443端口不监听不服务)。

这时候Chrome开始扯淡了,坚持访问443,地址栏强输http就不给过。Safari则没这么轴,指哪打哪。找台别的机器Chrome也没这毛病,所以确定是Chrome本地留了记录,对本站域名(fisherworks.cn)坚持不走80端口。

于是开始找解决方案,什么“https 重定向 http”,结果你们懂的,都是反的,所有博文都是http request强制301到https嘛,这才是大势所趋,何况教程文向来天下一抄。

怎么说呢,尽管是中国人讲普通话,但效率起见,技术搜索用英语搜,通常省钱省时间——关键字“force chrome to open http instead of https”,有效的返回只要一条就够。搜索结果就不截了,点进这个链接,看了顶赞答案621 upvote,心放下一半。

How to stop an automatic redirect from “http://” to “https://” in Chrome

做法很简单,打开 chrome://net-internals/#hsts 找到最底部 Delete domain security policies,输入需要回退http访问的域名,提交一下;出门清理cookie和cache,搞定收工。

对浏览器行家而言,可能分分钟。对我来说,一文钱难倒英雄汉。

这么说吧,stackoverflow,stackexchange,superuser,askubuntu,不要指望这些专业问答站给你任何架构意识,或从零开始搭建服务or提升能力的建议。但术业有专攻,解决这种掐脖子的一文钱问题,可谓无出其右,外科手术式精准打击。

完整阅读本篇»

相册插件的“逆天级服务”| Unbelievable Great Support of Gallery Plugin

2013-09-27 作者:

Sorry, here’s no English version available, however I’m talking about the one-day all-issue-fix support by BestWebSoft – even for a non-pro (free) version of Gallery plugin.

话说once upon a time,本站用的免费版Gallery Plugin因为多日不见“红色の上传小按钮”而黯然神伤,Fisherworks因此遍寻名医却每每“有疾而终”;而此插件却不易随便替换,何故?无它,唯好用尔。

于是不得不忍受每次用多媒体管理器上传,然后挨个操作附加到图库post中,以保持与之前完全统一的相册风格——一旦po错,不得悔改,只能移除重传,这繁琐的操作步骤让该插件颇有鸡肋之感。

前些天,不堪其扰,遂登录wordpress官网,在Gallery Plugin之support forum发帖求助,天可怜见,支持团队两日内即现身力挺(Fisherworks用的可是免费版哦),然而所提方案均为之前试过的,因而问题依然“我思故我在”——并未因“后台老大”来了就有哪怕丝毫收敛;后来support哥祭出必杀技:到我们自己的支持站点,发个私信,把你site的WP管理员和FTP账号show出来吧!

说实话,有点儿担心,当年玩WOW的时候,Blizzard不是说GM从来英雄不问出处……呸呸……从来英雄不问密码么……

不过,话说回来,他们的support ID倒不是假的,而且人家情深意重的花时间在收费版的支持站帮我解决免费版的问题,这是何等的革命共产主义精神!

也罢!于是keep自己的admin和ftp账户,然后去godaddy新建了为临时只用的全权限ftp账号,以及WP admin账号,发出去了……然后就是等啊等……

Guess what? 两小时不到:

  1. Gallery Plugin红色上传小按钮回来了
  2. 相册浏览的lightbox也意外恢复工作了
  3. 就连让我N年痛哭流涕都不工作的post“可视化/文本”编辑器都能来回切换了
  4. (没准儿还有其他fix我还没发现……)

逆天啊!(说的是Gallery Plugin团队的支持速度~~嗯……话说如果是个米国团队,感情人家敬业到以至于凌晨都在线?Fisherworks是不是该考虑入手收费版,聊表心意?)

智捉啊!(说的是Fisherworks的php水平~~嗯……话说Fisherworks要玩什么都是临时抱佛脚,这次终于遇到大坑,趟不过去了么……)

Fisherworks一顿唐僧,算是发泄完了,我们来看看这哥们都给解决了啥问题

Ning,

1) Almost all your WP catalogues had 705 permission. We have already asked you to check the rights for all folders and files.

2) Besides, there was incorrect redirection for .js in the file htaccess and the script couldn’t get loaded on any page. We fixed that.

Sincerely,

Support Team

September 26, 2013 14:04

Ning,

This is the line that caused incorrect interpretation of files: addhandler x-httpd-php5-cgi .php .html .htm .js We removed .js, but we can’t understand why you need to interpret .html .htm. Maybe these extensions should also be removed. Please keep it in mind.

Sincerely,

Support Team

September 26, 2013 14:21

事已至此,Fisherworks竟无语凝噎,啥也不说了,泪奔啊……

要不是人家厚道到把关键功能都放在免费版了(收费版那些额外功能都是必要性不大的),俺真有心像Minecraft和Titanium Backup Pro一样,毕恭毕敬的献上10大刀买个心安理得了——关注后续版本,随时期待收费版新feature!

完整阅读本篇»

让Mingle Forum上传的图像放置在单独的目录 Let Mingle Forum upload images to isolated directories

2013-07-06 作者:

As far as I know, the Mingle Forum is my favorite forum plugin of WP, but its only Cons is that the allowed uploading image size has no restriction.
I was a C programmer, but not touched it for almost 5 years, and yes I never touched PHP so far in my life. so it’s tough for me to add the restriction or resizing feature.
Then I realized that’s also ok if I can let it upload images to an isolated directory, since it could be easy to remove those images by whole directory from posts when the storage space is close to run out. Otherwise, all those images would stay together with Media library of WP posts/pages – quite hard to isolate them and get those stuff cleaned.

So you see, we get that standard WP media lib directory, then check and/or add “mf” sub-directory, and it’s perfectly solved.
Pls check the code enclosed at post bottom, feel free to refer but pls add link to this post; plus, pls let me know if there is any potential bug inside since it’s my 1st time to touch PHP.

PS: 1st time to read WP and PHP standard API manual, it’s “loud and clear”, not hard to learn, and I could even debug this stuff without error report – sure this one is easy and I know that. 🙂

Fisherworks今天一直在纠结使用哪个论坛插件的问题
bbpress在快速研究之下没找到合适的中文语言包
simple forum支持图像附件貌似还要个插件,而且这个论坛看起来比较专业,不是俺想要的

于是锁定了方便好配置的Mingle Forum,虽然默认皮肤集成不是很好,但这插件实在是太方便易用好配置了,而且默认支持图像附件的上传
但问题也跟着来了,它的图像附件是跟WP混在一个目录里上传的,而且不被WP“多媒体”管理
这都不算事儿,最关键的是Mingle Forum不限制图像尺寸(虽然显示时可以自动缩图,不会出错)
这样的话,每个用户都来发个5M的图像,这空间……

完整阅读本篇»