Composer 出現 lock file out of date 的解法

之前也有遇到,結果 Lorna Jane Mitchell 寫了一篇「Handling Composer "lock file out of date" Warning」給了不少解法。

第一種是 composer upgrade,直接全部升級。

第二種是先用 composer update --dry-run 看看是不是有人加到 composer.json 後忘記更新,如果是的話再用 composer update [package] 處理。

第三種是用 composer update nothing 閉上眼睛更新 hash 值,當作什麼都沒看到 XDDD

Sometimes this is the right answer so it's a handy trick to know!. I seem to see these kinds of issues in people's projects quite often (I'm a consultant, I see a lot of projects) so I thought I'd share my usual tactics for getting things sorted - if you have any tricks of your own to share, I'd love to hear them :)

該說很「實用」嗎 XDDD

D-Link 的 open source package 內包含了拿來簽名用的 Private Key

D-LinkDCS-5020L 的 open source package (因 GPL 要求) 裡放了簽名用的 private key:「D-Link spilled its private key onto the web – letting malware dress up as Windows apps」。

而這把 key 由 Verisign 所簽,因此被 Windows 所信任,所以這把 key 可以用來簽 malware:

而不幸的是,這把 key 已經洩漏出來超過半年了:

The D-Link key was leaked in late February, and expired on September 3, it appears.

又是一連串的 revoke 過程... orz

Composer 的版本選擇方式

Composer 是目前 PHP 世界裡比較紅的套件管理工具,內建了一些 autoload 模組,以及 Packagist 這個巨大的 ecosystem。

在「Installing Composer Packages」這篇文章裡提到要如何在 Composer 裡指定套件的版本。在這之前,你需要先知道什麼是 Semantic Versioning,然後再來看作者的論述。

直接講結論,文章裡推薦用 ~ 的方式指定版本,這通常會是你要的結果:用 ~1.2 表示 >=1.2.0,<2.0.0;而用 ~1.2.3 則可以表示 >=1.2.3, <1.3

在對付 compatibility 問題時還蠻常見的情況。

OpenBSD 要支援 signed package 了...

Slashdot 上看到 OpenBSD 要支援 signed package 的消息:「OpenBSD Moving Towards Signed Packages — Based On D. J. Bernstein Crypto」。

使用的演算法是 djbEd25519,是基於橢圓曲線密碼系統的演算法。演算法名稱取自 2255-19 這個參數。

[ed25519] 23pp. (PDF) Daniel J. Bernstein, Niels Duif, Tanja Lange, Peter Schwabe, Bo-Yin Yang. High-speed high-security signatures. Journal of Cryptographic Engineering 2 (2012), 77–89. Document ID: a1a62a2f76d23f65d622484ddd09caf8. URL: http://cr.yp.to/papers.html#ed25519. Date: 2011.09.26.

意外發現魯教授的名字出現在列表上...