スケジュール
出来事
-
pythonのconcurrent futureでmemory leak がまだ起きる.
- この記事を見るに, chunkに適当に区切って渡せば良さそうな気がする. (そううまくはいかなかったんだが…
-
仕事
- 要件から機能一覧作成して, UIも作成.
-
小説を読もう
- 悪辣姫のお気に入り
- まぁまぁ
- 悪辣姫のお気に入り
適当に
pythonのメモリリーク問題なおらねぇ…
ちょっとHaskell勉強した
windowsでのchocoからのdocker installに手間取った
frontera使ってみた.
クローラーのbroken process poolの対処.
小説を読もう
今日は結構いろんなことに嵌った日だった.
ブログ書いた. reverse proxyについて.
virtualboxの画面サイズ問題はとりあえずこれ見ておけば問題なさそう.
mindmapのOSSツールって意外に少ないんだなぁ… 作りたいんだが.
DDDは集約あたりを勉強. モデリングが大変そう.
原材料名
グリシン、クエン酸、香料
と書いてある. グリシンはパレオ先生曰く,
で取り上げられており, 大丈夫そう. 香料は謎だけど.
3000mgなので効果もありそう. まぁお試しかなぁ.
買い物結構大変だった. コロナあるからめんどくさいんだよなぁ.
コンカイハ, 簡単にSSL証明書を取得でき, HTTPSサーバーを簡単に作れるlinuxserver/letsencrypt dockerを紹介したいと思います.
公式の使い方のブログがあるので, 気になる方は是非そちらもご参照ください. (このブログを探すのにも結構手間取りましたw
まずはdocker-compose.ymlファイルを作成し, 次のように書きます.
version: "2"
services:
letsencrypt:
image: linuxserver/letsencrypt
container_name: letsencrypt
cap_add:
- NET_ADMIN
environment:
- PUID=1000
- PGID=1000
- TZ=Asia/Tokyo
- URL=<yourdomain>
- SUBDOMAINS=www,
- VALIDATION=http
- EMAIL= #optional
- EXTRA_DOMAINS= #optional
- STAGING=false #optional true or false
volumes:
- ./config:/config
ports:
- 443:443
- 80:80 #optional
restart: unless-stopped
各environmentの値の意味はこちらに書いてありますが, <yourdomain>のところを, SSL証明書を取得したいドメインに変えるだけで良いと思います.
例えばURL=example-aka.comなど.
次に, docker-composeコマンドを使えるようにします. 公式サイトからインストールするか, 手前味噌ですが, dockerでdocker-composeを動かす記事を参考にしていただければと思います.
あとは実際にdocker-compose run letsencrypt, もしくはdocker-compose upを実行します.
証明書の生成に時間がかかりますのでお待ちください☕︎
$ docker-compose run letsencrypt
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 01-envfile: executing...
[cont-init.d] 01-envfile: exited 0.
[cont-init.d] 10-adduser: executing...
usermod: no changes
-------------------------------------
_ ()
| | ___ _ __
| | / __| | | / \
| | \__ \ | | | () |
|_| |___/ |_| \__/
Brought to you by linuxserver.io
-------------------------------------
To support the app dev(s) visit:
Let's Encrypt: https://letsencrypt.org/donate/
To support LSIO projects visit:
https://www.linuxserver.io/donate/
...
New certificate generated; starting nginx
Starting 2019/12/30, GeoIP2 databases require personal license key to download. Please manually download/update the GeoIP2 db and save as /config/geoip2db/GeoLite2-City.mmdb
[cont-init.d] 50-config: exited 0.
[cont-init.d] 60-renew: executing...
The cert does not expire within the next day. Letting the cron script handle the renewal attempts overnight (2:08am).
[cont-init.d] 60-renew: exited 0.
[cont-init.d] 99-custom-files: executing...
[custom-init] no custom files found exiting...
[cont-init.d] 99-custom-files: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
nginx: [alert] detected a LuaJIT version which is not OpenResty's; many optimizations will be disabled and performance will be compromised (see https://github.com/openresty/luajit2 for OpenResty's LuaJIT or, even better, consider using the OpenResty releases from https://openresty.org/en/download.html)
Server ready
Server readyが表示されたら準備完了です.
実際に https://yourdomain/ にアクセスしてみましょう.
次のページが表示されたら成功です!
$ curl -L example-aka.com
<html>
<head>
<title>Welcome to our server</title>
<style>
body{
font-family: Helvetica, Arial, sans-serif;
}
.message{
width:330px;
padding:20px 40px;
margin:0 auto;
background-color:#f9f9f9;
border:1px solid #ddd;
}
center{
margin:40px 0;
}
h1{
font-size: 18px;
line-height: 26px;
}
p{
font-size: 12px;
}
</style>
</head>
<body>
<div class="message">
<h1>Welcome to our server</h1>
<p>The website is currently being setup under this address.</p>
<p>For help and support, please contact: <a href="me@example.com">me@example.com</a></p>
</div>
</body>
</html>
アクセスできない場合はFirewall設定など見てみてください.
以上の手順で簡単にHTTPSサーバーを立てることができました!
dockerで簡単にHTTPSサーバーをlinuxserver/letsencrypt Dockerを使ってみました. 証明書の自動更新機能もあるらしいのでとても便利ですね.
ただ, 私がこの記事を書いたきっかけは, 「dockerでサブディレクトリ型のhttps対応リバースプロキシが簡単に作れない!」というのを憤慨してのことなので, 次回はそれを記事にしていこうと思います.
サブドメイン型のhttpsリバースプロキシなら, https-portalとかnginx-reverse-proxyとかもあるので, そちらを試す方が良いかもしれません. (全然更新されていないのが気になるけど.
docker でvolumeの所有権を変更する方法をまた調べた
sudo chown -R $USER <directoryをするしかなかったっぽい.freenomでoracle cloud serverようのサブドメインを取得
# 5分で分かる!検察庁法改の内容と問題点について【せやろがいおじさん】を見た. すごいわかりやすかった
この日記やっぱnofollowつけたほうがいいのかなぁと思って少しSEO調べた
アニメーションで感覚的にハッシュ関数「SHA-256」の算出過程を理解できる「SHA-256 Animation」 - GIGAZINE が凄そう.
【告知】姿勢改善Tシャツ「NEKONOBIX」のデザインや仕組みとか | パレオな男
やっぱネットサーフィンもいいよなぁ.