Yukaii / KKBox-web-source

:notes: mp3tag web source script for KKbox
6 stars 2 forks source link

KKBox Developer 上線啦 #3

Open Yukaii opened 6 years ago

Yukaii commented 6 years ago

https://www.facebook.com/InnovationChat/posts/1955875698001396

有機會直接串 API 吧

Yukaii commented 6 years ago

看起來用 AWS Lambda 之類的弄比較清爽

Yukaii commented 6 years ago

聽說 Lambda 每個月一百萬次 request 免費呢,真是便宜 w

實作細節

先從參考強者我朋友的 https://github.com/zetavg/Feedify 開始吧喔耶

然後繼續 typescript 大法好

Yukaii commented 6 years ago

在 #5 進行中

Yukaii commented 6 years ago

還需要:

Yukaii commented 6 years ago

https://docs-zhtw.kkbox.codes/v1.1/reference#search_1

Yukaii commented 6 years ago

這輩子最恨 Legacy code 的時候。

在 cd4f96e workaround JSON 產生的方式,注意分號和逗號後面都需要有空格:

解析失敗:

{"key":"value","key2":"value2"}

解析成功:

{"key": "value", "key2": "value2"}

而且就只有這樣才能過,stringify with indent 也不行,馬的幹!浪費一堆時間

Yukaii commented 6 years ago

大致都搞定了,目前進度卡在自訂網域的設定

Yukaii commented 6 years ago

來還債了,就這樣放了又三週 XDD

自訂網域比預期難搞,因為我又不想全面移轉 route 53,想繼續用 Cloudflare

  1. 先照著這個弄完:http://www.leanx.eu/tutorials/set-up-amazons-api-gateway-custom-domain-with-cloudflare ,拿到 keypair 和 Cloudflare 的 Root CA
  2. 去 AWS Certificate 匯入憑證,https://console.aws.amazon.com/acm/home?region=us-east-1 ,注意要選 us-east-1,Edge domain 才拿得到
  3. 去建好的 API Gateway 建立 Custom domain,照著填一填
  4. 等拿到 cloufront domain 之後去 clouflare 設 cname alias
  5. 等,要四十分鐘 cloudfron 才會跑完
  6. Cloudflare page rules 的 ssl 也要開
Yukaii commented 6 years ago

結果上完 Cloudflare https 之後換 mp3tag 無法連接...

screen shot 2018-03-19 at 10 12 30 am

直接打又正常

image

用 SSLLabs 測試也沒問題

https://www.ssllabs.com/ssltest/analyze.html?d=kkmp3.yukaii.tw

Yukaii commented 6 years ago

先用 lambda 醜醜的網址發佈算了?還是在買一個網域專給 route 53 管...

繼續放置吧