diff --git a/content/post/ubuntu-letsencrypt-cloudflare-wildcard.md b/content/post/ubuntu-letsencrypt-cloudflare-wildcard.md new file mode 100644 index 00000000..5303de53 --- /dev/null +++ b/content/post/ubuntu-letsencrypt-cloudflare-wildcard.md @@ -0,0 +1,181 @@ +--- +title: "[筆記] 在 ubuntu 20.04 底下,用certbot 透過Cloudflare 申請全域的 Letsencrypt 憑證" +date: 2020-09-02T15:55:40+08:00 +draft: false +noSummary: false +categories: ['筆記'] +image: https://h.cowbay.org/images/post-default-4.jpg +tags: ['certbot','Cloudflare','Letsencrypt'] +author: "Eric Chang" +keywords: + - certbot + - Cloudflare + - Letsencrypt +--- + +之前用caddy 作為反向代理,其中一個優勢就是caddy 會自動處理Letsencrypt 憑證的問題 + +也不用煩惱怎麼去更新一堆有的沒的 + +不過,實際應用上,還是偶爾會拿這些憑證檔案來用的狀況 + +雖然可以從caddy 上面取得這些檔案 + +但是基本上這些檔案都是綁定一個特定的hostname + +可是我想要有一個憑證,可以給同網域底下的機器用 ( Wildcard certificates ) + + + +要申請Wildcard certificates ,必須要採用 DNS 驗證的方式 + +一般手動操作的步驟,會先產生一組亂數字串,然後更新 DNS 上面去 + +如果要改成自動化,要多一些步驟 + +### 安裝 certbot 及 Cloudflare 外掛 + +首先,先來安裝會用到的套件 + +``` +sudo apt install certbot letsencrypt python3-certbot-dns-cloudflare +``` + +### 設定 cloudflare API + +這個步驟我測了好久,網路上的說明似乎都過期了,造成cloudflare API 那邊會發生錯誤 + +先登入 cloudflare 管理界面的API token 設定 + +https://dash.cloudflare.com/profile/api-tokens + +建立一組token + +內容如下 + +!['cloudflare API']('https://i.imgur.com/3dZN6qC.png') + +在權限設定的地方,選擇三個項目 + +zone-zone settings-edit +zone-zone-edit +zone-DNS-edit + +在下一個 zone resources 選擇 include-All zones + +存檔後會產生一組 API token ,接著就是用這組 token 來做DNS更新 + +### 編輯 cloudflare 設定檔 + +在 /etc底下新增一個 cloudflare.ini + +內容如下 + +``` +sudo vim /etc/cloudflare.ini + +dns_cloudflare_email = #email@address.here +dns_cloudflare_api_key = #API token here +``` + +存檔後離開,然後改一下權限,不然等一下certbot 會跳警告 + +``` +sudo chmod 0600 /etc/cloudflare.ini +``` + +### 執行certbot 取得憑證 + +執行以下的指令 +``` +sudo certbot certonly --dns-cloudflare --dns-cloudflare-credentials /etc/cloudflare.ini --preferred-challenges=dns --email admin@abc.com --server https://acme-v02.api.letsencrypt.org/directory --agree-tos -d abc.com -d *.abc.com +``` + + + +正常的話,會是這樣的結果 + +``` +sudo certbot certonly --dns-cloudflare --dns-cloudflare-credentials /etc/cloudflare.ini --preferred-challenges=dns --email admin@abc.com --server https://acme-v02.api.letsencrypt.org/directory --agree-tos -d abc.com -d *.abc.com + +Saving debug log to /var/log/letsencrypt/letsencrypt.log +Plugins selected: Authenticator dns-cloudflare, Installer None +Obtaining a new certificate +Performing the following challenges: +dns-01 challenge for abc.com +dns-01 challenge for abc.com +Waiting 10 seconds for DNS changes to propagate +Waiting for verification... +Cleaning up challenges + +IMPORTANT NOTES: + - Congratulations! Your certificate and chain have been saved at: + /etc/letsencrypt/live/abc.com/fullchain.pem + Your key file has been saved at: + /etc/letsencrypt/live/abc.com/privkey.pem + Your cert will expire on 2020-12-01. To obtain a new or tweaked + version of this certificate in the future, simply run certbot + again. To non-interactively renew *all* of your certificates, run + "certbot renew" + - If you like Certbot, please consider supporting our work by: + + Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate + Donating to EFF: https://eff.org/donate-le + +``` + +這樣子就取得了全域通用的SSL 憑證檔案 + +如果看到底下這種錯誤 + +``` +administrator@ubuntu:~$ sudo certbot certonly --dns-cloudflare --dns-cloudflare-credentials /etc/cloudflare.ini --preferred-challenges=dns --email admin@abc.com --server https://acme-v02.api.letsencrypt.org/directory --agree-tos -d abc.com -d *.abc.com +Saving debug log to /var/log/letsencrypt/letsencrypt.log +Plugins selected: Authenticator dns-cloudflare, Installer None +Obtaining a new certificate +Performing the following challenges: +dns-01 challenge for abc.com +dns-01 challenge for abc.com +Cleaning up challenges +Error determining zone_id: 6003 Invalid request headers. Please confirm that you have supplied valid Cloudflare API credentials. (Did you copy your entire API key?) +``` + +那就是cloudflare API 那邊的權限設定錯了,我就是在這邊卡很久... + +請參照上面的步驟和圖片正確的設定 + +可以用 certbot certificates 來驗證看看 + +``` +administrator@ubuntu:~$ sudo certbot certificates +Saving debug log to /var/log/letsencrypt/letsencrypt.log + +- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Found the following certs: + Certificate Name: abc.com + Domains: abc.com *.abc.com + Expiry Date: 2020-12-01 05:31:31+00:00 (VALID: 89 days) + Certificate Path: /etc/letsencrypt/live/abc.com/fullchain.pem + Private Key Path: /etc/letsencrypt/live/abc.com/privkey.pem +- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +``` + +之後就可以用 + +``` +sudo certbot renew +``` + +來更新憑證 + +寫到/etc/crontab 去排程每個月的1號自動更新 + +``` +administrator@ubuntu:~$ echo "* * 1 * * root /usr/bin/certbot renew" |sudo tee -a /etc/crontab +* * 1 * * root /usr/bin/certbot renew +administrator@ubuntu:~$ +``` + +接下來就等三個月之後,檢查看看憑證是否有自動更新了! + + diff --git a/public/about/index.html b/public/about/index.html index e106ba87..0a0df940 100644 --- a/public/about/index.html +++ b/public/about/index.html @@ -45,9 +45,9 @@ - + - + @@ -603,7 +603,7 @@ title="pinterest icon"> - + diff --git a/public/categories/ansible/index.html b/public/categories/ansible/index.html index 4176343a..897fb1b8 100644 --- a/public/categories/ansible/index.html +++ b/public/categories/ansible/index.html @@ -45,9 +45,9 @@ - + - + @@ -608,6 +608,6 @@ if (!doNotTrack) { - + diff --git a/public/categories/index.xml b/public/categories/index.xml index 5b9918b0..bc8ca3f7 100644 --- a/public/categories/index.xml +++ b/public/categories/index.xml @@ -6,7 +6,7 @@ Recent content in Categories on MC部落 Hugo -- gohugo.io en-us - Thu, 13 Aug 2020 14:22:05 +0800 + Wed, 02 Sep 2020 15:55:40 +0800 @@ -14,7 +14,7 @@ 筆記 https://h.cowbay.org/categories/%E7%AD%86%E8%A8%98/ - Thu, 13 Aug 2020 14:22:05 +0800 + Wed, 02 Sep 2020 15:55:40 +0800 https://h.cowbay.org/categories/%E7%AD%86%E8%A8%98/ diff --git a/public/categories/linux/index.html b/public/categories/linux/index.html index bbefca98..f87312b3 100644 --- a/public/categories/linux/index.html +++ b/public/categories/linux/index.html @@ -45,9 +45,9 @@ - + - + @@ -483,6 +483,6 @@ if (!doNotTrack) { - + diff --git a/public/categories/proxmox/index.html b/public/categories/proxmox/index.html index 44d9c67b..03f2215a 100644 --- a/public/categories/proxmox/index.html +++ b/public/categories/proxmox/index.html @@ -45,9 +45,9 @@ - + - + @@ -487,6 +487,6 @@ if (!doNotTrack) { - + diff --git a/public/categories/ps/index.html b/public/categories/ps/index.html index f8b1633d..a2c10a75 100644 --- a/public/categories/ps/index.html +++ b/public/categories/ps/index.html @@ -45,9 +45,9 @@ - + - + @@ -422,6 +422,6 @@ if (!doNotTrack) { - + diff --git a/public/categories/碎念/index.html b/public/categories/碎念/index.html index f25dd1b2..1bb04292 100644 --- a/public/categories/碎念/index.html +++ b/public/categories/碎念/index.html @@ -45,9 +45,9 @@ - + - + @@ -485,6 +485,6 @@ if (!doNotTrack) { - + diff --git a/public/categories/筆記/index.html b/public/categories/筆記/index.html index ac2d2a06..aaed7730 100644 --- a/public/categories/筆記/index.html +++ b/public/categories/筆記/index.html @@ -21,8 +21,8 @@ "accountablePerson" : "", "copyrightHolder" : "", "copyrightYear" : "2020", - "datePublished": "2020-08-13 14:22:05 \x2b0800 CST", - "dateModified" : "2020-08-13 14:22:05 \x2b0800 CST", + "datePublished": "2020-09-02 15:55:40 \x2b0800 CST", + "dateModified" : "2020-09-02 15:55:40 \x2b0800 CST", "url" : "https:\/\/h.cowbay.org\/categories\/%E7%AD%86%E8%A8%98\/", "wordCount" : "0", "image" : "https://h.cowbay.org%!s(\u003cnil\u003e)"", @@ -45,9 +45,9 @@ - + - + @@ -301,6 +301,71 @@ if (!doNotTrack) { + + + +
+
+ 02 September + + + + + + / + + + + + + + + + / + + 筆記 + + +
+ +
+
+

之前用caddy 作為反向代理,其中一個優勢就是caddy 會自動處理Letsencrypt 憑證的問題

+ +

也不用煩惱怎麼去更新一堆有的沒的

+ +

不過,實際應用上,還是偶爾會拿這些憑證檔案來用的狀況

+ +

雖然可以從caddy 上面取得這些檔案

+ +

但是基本上這些檔案都是綁定一個特定的hostname

+ +

可是我想要有一個憑證,可以給同網域底下的機器用 ( Wildcard certificates )

+ + +
+
+
+ + + + + + + + + + + +
+ + + + @@ -361,7 +426,7 @@ if (!doNotTrack) { -
+
@@ -436,7 +501,7 @@ if (!doNotTrack) { -
+
@@ -505,7 +570,7 @@ if (!doNotTrack) { -
+
@@ -568,7 +633,7 @@ if (!doNotTrack) { -
+
@@ -627,7 +692,7 @@ if (!doNotTrack) { -
+
@@ -688,7 +753,7 @@ if (!doNotTrack) { -
+
@@ -753,7 +818,7 @@ if (!doNotTrack) { -
+
@@ -818,7 +883,7 @@ if (!doNotTrack) { -
+
@@ -879,7 +944,7 @@ if (!doNotTrack) { -
+
@@ -944,7 +1009,7 @@ if (!doNotTrack) { -
+
@@ -1005,7 +1070,7 @@ if (!doNotTrack) { -
+
@@ -1064,7 +1129,7 @@ if (!doNotTrack) { -
+
@@ -1125,7 +1190,7 @@ if (!doNotTrack) { -
+
@@ -1188,7 +1253,7 @@ if (!doNotTrack) { -
+
@@ -1253,7 +1318,7 @@ if (!doNotTrack) { -
+
@@ -1312,7 +1377,7 @@ if (!doNotTrack) { -
+
@@ -1373,7 +1438,7 @@ if (!doNotTrack) { -
+
@@ -1442,7 +1507,7 @@ if (!doNotTrack) { -
+
@@ -1503,7 +1568,7 @@ if (!doNotTrack) { -
+
@@ -1568,7 +1633,7 @@ if (!doNotTrack) { -
+
@@ -1625,7 +1690,7 @@ if (!doNotTrack) { -
+
@@ -1684,7 +1749,7 @@ if (!doNotTrack) { -
+
@@ -1739,7 +1804,7 @@ if (!doNotTrack) { -
+
@@ -1794,7 +1859,7 @@ if (!doNotTrack) { -
+
@@ -1855,7 +1920,7 @@ if (!doNotTrack) { -
+
@@ -1916,7 +1981,7 @@ if (!doNotTrack) { -
+
@@ -1983,7 +2048,7 @@ if (!doNotTrack) { -
+
@@ -2048,7 +2113,7 @@ if (!doNotTrack) { -
+
@@ -2121,7 +2186,7 @@ if (!doNotTrack) { -
+
@@ -2190,7 +2255,7 @@ if (!doNotTrack) { -
+
@@ -2253,7 +2318,7 @@ if (!doNotTrack) { -
+
@@ -2310,7 +2375,7 @@ if (!doNotTrack) { -
+
@@ -2373,7 +2438,7 @@ if (!doNotTrack) { -
+
@@ -2434,7 +2499,7 @@ if (!doNotTrack) { -
+
@@ -2493,7 +2558,7 @@ if (!doNotTrack) { -
+
@@ -2550,7 +2615,7 @@ if (!doNotTrack) { -
+
@@ -2611,7 +2676,7 @@ if (!doNotTrack) { -
+
@@ -2668,7 +2733,7 @@ if (!doNotTrack) { -
+
@@ -2727,7 +2792,7 @@ if (!doNotTrack) { -
+
@@ -2788,7 +2853,7 @@ if (!doNotTrack) { -
+
@@ -2849,7 +2914,7 @@ if (!doNotTrack) { -
+
@@ -2920,7 +2985,7 @@ if (!doNotTrack) { -
+
@@ -2979,7 +3044,7 @@ if (!doNotTrack) { -
+
@@ -3077,7 +3142,7 @@ if (!doNotTrack) { -
+
@@ -3138,7 +3203,7 @@ if (!doNotTrack) { -
+
@@ -3199,7 +3264,7 @@ if (!doNotTrack) { -
+
@@ -3266,7 +3331,7 @@ if (!doNotTrack) { -
+
@@ -3326,7 +3391,7 @@ if (!doNotTrack) { -
+
@@ -3397,7 +3462,7 @@ if (!doNotTrack) { -
+
@@ -3591,6 +3656,6 @@ if (!doNotTrack) {
- + diff --git a/public/categories/筆記/index.xml b/public/categories/筆記/index.xml index 5d33b4bf..7509fdf4 100644 --- a/public/categories/筆記/index.xml +++ b/public/categories/筆記/index.xml @@ -6,11 +6,30 @@ Recent content in 筆記 on MC部落 Hugo -- gohugo.io en-us - Thu, 13 Aug 2020 14:22:05 +0800 + Wed, 02 Sep 2020 15:55:40 +0800 + + [筆記] 在 ubuntu 20.04 底下,用certbot 透過Cloudflare 申請全域的 Letsencrypt 憑證 + https://h.cowbay.org/post/ubuntu-letsencrypt-cloudflare-wildcard/ + Wed, 02 Sep 2020 15:55:40 +0800 + + https://h.cowbay.org/post/ubuntu-letsencrypt-cloudflare-wildcard/ + <p>之前用caddy 作為反向代理,其中一個優勢就是caddy 會自動處理Letsencrypt 憑證的問題</p> + +<p>也不用煩惱怎麼去更新一堆有的沒的</p> + +<p>不過,實際應用上,還是偶爾會拿這些憑證檔案來用的狀況</p> + +<p>雖然可以從caddy 上面取得這些檔案</p> + +<p>但是基本上這些檔案都是綁定一個特定的hostname</p> + +<p>可是我想要有一個憑證,可以給同網域底下的機器用 ( Wildcard certificates )</p> + + [筆記] 在 ubuntu 20.04 上安裝 wireguard + pihole 作 AD Blocking/install wireguard and pihole to do ad block in ubuntu 20.04 https://h.cowbay.org/post/wireguard-pihole-in-ubuntu-20.04/ diff --git a/public/categories/群暉/index.html b/public/categories/群暉/index.html index 4a7250ea..9c193a41 100644 --- a/public/categories/群暉/index.html +++ b/public/categories/群暉/index.html @@ -45,9 +45,9 @@ - + - + @@ -491,6 +491,6 @@ if (!doNotTrack) {
- + diff --git a/public/categories/雜念/index.html b/public/categories/雜念/index.html index 2334092c..ef9ec52a 100644 --- a/public/categories/雜念/index.html +++ b/public/categories/雜念/index.html @@ -45,9 +45,9 @@ - + - + @@ -483,6 +483,6 @@ if (!doNotTrack) {
- + diff --git a/public/contact/index.html b/public/contact/index.html index aeeade12..18428826 100644 --- a/public/contact/index.html +++ b/public/contact/index.html @@ -45,9 +45,9 @@ - + - + @@ -459,7 +459,7 @@ if (!doNotTrack) {
- + diff --git a/public/gallery/sammy93/index.html b/public/gallery/sammy93/index.html index a669fc54..d3073723 100644 --- a/public/gallery/sammy93/index.html +++ b/public/gallery/sammy93/index.html @@ -45,9 +45,9 @@ - + - + @@ -598,7 +598,7 @@ title="pinterest icon">
- + diff --git a/public/index.html b/public/index.html index bdb91b4d..bfd1490a 100644 --- a/public/index.html +++ b/public/index.html @@ -22,8 +22,8 @@ "accountablePerson" : "", "copyrightHolder" : "", "copyrightYear" : "2020", - "datePublished": "2020-08-13 14:22:05 \x2b0800 CST", - "dateModified" : "2020-08-13 14:22:05 \x2b0800 CST", + "datePublished": "2020-09-02 15:55:40 \x2b0800 CST", + "dateModified" : "2020-09-02 15:55:40 \x2b0800 CST", "url" : "https:\/\/h.cowbay.org\/", "wordCount" : "0", "image" : "https://h.cowbay.org%!s(\u003cnil\u003e)"", @@ -46,9 +46,9 @@ - + - + @@ -292,12 +292,12 @@ if (!doNotTrack) { - +
- 13 August + 02 September @@ -319,24 +319,24 @@ if (!doNotTrack) {
-

手機上的廣告越來越討厭了

+

之前用caddy 作為反向代理,其中一個優勢就是caddy 會自動處理Letsencrypt 憑證的問題

-

但是用手機看頁面、影片的機會越來越高

+

也不用煩惱怎麼去更新一堆有的沒的

-

所以一直想看看有沒有什麼方式可以解決這個問題

+

不過,實際應用上,還是偶爾會拿這些憑證檔案來用的狀況

-

不只可以用在safari 上,連APP 裡面的廣告最好都能夠擋掉

+

雖然可以從caddy 上面取得這些檔案

-

在github上面看到有個專案是 wireguard + pihole

+

但是基本上這些檔案都是綁定一個特定的hostname

-

滿有趣的,就來研究一下

+

可是我想要有一個憑證,可以給同網域底下的機器用 ( Wildcard certificates )

- +
@@ -354,12 +354,12 @@ if (!doNotTrack) { - +
- 15 July + 13 August @@ -381,34 +381,24 @@ if (!doNotTrack) {
-

最近在玩ansible + openwrt + wireguard

- -

ansible 腳本寫好之後,可以把config 佈署到 openwrt 上

- -

當然前提是最好用同樣的機器,不同的機器在config 上會有一些差異

- -

但是這些差異常常就會造成無法連線、無法使用的狀況

- -

BTW 我是用 ubiquiti 的 edgerouter X 來做

- -

都弄好之後,就想說來跑個iperf3 測試一下連線速度

+

手機上的廣告越來越討厭了

-

也好和之前做的 IPSEC 比較一下

+

但是用手機看頁面、影片的機會越來越高

-

結果很奇怪的是,明明一樣的機器、一樣用ansible 跑出來的config

+

所以一直想看看有沒有什麼方式可以解決這個問題

-

但是有一台edgerouter X 的VPN 連接速度就是特別慢

+

不只可以用在safari 上,連APP 裡面的廣告最好都能夠擋掉

-

而且速度都剛好卡在 99.X Mb 左右

+

在github上面看到有個專案是 wireguard + pihole

-

就讓我很納悶了…

+

滿有趣的,就來研究一下

- +
@@ -426,12 +416,12 @@ if (!doNotTrack) { - +
- 10 July + 15 July @@ -453,28 +443,34 @@ if (!doNotTrack) {
-

上禮拜某天在開會的時候,LINE不斷傳來訊息

+

最近在玩ansible + openwrt + wireguard

-

不過因為我向來開會都很認真(驕傲,所以都沒看,接著就變成來電了

+

ansible 腳本寫好之後,可以把config 佈署到 openwrt 上

-

看來大概有啥事發生

+

當然前提是最好用同樣的機器,不同的機器在config 上會有一些差異

-

不過畢竟不是正職的工作,就先放著吧

+

但是這些差異常常就會造成無法連線、無法使用的狀況

-

後來變成連學長都直接打來告訴我,某間公司的伺服器出事了,客戶找不到我

+

BTW 我是用 ubiquiti 的 edgerouter X 來做

-

叫我趕快連進去看

+

都弄好之後,就想說來跑個iperf3 測試一下連線速度

-

是說,啊我又沒跟人家簽維護,趕什麼趕…

+

也好和之前做的 IPSEC 比較一下

-

總之,開完會後就了解一下狀況

+

結果很奇怪的是,明明一樣的機器、一樣用ansible 跑出來的config

- +

但是有一台edgerouter X 的VPN 連接速度就是特別慢

+ +

而且速度都剛好卡在 99.X Mb 左右

+ +

就讓我很納悶了…

+ +
@@ -492,12 +488,12 @@ if (!doNotTrack) { - +
- 22 June + 10 July @@ -519,22 +515,28 @@ if (!doNotTrack) {
-

工作用的電腦,昨天終於難得的reboot了(uptime 看了一下,大概是三百多天)

+

上禮拜某天在開會的時候,LINE不斷傳來訊息

-

結果重開機之後,發現原本在打tunnel 連 ptt 的 wireguard VPN 掛掉了

+

不過因為我向來開會都很認真(驕傲,所以都沒看,接著就變成來電了

-

手動下指令也啟動不了

+

看來大概有啥事發生

-

查了一下發現是 ubuntu 18.04 kernel 4.15.0-106 的包

+

不過畢竟不是正職的工作,就先放著吧

-

看來就連kernel 最好都不要自動升級…

+

後來變成連學長都直接打來告訴我,某間公司的伺服器出事了,客戶找不到我

- +

叫我趕快連進去看

+ +

是說,啊我又沒跟人家簽維護,趕什麼趕…

+ +

總之,開完會後就了解一下狀況

+ +
@@ -552,12 +554,12 @@ if (!doNotTrack) { - +
- 08 April + 22 June @@ -579,18 +581,22 @@ if (!doNotTrack) {
-

ubuntu 18.04 預設移掉了 /etc/rc.local 的功能

+

工作用的電腦,昨天終於難得的reboot了(uptime 看了一下,大概是三百多天)

+ +

結果重開機之後,發現原本在打tunnel 連 ptt 的 wireguard VPN 掛掉了

-

變成要用 systemd 的方式來運作,可是有點難用…

+

手動下指令也啟動不了

+ +

查了一下發現是 ubuntu 18.04 kernel 4.15.0-106 的包

-

紀錄一下步驟,再來研究怎麼整合到 preseed 裡面

+

看來就連kernel 最好都不要自動升級…

- +
@@ -721,7 +727,16 @@ if (!doNotTrack) { - 12 + + + + + + + + + + 13 @@ -865,7 +880,7 @@ if (!doNotTrack) {
- + diff --git a/public/index.xml b/public/index.xml index 61444c23..6eb41cd8 100644 --- a/public/index.xml +++ b/public/index.xml @@ -6,11 +6,30 @@ Recent content on MC部落 Hugo -- gohugo.io en-us - Thu, 13 Aug 2020 14:22:05 +0800 + Wed, 02 Sep 2020 15:55:40 +0800 + + [筆記] 在 ubuntu 20.04 底下,用certbot 透過Cloudflare 申請全域的 Letsencrypt 憑證 + https://h.cowbay.org/post/ubuntu-letsencrypt-cloudflare-wildcard/ + Wed, 02 Sep 2020 15:55:40 +0800 + + https://h.cowbay.org/post/ubuntu-letsencrypt-cloudflare-wildcard/ + <p>之前用caddy 作為反向代理,其中一個優勢就是caddy 會自動處理Letsencrypt 憑證的問題</p> + +<p>也不用煩惱怎麼去更新一堆有的沒的</p> + +<p>不過,實際應用上,還是偶爾會拿這些憑證檔案來用的狀況</p> + +<p>雖然可以從caddy 上面取得這些檔案</p> + +<p>但是基本上這些檔案都是綁定一個特定的hostname</p> + +<p>可是我想要有一個憑證,可以給同網域底下的機器用 ( Wildcard certificates )</p> + + [筆記] 在 ubuntu 20.04 上安裝 wireguard + pihole 作 AD Blocking/install wireguard and pihole to do ad block in ubuntu 20.04 https://h.cowbay.org/post/wireguard-pihole-in-ubuntu-20.04/ diff --git a/public/page/10/index.html b/public/page/10/index.html index 43c9ab43..0892fd7a 100644 --- a/public/page/10/index.html +++ b/public/page/10/index.html @@ -22,8 +22,8 @@ "accountablePerson" : "", "copyrightHolder" : "", "copyrightYear" : "2020", - "datePublished": "2020-08-13 14:22:05 \x2b0800 CST", - "dateModified" : "2020-08-13 14:22:05 \x2b0800 CST", + "datePublished": "2020-09-02 15:55:40 \x2b0800 CST", + "dateModified" : "2020-09-02 15:55:40 \x2b0800 CST", "url" : "https:\/\/h.cowbay.org\/", "wordCount" : "0", "image" : "https://h.cowbay.org%!s(\u003cnil\u003e)"", @@ -46,9 +46,9 @@ - + - + @@ -292,12 +292,12 @@ if (!doNotTrack) { - +
- 16 January + 11 March @@ -319,16 +319,20 @@ if (!doNotTrack) {
-

買了一張 DELL 6/iR 低階的raid 卡

+

最近要開始測試client安裝 ubuntu 18.04 的 ansible playbook

-

來測試把系統裝在硬體做的RAID上,結果沒想到居然不能開機…

+

因為要不斷的修正,所以想到一直有在自己電腦上執行的timeshift這個軟體

- +

可以很簡單快速的備份、恢復系統狀態

+ +

可是不知道為什麼,在ubuntu 18.04 上安裝就是會發生錯誤….

+ +
@@ -346,7 +350,7 @@ if (!doNotTrack) { - +
@@ -373,18 +377,16 @@ if (!doNotTrack) {
-

最近在弄一台機器,想要把ubuntu 18.04 安裝在software raid上

- -

因為新開的機器大部分都是在proxmox上,所以很少碰實體機器了

+

買了一張 DELL 6/iR 低階的raid 卡

-

結果在安裝過程中,做raid碰到一些問題,來紀錄一下

+

來測試把系統裝在硬體做的RAID上,結果沒想到居然不能開機…

- +
@@ -402,12 +404,12 @@ if (!doNotTrack) { - +
- 13 December + 16 January @@ -429,20 +431,18 @@ if (!doNotTrack) {
-

這兩天在弄兩台Freenas ,準備當作Proxmox 的Storage & Server Backup

- -

因為伺服器的限制,只能接六個SATA,我接了六個2T的硬碟做raid10

+

最近在弄一台機器,想要把ubuntu 18.04 安裝在software raid上

-

然後把Freenas 安裝在隨身碟上

+

因為新開的機器大部分都是在proxmox上,所以很少碰實體機器了

-

不過會一直出現Smartd failed to start 的錯誤訊息

+

結果在安裝過程中,做raid碰到一些問題,來紀錄一下

- +
@@ -460,12 +460,12 @@ if (!doNotTrack) { - +
- 12 December + 13 December @@ -481,28 +481,26 @@ if (!doNotTrack) { / - 碎念 + 筆記
-

最近在做一台老機器的P2V

- -

偏偏user說不能關機,所以我用dd + ssh 做線上移轉

+

這兩天在弄兩台Freenas ,準備當作Proxmox 的Storage & Server Backup

-

這部份有空再來寫

+

因為伺服器的限制,只能接六個SATA,我接了六個2T的硬碟做raid10

-

只是因為原來的設定有用mdadm 做raid1

+

然後把Freenas 安裝在隨身碟上

-

這部份導致移轉過去proxmox 後,會出現raid degrade 導致無法正常開機

+

不過會一直出現Smartd failed to start 的錯誤訊息

- +
@@ -520,12 +518,12 @@ if (!doNotTrack) { - +
- 07 December + 12 December @@ -541,26 +539,28 @@ if (!doNotTrack) { / - 筆記 + 碎念
-

因為工作的關係,現在很多時間都花在VIM的操作上

+

最近在做一台老機器的P2V

+ +

偏偏user說不能關機,所以我用dd + ssh 做線上移轉

-

所以之前花了滿多時間,調整出一個適合自己的VIM環境

+

這部份有空再來寫

-

原本的作法是把這個設定好的環境,丟到自己建立的gitea 上面

+

只是因為原來的設定有用mdadm 做raid1

-

然後每到一台新的機器,就要去clone 下來

+

這部份導致移轉過去proxmox 後,會出現raid degrade 導致無法正常開機

- +
@@ -699,7 +699,18 @@ if (!doNotTrack) { - 12 + 12 + + + + + + + + + + + 13 @@ -843,7 +854,7 @@ if (!doNotTrack) {
- + diff --git a/public/page/11/index.html b/public/page/11/index.html index 98e55ba8..a1574b14 100644 --- a/public/page/11/index.html +++ b/public/page/11/index.html @@ -22,8 +22,8 @@ "accountablePerson" : "", "copyrightHolder" : "", "copyrightYear" : "2020", - "datePublished": "2020-08-13 14:22:05 \x2b0800 CST", - "dateModified" : "2020-08-13 14:22:05 \x2b0800 CST", + "datePublished": "2020-09-02 15:55:40 \x2b0800 CST", + "dateModified" : "2020-09-02 15:55:40 \x2b0800 CST", "url" : "https:\/\/h.cowbay.org\/", "wordCount" : "0", "image" : "https://h.cowbay.org%!s(\u003cnil\u003e)"", @@ -46,9 +46,9 @@ - + - + @@ -292,6 +292,64 @@ if (!doNotTrack) { + + + +
+
+ 07 December + + + + / + + + + + + + + + + / + + 筆記 + + +
+ +
+
+

因為工作的關係,現在很多時間都花在VIM的操作上

+ +

所以之前花了滿多時間,調整出一個適合自己的VIM環境

+ +

原本的作法是把這個設定好的環境,丟到自己建立的gitea 上面

+ +

然後每到一台新的機器,就要去clone 下來

+ + +
+
+
+
+ + + + + + + + +
+ + + + @@ -353,8 +411,8 @@ if (!doNotTrack) { -
- +
+ @@ -421,8 +479,8 @@ if (!doNotTrack) { -
- +
+ @@ -477,8 +535,8 @@ if (!doNotTrack) { -
- +
+ @@ -565,64 +623,6 @@ if (!doNotTrack) {
- - - - - - - -
- - - - - - - -
-
- 15 November - - - - / - - - - - - - - - - / - - 筆記 - - -
- -
-
-

最近在測試metabase,記得幾個月前就有測試過

- -

但是當時的界面和現在的樣子差很多,看樣子改版還滿勤勞的

- -

所以這次改用docker來建立,根本五分鐘不到就建好了(挖鼻孔)

- -

不過呢,很討厭的是,一進去就發現語系採用的是簡體中文

- - -
-
-
-
-
@@ -757,6 +757,17 @@ if (!doNotTrack) { 12 + + + + + + + + + 13 + + @@ -898,7 +909,7 @@ if (!doNotTrack) {
- + diff --git a/public/page/12/index.html b/public/page/12/index.html index f4cba15d..3a90e163 100644 --- a/public/page/12/index.html +++ b/public/page/12/index.html @@ -22,8 +22,8 @@ "accountablePerson" : "", "copyrightHolder" : "", "copyrightYear" : "2020", - "datePublished": "2020-08-13 14:22:05 \x2b0800 CST", - "dateModified" : "2020-08-13 14:22:05 \x2b0800 CST", + "datePublished": "2020-09-02 15:55:40 \x2b0800 CST", + "dateModified" : "2020-09-02 15:55:40 \x2b0800 CST", "url" : "https:\/\/h.cowbay.org\/", "wordCount" : "0", "image" : "https://h.cowbay.org%!s(\u003cnil\u003e)"", @@ -46,9 +46,9 @@ - + - + @@ -292,12 +292,12 @@ if (!doNotTrack) { - +
- 12 November + 15 November @@ -319,20 +319,20 @@ if (!doNotTrack) {
-

因為工作上的需求,有個資料庫需要開放給不同team的人去存取

+

最近在測試metabase,記得幾個月前就有測試過

-

雖然都是在同一台機器上的同一個資料庫

+

但是當時的界面和現在的樣子差很多,看樣子改版還滿勤勞的

-

但是希望能夠不同team的人用不同的資料庫使用者

+

所以這次改用docker來建立,根本五分鐘不到就建好了(挖鼻孔)

-

這樣萬一出事,會比較好抓兇手??

+

不過呢,很討厭的是,一進去就發現語系採用的是簡體中文

- +
@@ -350,12 +350,12 @@ if (!doNotTrack) { - +
- 08 November + 12 November @@ -377,26 +377,20 @@ if (!doNotTrack) {
-

這是發生在一個夜黑風高的寂寥深夜….. ( What The FXXX … )

- -

來到這個環境之後,有一個很詭異的狀況一直困擾著我

- -

在每個分公司,都會有一台伺服器作為KVM Host

- -

上面跑兩台VM,一台作為ansible controller (目前沒作用)

+

因為工作上的需求,有個資料庫需要開放給不同team的人去存取

-

另一台作為這邊所謂的 “Build Server”

+

雖然都是在同一台機器上的同一個資料庫

-

用途包含了DHCP Server / Proxy Server (squid3) / APT Proxy (squid-deb-proxy)

+

但是希望能夠不同team的人用不同的資料庫使用者

-

問題就發生在這台 Build Server 上…

+

這樣萬一出事,會比較好抓兇手??

- +
@@ -414,12 +408,12 @@ if (!doNotTrack) { - +
- 06 November + 08 November @@ -441,19 +435,26 @@ if (!doNotTrack) {
-

最近在重新規劃前人留下的backup爛攤子 -各個伺服器統一備份到一台backup storage -想說如果每天能夠看到backup storage的磁碟用量的話 -就可以抓出備份空間成長速度、推估需要多大的磁碟空間 -找了一些工具,結果發現 durep 這個 ubuntu 內建的工具 -基本上可以滿足我的需求

+

這是發生在一個夜黑風高的寂寥深夜….. ( What The FXXX … )

- +

來到這個環境之後,有一個很詭異的狀況一直困擾著我

+ +

在每個分公司,都會有一台伺服器作為KVM Host

+ +

上面跑兩台VM,一台作為ansible controller (目前沒作用)

+ +

另一台作為這邊所謂的 “Build Server”

+ +

用途包含了DHCP Server / Proxy Server (squid3) / APT Proxy (squid-deb-proxy)

+ +

問題就發生在這台 Build Server 上…

+ +
@@ -471,7 +472,7 @@ if (!doNotTrack) { - +
@@ -498,30 +499,19 @@ if (!doNotTrack) {
-

Bookstack 是一套非常好用的線上”筆記”系統

- -

他用圖書館/書本的概念,讓使用者可以建立自己的”圖書館”

- -

同時在圖書館內建立不同的”書籍”

- -

而且支援 Markdown 語法

- -

其他的方式像是在nextcloud上編輯 md檔案(字體太小)

- -

或者是boostnote(只能在本機)

- -

都或多或少有點小缺點

- -

Bookstack則是沒有這些問題,不過就是系統「大」了點…

- -

不過還好有人做成docker的方式來啟動,大大的降低了建置的難度(其實也沒有很難啦,只是要裝個PHP、弄個DB而已)

+

最近在重新規劃前人留下的backup爛攤子 +各個伺服器統一備份到一台backup storage +想說如果每天能夠看到backup storage的磁碟用量的話 +就可以抓出備份空間成長速度、推估需要多大的磁碟空間 +找了一些工具,結果發現 durep 這個 ubuntu 內建的工具 +基本上可以滿足我的需求

- +
@@ -539,12 +529,12 @@ if (!doNotTrack) { - +
- 05 November + 06 November @@ -566,27 +556,30 @@ if (!doNotTrack) {
-

公司內有幾台NAS,其中有一台用來放開發人員的postgresql dump file -之前都是主要的開發人員上傳到google drive,分享出來 ,然後其他人去抓回來

+

Bookstack 是一套非常好用的線上”筆記”系統

+ +

他用圖書館/書本的概念,讓使用者可以建立自己的”圖書館”

-

這樣子有個問題是,當server要存取這些檔案時,就沒辦法了,除非透過一些 3rd party的軟體 -像是這篇

+

同時在圖書館內建立不同的”書籍”

+ +

而且支援 Markdown 語法

-

https://www.omgubuntu.co.uk/2017/04/mount-google-drive-ocamlfuse-linux

+

其他的方式像是在nextcloud上編輯 md檔案(字體太小)

-

或者是這篇

+

或者是boostnote(只能在本機)

+ +

都或多或少有點小缺點

-

https://www.maketecheasier.com/mount-google-drive-ubuntu/

+

Bookstack則是沒有這些問題,不過就是系統「大」了點…

-

但是手邊的伺服器,原則上除非有必要,不然都沒有開放internet -所以導致明明檔案就在那邊,但是要取得就是很麻煩

+

不過還好有人做成docker的方式來啟動,大大的降低了建置的難度(其實也沒有很難啦,只是要裝個PHP、弄個DB而已)

- +
@@ -724,6 +717,19 @@ if (!doNotTrack) { 12 + + + + + + + + + 13 + + + +
@@ -863,7 +869,7 @@ if (!doNotTrack) {
- + diff --git a/public/page/13/index.html b/public/page/13/index.html new file mode 100644 index 00000000..449ec1d4 --- /dev/null +++ b/public/page/13/index.html @@ -0,0 +1,631 @@ + + + + + + + + + MC部落 - What’s the Worst That Could Happen? + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Skip to content + + +
+ + +

Posts

+ +
+ + + + + + + + + +
+ + + + + + + +
+
+ 05 November + + + + / + + + + + + + + + + / + + 筆記 + + +
+ +
+
+

公司內有幾台NAS,其中有一台用來放開發人員的postgresql dump file +之前都是主要的開發人員上傳到google drive,分享出來 ,然後其他人去抓回來

+ +

這樣子有個問題是,當server要存取這些檔案時,就沒辦法了,除非透過一些 3rd party的軟體 +像是這篇

+ +

https://www.omgubuntu.co.uk/2017/04/mount-google-drive-ocamlfuse-linux

+ +

或者是這篇

+ +

https://www.maketecheasier.com/mount-google-drive-ubuntu/

+ +

但是手邊的伺服器,原則上除非有必要,不然都沒有開放internet +所以導致明明檔案就在那邊,但是要取得就是很麻煩

+ + +
+
+
+
+ +
+ + + + + + + +
+ + + +
+ + + + + + diff --git a/public/page/2/index.html b/public/page/2/index.html index 47bba894..292490c5 100644 --- a/public/page/2/index.html +++ b/public/page/2/index.html @@ -22,8 +22,8 @@ "accountablePerson" : "", "copyrightHolder" : "", "copyrightYear" : "2020", - "datePublished": "2020-08-13 14:22:05 \x2b0800 CST", - "dateModified" : "2020-08-13 14:22:05 \x2b0800 CST", + "datePublished": "2020-09-02 15:55:40 \x2b0800 CST", + "dateModified" : "2020-09-02 15:55:40 \x2b0800 CST", "url" : "https:\/\/h.cowbay.org\/", "wordCount" : "0", "image" : "https://h.cowbay.org%!s(\u003cnil\u003e)"", @@ -46,9 +46,9 @@ - + - + @@ -292,12 +292,12 @@ if (!doNotTrack) { - +
- 06 April + 08 April @@ -319,20 +319,18 @@ if (!doNotTrack) {
-

這是之前做過的task,client透過pxe開機後,會自動安裝ubuntu 14.04

+

ubuntu 18.04 預設移掉了 /etc/rc.local 的功能

-

在安裝完成後,會發出郵件通知管理者已經安裝完成

+

變成要用 systemd 的方式來運作,可是有點難用…

-

可是某次ansible 更新之後,反而沒辦法安裝完成

+

紀錄一下步驟,再來研究怎麼整合到 preseed 裡面

-

這次順手修改一下,同時更新了ansible 的template

- - +
@@ -350,12 +348,12 @@ if (!doNotTrack) { - +
- 04 March + 06 April @@ -377,24 +375,20 @@ if (!doNotTrack) {
-

ubuntu 18.04 的 DNS 設定很煩

- -

系統預設會用NetworkManager 去管理

- -

然後NetworkManager 又很「靈活」的許多種修改 /etc/resolv.conf 的方式

+

這是之前做過的task,client透過pxe開機後,會自動安裝ubuntu 14.04

-

之前都是很粗暴的停用 NetworkManager

+

在安裝完成後,會發出郵件通知管理者已經安裝完成

-

但是用筆電的user 又需要用 NetworkManager 來管理無線網路

+

可是某次ansible 更新之後,反而沒辦法安裝完成

-

今天找了一下文件,讓NetworkManager 可以執行,卻不會去異動 /etc/resolv.conf

+

這次順手修改一下,同時更新了ansible 的template

- +
@@ -412,12 +406,12 @@ if (!doNotTrack) { - +
- 19 February + 04 March @@ -439,24 +433,24 @@ if (!doNotTrack) {
-

早上忘了要幹什麼,去看到手上的自然人憑證到期日是今年的 417

+

ubuntu 18.04 的 DNS 設定很煩

-

想說快到期了,看看能不能線上申請展延

+

系統預設會用NetworkManager 去管理

-

結果辦公室沒有Linux 可以用的讀卡機

+

然後NetworkManager 又很「靈活」的許多種修改 /etc/resolv.conf 的方式

-

OOXX 咧,我們可是號稱全Linux 環境捏!

+

之前都是很粗暴的停用 NetworkManager

-

結果居然沒有對應的硬體!?

+

但是用筆電的user 又需要用 NetworkManager 來管理無線網路

-

於是馬上敗了一台據說有支援 Linux 的 IT 850UM 讀卡機!

+

今天找了一下文件,讓NetworkManager 可以執行,卻不會去異動 /etc/resolv.conf

- +
@@ -474,12 +468,12 @@ if (!doNotTrack) { - +
- 17 January + 19 February @@ -501,20 +495,24 @@ if (!doNotTrack) {
-

前幾天修復了因為intel cpu bug 導致無法使用的 synology DS415+

+

早上忘了要幹什麼,去看到手上的自然人憑證到期日是今年的 417

-

詳情請看 https://h.cowbay.org/post/first-try-synology-ha/

+

想說快到期了,看看能不能線上申請展延

-

今天趁尾牙前夕,手邊沒啥要緊事

+

結果辦公室沒有Linux 可以用的讀卡機

-

就來玩玩看promox 加上 synology high availability 再加上 NFS share 的環境

+

OOXX 咧,我們可是號稱全Linux 環境捏!

- +

結果居然沒有對應的硬體!?

+ +

於是馬上敗了一台據說有支援 Linux 的 IT 850UM 讀卡機!

+ +
@@ -532,12 +530,12 @@ if (!doNotTrack) { - +
- 10 January + 17 January @@ -559,24 +557,20 @@ if (!doNotTrack) {
-

上禮拜,原本擔任 proxmox cluster 的主要 storage 的 ds415+ 掛點了

- -

原因應該就是之前的 intel c2000 series cpu 的 bug

- -

只是不知道為什麼這台兩三年來都沒有關機的NAS

+

前幾天修復了因為intel cpu bug 導致無法使用的 synology DS415+

-

比其他三台多撐了那麼久 (已經有兩台送修回來,一台也是同樣症狀,被放在一邊)

+

詳情請看 https://h.cowbay.org/post/first-try-synology-ha/

-

趁著這次機會,看看網路上說的換電阻大法有沒有用!

+

今天趁尾牙前夕,手邊沒啥要緊事

-

如果有用,就拿這兩台來玩玩 synology high availability !

+

就來玩玩看promox 加上 synology high availability 再加上 NFS share 的環境

- +
@@ -709,7 +703,16 @@ if (!doNotTrack) { - 12 + + + + + + + + + + 13 @@ -853,7 +856,7 @@ if (!doNotTrack) {
- + diff --git a/public/page/3/index.html b/public/page/3/index.html index 89a6ad8c..1c0d444c 100644 --- a/public/page/3/index.html +++ b/public/page/3/index.html @@ -22,8 +22,8 @@ "accountablePerson" : "", "copyrightHolder" : "", "copyrightYear" : "2020", - "datePublished": "2020-08-13 14:22:05 \x2b0800 CST", - "dateModified" : "2020-08-13 14:22:05 \x2b0800 CST", + "datePublished": "2020-09-02 15:55:40 \x2b0800 CST", + "dateModified" : "2020-09-02 15:55:40 \x2b0800 CST", "url" : "https:\/\/h.cowbay.org\/", "wordCount" : "0", "image" : "https://h.cowbay.org%!s(\u003cnil\u003e)"", @@ -46,9 +46,9 @@ - + - + @@ -292,12 +292,12 @@ if (!doNotTrack) { - +
- 07 January + 10 January @@ -319,20 +319,24 @@ if (!doNotTrack) {
-

昨天老闆在slack 上面問說現在的幾台 DB Server 有沒有跑過 pgbench

+

上禮拜,原本擔任 proxmox cluster 的主要 storage 的 ds415+ 掛點了

-

分數大概如何,想要跟他的筆電做個比較

+

原因應該就是之前的 intel c2000 series cpu 的 bug

-

之前有跑過幾次,這次就順便測試一下不同的硬體配置、以及不同的軟體版本

+

只是不知道為什麼這台兩三年來都沒有關機的NAS

-

對於pgbench 跑分會有多大的影響

+

比其他三台多撐了那麼久 (已經有兩台送修回來,一台也是同樣症狀,被放在一邊)

- +

趁著這次機會,看看網路上說的換電阻大法有沒有用!

+ +

如果有用,就拿這兩台來玩玩 synology high availability !

+ +
@@ -350,12 +354,12 @@ if (!doNotTrack) { - +
- 03 January + 07 January @@ -377,18 +381,20 @@ if (!doNotTrack) {
-

2020/01/02 , 2020年上工的第一天,群暉的 DS415+ NAS 掛了!

+

昨天老闆在slack 上面問說現在的幾台 DB Server 有沒有跑過 pgbench

-

因為群暉的文件在最關鍵的一步寫得亂七八糟!

+

分數大概如何,想要跟他的筆電做個比較

-

所以在這邊紀錄一下我操作的步驟!

+

之前有跑過幾次,這次就順便測試一下不同的硬體配置、以及不同的軟體版本

- +

對於pgbench 跑分會有多大的影響

+ +
@@ -406,7 +412,7 @@ if (!doNotTrack) { - +
@@ -427,26 +433,24 @@ if (!doNotTrack) { / - 雜念 + 筆記
-

2020/01/02 2020 上工的第一天,公司碩果僅存的唯一一台 Synology DS415+ 也終於掛了

- -

開機沒多久就連不上,反覆幾次之後,出現了開機時所有燈號都狂閃的狀況

+

2020/01/02 , 2020年上工的第一天,群暉的 DS415+ NAS 掛了!

-

終於宣告不治

+

因為群暉的文件在最關鍵的一步寫得亂七八糟!

-

問題很明顯的就是Intel C2000 系列 CPU 的瑕疵

+

所以在這邊紀錄一下我操作的步驟!

- +
@@ -464,12 +468,12 @@ if (!doNotTrack) { - +
- 27 December + 03 January @@ -485,26 +489,26 @@ if (!doNotTrack) { / - 筆記 + 雜念
-

今天在寫一支客製化 firefox 的playbook

+

2020/01/02 2020 上工的第一天,公司碩果僅存的唯一一台 Synology DS415+ 也終於掛了

-

因為firefox 會給每個user 建立一個由亂數字串組成的default profile

+

開機沒多久就連不上,反覆幾次之後,出現了開機時所有燈號都狂閃的狀況

-

所以每個user的 default profile 都不同

+

終於宣告不治

-

也因此在用register處理的時候,碰到了一些問題

+

問題很明顯的就是Intel C2000 系列 CPU 的瑕疵

- +
@@ -522,12 +526,12 @@ if (!doNotTrack) { - +
- 24 December + 27 December @@ -549,22 +553,20 @@ if (!doNotTrack) {
-

正確來說,我不曉得到底怎麼「稱呼」這個 forwardx11 / forwardagent

- -

總之就是在寫一隻ansible playbook

+

今天在寫一支客製化 firefox 的playbook

-

目的是用來安裝、設定 firefox

+

因為firefox 會給每個user 建立一個由亂數字串組成的default profile

-

包含安裝 firefox addon

+

所以每個user的 default profile 都不同

-

但是一開始在執行的時候,碰到了一些錯誤

+

也因此在用register處理的時候,碰到了一些問題

- +
@@ -699,7 +701,16 @@ if (!doNotTrack) { - 12 + + + + + + + + + + 13 @@ -843,7 +854,7 @@ if (!doNotTrack) {
- + diff --git a/public/page/4/index.html b/public/page/4/index.html index fd69ebda..7d130e3a 100644 --- a/public/page/4/index.html +++ b/public/page/4/index.html @@ -22,8 +22,8 @@ "accountablePerson" : "", "copyrightHolder" : "", "copyrightYear" : "2020", - "datePublished": "2020-08-13 14:22:05 \x2b0800 CST", - "dateModified" : "2020-08-13 14:22:05 \x2b0800 CST", + "datePublished": "2020-09-02 15:55:40 \x2b0800 CST", + "dateModified" : "2020-09-02 15:55:40 \x2b0800 CST", "url" : "https:\/\/h.cowbay.org\/", "wordCount" : "0", "image" : "https://h.cowbay.org%!s(\u003cnil\u003e)"", @@ -46,9 +46,9 @@ - + - + @@ -292,12 +292,12 @@ if (!doNotTrack) { - +
- 20 December + 24 December @@ -319,24 +319,22 @@ if (!doNotTrack) {
-

老闆提到想要把新系統的 postgresql 資料庫都撈到記憶體裡面

- -

但是否決了我提出的ramdisk 作法(因為當機的話,資料就沒了)

+

正確來說,我不曉得到底怎麼「稱呼」這個 forwardx11 / forwardagent

-

在找資料的時候,發現了這個postgresql 的 pg_prewarm extension

+

總之就是在寫一隻ansible playbook

-

好像有點意思?就來測試看看吧!

+

目的是用來安裝、設定 firefox

-

只是目前還不知道該怎麼解讀測試的數據就是了…

+

包含安裝 firefox addon

-

幹!林北真的不是 DBA 啦 =.=

+

但是一開始在執行的時候,碰到了一些錯誤

- +
@@ -354,12 +352,12 @@ if (!doNotTrack) { - +
- 18 December + 20 December @@ -381,18 +379,24 @@ if (!doNotTrack) {
-

剛剛在跑一個修改過的playbook,卻發現一個詭異的狀況

+

老闆提到想要把新系統的 postgresql 資料庫都撈到記憶體裡面

-

在用template產生檔案之前,爲了避免錯誤,所以我先用 file module 去建立目錄

+

但是否決了我提出的ramdisk 作法(因為當機的話,資料就沒了)

-

怪就怪在,建立目錄的task沒錯,但是要產生檔案時,卻出現了目的目錄不存在的錯誤

+

在找資料的時候,發現了這個postgresql 的 pg_prewarm extension

- +

好像有點意思?就來測試看看吧!

+ +

只是目前還不知道該怎麼解讀測試的數據就是了…

+ +

幹!林北真的不是 DBA 啦 =.=

+ +
@@ -410,12 +414,12 @@ if (!doNotTrack) { - +
- 16 December + 18 December @@ -437,20 +441,18 @@ if (!doNotTrack) {
-

這幾天在ansible 寫了一份新的playbook給developer 用

- -

然後user反映說,希望能在ubuntu 18.04 內建的dock 裏面新增一個gnome-terminal的icon

+

剛剛在跑一個修改過的playbook,卻發現一個詭異的狀況

-

我才發現原來之前的寫法不能用在 ubuntu 18.04 上

+

在用template產生檔案之前,爲了避免錯誤,所以我先用 file module 去建立目錄

-

只好又弄了一份出來

+

怪就怪在,建立目錄的task沒錯,但是要產生檔案時,卻出現了目的目錄不存在的錯誤

- +
@@ -468,12 +470,12 @@ if (!doNotTrack) { - +
- 31 October + 16 December @@ -495,28 +497,20 @@ if (!doNotTrack) {
-

最近在準備升級client 的作業系統,從 ubuntu 14.04 準備升級到 18.04 或明年的 20.04

- -

因為公司政策的關係,所以現在要連接internet ,需要申請

- -

然後 user 再去系統的proxy 設定新增一個 PAC 檔

- -

但是這個動作其實是去叫NetworkManager 這個服務

- -

可是在18.04 上,我會把這個服務關掉,因為他會干擾我的DNS設定

+

這幾天在ansible 寫了一份新的playbook給developer 用

-

所以想試試看有沒有辦法不使用 NetworkManager 服務

+

然後user反映說,希望能在ubuntu 18.04 內建的dock 裏面新增一個gnome-terminal的icon

-

又能夠在 user level 修改 proxy 參數

+

我才發現原來之前的寫法不能用在 ubuntu 18.04 上

-

就想到了用 dconf 來做

+

只好又弄了一份出來

- +
@@ -534,12 +528,12 @@ if (!doNotTrack) { - +
- 14 October + 31 October @@ -561,20 +555,28 @@ if (!doNotTrack) {
-

最近上班閒得發慌,沒事就上 github 找看看有沒有什麼好玩的專案

+

最近在準備升級client 的作業系統,從 ubuntu 14.04 準備升級到 18.04 或明年的 20.04

+ +

因為公司政策的關係,所以現在要連接internet ,需要申請

+ +

然後 user 再去系統的proxy 設定新增一個 PAC 檔

+ +

但是這個動作其實是去叫NetworkManager 這個服務

-

就不小心發現了這個 streisand

+

可是在18.04 上,我會把這個服務關掉,因為他會干擾我的DNS設定

+ +

所以想試試看有沒有辦法不使用 NetworkManager 服務

-

https://github.com/StreisandEffect/streisand

+

又能夠在 user level 修改 proxy 參數

-

玩了一下,發現這根本就是終極的VPN Server solution ..

+

就想到了用 dconf 來做

- +
@@ -711,7 +713,16 @@ if (!doNotTrack) { - 12 + + + + + + + + + + 13 @@ -855,7 +866,7 @@ if (!doNotTrack) {
- + diff --git a/public/page/5/index.html b/public/page/5/index.html index bdd7a4e5..0be6430c 100644 --- a/public/page/5/index.html +++ b/public/page/5/index.html @@ -22,8 +22,8 @@ "accountablePerson" : "", "copyrightHolder" : "", "copyrightYear" : "2020", - "datePublished": "2020-08-13 14:22:05 \x2b0800 CST", - "dateModified" : "2020-08-13 14:22:05 \x2b0800 CST", + "datePublished": "2020-09-02 15:55:40 \x2b0800 CST", + "dateModified" : "2020-09-02 15:55:40 \x2b0800 CST", "url" : "https:\/\/h.cowbay.org\/", "wordCount" : "0", "image" : "https://h.cowbay.org%!s(\u003cnil\u003e)"", @@ -46,9 +46,9 @@ - + - + @@ -292,12 +292,12 @@ if (!doNotTrack) { - +
- 04 October + 14 October @@ -313,22 +313,26 @@ if (!doNotTrack) { / - + 筆記
@@ -346,12 +350,12 @@ if (!doNotTrack) { - +
- 20 September + 04 October @@ -367,30 +371,22 @@ if (!doNotTrack) { / - 筆記 +
-

最近都在弄postgresql

- -

備份、還原測試得差不多了,就等著看到時候要用什麼方式

- -

前幾天看到 pg_auto_failover 這個postgresql 的extension

- -

https://github.com/citusdata/pg_auto_failover

- -

感覺挺不錯的,看起來設定很簡單,雖然之前已經測試了 keepalived 做 HA

+

這兩天在找關於在 ubuntu 中做搜尋的軟體

-

不過,反正當作練功嘛,多測試一套也不錯!

+

意外找到一個非常好用的工具 ulauncher

- +
@@ -408,12 +404,12 @@ if (!doNotTrack) { - +
- 10 September + 20 September @@ -435,16 +431,24 @@ if (!doNotTrack) {
-

前幾天在淘寶上買了個 SSK 的USB 3.1 Gen2 (type-c) NVME SSD 外接盒 -手邊也剛好有一條多的intel 600p nvme ssd 就順手來做個比較 -目標是看看有沒有可能直接用外接的SSD來跑postgresql

+

最近都在弄postgresql

- +

備份、還原測試得差不多了,就等著看到時候要用什麼方式

+ +

前幾天看到 pg_auto_failover 這個postgresql 的extension

+ +

https://github.com/citusdata/pg_auto_failover

+ +

感覺挺不錯的,看起來設定很簡單,雖然之前已經測試了 keepalived 做 HA

+ +

不過,反正當作練功嘛,多測試一套也不錯!

+ +
@@ -462,12 +466,12 @@ if (!doNotTrack) { - +
- 06 September + 10 September @@ -489,18 +493,16 @@ if (!doNotTrack) {
-

前面測試了用pgbarman / pgbackrest 來備份 postgresql

- -

這次改從system file level 來下手

- -

採用zfs 的快照來備份、還原postgresql 資料庫

+

前幾天在淘寶上買了個 SSK 的USB 3.1 Gen2 (type-c) NVME SSD 外接盒 +手邊也剛好有一條多的intel 600p nvme ssd 就順手來做個比較 +目標是看看有沒有可能直接用外接的SSD來跑postgresql

- +
@@ -518,12 +520,12 @@ if (!doNotTrack) { - +
- 05 September + 06 September @@ -545,14 +547,18 @@ if (!doNotTrack) {
@@ -691,7 +697,16 @@ if (!doNotTrack) { - 12 + + + + + + + + + + 13 @@ -835,7 +850,7 @@ if (!doNotTrack) {
- + diff --git a/public/page/6/index.html b/public/page/6/index.html index 5bcea4cb..0e5183a1 100644 --- a/public/page/6/index.html +++ b/public/page/6/index.html @@ -22,8 +22,8 @@ "accountablePerson" : "", "copyrightHolder" : "", "copyrightYear" : "2020", - "datePublished": "2020-08-13 14:22:05 \x2b0800 CST", - "dateModified" : "2020-08-13 14:22:05 \x2b0800 CST", + "datePublished": "2020-09-02 15:55:40 \x2b0800 CST", + "dateModified" : "2020-09-02 15:55:40 \x2b0800 CST", "url" : "https:\/\/h.cowbay.org\/", "wordCount" : "0", "image" : "https://h.cowbay.org%!s(\u003cnil\u003e)"", @@ -46,9 +46,9 @@ - + - + @@ -292,12 +292,12 @@ if (!doNotTrack) { - +
- 23 August + 05 September @@ -319,14 +319,14 @@ if (!doNotTrack) {
@@ -344,7 +344,7 @@ if (!doNotTrack) { - +
@@ -371,20 +371,14 @@ if (!doNotTrack) {
@@ -402,12 +396,12 @@ if (!doNotTrack) { - +
- 20 August + 23 August @@ -429,20 +423,20 @@ if (!doNotTrack) {
-

因為老闆說要試試看用GPU 來跑postgresql 威力

+

很久以前就有看到這個用來備份postgresql 的 pgbarman

-

手邊剛好有一張 geforce gt 720

+

https://www.pgbarman.org/

-

一開始沒想太多,看到有這張卡的驅動程式,然後CUDA也有支援

+

前幾天老闆在slack 上面又提到,所以這次就花了點時間來玩玩看

-

就直接從桌機拔下來,接去LAB Server ,然後就開始一連串的難關了…

+

不過呢,雖然有弄起來,但是還真不知道有些問題是怎麼解決的…

- +
@@ -460,12 +454,12 @@ if (!doNotTrack) { - +
- 16 August + 20 August @@ -487,26 +481,20 @@ if (!doNotTrack) {
-

最近一直在玩 wireguard ,先前把各個分公司和總部的VPN 改用 wireguard 建立

- -

想說再打個VPN tunnel 來當跳板連 ptt 好了

- -

因為wireguard 建立很簡單,而且又可以指定想要繞出去的路由,不會影響原本的網路環境

- -

本來是在vultr 的VPS上面建立這個tunnel

+

因為老闆說要試試看用GPU 來跑postgresql 威力

-

但是那台VPS連去ptt 很頓,卡卡的

+

手邊剛好有一張 geforce gt 720

-

所以改用google cloud platform 的free tier 來做

+

一開始沒想太多,看到有這張卡的驅動程式,然後CUDA也有支援

-

反正只是拿來當跳板,不會有什麼流量、運算產生,可以一直保持免費的狀態

+

就直接從桌機拔下來,接去LAB Server ,然後就開始一連串的難關了…

- +
@@ -524,12 +512,12 @@ if (!doNotTrack) { - +
- 13 August + 16 August @@ -551,24 +539,26 @@ if (!doNotTrack) {
-

因為實在受夠了現在用的 openwrt + strongswan 建立 IPSec VPN

+

最近一直在玩 wireguard ,先前把各個分公司和總部的VPN 改用 wireguard 建立

-

雖然說其實沒有什麼不好,但是畢竟不是我建立的,而當初的文件也都不見了

+

想說再打個VPN tunnel 來當跳板連 ptt 好了

+ +

因為wireguard 建立很簡單,而且又可以指定想要繞出去的路由,不會影響原本的網路環境

-

完全沒辦法了解當時設計的邏輯,造成後續debug 困難

+

本來是在vultr 的VPS上面建立這個tunnel

-

可以想像一下,一台VPN router ping 不到remote、ping不到internet、甚至ping不到自己 是要怎麼debug !?(翻桌

+

但是那台VPS連去ptt 很頓,卡卡的

-

之前買了兩台edgerouter X 拿來玩了一下 wireguard,感覺還不錯,不過只有測試到點對點

+

所以改用google cloud platform 的free tier 來做

-

這次試試看躲在gateway後面,看看能不能建立多點的VPN環境

+

反正只是拿來當跳板,不會有什麼流量、運算產生,可以一直保持免費的狀態

- +
@@ -709,7 +699,16 @@ if (!doNotTrack) { - 12 + + + + + + + + + + 13 @@ -853,7 +852,7 @@ if (!doNotTrack) {
- + diff --git a/public/page/7/index.html b/public/page/7/index.html index 2444f2cc..9c72294e 100644 --- a/public/page/7/index.html +++ b/public/page/7/index.html @@ -22,8 +22,8 @@ "accountablePerson" : "", "copyrightHolder" : "", "copyrightYear" : "2020", - "datePublished": "2020-08-13 14:22:05 \x2b0800 CST", - "dateModified" : "2020-08-13 14:22:05 \x2b0800 CST", + "datePublished": "2020-09-02 15:55:40 \x2b0800 CST", + "dateModified" : "2020-09-02 15:55:40 \x2b0800 CST", "url" : "https:\/\/h.cowbay.org\/", "wordCount" : "0", "image" : "https://h.cowbay.org%!s(\u003cnil\u003e)"", @@ -46,9 +46,9 @@ - + - + @@ -292,12 +292,12 @@ if (!doNotTrack) { - +
- 06 August + 13 August @@ -319,32 +319,24 @@ if (!doNotTrack) {
-

之前總部和分公司之間 是用buffalo 的小AP 灌 openwrt

- -

然後用strongswan 來打 IPSEC site to site VPN

- -

config 看起來不是很難 (只是看起來)

+

因為實在受夠了現在用的 openwrt + strongswan 建立 IPSec VPN

-

但是實際上已經找不到當初的文件

- -

所以要維護很困難(光那些RSA KEY 就不知道為何、如何產生)

+

雖然說其實沒有什麼不好,但是畢竟不是我建立的,而當初的文件也都不見了

-

後來採購了兩台edgerouter X 做測試

+

完全沒辦法了解當時設計的邏輯,造成後續debug 困難

-

也用openvpn 成功的建立了 site to site VPN

+

可以想像一下,一台VPN router ping 不到remote、ping不到internet、甚至ping不到自己 是要怎麼debug !?(翻桌

-

本來想說 openvpn 已經夠簡單了

+

之前買了兩台edgerouter X 拿來玩了一下 wireguard,感覺還不錯,不過只有測試到點對點

-

今天看到文章說用wireguard 可以更簡單

+

這次試試看躲在gateway後面,看看能不能建立多點的VPN環境

-

於是研究了一下,發現還真的很簡單!

- - +
@@ -362,12 +354,12 @@ if (!doNotTrack) { - +
- 05 August + 06 August @@ -383,31 +375,38 @@ if (!doNotTrack) { / - ansible + 筆記
-

之前為了能夠在執行完 ansible playbook 後,能有個log 可以看

+

之前總部和分公司之間 是用buffalo 的小AP 灌 openwrt

-

所以在每次執行的時候,都要加入 tee 的指令

+

然後用strongswan 來打 IPSEC site to site VPN

-

像是

+

config 看起來不是很難 (只是看起來)

-
ANSIBLE_CONFIG=/home/D/ansiblecontrol/ansible.cfg /usr/local/bin/ansible-playbook  /home/D/ansiblecontrol/playbook.user_client.yml --vault-password-file=/home/D/ansiblecontrol/vault.passwd -i /home/D/ansiblecontrol/inventory/production -f1 --limit tyuserclients |tee /tmp/tyuserclients.log
-
+

但是實際上已經找不到當初的文件

-

一直都是放在crontab 裡面執行,也就沒有去管他

+

所以要維護很困難(光那些RSA KEY 就不知道為何、如何產生)

-

反正也沒有人關心結果怎樣 (攤手

+

後來採購了兩台edgerouter X 做測試

- +

也用openvpn 成功的建立了 site to site VPN

+ +

本來想說 openvpn 已經夠簡單了

+ +

今天看到文章說用wireguard 可以更簡單

+ +

於是研究了一下,發現還真的很簡單!

+ +
@@ -425,12 +424,12 @@ if (!doNotTrack) { - +
- 31 July + 05 August @@ -446,34 +445,31 @@ if (!doNotTrack) { / - 筆記 + ansible
-

最近有個任務,需要大量安裝client

- -

想用PXE來處理,只要user開機按F12(acer 桌機) 選擇PXE Boot

- -

然後選擇OS版本,就可以自動進行安裝

+

之前為了能夠在執行完 ansible playbook 後,能有個log 可以看

-

安裝完成後,會自動重新開機,接著就用ansible來做user環境設定

+

所以在每次執行的時候,都要加入 tee 的指令

-

PXE的部份本來是沒有什麼問題,自動安裝系統的部份都做好了

+

像是

-

可是因為這次的量比較多,想說讓每一台在完成PXE安裝後的第一次重開機

+
ANSIBLE_CONFIG=/home/D/ansiblecontrol/ansible.cfg /usr/local/bin/ansible-playbook  /home/D/ansiblecontrol/playbook.user_client.yml --vault-password-file=/home/D/ansiblecontrol/vault.passwd -i /home/D/ansiblecontrol/inventory/production -f1 --limit tyuserclients |tee /tmp/tyuserclients.log
+
-

就送出一封郵件來通知我,說已經完成安裝,可以執行ansible 了

+

一直都是放在crontab 裡面執行,也就沒有去管他

-

看似很簡單的一件事情,卻搞了我兩天….

+

反正也沒有人關心結果怎樣 (攤手

- +
@@ -491,12 +487,12 @@ if (!doNotTrack) { - +
- 23 July + 31 July @@ -512,26 +508,34 @@ if (!doNotTrack) { / - ansible + 筆記
-

因為工作上的需要,要修改client端的 /etc/environment 檔案

+

最近有個任務,需要大量安裝client

-

在有權限使用proxy 服務的user的環境中,加入proxy 的設定

+

想用PXE來處理,只要user開機按F12(acer 桌機) 選擇PXE Boot

-

原本的清單中,有host/user/ip 這幾個值可以拿來判斷

+

然後選擇OS版本,就可以自動進行安裝

-

proxy server 那邊是採用ip 來控制,所以這邊也跟著用 ip 來判斷要不要修改 /etc/environment

+

安裝完成後,會自動重新開機,接著就用ansible來做user環境設定

- +

PXE的部份本來是沒有什麼問題,自動安裝系統的部份都做好了

+ +

可是因為這次的量比較多,想說讓每一台在完成PXE安裝後的第一次重開機

+ +

就送出一封郵件來通知我,說已經完成安裝,可以執行ansible 了

+ +

看似很簡單的一件事情,卻搞了我兩天….

+ +
@@ -549,12 +553,12 @@ if (!doNotTrack) { - +
- 01 July + 23 July @@ -570,24 +574,26 @@ if (!doNotTrack) { / - Ansible + ansible
-

在ansible中,關於如何引用自定義的變數,一直讓我很頭疼

+

因為工作上的需要,要修改client端的 /etc/environment 檔案

+ +

在有權限使用proxy 服務的user的環境中,加入proxy 的設定

-

尤其是有牽涉到從外部導入yaml檔案時,更是常常讓我不知道到底該怎麼抓出想要的變數

+

原本的清單中,有host/user/ip 這幾個值可以拿來判斷

-

這次還是用selectattr 來處理,希望下次能夠記得…

+

proxy server 那邊是採用ip 來控制,所以這邊也跟著用 ip 來判斷要不要修改 /etc/environment

- +
@@ -728,7 +734,16 @@ if (!doNotTrack) { - 12 + + + + + + + + + + 13 @@ -872,7 +887,7 @@ if (!doNotTrack) {
- + diff --git a/public/page/8/index.html b/public/page/8/index.html index 5980d074..c0a39c70 100644 --- a/public/page/8/index.html +++ b/public/page/8/index.html @@ -22,8 +22,8 @@ "accountablePerson" : "", "copyrightHolder" : "", "copyrightYear" : "2020", - "datePublished": "2020-08-13 14:22:05 \x2b0800 CST", - "dateModified" : "2020-08-13 14:22:05 \x2b0800 CST", + "datePublished": "2020-09-02 15:55:40 \x2b0800 CST", + "dateModified" : "2020-09-02 15:55:40 \x2b0800 CST", "url" : "https:\/\/h.cowbay.org\/", "wordCount" : "0", "image" : "https://h.cowbay.org%!s(\u003cnil\u003e)"", @@ -46,9 +46,9 @@ - + - + @@ -292,12 +292,12 @@ if (!doNotTrack) { - +
- 20 June + 01 July @@ -313,28 +313,24 @@ if (!doNotTrack) { / - 筆記 + Ansible
-

之前在LAN/windows環境下,一直都是用ultravnc/winvnc/tigervnc之類的VNC軟體

- -

但是如果要過 internet ,就會碰到各種開port的問題

- -

在這種環境下,就有了當時 teamviewer 的橫空出世

+

在ansible中,關於如何引用自定義的變數,一直讓我很頭疼

-

解決了開PORT的問題,讓被控端(通常是資訊技術相對弱勢,需要接受幫助的一方)不需要懂太多

+

尤其是有牽涉到從外部導入yaml檔案時,更是常常讓我不知道到底該怎麼抓出想要的變數

-

只要下載teamviewer被控端,開啟後報ID 給協助者就好了

+

這次還是用selectattr 來處理,希望下次能夠記得…

- +
@@ -352,12 +348,12 @@ if (!doNotTrack) { - +
- 17 June + 20 June @@ -373,30 +369,28 @@ if (!doNotTrack) { / - Proxmox + 筆記
-

前幾天接的一個case

- -

因為費用的關係,所以沒有考慮用傳統定義上的伺服器(DELL R640)

+

之前在LAN/windows環境下,一直都是用ultravnc/winvnc/tigervnc之類的VNC軟體

-

改採用比較高階一點的洋垃圾,規格大概是 Intel E5-2680V2 x2 + 64G RAM + 128G SSD x2 (OS) + 960G SSD x4 (raid 10 , zfs)

+

但是如果要過 internet ,就會碰到各種開port的問題

-

storage 選擇QNAP NAS TS-932X + 960G SSD x 4 (raid 10 , NFS) + QNAP 10G Switch QSW-1280C-8C

+

在這種環境下,就有了當時 teamviewer 的橫空出世

-

既然storage這邊選用了10G的機種,伺服器上當然也要增加10G網卡

+

解決了開PORT的問題,讓被控端(通常是資訊技術相對弱勢,需要接受幫助的一方)不需要懂太多

-

一樣,成本考量,就不用INTEL 了,買了這張 ASUS 10G 網卡

+

只要下載teamviewer被控端,開啟後報ID 給協助者就好了

- +
@@ -414,12 +408,12 @@ if (!doNotTrack) { - +
- 21 May + 17 June @@ -435,22 +429,30 @@ if (!doNotTrack) { / - 筆記 + Proxmox
-

最近一直在玩一些docker,不過老是會碰到歪果扔寫的東西,時區都不一致

+

前幾天接的一個case

-

有的用 UTC,有的用localtime,就是沒碰到用 Asia/Taipei 的….

+

因為費用的關係,所以沒有考慮用傳統定義上的伺服器(DELL R640)

- +

改採用比較高階一點的洋垃圾,規格大概是 Intel E5-2680V2 x2 + 64G RAM + 128G SSD x2 (OS) + 960G SSD x4 (raid 10 , zfs)

+ +

storage 選擇QNAP NAS TS-932X + 960G SSD x 4 (raid 10 , NFS) + QNAP 10G Switch QSW-1280C-8C

+ +

既然storage這邊選用了10G的機種,伺服器上當然也要增加10G網卡

+ +

一樣,成本考量,就不用INTEL 了,買了這張 ASUS 10G 網卡

+ +
@@ -468,12 +470,12 @@ if (!doNotTrack) { - +
- 17 May + 21 May @@ -489,26 +491,22 @@ if (!doNotTrack) { / - linux + 筆記
-

工作上常會需要用ssh登入遠端主機檢查LOG,有必要的時候,還要把log複製回本機來處理。

- -

以前都是傻傻的用 scp 傳檔案

- -

之前就記得有這個xclip/xsel 可以用,但是一直沒有弄清楚怎麼執行

+

最近一直在玩一些docker,不過老是會碰到歪果扔寫的東西,時區都不一致

-

早上研究了一下,順便做個筆記。

+

有的用 UTC,有的用localtime,就是沒碰到用 Asia/Taipei 的….

- +
@@ -526,12 +524,12 @@ if (!doNotTrack) { - +
- 23 April + 17 May @@ -547,28 +545,26 @@ if (!doNotTrack) { / - 筆記 + linux
-

最近因為一直碰到硬碟故障的問題,算起來那一批同時購買的5X顆 seagate 2T硬碟,已經有一半以上故障返修了….

- -

然後又因為一直沒有添購新的硬碟,只能用這些快過保/已過保的撐著

+

工作上常會需要用ssh登入遠端主機檢查LOG,有必要的時候,還要把log複製回本機來處理。

-

所以最近不斷的在更換機器內的硬碟,而且還沒有熱插拔!

+

以前都是傻傻的用 scp 傳檔案

-

也導致原本負責處理盤點資產的同事困擾,因為跟手邊的紀錄已經對不起來了

+

之前就記得有這個xclip/xsel 可以用,但是一直沒有弄清楚怎麼執行

-

然後就變成要對資產的時候,需要一台一台登入,然後去下不同的指令,取得想要的硬體資訊,超級麻煩的!

+

早上研究了一下,順便做個筆記。

- +
@@ -709,7 +705,16 @@ if (!doNotTrack) { - 12 + + + + + + + + + + 13 @@ -853,7 +858,7 @@ if (!doNotTrack) {
- + diff --git a/public/page/9/index.html b/public/page/9/index.html index 9addc9ea..2f15d70b 100644 --- a/public/page/9/index.html +++ b/public/page/9/index.html @@ -22,8 +22,8 @@ "accountablePerson" : "", "copyrightHolder" : "", "copyrightYear" : "2020", - "datePublished": "2020-08-13 14:22:05 \x2b0800 CST", - "dateModified" : "2020-08-13 14:22:05 \x2b0800 CST", + "datePublished": "2020-09-02 15:55:40 \x2b0800 CST", + "dateModified" : "2020-09-02 15:55:40 \x2b0800 CST", "url" : "https:\/\/h.cowbay.org\/", "wordCount" : "0", "image" : "https://h.cowbay.org%!s(\u003cnil\u003e)"", @@ -46,9 +46,9 @@ - + - + @@ -292,7 +292,7 @@ if (!doNotTrack) { - +
@@ -319,20 +319,22 @@ if (!doNotTrack) {
-

今天發生一件有點詭異的事情,本來應該要經過某個指令才會產生的檔案

+

最近因為一直碰到硬碟故障的問題,算起來那一批同時購買的5X顆 seagate 2T硬碟,已經有一半以上故障返修了….

-

居然不知為何自己產生了,在我記憶中沒有去執行過那個指令

+

然後又因為一直沒有添購新的硬碟,只能用這些快過保/已過保的撐著

-

翻了一下 bash_history ,裡面也只有下過哪些指令,沒有紀錄時間,完全沒有參考價值(攤手)

+

所以最近不斷的在更換機器內的硬碟,而且還沒有熱插拔!

-

所以翻了一下網路,至少把這兩台主要跑ansible的機器的log功能補上紀錄所有指令以及時間的部份

+

也導致原本負責處理盤點資產的同事困擾,因為跟手邊的紀錄已經對不起來了

- +

然後就變成要對資產的時候,需要一台一台登入,然後去下不同的指令,取得想要的硬體資訊,超級麻煩的!

+ +
@@ -350,12 +352,12 @@ if (!doNotTrack) { - +
- 01 April + 23 April @@ -377,18 +379,20 @@ if (!doNotTrack) {
-

今天把其中一台proxmox 加上10G 光纖網卡,準備和另一台proxmox 組成10G 環境進行測試

+

今天發生一件有點詭異的事情,本來應該要經過某個指令才會產生的檔案

-

想說把本機的zpool 拆掉,重新建立一個raid0 的空間來做clone/migrate

+

居然不知為何自己產生了,在我記憶中沒有去執行過那個指令

-

可是一直出現device busy的錯誤訊息

+

翻了一下 bash_history ,裡面也只有下過哪些指令,沒有紀錄時間,完全沒有參考價值(攤手)

- +

所以翻了一下網路,至少把這兩台主要跑ansible的機器的log功能補上紀錄所有指令以及時間的部份

+ +
@@ -406,12 +410,12 @@ if (!doNotTrack) { - +
- 27 March + 01 April @@ -433,16 +437,18 @@ if (!doNotTrack) {
-

公司的一台老伺服器空間不足了,要執行指令都會中斷,所以想要擴充空間。

+

今天把其中一台proxmox 加上10G 光纖網卡,準備和另一台proxmox 組成10G 環境進行測試

-

看起來不難搞,事實上…..

+

想說把本機的zpool 拆掉,重新建立一個raid0 的空間來做clone/migrate

- +

可是一直出現device busy的錯誤訊息

+ +
@@ -460,12 +466,12 @@ if (!doNotTrack) { - +
- 20 March + 27 March @@ -479,21 +485,24 @@ if (!doNotTrack) { + / + + 筆記 + +
-

今天老闆出國,發slack說手機不能寄信,看了一下,似乎是因為用GMAIL的APP來收信

- -

然後google 不知道跟人家改了什麼,結果不接受原本的認證了… WTF ….

+

公司的一台老伺服器空間不足了,要執行指令都會中斷,所以想要擴充空間。

-

然後,這問題應該很久了,結果現在才在講 ….

+

看起來不難搞,事實上…..

- +
@@ -511,12 +520,12 @@ if (!doNotTrack) { - +
- 11 March + 20 March @@ -530,28 +539,21 @@ if (!doNotTrack) { - / - - 筆記 - -
-

最近要開始測試client安裝 ubuntu 18.04 的 ansible playbook

- -

因為要不斷的修正,所以想到一直有在自己電腦上執行的timeshift這個軟體

+

今天老闆出國,發slack說手機不能寄信,看了一下,似乎是因為用GMAIL的APP來收信

-

可以很簡單快速的備份、恢復系統狀態

+

然後google 不知道跟人家改了什麼,結果不接受原本的認證了… WTF ….

-

可是不知道為什麼,在ubuntu 18.04 上安裝就是會發生錯誤….

+

然後,這問題應該很久了,結果現在才在講 ….

- +
@@ -692,7 +694,16 @@ if (!doNotTrack) { - 12 + + + + + + + + + + 13 @@ -836,7 +847,7 @@ if (!doNotTrack) {
- + diff --git a/public/post/10g-lab-using-proxmox-and-mellanox/index.html b/public/post/10g-lab-using-proxmox-and-mellanox/index.html index 5f4d7875..7644e819 100644 --- a/public/post/10g-lab-using-proxmox-and-mellanox/index.html +++ b/public/post/10g-lab-using-proxmox-and-mellanox/index.html @@ -45,9 +45,9 @@ - + - + @@ -818,7 +818,7 @@ title="pinterest icon">
- + diff --git a/public/post/accidentally-typed-an-extra-space-in-ansible-playbook/index.html b/public/post/accidentally-typed-an-extra-space-in-ansible-playbook/index.html index a9824d96..9af01c75 100644 --- a/public/post/accidentally-typed-an-extra-space-in-ansible-playbook/index.html +++ b/public/post/accidentally-typed-an-extra-space-in-ansible-playbook/index.html @@ -45,9 +45,9 @@ - + - + @@ -688,7 +688,7 @@ title="pinterest icon">
- + diff --git a/public/post/add-system-wide-favorite-apps-in-dconf/index.html b/public/post/add-system-wide-favorite-apps-in-dconf/index.html index a405f5b0..f8b5a3ac 100644 --- a/public/post/add-system-wide-favorite-apps-in-dconf/index.html +++ b/public/post/add-system-wide-favorite-apps-in-dconf/index.html @@ -45,9 +45,9 @@ - + - + @@ -656,7 +656,7 @@ title="pinterest icon">
- + diff --git a/public/post/another-way-to-keep-ansible-log/index.html b/public/post/another-way-to-keep-ansible-log/index.html index b338e55a..db9660b6 100644 --- a/public/post/another-way-to-keep-ansible-log/index.html +++ b/public/post/another-way-to-keep-ansible-log/index.html @@ -45,9 +45,9 @@ - + - + @@ -618,7 +618,7 @@ title="pinterest icon">
- + diff --git a/public/post/ansible-get-value-from-loop-register/index.html b/public/post/ansible-get-value-from-loop-register/index.html index 5298b9db..c9f86438 100644 --- a/public/post/ansible-get-value-from-loop-register/index.html +++ b/public/post/ansible-get-value-from-loop-register/index.html @@ -45,9 +45,9 @@ - + - + @@ -723,7 +723,7 @@ title="pinterest icon">
- + diff --git a/public/post/ansible-run-task-depends-on-ipaddr/index.html b/public/post/ansible-run-task-depends-on-ipaddr/index.html index 8c726210..0e3e53e0 100644 --- a/public/post/ansible-run-task-depends-on-ipaddr/index.html +++ b/public/post/ansible-run-task-depends-on-ipaddr/index.html @@ -45,9 +45,9 @@ - + - + @@ -701,7 +701,7 @@ title="pinterest icon">
- + diff --git a/public/post/ansible-selectattr-filter/index.html b/public/post/ansible-selectattr-filter/index.html index 9367b237..d138a79e 100644 --- a/public/post/ansible-selectattr-filter/index.html +++ b/public/post/ansible-selectattr-filter/index.html @@ -45,9 +45,9 @@ - + - + @@ -621,7 +621,7 @@ title="pinterest icon">
- + diff --git a/public/post/ansible-selectattr-from-list-in-dictionary/index.html b/public/post/ansible-selectattr-from-list-in-dictionary/index.html index 1d00506b..8f085319 100644 --- a/public/post/ansible-selectattr-from-list-in-dictionary/index.html +++ b/public/post/ansible-selectattr-from-list-in-dictionary/index.html @@ -45,9 +45,9 @@ - + - + @@ -676,7 +676,7 @@ title="pinterest icon">
- + diff --git a/public/post/ansible-selectattr/index.html b/public/post/ansible-selectattr/index.html index 3ab4cf73..edebfcc0 100644 --- a/public/post/ansible-selectattr/index.html +++ b/public/post/ansible-selectattr/index.html @@ -45,9 +45,9 @@ - + - + @@ -732,7 +732,7 @@ title="pinterest icon">
- + diff --git a/public/post/ansible-ssh-forwardagent/index.html b/public/post/ansible-ssh-forwardagent/index.html index 728f7078..afcaab5f 100644 --- a/public/post/ansible-ssh-forwardagent/index.html +++ b/public/post/ansible-ssh-forwardagent/index.html @@ -45,9 +45,9 @@ - + - + @@ -770,7 +770,7 @@ title="pinterest icon">
- + diff --git a/public/post/awesome-all-in-one-vpn-server-streisand/index.html b/public/post/awesome-all-in-one-vpn-server-streisand/index.html index 469d89da..40f96973 100644 --- a/public/post/awesome-all-in-one-vpn-server-streisand/index.html +++ b/public/post/awesome-all-in-one-vpn-server-streisand/index.html @@ -45,9 +45,9 @@ - + - + @@ -633,7 +633,7 @@ title="pinterest icon">
- + diff --git a/public/post/backup-restore-postgresql-with-pgbackrest/index.html b/public/post/backup-restore-postgresql-with-pgbackrest/index.html index a75d8251..4ea6fe77 100644 --- a/public/post/backup-restore-postgresql-with-pgbackrest/index.html +++ b/public/post/backup-restore-postgresql-with-pgbackrest/index.html @@ -45,9 +45,9 @@ - + - + @@ -858,7 +858,7 @@ title="pinterest icon">
- + diff --git a/public/post/bencmark-with-external-internal-nvme-ssd-and-external-sata-ssd/index.html b/public/post/bencmark-with-external-internal-nvme-ssd-and-external-sata-ssd/index.html index 60ac8d07..47b23d68 100644 --- a/public/post/bencmark-with-external-internal-nvme-ssd-and-external-sata-ssd/index.html +++ b/public/post/bencmark-with-external-internal-nvme-ssd-and-external-sata-ssd/index.html @@ -45,9 +45,9 @@ - + - + @@ -1000,7 +1000,7 @@ title="pinterest icon">
- + diff --git a/public/post/bookstack-docker/index.html b/public/post/bookstack-docker/index.html index c1a11a7d..11f017d7 100644 --- a/public/post/bookstack-docker/index.html +++ b/public/post/bookstack-docker/index.html @@ -45,9 +45,9 @@ - + - + @@ -687,7 +687,7 @@ title="pinterest icon">
- + diff --git a/public/post/change-preferred-language-in-firefox/index.html b/public/post/change-preferred-language-in-firefox/index.html index 86baf133..90e4477c 100644 --- a/public/post/change-preferred-language-in-firefox/index.html +++ b/public/post/change-preferred-language-in-firefox/index.html @@ -45,9 +45,9 @@ - + - + @@ -661,7 +661,7 @@ title="pinterest icon">
- + diff --git a/public/post/change-timezone-in-docker/index.html b/public/post/change-timezone-in-docker/index.html index 4b1bc355..0f26864c 100644 --- a/public/post/change-timezone-in-docker/index.html +++ b/public/post/change-timezone-in-docker/index.html @@ -45,9 +45,9 @@ - + - + @@ -725,7 +725,7 @@ title="pinterest icon">
- + diff --git a/public/post/check-port-speed-in-openwrt/index.html b/public/post/check-port-speed-in-openwrt/index.html index add698cb..0704e946 100644 --- a/public/post/check-port-speed-in-openwrt/index.html +++ b/public/post/check-port-speed-in-openwrt/index.html @@ -45,9 +45,9 @@ - + - + @@ -1067,7 +1067,7 @@ title="pinterest icon">
- + diff --git a/public/post/command_to_test_main_ssl/index.html b/public/post/command_to_test_main_ssl/index.html index 2f8fcd9a..06b4f3b2 100644 --- a/public/post/command_to_test_main_ssl/index.html +++ b/public/post/command_to_test_main_ssl/index.html @@ -45,9 +45,9 @@ - + - + @@ -802,7 +802,7 @@ title="pinterest icon">
- + diff --git a/public/post/config-networkmanager-in-ubuntu-to-stop-modify-resolvconf/index.html b/public/post/config-networkmanager-in-ubuntu-to-stop-modify-resolvconf/index.html index b9ce088c..1fdfe22c 100644 --- a/public/post/config-networkmanager-in-ubuntu-to-stop-modify-resolvconf/index.html +++ b/public/post/config-networkmanager-in-ubuntu-to-stop-modify-resolvconf/index.html @@ -45,9 +45,9 @@ - + - + @@ -651,7 +651,7 @@ title="pinterest icon">
- + diff --git a/public/post/copy_role_in_pgsql/index.html b/public/post/copy_role_in_pgsql/index.html index 0fed6aae..3ee098c1 100644 --- a/public/post/copy_role_in_pgsql/index.html +++ b/public/post/copy_role_in_pgsql/index.html @@ -45,9 +45,9 @@ - + - + @@ -619,7 +619,7 @@ title="pinterest icon">
- + diff --git a/public/post/create-portable-vim-environment/index.html b/public/post/create-portable-vim-environment/index.html index c292b812..5c636ba4 100644 --- a/public/post/create-portable-vim-environment/index.html +++ b/public/post/create-portable-vim-environment/index.html @@ -45,9 +45,9 @@ - + - + @@ -632,7 +632,7 @@ title="pinterest icon">
- + diff --git a/public/post/debian-buster-server-been-hacked/index.html b/public/post/debian-buster-server-been-hacked/index.html index fb68e575..3dc82e1a 100644 --- a/public/post/debian-buster-server-been-hacked/index.html +++ b/public/post/debian-buster-server-been-hacked/index.html @@ -45,9 +45,9 @@ - + - + @@ -750,7 +750,7 @@ title="pinterest icon">
- + diff --git a/public/post/do-no-use-10-0-0-0-private-ipaddr-in-gcp/index.html b/public/post/do-no-use-10-0-0-0-private-ipaddr-in-gcp/index.html index 977d1d59..6ce5bec9 100644 --- a/public/post/do-no-use-10-0-0-0-private-ipaddr-in-gcp/index.html +++ b/public/post/do-no-use-10-0-0-0-private-ipaddr-in-gcp/index.html @@ -45,9 +45,9 @@ - + - + @@ -687,7 +687,7 @@ title="pinterest icon">
- + diff --git a/public/post/enable-synology-public-ssh/index.html b/public/post/enable-synology-public-ssh/index.html index a05e30a9..905accdf 100644 --- a/public/post/enable-synology-public-ssh/index.html +++ b/public/post/enable-synology-public-ssh/index.html @@ -45,9 +45,9 @@ - + - + @@ -705,7 +705,7 @@ title="pinterest icon">
- + diff --git a/public/post/first-try-synology-ha/index.html b/public/post/first-try-synology-ha/index.html index fcf67bbc..27cba848 100644 --- a/public/post/first-try-synology-ha/index.html +++ b/public/post/first-try-synology-ha/index.html @@ -45,9 +45,9 @@ - + - + @@ -676,7 +676,7 @@ title="pinterest icon">
- + diff --git a/public/post/fix-zpool-device-busy-using-dmsetup/index.html b/public/post/fix-zpool-device-busy-using-dmsetup/index.html index 5270b0ea..12c1629d 100644 --- a/public/post/fix-zpool-device-busy-using-dmsetup/index.html +++ b/public/post/fix-zpool-device-busy-using-dmsetup/index.html @@ -45,9 +45,9 @@ - + - + @@ -652,7 +652,7 @@ title="pinterest icon">
- + diff --git a/public/post/incredibly-slow-mdadm-rebuild/index.html b/public/post/incredibly-slow-mdadm-rebuild/index.html index 76a7fbf6..acc0f2ac 100644 --- a/public/post/incredibly-slow-mdadm-rebuild/index.html +++ b/public/post/incredibly-slow-mdadm-rebuild/index.html @@ -45,9 +45,9 @@ - + - + @@ -675,7 +675,7 @@ title="pinterest icon">
- + diff --git a/public/post/index.xml b/public/post/index.xml index a588d1a4..0c8899d4 100644 --- a/public/post/index.xml +++ b/public/post/index.xml @@ -6,11 +6,30 @@ Recent content in Posts on MC部落 Hugo -- gohugo.io en-us - Thu, 13 Aug 2020 14:22:05 +0800 + Wed, 02 Sep 2020 15:55:40 +0800 + + [筆記] 在 ubuntu 20.04 底下,用certbot 透過Cloudflare 申請全域的 Letsencrypt 憑證 + https://h.cowbay.org/post/ubuntu-letsencrypt-cloudflare-wildcard/ + Wed, 02 Sep 2020 15:55:40 +0800 + + https://h.cowbay.org/post/ubuntu-letsencrypt-cloudflare-wildcard/ + <p>之前用caddy 作為反向代理,其中一個優勢就是caddy 會自動處理Letsencrypt 憑證的問題</p> + +<p>也不用煩惱怎麼去更新一堆有的沒的</p> + +<p>不過,實際應用上,還是偶爾會拿這些憑證檔案來用的狀況</p> + +<p>雖然可以從caddy 上面取得這些檔案</p> + +<p>但是基本上這些檔案都是綁定一個特定的hostname</p> + +<p>可是我想要有一個憑證,可以給同網域底下的機器用 ( Wildcard certificates )</p> + + [筆記] 在 ubuntu 20.04 上安裝 wireguard + pihole 作 AD Blocking/install wireguard and pihole to do ad block in ubuntu 20.04 https://h.cowbay.org/post/wireguard-pihole-in-ubuntu-20.04/ diff --git a/public/post/install-asus-10g-nic-in-proxmox/index.html b/public/post/install-asus-10g-nic-in-proxmox/index.html index 55093bff..f9c2b82f 100644 --- a/public/post/install-asus-10g-nic-in-proxmox/index.html +++ b/public/post/install-asus-10g-nic-in-proxmox/index.html @@ -45,9 +45,9 @@ - + - + @@ -714,7 +714,7 @@ title="pinterest icon">
- + diff --git a/public/post/install-it500u-card-reader-in-ubuntu-1804/index.html b/public/post/install-it500u-card-reader-in-ubuntu-1804/index.html index f6abe409..38526f75 100644 --- a/public/post/install-it500u-card-reader-in-ubuntu-1804/index.html +++ b/public/post/install-it500u-card-reader-in-ubuntu-1804/index.html @@ -45,9 +45,9 @@ - + - + @@ -708,7 +708,7 @@ title="pinterest icon">
- + diff --git a/public/post/install-nvidia-driver-cuda-pgstrom-in-ubuntu-1804/index.html b/public/post/install-nvidia-driver-cuda-pgstrom-in-ubuntu-1804/index.html index 49d6aec8..44a4a329 100644 --- a/public/post/install-nvidia-driver-cuda-pgstrom-in-ubuntu-1804/index.html +++ b/public/post/install-nvidia-driver-cuda-pgstrom-in-ubuntu-1804/index.html @@ -45,9 +45,9 @@ - + - + @@ -852,7 +852,7 @@ title="pinterest icon">
- + diff --git a/public/post/install-timeshift-on-ubuntu1804/index.html b/public/post/install-timeshift-on-ubuntu1804/index.html index 64cfcd1b..f4aa7f8e 100644 --- a/public/post/install-timeshift-on-ubuntu1804/index.html +++ b/public/post/install-timeshift-on-ubuntu1804/index.html @@ -45,9 +45,9 @@ - + - + @@ -1177,7 +1177,7 @@ title="pinterest icon">
- + diff --git a/public/post/install-ubuntu1804-on-dell-6ir-raid-controller/index.html b/public/post/install-ubuntu1804-on-dell-6ir-raid-controller/index.html index c371e35b..f333cf26 100644 --- a/public/post/install-ubuntu1804-on-dell-6ir-raid-controller/index.html +++ b/public/post/install-ubuntu1804-on-dell-6ir-raid-controller/index.html @@ -45,9 +45,9 @@ - + - + @@ -638,7 +638,7 @@ title="pinterest icon">
- + diff --git a/public/post/inx-collect-detail-hardware-info/index.html b/public/post/inx-collect-detail-hardware-info/index.html index 9358a5ff..81afdd4d 100644 --- a/public/post/inx-collect-detail-hardware-info/index.html +++ b/public/post/inx-collect-detail-hardware-info/index.html @@ -45,9 +45,9 @@ - + - + @@ -723,7 +723,7 @@ title="pinterest icon">
- + diff --git a/public/post/log-all-bash-commands/index.html b/public/post/log-all-bash-commands/index.html index 00756b16..34afa743 100644 --- a/public/post/log-all-bash-commands/index.html +++ b/public/post/log-all-bash-commands/index.html @@ -45,9 +45,9 @@ - + - + @@ -656,7 +656,7 @@ title="pinterest icon">
- + diff --git a/public/post/multiple-site-to-site-vpn-using-wireguard/index.html b/public/post/multiple-site-to-site-vpn-using-wireguard/index.html index 334fec50..c1d534fc 100644 --- a/public/post/multiple-site-to-site-vpn-using-wireguard/index.html +++ b/public/post/multiple-site-to-site-vpn-using-wireguard/index.html @@ -45,9 +45,9 @@ - + - + @@ -880,7 +880,7 @@ title="pinterest icon">
- + diff --git a/public/post/nice-du-report-tool-durep/index.html b/public/post/nice-du-report-tool-durep/index.html index 445c87b3..10acbbb6 100644 --- a/public/post/nice-du-report-tool-durep/index.html +++ b/public/post/nice-du-report-tool-durep/index.html @@ -45,9 +45,9 @@ - + - + @@ -655,7 +655,7 @@ title="pinterest icon">
- + diff --git a/public/post/pg_auto_failover_in_ubuntu_1804_psql_11/index.html b/public/post/pg_auto_failover_in_ubuntu_1804_psql_11/index.html index 398ae71c..ea4ee2b0 100644 --- a/public/post/pg_auto_failover_in_ubuntu_1804_psql_11/index.html +++ b/public/post/pg_auto_failover_in_ubuntu_1804_psql_11/index.html @@ -45,9 +45,9 @@ - + - + @@ -1574,7 +1574,7 @@ title="pinterest icon">
- + diff --git a/public/post/pgbarman-in-ubuntu-1804-postgresql-10-via-ssh/index.html b/public/post/pgbarman-in-ubuntu-1804-postgresql-10-via-ssh/index.html index 552b533c..e7805692 100644 --- a/public/post/pgbarman-in-ubuntu-1804-postgresql-10-via-ssh/index.html +++ b/public/post/pgbarman-in-ubuntu-1804-postgresql-10-via-ssh/index.html @@ -45,9 +45,9 @@ - + - + @@ -744,7 +744,7 @@ title="pinterest icon">
- + diff --git a/public/post/pgbarman-in-ubuntu-1804-postgresql-10/index.html b/public/post/pgbarman-in-ubuntu-1804-postgresql-10/index.html index 0f80a07f..a7465989 100644 --- a/public/post/pgbarman-in-ubuntu-1804-postgresql-10/index.html +++ b/public/post/pgbarman-in-ubuntu-1804-postgresql-10/index.html @@ -45,9 +45,9 @@ - + - + @@ -908,7 +908,7 @@ title="pinterest icon">
- + diff --git a/public/post/postgresql-backup-restore-using-zfs-snapshot/index.html b/public/post/postgresql-backup-restore-using-zfs-snapshot/index.html index be97e742..a65f0930 100644 --- a/public/post/postgresql-backup-restore-using-zfs-snapshot/index.html +++ b/public/post/postgresql-backup-restore-using-zfs-snapshot/index.html @@ -45,9 +45,9 @@ - + - + @@ -1009,7 +1009,7 @@ title="pinterest icon">
- + diff --git a/public/post/postgresql-pgbench-benchmark/index.html b/public/post/postgresql-pgbench-benchmark/index.html index 2cb0cadb..434a618c 100644 --- a/public/post/postgresql-pgbench-benchmark/index.html +++ b/public/post/postgresql-pgbench-benchmark/index.html @@ -45,9 +45,9 @@ - + - + @@ -693,7 +693,7 @@ title="pinterest icon">
- + diff --git a/public/post/proxmox-with-synology-high-availability/index.html b/public/post/proxmox-with-synology-high-availability/index.html index 645d4d4a..a9a6ceca 100644 --- a/public/post/proxmox-with-synology-high-availability/index.html +++ b/public/post/proxmox-with-synology-high-availability/index.html @@ -45,9 +45,9 @@ - + - + @@ -660,7 +660,7 @@ title="pinterest icon">
- + diff --git a/public/post/recommended-ulauncher-in-ubuntu-1804/index.html b/public/post/recommended-ulauncher-in-ubuntu-1804/index.html index 27ec6e0b..ee41dbc7 100644 --- a/public/post/recommended-ulauncher-in-ubuntu-1804/index.html +++ b/public/post/recommended-ulauncher-in-ubuntu-1804/index.html @@ -45,9 +45,9 @@ - + - + @@ -687,7 +687,7 @@ title="pinterest icon">
- + diff --git a/public/post/remote-management-system-meshcentral/index.html b/public/post/remote-management-system-meshcentral/index.html index 01e9742f..40a27dd7 100644 --- a/public/post/remote-management-system-meshcentral/index.html +++ b/public/post/remote-management-system-meshcentral/index.html @@ -45,9 +45,9 @@ - + - + @@ -717,7 +717,7 @@ title="pinterest icon">
- + diff --git a/public/post/rescue-synology-nas-with-ubuntu-livecd/index.html b/public/post/rescue-synology-nas-with-ubuntu-livecd/index.html index 2e127126..3752804d 100644 --- a/public/post/rescue-synology-nas-with-ubuntu-livecd/index.html +++ b/public/post/rescue-synology-nas-with-ubuntu-livecd/index.html @@ -45,9 +45,9 @@ - + - + @@ -751,7 +751,7 @@ title="pinterest icon">
- + diff --git a/public/post/send-mail-to-notify-after-pxe-install/index.html b/public/post/send-mail-to-notify-after-pxe-install/index.html index b4b38190..08a0371f 100644 --- a/public/post/send-mail-to-notify-after-pxe-install/index.html +++ b/public/post/send-mail-to-notify-after-pxe-install/index.html @@ -45,9 +45,9 @@ - + - + @@ -684,7 +684,7 @@ title="pinterest icon">
- + diff --git a/public/post/site-to-site-vpn-using-wireguard-in-two-edgerouters/index.html b/public/post/site-to-site-vpn-using-wireguard-in-two-edgerouters/index.html index 7378e70e..107c0b4a 100644 --- a/public/post/site-to-site-vpn-using-wireguard-in-two-edgerouters/index.html +++ b/public/post/site-to-site-vpn-using-wireguard-in-two-edgerouters/index.html @@ -45,9 +45,9 @@ - + - + @@ -813,7 +813,7 @@ title="pinterest icon">
- + diff --git a/public/post/smartd-failed-to-start-in-freenas/index.html b/public/post/smartd-failed-to-start-in-freenas/index.html index a227046a..bea51a3f 100644 --- a/public/post/smartd-failed-to-start-in-freenas/index.html +++ b/public/post/smartd-failed-to-start-in-freenas/index.html @@ -45,9 +45,9 @@ - + - + @@ -617,7 +617,7 @@ title="pinterest icon">
- + diff --git a/public/post/synology-ds415-repair-cost/index.html b/public/post/synology-ds415-repair-cost/index.html index 298c3de9..be836754 100644 --- a/public/post/synology-ds415-repair-cost/index.html +++ b/public/post/synology-ds415-repair-cost/index.html @@ -45,9 +45,9 @@ - + - + @@ -667,7 +667,7 @@ title="pinterest icon">
- + diff --git a/public/post/test-pg_prewarm/index.html b/public/post/test-pg_prewarm/index.html index f2a38999..5d73bf2b 100644 --- a/public/post/test-pg_prewarm/index.html +++ b/public/post/test-pg_prewarm/index.html @@ -45,9 +45,9 @@ - + - + @@ -983,7 +983,7 @@ title="pinterest icon">
- + diff --git a/public/post/transfer-cent62-using-rsync/index.html b/public/post/transfer-cent62-using-rsync/index.html index e7be1fd0..c4773e70 100644 --- a/public/post/transfer-cent62-using-rsync/index.html +++ b/public/post/transfer-cent62-using-rsync/index.html @@ -45,9 +45,9 @@ - + - + @@ -978,7 +978,7 @@ title="pinterest icon">
- + diff --git a/public/post/transfer-file-content-using-xclip-in-terminal/index.html b/public/post/transfer-file-content-using-xclip-in-terminal/index.html index 6717bff0..e876be4a 100644 --- a/public/post/transfer-file-content-using-xclip-in-terminal/index.html +++ b/public/post/transfer-file-content-using-xclip-in-terminal/index.html @@ -45,9 +45,9 @@ - + - + @@ -666,7 +666,7 @@ title="pinterest icon">
- + diff --git a/public/post/ubuntu-1404-preseed/index.html b/public/post/ubuntu-1404-preseed/index.html index fe6ea8ef..fa7b68b2 100644 --- a/public/post/ubuntu-1404-preseed/index.html +++ b/public/post/ubuntu-1404-preseed/index.html @@ -45,9 +45,9 @@ - + - + @@ -747,7 +747,7 @@ title="pinterest icon">
- + diff --git a/public/post/ubuntu-1804-install-root-on-raid/index.html b/public/post/ubuntu-1804-install-root-on-raid/index.html index aa55e535..ed1feee1 100644 --- a/public/post/ubuntu-1804-install-root-on-raid/index.html +++ b/public/post/ubuntu-1804-install-root-on-raid/index.html @@ -45,9 +45,9 @@ - + - + @@ -729,7 +729,7 @@ title="pinterest icon">
- + diff --git a/public/post/ubuntu-1804-preseeds/index.html b/public/post/ubuntu-1804-preseeds/index.html index 00094a4e..d2a31b17 100644 --- a/public/post/ubuntu-1804-preseeds/index.html +++ b/public/post/ubuntu-1804-preseeds/index.html @@ -45,9 +45,9 @@ - + - + @@ -835,7 +835,7 @@ title="pinterest icon">
- + diff --git a/public/post/ubuntu-dconf-proxy-settings/index.html b/public/post/ubuntu-dconf-proxy-settings/index.html index 1d77fe25..2293b1d3 100644 --- a/public/post/ubuntu-dconf-proxy-settings/index.html +++ b/public/post/ubuntu-dconf-proxy-settings/index.html @@ -45,9 +45,9 @@ - + - + @@ -657,7 +657,7 @@ title="pinterest icon">
- + diff --git a/public/post/ubuntu-kernel-4-15-0-106-unable-to-start-wireguard-interface/index.html b/public/post/ubuntu-kernel-4-15-0-106-unable-to-start-wireguard-interface/index.html index bea40202..27f3395b 100644 --- a/public/post/ubuntu-kernel-4-15-0-106-unable-to-start-wireguard-interface/index.html +++ b/public/post/ubuntu-kernel-4-15-0-106-unable-to-start-wireguard-interface/index.html @@ -45,9 +45,9 @@ - + - + @@ -759,7 +759,7 @@ title="pinterest icon">
- + diff --git a/public/post/ubuntu-letsencrypt-cloudflare-wildcard/index.html b/public/post/ubuntu-letsencrypt-cloudflare-wildcard/index.html new file mode 100644 index 00000000..a0c9d7b8 --- /dev/null +++ b/public/post/ubuntu-letsencrypt-cloudflare-wildcard/index.html @@ -0,0 +1,756 @@ + + + + + + + + [筆記] 在 ubuntu 20.04 底下,用certbot 透過Cloudflare 申請全域的 Letsencrypt 憑證 + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Skip to content + + +
+ + + + + + + +
+ +
+ + + + +
+

[筆記] 在 ubuntu 20.04 底下,用certbot 透過Cloudflare 申請全域的 Letsencrypt 憑證

+
+
+
+
+

之前用caddy 作為反向代理,其中一個優勢就是caddy 會自動處理Letsencrypt 憑證的問題

+ +

也不用煩惱怎麼去更新一堆有的沒的

+ +

不過,實際應用上,還是偶爾會拿這些憑證檔案來用的狀況

+ +

雖然可以從caddy 上面取得這些檔案

+ +

但是基本上這些檔案都是綁定一個特定的hostname

+ +

可是我想要有一個憑證,可以給同網域底下的機器用 ( Wildcard certificates )

+ +

要申請Wildcard certificates ,必須要採用 DNS 驗證的方式

+ +

一般手動操作的步驟,會先產生一組亂數字串,然後更新 DNS 上面去

+ +

如果要改成自動化,要多一些步驟

+ +

安裝 certbot 及 Cloudflare 外掛

+ +

首先,先來安裝會用到的套件

+ +
sudo apt install certbot letsencrypt python3-certbot-dns-cloudflare
+
+ +

設定 cloudflare API

+ +

這個步驟我測了好久,網路上的說明似乎都過期了,造成cloudflare API 那邊會發生錯誤

+ +

先登入 cloudflare 管理界面的API token 設定

+ +

https://dash.cloudflare.com/profile/api-tokens

+ +

建立一組token

+ +

內容如下

+ +

![‘cloudflare API’](‘https://i.imgur.com/3dZN6qC.png')

+ +

在權限設定的地方,選擇三個項目

+ +

zone-zone settings-edit +zone-zone-edit +zone-DNS-edit

+ +

在下一個 zone resources 選擇 include-All zones

+ +

存檔後會產生一組 API token ,接著就是用這組 token 來做DNS更新

+ +

編輯 cloudflare 設定檔

+ +

在 /etc底下新增一個 cloudflare.ini

+ +

內容如下

+ +
sudo vim /etc/cloudflare.ini
+
+dns_cloudflare_email =  #email@address.here
+dns_cloudflare_api_key = #API token here
+
+ +

存檔後離開,然後改一下權限,不然等一下certbot 會跳警告

+ +
sudo chmod 0600 /etc/cloudflare.ini
+
+ +

執行certbot 取得憑證

+ +

執行以下的指令

+ +
sudo certbot certonly  --dns-cloudflare --dns-cloudflare-credentials /etc/cloudflare.ini --preferred-challenges=dns --email admin@abc.com --server https://acme-v02.api.letsencrypt.org/directory --agree-tos -d abc.com -d *.abc.com
+
+ +

正常的話,會是這樣的結果

+ +
sudo certbot certonly  --dns-cloudflare --dns-cloudflare-credentials /etc/cloudflare.ini --preferred-challenges=dns --email admin@abc.com --server https://acme-v02.api.letsencrypt.org/directory --agree-tos -d abc.com -d *.abc.com
+
+Saving debug log to /var/log/letsencrypt/letsencrypt.log
+Plugins selected: Authenticator dns-cloudflare, Installer None
+Obtaining a new certificate
+Performing the following challenges:
+dns-01 challenge for abc.com
+dns-01 challenge for abc.com
+Waiting 10 seconds for DNS changes to propagate
+Waiting for verification...
+Cleaning up challenges
+
+IMPORTANT NOTES:
+ - Congratulations! Your certificate and chain have been saved at:
+   /etc/letsencrypt/live/abc.com/fullchain.pem
+   Your key file has been saved at:
+   /etc/letsencrypt/live/abc.com/privkey.pem
+   Your cert will expire on 2020-12-01. To obtain a new or tweaked
+   version of this certificate in the future, simply run certbot
+   again. To non-interactively renew *all* of your certificates, run
+   "certbot renew"
+ - If you like Certbot, please consider supporting our work by:
+
+   Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
+   Donating to EFF:                    https://eff.org/donate-le
+
+
+ +

這樣子就取得了全域通用的SSL 憑證檔案

+ +

如果看到底下這種錯誤

+ +
administrator@ubuntu:~$ sudo certbot certonly  --dns-cloudflare --dns-cloudflare-credentials /etc/cloudflare.ini --preferred-challenges=dns --email admin@abc.com --server https://acme-v02.api.letsencrypt.org/directory --agree-tos -d abc.com -d *.abc.com
+Saving debug log to /var/log/letsencrypt/letsencrypt.log
+Plugins selected: Authenticator dns-cloudflare, Installer None
+Obtaining a new certificate
+Performing the following challenges:
+dns-01 challenge for abc.com
+dns-01 challenge for abc.com
+Cleaning up challenges
+Error determining zone_id: 6003 Invalid request headers. Please confirm that you have supplied valid Cloudflare API credentials. (Did you copy your entire API key?)
+
+ +

那就是cloudflare API 那邊的權限設定錯了,我就是在這邊卡很久…

+ +

請參照上面的步驟和圖片正確的設定

+ +

可以用 certbot certificates 來驗證看看

+ +
administrator@ubuntu:~$ sudo certbot certificates
+Saving debug log to /var/log/letsencrypt/letsencrypt.log
+
+- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+Found the following certs:
+  Certificate Name: abc.com
+    Domains: abc.com *.abc.com
+    Expiry Date: 2020-12-01 05:31:31+00:00 (VALID: 89 days)
+    Certificate Path: /etc/letsencrypt/live/abc.com/fullchain.pem
+    Private Key Path: /etc/letsencrypt/live/abc.com/privkey.pem
+- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+ +

之後就可以用

+ +
sudo certbot renew
+
+ +

來更新憑證

+ +

寫到/etc/crontab 去排程每個月的1號自動更新

+ +
administrator@ubuntu:~$ echo "* * 1 * * root /usr/bin/certbot renew" |sudo tee -a /etc/crontab
+* * 1 * * root /usr/bin/certbot renew
+administrator@ubuntu:~$ 
+
+ +

接下來就等三個月之後,檢查看看憑證是否有自動更新了!

+
+
+ + + + +
+ +
+ + Eric Chang + + + Written by: +
+
+ + +

塵世裡一個迷途小書僮

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+ +
+
+ + +comments powered by Disqus + + + + + + +
+
+ + + + + +
+ + + +
+ + + + + + diff --git a/public/post/weird-client-server-connection/index.html b/public/post/weird-client-server-connection/index.html index 778ef22a..7b77e0d5 100644 --- a/public/post/weird-client-server-connection/index.html +++ b/public/post/weird-client-server-connection/index.html @@ -45,9 +45,9 @@ - + - + @@ -698,7 +698,7 @@ title="pinterest icon">
- + diff --git a/public/post/what-a-piss-in-synology-document/index.html b/public/post/what-a-piss-in-synology-document/index.html index 59d6121a..360ee583 100644 --- a/public/post/what-a-piss-in-synology-document/index.html +++ b/public/post/what-a-piss-in-synology-document/index.html @@ -45,9 +45,9 @@ - + - + @@ -684,7 +684,7 @@ title="pinterest icon">
- + diff --git a/public/post/wireguard-pihole-in-ubuntu-20.04/index.html b/public/post/wireguard-pihole-in-ubuntu-20.04/index.html index e9d61e0b..52cf88dc 100644 --- a/public/post/wireguard-pihole-in-ubuntu-20.04/index.html +++ b/public/post/wireguard-pihole-in-ubuntu-20.04/index.html @@ -45,9 +45,9 @@ - + - + @@ -889,7 +889,7 @@ title="pinterest icon">
- + diff --git a/public/sitemap.xml b/public/sitemap.xml index 58d7316e..69b71108 100644 --- a/public/sitemap.xml +++ b/public/sitemap.xml @@ -3,47 +3,67 @@ xmlns:xhtml="http://www.w3.org/1999/xhtml"> - https://h.cowbay.org/post/wireguard-pihole-in-ubuntu-20.04/ - 2020-08-13T14:22:05+08:00 + https://h.cowbay.org/post/ubuntu-letsencrypt-cloudflare-wildcard/ + 2020-09-02T15:55:40+08:00 https://h.cowbay.org/categories/ - 2020-08-13T14:22:05+08:00 + 2020-09-02T15:55:40+08:00 - https://h.cowbay.org/ - 2020-08-13T14:22:05+08:00 + https://h.cowbay.org/tags/certbot/ + 2020-09-02T15:55:40+08:00 - https://h.cowbay.org/tags/pihole/ - 2020-08-13T14:22:05+08:00 + https://h.cowbay.org/tags/cloudflare/ + 2020-09-02T15:55:40+08:00 + + + + https://h.cowbay.org/tags/letsencrypt/ + 2020-09-02T15:55:40+08:00 + + + + https://h.cowbay.org/ + 2020-09-02T15:55:40+08:00 https://h.cowbay.org/post/ - 2020-08-13T14:22:05+08:00 + 2020-09-02T15:55:40+08:00 https://h.cowbay.org/tags/ + 2020-09-02T15:55:40+08:00 + + + + https://h.cowbay.org/categories/%E7%AD%86%E8%A8%98/ + 2020-09-02T15:55:40+08:00 + + + + https://h.cowbay.org/post/wireguard-pihole-in-ubuntu-20.04/ 2020-08-13T14:22:05+08:00 - https://h.cowbay.org/tags/ubuntu/ + https://h.cowbay.org/tags/pihole/ 2020-08-13T14:22:05+08:00 - https://h.cowbay.org/tags/wireguard/ + https://h.cowbay.org/tags/ubuntu/ 2020-08-13T14:22:05+08:00 - https://h.cowbay.org/categories/%E7%AD%86%E8%A8%98/ + https://h.cowbay.org/tags/wireguard/ 2020-08-13T14:22:05+08:00 @@ -528,12 +548,12 @@ - https://h.cowbay.org/categories/%E7%BE%A4%E6%9A%89/ + https://h.cowbay.org/tags/%E7%BE%A4%E6%9A%89/ 2018-12-04T10:25:19+08:00 - https://h.cowbay.org/tags/%E7%BE%A4%E6%9A%89/ + https://h.cowbay.org/categories/%E7%BE%A4%E6%9A%89/ 2018-12-04T10:25:19+08:00 diff --git a/public/tags/10g/index.html b/public/tags/10g/index.html index 1e35f041..67e7c568 100644 --- a/public/tags/10g/index.html +++ b/public/tags/10g/index.html @@ -45,9 +45,9 @@ - + - + @@ -484,6 +484,6 @@ if (!doNotTrack) {
- + diff --git a/public/tags/ansible/index.html b/public/tags/ansible/index.html index 3a9d4aef..b75c040e 100644 --- a/public/tags/ansible/index.html +++ b/public/tags/ansible/index.html @@ -45,9 +45,9 @@ - + - + @@ -876,6 +876,6 @@ if (!doNotTrack) {
- + diff --git a/public/tags/backup/index.html b/public/tags/backup/index.html index f431b02d..be93615c 100644 --- a/public/tags/backup/index.html +++ b/public/tags/backup/index.html @@ -45,9 +45,9 @@ - + - + @@ -524,6 +524,6 @@ if (!doNotTrack) {
- + diff --git a/public/tags/benchmark/index.html b/public/tags/benchmark/index.html index 6cb82419..bfb7ea07 100644 --- a/public/tags/benchmark/index.html +++ b/public/tags/benchmark/index.html @@ -45,9 +45,9 @@ - + - + @@ -470,6 +470,6 @@ if (!doNotTrack) {
- + diff --git a/public/tags/bookstack/index.html b/public/tags/bookstack/index.html index e9587268..5e7c916d 100644 --- a/public/tags/bookstack/index.html +++ b/public/tags/bookstack/index.html @@ -45,9 +45,9 @@ - + - + @@ -484,6 +484,6 @@ if (!doNotTrack) {
- + diff --git a/public/tags/bsd/index.html b/public/tags/bsd/index.html index 4090b005..ad689dcb 100644 --- a/public/tags/bsd/index.html +++ b/public/tags/bsd/index.html @@ -45,9 +45,9 @@ - + - + @@ -476,6 +476,6 @@ if (!doNotTrack) {
- + diff --git a/public/tags/centos/index.html b/public/tags/centos/index.html index 82897ed2..78422d80 100644 --- a/public/tags/centos/index.html +++ b/public/tags/centos/index.html @@ -45,9 +45,9 @@ - + - + @@ -470,6 +470,6 @@ if (!doNotTrack) {
- + diff --git a/public/tags/certbot/index.html b/public/tags/certbot/index.html new file mode 100644 index 00000000..091e75f3 --- /dev/null +++ b/public/tags/certbot/index.html @@ -0,0 +1,483 @@ + + + + + + + + certbot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Skip to content + + +
+ +
+

+ Tag: certbot + + + + rss + + +

+
+ +

Posts

+
+ + + +
+ + + + + + + + +
+
+ 02 September 2020 / + + + + + + + + + + + + / + + 筆記 + + +
+ +
+
+

之前用caddy 作為反向代理,其中一個優勢就是caddy 會自動處理Letsencrypt 憑證的問題

+ +

也不用煩惱怎麼去更新一堆有的沒的

+ +

不過,實際應用上,還是偶爾會拿這些憑證檔案來用的狀況

+ +

雖然可以從caddy 上面取得這些檔案

+ +

但是基本上這些檔案都是綁定一個特定的hostname

+ +

可是我想要有一個憑證,可以給同網域底下的機器用 ( Wildcard certificates )

+ + +
+
+
+
+ +
+ +
+ + + +
+ + + + + diff --git a/public/tags/certbot/index.xml b/public/tags/certbot/index.xml new file mode 100644 index 00000000..eac3342a --- /dev/null +++ b/public/tags/certbot/index.xml @@ -0,0 +1,34 @@ + + + + certbot on MC部落 + https://h.cowbay.org/tags/certbot/ + Recent content in certbot on MC部落 + Hugo -- gohugo.io + en-us + Wed, 02 Sep 2020 15:55:40 +0800 + + + + + + [筆記] 在 ubuntu 20.04 底下,用certbot 透過Cloudflare 申請全域的 Letsencrypt 憑證 + https://h.cowbay.org/post/ubuntu-letsencrypt-cloudflare-wildcard/ + Wed, 02 Sep 2020 15:55:40 +0800 + + https://h.cowbay.org/post/ubuntu-letsencrypt-cloudflare-wildcard/ + <p>之前用caddy 作為反向代理,其中一個優勢就是caddy 會自動處理Letsencrypt 憑證的問題</p> + +<p>也不用煩惱怎麼去更新一堆有的沒的</p> + +<p>不過,實際應用上,還是偶爾會拿這些憑證檔案來用的狀況</p> + +<p>雖然可以從caddy 上面取得這些檔案</p> + +<p>但是基本上這些檔案都是綁定一個特定的hostname</p> + +<p>可是我想要有一個憑證,可以給同網域底下的機器用 ( Wildcard certificates )</p> + + + + \ No newline at end of file diff --git a/public/tags/cloudflare/index.html b/public/tags/cloudflare/index.html new file mode 100644 index 00000000..1f65fc63 --- /dev/null +++ b/public/tags/cloudflare/index.html @@ -0,0 +1,483 @@ + + + + + + + + Cloudflare + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Skip to content + + +
+ +
+

+ Tag: Cloudflare + + + + rss + + +

+
+ +

Posts

+
+ + + +
+ + + + + + + + +
+
+ 02 September 2020 / + + + + + + + + + + + + / + + 筆記 + + +
+ +
+
+

之前用caddy 作為反向代理,其中一個優勢就是caddy 會自動處理Letsencrypt 憑證的問題

+ +

也不用煩惱怎麼去更新一堆有的沒的

+ +

不過,實際應用上,還是偶爾會拿這些憑證檔案來用的狀況

+ +

雖然可以從caddy 上面取得這些檔案

+ +

但是基本上這些檔案都是綁定一個特定的hostname

+ +

可是我想要有一個憑證,可以給同網域底下的機器用 ( Wildcard certificates )

+ + +
+
+
+
+ +
+ +
+ + + +
+ + + + + diff --git a/public/tags/cloudflare/index.xml b/public/tags/cloudflare/index.xml new file mode 100644 index 00000000..38336a89 --- /dev/null +++ b/public/tags/cloudflare/index.xml @@ -0,0 +1,34 @@ + + + + Cloudflare on MC部落 + https://h.cowbay.org/tags/cloudflare/ + Recent content in Cloudflare on MC部落 + Hugo -- gohugo.io + en-us + Wed, 02 Sep 2020 15:55:40 +0800 + + + + + + [筆記] 在 ubuntu 20.04 底下,用certbot 透過Cloudflare 申請全域的 Letsencrypt 憑證 + https://h.cowbay.org/post/ubuntu-letsencrypt-cloudflare-wildcard/ + Wed, 02 Sep 2020 15:55:40 +0800 + + https://h.cowbay.org/post/ubuntu-letsencrypt-cloudflare-wildcard/ + <p>之前用caddy 作為反向代理,其中一個優勢就是caddy 會自動處理Letsencrypt 憑證的問題</p> + +<p>也不用煩惱怎麼去更新一堆有的沒的</p> + +<p>不過,實際應用上,還是偶爾會拿這些憑證檔案來用的狀況</p> + +<p>雖然可以從caddy 上面取得這些檔案</p> + +<p>但是基本上這些檔案都是綁定一個特定的hostname</p> + +<p>可是我想要有一個憑證,可以給同網域底下的機器用 ( Wildcard certificates )</p> + + + + \ No newline at end of file diff --git a/public/tags/dconf/index.html b/public/tags/dconf/index.html index d486a08c..9646014f 100644 --- a/public/tags/dconf/index.html +++ b/public/tags/dconf/index.html @@ -45,9 +45,9 @@ - + - + @@ -534,6 +534,6 @@ if (!doNotTrack) {
- + diff --git a/public/tags/debian/index.html b/public/tags/debian/index.html index 9da4e71b..edaf0533 100644 --- a/public/tags/debian/index.html +++ b/public/tags/debian/index.html @@ -45,9 +45,9 @@ - + - + @@ -482,6 +482,6 @@ if (!doNotTrack) {
- + diff --git a/public/tags/docker/index.html b/public/tags/docker/index.html index f926fd10..b9dd048a 100644 --- a/public/tags/docker/index.html +++ b/public/tags/docker/index.html @@ -45,9 +45,9 @@ - + - + @@ -532,6 +532,6 @@ if (!doNotTrack) {
- + diff --git a/public/tags/du/index.html b/public/tags/du/index.html index 97dcdd1f..78505368 100644 --- a/public/tags/du/index.html +++ b/public/tags/du/index.html @@ -45,9 +45,9 @@ - + - + @@ -473,6 +473,6 @@ if (!doNotTrack) {
- + diff --git a/public/tags/edgerouter/index.html b/public/tags/edgerouter/index.html index 38b8acc2..a9d4478a 100644 --- a/public/tags/edgerouter/index.html +++ b/public/tags/edgerouter/index.html @@ -45,9 +45,9 @@ - + - + @@ -486,6 +486,6 @@ if (!doNotTrack) {
- + diff --git a/public/tags/failover/index.html b/public/tags/failover/index.html index aaa5df8f..266b7012 100644 --- a/public/tags/failover/index.html +++ b/public/tags/failover/index.html @@ -45,9 +45,9 @@ - + - + @@ -478,6 +478,6 @@ if (!doNotTrack) {
- + diff --git a/public/tags/firefox/index.html b/public/tags/firefox/index.html index b08baffc..288b0a63 100644 --- a/public/tags/firefox/index.html +++ b/public/tags/firefox/index.html @@ -45,9 +45,9 @@ - + - + @@ -474,6 +474,6 @@ if (!doNotTrack) {
- + diff --git a/public/tags/forwardx11/index.html b/public/tags/forwardx11/index.html index 0993e678..cf063c56 100644 --- a/public/tags/forwardx11/index.html +++ b/public/tags/forwardx11/index.html @@ -45,9 +45,9 @@ - + - + @@ -476,6 +476,6 @@ if (!doNotTrack) {
- + diff --git a/public/tags/freenas/index.html b/public/tags/freenas/index.html index 7a33a275..e7e97aca 100644 --- a/public/tags/freenas/index.html +++ b/public/tags/freenas/index.html @@ -45,9 +45,9 @@ - + - + @@ -474,6 +474,6 @@ if (!doNotTrack) {
- + diff --git a/public/tags/high-availability/index.html b/public/tags/high-availability/index.html index 4f1308f8..5b6ee7e7 100644 --- a/public/tags/high-availability/index.html +++ b/public/tags/high-availability/index.html @@ -45,9 +45,9 @@ - + - + @@ -474,6 +474,6 @@ if (!doNotTrack) {
- + diff --git a/public/tags/index.xml b/public/tags/index.xml index cd188b89..9454cafc 100644 --- a/public/tags/index.xml +++ b/public/tags/index.xml @@ -6,11 +6,38 @@ Recent content in Tags on MC部落 Hugo -- gohugo.io en-us - Thu, 13 Aug 2020 14:22:05 +0800 + Wed, 02 Sep 2020 15:55:40 +0800 + + certbot + https://h.cowbay.org/tags/certbot/ + Wed, 02 Sep 2020 15:55:40 +0800 + + https://h.cowbay.org/tags/certbot/ + + + + + Cloudflare + https://h.cowbay.org/tags/cloudflare/ + Wed, 02 Sep 2020 15:55:40 +0800 + + https://h.cowbay.org/tags/cloudflare/ + + + + + Letsencrypt + https://h.cowbay.org/tags/letsencrypt/ + Wed, 02 Sep 2020 15:55:40 +0800 + + https://h.cowbay.org/tags/letsencrypt/ + + + pihole https://h.cowbay.org/tags/pihole/ diff --git a/public/tags/inventory/index.html b/public/tags/inventory/index.html index ae608aa9..1aa8c8d9 100644 --- a/public/tags/inventory/index.html +++ b/public/tags/inventory/index.html @@ -45,9 +45,9 @@ - + - + @@ -476,6 +476,6 @@ if (!doNotTrack) {
- + diff --git a/public/tags/launcher/index.html b/public/tags/launcher/index.html index 577dfba1..b7a87a89 100644 --- a/public/tags/launcher/index.html +++ b/public/tags/launcher/index.html @@ -45,9 +45,9 @@ - + - + @@ -470,6 +470,6 @@ if (!doNotTrack) {
- + diff --git a/public/tags/letsencrypt/index.html b/public/tags/letsencrypt/index.html new file mode 100644 index 00000000..a8a8a934 --- /dev/null +++ b/public/tags/letsencrypt/index.html @@ -0,0 +1,483 @@ + + + + + + + + Letsencrypt + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Skip to content + + +
+ +
+

+ Tag: Letsencrypt + + + + rss + + +

+
+ +

Posts

+
+ + + +
+ + + + + + + + +
+
+ 02 September 2020 / + + + + + + + + + + + + / + + 筆記 + + +
+ +
+
+

之前用caddy 作為反向代理,其中一個優勢就是caddy 會自動處理Letsencrypt 憑證的問題

+ +

也不用煩惱怎麼去更新一堆有的沒的

+ +

不過,實際應用上,還是偶爾會拿這些憑證檔案來用的狀況

+ +

雖然可以從caddy 上面取得這些檔案

+ +

但是基本上這些檔案都是綁定一個特定的hostname

+ +

可是我想要有一個憑證,可以給同網域底下的機器用 ( Wildcard certificates )

+ + +
+
+
+
+ +
+ +
+ + + +
+ + + + + diff --git a/public/tags/letsencrypt/index.xml b/public/tags/letsencrypt/index.xml new file mode 100644 index 00000000..8b393b6c --- /dev/null +++ b/public/tags/letsencrypt/index.xml @@ -0,0 +1,34 @@ + + + + Letsencrypt on MC部落 + https://h.cowbay.org/tags/letsencrypt/ + Recent content in Letsencrypt on MC部落 + Hugo -- gohugo.io + en-us + Wed, 02 Sep 2020 15:55:40 +0800 + + + + + + [筆記] 在 ubuntu 20.04 底下,用certbot 透過Cloudflare 申請全域的 Letsencrypt 憑證 + https://h.cowbay.org/post/ubuntu-letsencrypt-cloudflare-wildcard/ + Wed, 02 Sep 2020 15:55:40 +0800 + + https://h.cowbay.org/post/ubuntu-letsencrypt-cloudflare-wildcard/ + <p>之前用caddy 作為反向代理,其中一個優勢就是caddy 會自動處理Letsencrypt 憑證的問題</p> + +<p>也不用煩惱怎麼去更新一堆有的沒的</p> + +<p>不過,實際應用上,還是偶爾會拿這些憑證檔案來用的狀況</p> + +<p>雖然可以從caddy 上面取得這些檔案</p> + +<p>但是基本上這些檔案都是綁定一個特定的hostname</p> + +<p>可是我想要有一個憑證,可以給同網域底下的機器用 ( Wildcard certificates )</p> + + + + \ No newline at end of file diff --git a/public/tags/linux/index.html b/public/tags/linux/index.html index ec20ea5b..d1ca2c5b 100644 --- a/public/tags/linux/index.html +++ b/public/tags/linux/index.html @@ -45,9 +45,9 @@ - + - + @@ -830,6 +830,6 @@ if (!doNotTrack) { - + diff --git a/public/tags/log/index.html b/public/tags/log/index.html index 2a9cb579..d3629d8c 100644 --- a/public/tags/log/index.html +++ b/public/tags/log/index.html @@ -45,9 +45,9 @@ - + - + @@ -474,6 +474,6 @@ if (!doNotTrack) { - + diff --git a/public/tags/mdadm/index.html b/public/tags/mdadm/index.html index 41664ee0..5a71ed12 100644 --- a/public/tags/mdadm/index.html +++ b/public/tags/mdadm/index.html @@ -45,9 +45,9 @@ - + - + @@ -476,6 +476,6 @@ if (!doNotTrack) { - + diff --git a/public/tags/mellanox/index.html b/public/tags/mellanox/index.html index b9ece39e..6967eaf5 100644 --- a/public/tags/mellanox/index.html +++ b/public/tags/mellanox/index.html @@ -45,9 +45,9 @@ - + - + @@ -484,6 +484,6 @@ if (!doNotTrack) { - + diff --git a/public/tags/meshcentral/index.html b/public/tags/meshcentral/index.html index b4f2d062..f8427fce 100644 --- a/public/tags/meshcentral/index.html +++ b/public/tags/meshcentral/index.html @@ -45,9 +45,9 @@ - + - + @@ -476,6 +476,6 @@ if (!doNotTrack) { - + diff --git a/public/tags/metabase/index.html b/public/tags/metabase/index.html index 788456ab..e6c559be 100644 --- a/public/tags/metabase/index.html +++ b/public/tags/metabase/index.html @@ -45,9 +45,9 @@ - + - + @@ -474,6 +474,6 @@ if (!doNotTrack) { - + diff --git a/public/tags/nas/index.html b/public/tags/nas/index.html index c1829e1a..f18db9aa 100644 --- a/public/tags/nas/index.html +++ b/public/tags/nas/index.html @@ -45,9 +45,9 @@ - + - + @@ -591,6 +591,6 @@ if (!doNotTrack) { - + diff --git a/public/tags/networkmanager/index.html b/public/tags/networkmanager/index.html index 297034d9..bc0f09a2 100644 --- a/public/tags/networkmanager/index.html +++ b/public/tags/networkmanager/index.html @@ -45,9 +45,9 @@ - + - + @@ -478,6 +478,6 @@ if (!doNotTrack) { - + diff --git a/public/tags/nvidia/index.html b/public/tags/nvidia/index.html index 2ac52f05..79f7f730 100644 --- a/public/tags/nvidia/index.html +++ b/public/tags/nvidia/index.html @@ -45,9 +45,9 @@ - + - + @@ -474,6 +474,6 @@ if (!doNotTrack) { - + diff --git a/public/tags/nvme/index.html b/public/tags/nvme/index.html index f773e864..d023de80 100644 --- a/public/tags/nvme/index.html +++ b/public/tags/nvme/index.html @@ -45,9 +45,9 @@ - + - + @@ -470,6 +470,6 @@ if (!doNotTrack) { - + diff --git a/public/tags/openwrt/index.html b/public/tags/openwrt/index.html index 2822bb7a..eb6d2736 100644 --- a/public/tags/openwrt/index.html +++ b/public/tags/openwrt/index.html @@ -45,9 +45,9 @@ - + - + @@ -488,6 +488,6 @@ if (!doNotTrack) { - + diff --git a/public/tags/pgbarman/index.html b/public/tags/pgbarman/index.html index 53ba15c5..8e0d32aa 100644 --- a/public/tags/pgbarman/index.html +++ b/public/tags/pgbarman/index.html @@ -45,9 +45,9 @@ - + - + @@ -520,6 +520,6 @@ if (!doNotTrack) { - + diff --git a/public/tags/pgbench/index.html b/public/tags/pgbench/index.html index 78d1286a..0a101535 100644 --- a/public/tags/pgbench/index.html +++ b/public/tags/pgbench/index.html @@ -45,9 +45,9 @@ - + - + @@ -474,6 +474,6 @@ if (!doNotTrack) { - + diff --git a/public/tags/pihole/index.html b/public/tags/pihole/index.html index c01f178c..8c89b62b 100644 --- a/public/tags/pihole/index.html +++ b/public/tags/pihole/index.html @@ -45,9 +45,9 @@ - + - + @@ -478,6 +478,6 @@ if (!doNotTrack) { - + diff --git a/public/tags/postgresql/index.html b/public/tags/postgresql/index.html index 49032669..3112e789 100644 --- a/public/tags/postgresql/index.html +++ b/public/tags/postgresql/index.html @@ -45,9 +45,9 @@ - + - + @@ -828,6 +828,6 @@ if (!doNotTrack) { - + diff --git a/public/tags/preseeds/index.html b/public/tags/preseeds/index.html index ed878444..3ac53dd9 100644 --- a/public/tags/preseeds/index.html +++ b/public/tags/preseeds/index.html @@ -45,9 +45,9 @@ - + - + @@ -472,6 +472,6 @@ if (!doNotTrack) { - + diff --git a/public/tags/proxmox/index.html b/public/tags/proxmox/index.html index 8707a8eb..862ce5fd 100644 --- a/public/tags/proxmox/index.html +++ b/public/tags/proxmox/index.html @@ -45,9 +45,9 @@ - + - + @@ -530,6 +530,6 @@ if (!doNotTrack) { - + diff --git a/public/tags/ps/index.html b/public/tags/ps/index.html index a0c18579..6979e771 100644 --- a/public/tags/ps/index.html +++ b/public/tags/ps/index.html @@ -45,9 +45,9 @@ - + - + @@ -422,6 +422,6 @@ if (!doNotTrack) { - + diff --git a/public/tags/psql/index.html b/public/tags/psql/index.html index 643f7c5d..c99ce719 100644 --- a/public/tags/psql/index.html +++ b/public/tags/psql/index.html @@ -45,9 +45,9 @@ - + - + @@ -474,6 +474,6 @@ if (!doNotTrack) { - + diff --git a/public/tags/pxe/index.html b/public/tags/pxe/index.html index e3eb846d..3227300d 100644 --- a/public/tags/pxe/index.html +++ b/public/tags/pxe/index.html @@ -45,9 +45,9 @@ - + - + @@ -584,6 +584,6 @@ if (!doNotTrack) { - + diff --git a/public/tags/raid/index.html b/public/tags/raid/index.html index ec63c8df..c4c6c492 100644 --- a/public/tags/raid/index.html +++ b/public/tags/raid/index.html @@ -45,9 +45,9 @@ - + - + @@ -472,6 +472,6 @@ if (!doNotTrack) { - + diff --git a/public/tags/remote/index.html b/public/tags/remote/index.html index d109c84e..5b31f602 100644 --- a/public/tags/remote/index.html +++ b/public/tags/remote/index.html @@ -45,9 +45,9 @@ - + - + @@ -476,6 +476,6 @@ if (!doNotTrack) { - + diff --git a/public/tags/resolv.conf/index.html b/public/tags/resolv.conf/index.html index 7fdb7d08..82c88a07 100644 --- a/public/tags/resolv.conf/index.html +++ b/public/tags/resolv.conf/index.html @@ -45,9 +45,9 @@ - + - + @@ -478,6 +478,6 @@ if (!doNotTrack) { - + diff --git a/public/tags/restore/index.html b/public/tags/restore/index.html index c5b33f0d..2e134f12 100644 --- a/public/tags/restore/index.html +++ b/public/tags/restore/index.html @@ -45,9 +45,9 @@ - + - + @@ -472,6 +472,6 @@ if (!doNotTrack) { - + diff --git a/public/tags/ssh/index.html b/public/tags/ssh/index.html index 029c676a..d003f22d 100644 --- a/public/tags/ssh/index.html +++ b/public/tags/ssh/index.html @@ -45,9 +45,9 @@ - + - + @@ -535,6 +535,6 @@ if (!doNotTrack) { - + diff --git a/public/tags/synology/index.html b/public/tags/synology/index.html index 7286132a..0a35aa74 100644 --- a/public/tags/synology/index.html +++ b/public/tags/synology/index.html @@ -45,9 +45,9 @@ - + - + @@ -751,6 +751,6 @@ if (!doNotTrack) { - + diff --git a/public/tags/timezone/index.html b/public/tags/timezone/index.html index 1a8e652a..45eb68d9 100644 --- a/public/tags/timezone/index.html +++ b/public/tags/timezone/index.html @@ -45,9 +45,9 @@ - + - + @@ -470,6 +470,6 @@ if (!doNotTrack) { - + diff --git a/public/tags/ubuntu/index.html b/public/tags/ubuntu/index.html index a2848c6d..76d0104c 100644 --- a/public/tags/ubuntu/index.html +++ b/public/tags/ubuntu/index.html @@ -45,9 +45,9 @@ - + - + @@ -960,6 +960,6 @@ if (!doNotTrack) { - + diff --git a/public/tags/vim/index.html b/public/tags/vim/index.html index 4f858521..52238d10 100644 --- a/public/tags/vim/index.html +++ b/public/tags/vim/index.html @@ -45,9 +45,9 @@ - + - + @@ -474,6 +474,6 @@ if (!doNotTrack) { - + diff --git a/public/tags/vpn/index.html b/public/tags/vpn/index.html index a5332e00..9b26f155 100644 --- a/public/tags/vpn/index.html +++ b/public/tags/vpn/index.html @@ -45,9 +45,9 @@ - + - + @@ -652,6 +652,6 @@ if (!doNotTrack) { - + diff --git a/public/tags/wireguard/index.html b/public/tags/wireguard/index.html index c7457440..34a5671d 100644 --- a/public/tags/wireguard/index.html +++ b/public/tags/wireguard/index.html @@ -45,9 +45,9 @@ - + - + @@ -698,6 +698,6 @@ if (!doNotTrack) { - + diff --git a/public/tags/zfs/index.html b/public/tags/zfs/index.html index eea30a8e..c6227cc7 100644 --- a/public/tags/zfs/index.html +++ b/public/tags/zfs/index.html @@ -45,9 +45,9 @@ - + - + @@ -522,6 +522,6 @@ if (!doNotTrack) { - + diff --git a/public/tags/短今/index.html b/public/tags/短今/index.html index 11580911..01cc2c10 100644 --- a/public/tags/短今/index.html +++ b/public/tags/短今/index.html @@ -45,9 +45,9 @@ - + - + @@ -422,6 +422,6 @@ if (!doNotTrack) { - + diff --git a/public/tags/筆記/index.html b/public/tags/筆記/index.html index d019cf53..bc37bbdf 100644 --- a/public/tags/筆記/index.html +++ b/public/tags/筆記/index.html @@ -45,9 +45,9 @@ - + - + @@ -761,6 +761,6 @@ if (!doNotTrack) { - + diff --git a/public/tags/群暉/index.html b/public/tags/群暉/index.html index 8d516f2a..5be39eac 100644 --- a/public/tags/群暉/index.html +++ b/public/tags/群暉/index.html @@ -45,9 +45,9 @@ - + - + @@ -482,6 +482,6 @@ if (!doNotTrack) { - +