{"id":7602,"date":"2020-09-01T22:12:30","date_gmt":"2020-09-01T13:12:30","guid":{"rendered":"https:\/\/www.taruki.com\/wp\/?p=7602"},"modified":"2020-09-06T09:31:35","modified_gmt":"2020-09-06T00:31:35","slug":"quoridorn-mark2%e3%81%ae%e9%9b%91%e3%81%aa%e5%b0%8e%e5%85%a5%e6%89%8b%e9%a0%86","status":"publish","type":"post","link":"https:\/\/www.taruki.com\/wp\/?p=7602","title":{"rendered":"Quoridorn-mark2\u306e\u96d1\u306a\u5c0e\u5165\u624b\u9806"},"content":{"rendered":"<p>\u6ce8\u610f\uff01\uff012020\/09\/03\u306b\u516c\u958b\u3055\u308c\u305f\u300cclient\uff1aVer.2.0.0a80\u300d\u300cserver\uff1aVer1.0.0a50\u300d\u3067\u306f\u672c\u624b\u9806\u3067\u306f\u30d3\u30eb\u30c9\u3067\u304d\u307e\u305b\u3093\u3002\u624b\u9806\u3084\u8a2d\u5b9a\u5185\u5bb9\u304c\u5909\u308f\u3063\u3066\u3044\u307e\u3059\u3002<br \/>\n<H3>\u5fc5\u8981\u306a\u3082\u306e<\/H3><br \/>\n<UL><br \/>\n<LI>Linux\u304c\u52d5\u304f\u30b5\u30fc\u30d0\u30fc(\u7269\u7406\u3067\u3082\u4eee\u60f3\u3067\u3082\u30af\u30e9\u30a6\u30c9\u3067\u3082\u53ef)<\/LI><br \/>\n<LI>mongodb<\/LI><br \/>\n<LI>nginx<\/LI><br \/>\n<LI>nodejs-12.x.x(nvm\u304c\u3042\u308c\u3070\u4fbf\u5229)<\/LI><br \/>\n<LI>certbot\u307e\u305f\u306fSSL\u8a3c\u660e\u66f8(HTTPS\u4f7f\u3046\u306a\u3089\u5fc5\u9808)<\/LI><br \/>\n<LI>minio<\/LI><br \/>\n<LI>bcdice-api\u30b5\u30fc\u30d0\u30fc(\u3069\u3069\u3093\u3068\u3075\u516c\u5f0f\u9bd6\u3068\u304b\u516c\u958bAPI\u9bd6\u4f7f\u3046\u306a\u3089\u4e0d\u8981)<\/LI><br \/>\n<\/UL><br \/>\n<H3>\u524d\u63d0\u8272\u3005<\/H3><br \/>\n<H4>mongodb<\/H4><br \/>\nmongodb\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u65b9\u6cd5\u306f\u3001mongodb\u306e\u30b5\u30a4\u30c8\u306a\u3069\u3092\u53c2\u7167\u3057\u3066\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3057\u3066\u304f\u3060\u3055\u3044\u3002debian\u3068\u304bCentOS\u306a\u3089\u30ea\u30dd\u30b8\u30c8\u30ea\u8ffd\u52a0\u3057\u305f\u3089apt\u306a\u308adnf\u3067\u3059\u3093\u306a\u308a\u5c0e\u5165\u53ef\u80fd\u3002<br \/>\n4.x\u30683.x\u3067\u52d5\u4f5c\u78ba\u8a8d\u6e08\u307f\u3002\u7279\u306b\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3067OK\u3002\u53ef\u7528\u6027\u9ad8\u3081\u305f\u3051\u308c\u3070\u30ec\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u69cb\u6210\u306a\u308a\u306b\u3002quoridorn\u7528\u306b\u597d\u304d\u306a\u540d\u524d\u3067DB\u3092\u4f5c\u6210\u3002<br \/>\n<H4>S3<\/H4><br \/>\nAWS\u306eS3\u3067\u3082wasabi\u3067\u3082IBM Cloud Object Storage\u3067\u3082\u3055\u304f\u3089\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u30b9\u30c8\u30ec\u30fc\u30b8\u3067\u3082\u52d5\u304f\u306f\u305a\u3067\u3059\u304c\u3001\u5f53\u30b5\u30fc\u30d0\u30fc\u306fminio\u306estandalone\u69cb\u6210\u3002<br \/>\nminio\u306e\u30b5\u30a4\u30c8\u3092\u898b\u3066\u5c0e\u5165\u3057\u3088\u3046\u3002\u57fa\u672c\u7684\u306b\u306f\u9069\u5f53\u306a\u30e6\u30fc\u30b6\u30fc\u3068\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u3092\u4f5c\u6210\u3057\u3066\u3001\u30d0\u30a4\u30ca\u30ea\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u3001systemd\u306eservice\u3092\u4f5c\u6210\u3057\u3066\u8d77\u52d5\u3057\u3066\u7d42\u308f\u308a\u3002\u52d5\u4f5c\u78ba\u8a8d\u306fmc\u306a\u3069\u3067\u3002<br \/>\nAWS\u3067\u3082\u3055\u304f\u3089\u3067\u3082minio\u3067\u3082OK\u3002\u9069\u5f53\u306a\u540d\u79f0\u3067bucket\u3092\u4f5c\u6210\u3057\u3001Quoridorn\u7528\u306eAPI\u3068Secret\u30ad\u30fc\u3092\u751f\u6210\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u30dd\u30ea\u30b7\u30fc\u306fREAD-ONLY\u306b\u3059\u308b\u3002<br \/>\nminio\u3092\u305d\u306e\u307e\u307e\u5916\u90e8\u516c\u958b\u3059\u308b\u306e\u306f\u304a\u3059\u3059\u3081\u3057\u306a\u3044\u3002\u3053\u3061\u3089\u3067\u306f127.0.0.1\u3067\u5f85\u3061\u53d7\u3051\u3066nginx\u304cReverseProxy\u3067minio\u306b\u6e21\u3059\u3088\u3046\u306b\u3057\u305f\u3002<br \/>\nAPI\u30ad\u30fc\u306f\u7d76\u5bfenginx\u306edocument root\u4ee5\u4e0b\u306b\u306f\u7f6e\u304b\u306a\u3044\u3088\u3046\u306b\u3002<br \/>\nminio\u306esystemd\u306eunit\u30d5\u30a1\u30a4\u30eb\u4f8b(\/etc\/systemd\/system\/minio.service)<br \/>\n<PRE><br \/>\n[Unit]<br \/>\nDescription=minio Object Storage Service Inst1<br \/>\nAfter=network.target<\/p>\n<p>[Service]<br \/>\nType=simple<br \/>\nUser=minio<br \/>\nEnvironmentFile=\/srv\/minio\/inst1\/env<br \/>\nExecStart=\/usr\/local\/sbin\/minio server &#8211;address 0.0.0.0:9000 &#8211;config-dir \/srv\/minio\/inst1\/config \/srv\/minio\/inst1\/data<br \/>\nRestart=on-abort<br \/>\nWorkingDirectory=\/srv\/minio\/inst1<\/p>\n<p>[Install]<br \/>\nWantedBy=multi-user.target<br \/>\n<\/PRE><br \/>\n<H3>Quoridorn-server\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7<\/H3><br \/>\nnvm\u3067nodejs\u3092\u8a2d\u5b9a<br \/>\n<PRE><br \/>\n$ curl -o- https:\/\/raw.githubusercontent.com\/nvm-sh\/nvm\/v0.35.3\/install.sh | bash<br \/>\n$ . ~\/.bashrc<br \/>\n$ nvm install v12.18.3<br \/>\n$ nvm alias default v12.18.3<br \/>\n<\/PRE><br \/>\nquoridorn\u30b5\u30fc\u30d0\u30fc\u3092\u5b9f\u884c\u3059\u308b\u30e6\u30fc\u30b6\u30fc\u3067pull\u3057\u3066README\u901a\u308a\u306b\u30d3\u30eb\u30c9(npm install\u3067\u3001README\u306b\u66f8\u304b\u308c\u3066\u3044\u308b\u524d\u63d0\u306eExpress\u3084socket.io\u3084nekostore\u306f\u5c0e\u5165\u3055\u308c\u307e\u3059)<br \/>\n<PRE><br \/>\n$ git clone https:\/\/github.com\/HillTopTRPG\/quoridorn-server<br \/>\n$ npm install<br \/>\n$ npm run build<br \/>\n<\/PRE><br \/>\nconfig\/server.yaml\u3092\u7de8\u96c6(\u30b3\u30e1\u30f3\u30c8\u306f\u7701\u7565\u3057\u3066\u307e\u3059<br \/>\n<PRE><br \/>\nport: 8180<br \/>\nstoreType: mongodb<br \/>\nsecretCollectionSuffix: \u30b3\u30e1\u30f3\u30c8\u306b\u66f8\u304b\u308c\u3066\u3044\u308bUUID\u751f\u6210\u30b5\u30a4\u30c8\u306a\u3069\u3067\u751f\u6210\u3057\u305f\u4efb\u610f\u306e\u56fa\u6709\u306aUUID\u3092\u5165\u529b<br \/>\nroomNum: 100<br \/>\nroomAutoRemove: 4320<br \/>\nmongodbConnectionStrings: mongodb:\/\/127.0.0.1:27017\/DB\u540d<br \/>\n<\/PRE><br \/>\nconfig\/stoprage.yaml\u3092\u7de8\u96c6<br \/>\n<PRE><br \/>\nbucket: quoridorn<br \/>\naccessUrl: &#8216;https:\/\/quoridorn-test.onlinesession.app\/s3\/&#8217;<br \/>\nendPoint: localhost<br \/>\nport: 9000<br \/>\naccessKey: &#8216;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&#8217;<br \/>\nsecretKey: &#8216;xxxxxxxxxxxxxxxxxxxxxxxxxxx&#8217;<br \/>\nuseSSL: false<br \/>\n<\/PRE><br \/>\n\u3053\u3053\u307e\u3067\u8a2d\u5b9a\u3057\u305f\u3089\u3001\u300cnpm run node-server\u300d\u3092\u5b9f\u884c\u3057\u3066\u8d77\u52d5\u306b\u6210\u529f\u3059\u308b\u304b\u78ba\u8a8d\u3002\u6210\u529f\u3057\u305f\u3089systemd\u306eunit\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u3066\u30b7\u30b9\u30c6\u30e0\u8d77\u52d5\u6642\u306b\u81ea\u52d5\u8d77\u52d5\u3059\u308b\u3088\u3046\u8a2d\u5b9a<br \/>\n\/etc\/systemd\/system\/quoridorn.service\u307f\u305f\u3044\u306a\u540d\u524d\u3067unit\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210<br \/>\n<PRE><br \/>\n[Unit]<br \/>\nDescription=quoridornserver<br \/>\nAfter=network.target mongod.service minio.service<\/p>\n<p>[Service]<br \/>\nType=simple<br \/>\nUser=quoridorn<br \/>\nWorkingDirectory=\/srv\/quoridorn\/quoridorn-server<br \/>\nEnvironment=NODE_VERSION=stable<br \/>\nEnvironment=ENV=production<br \/>\nExecStart=\/home\/quoridorn\/.nvm\/nvm-exec npm run node-server<br \/>\nTimeoutSec=120<br \/>\nRestart=always<\/p>\n<p>[Install]<br \/>\nWantedBy=multi-user.target<br \/>\n<\/PRE><br \/>\n<H3>quoridorn\u306e\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u3092\u30d3\u30eb\u30c9\u3057\u3066\u8a2d\u7f6e<\/H3><br \/>\nnodejs\u304c\u4f7f\u3048\u308b\u306a\u3089\u30ed\u30fc\u30ab\u30ebPC\u3067\u3082\u53ef\u3002\u30d3\u30eb\u30c9\u306b\u306f\u30e1\u30e2\u30ea\u30fc\u30922GB\u3050\u3089\u3044\u4f7f\u3046\u306e\u3067\u3057\u3087\u307c\u3044VPS\u3060\u3068\u30e1\u30e2\u30ea\u304c\u8db3\u308a\u306a\u304f\u3066\u30d3\u30eb\u30c9\u306b\u5931\u6557\u3057\u307e\u3059\u3002<br \/>\n<PRE><br \/>\n$ git clone https:\/\/github.com\/HillTopTRPG\/quoridorn-mark2<br \/>\n$ cd quoridorn-mark2<br \/>\n$ npm install<br \/>\n$ vi .env<br \/>\n\u3067\u3001\u30c9\u30e1\u30a4\u30f3\u76f4\u4e0b\u306a\u3089BASE_URL\u3092\u30d6\u30e9\u30f3\u30af\u306b\u305d\u3046\u3067\u306a\u3051\u308c\u3070\u76f8\u5bfe\u30d1\u30b9\u3092\u8a2d\u5b9a<br \/>\n$ npm run build<br \/>\n<\/PRE><br \/>\n\u30d3\u30eb\u30c9\u306b\u6210\u529f\u3057\u305f\u3089\u3001dist\/config\/static\/connect.yaml\u3092\u7de8\u96c6\u3057\u3001quoridorn-server\u306e\u63a5\u7d9a\u5148URL\u3068bcdice-api\u306e\u30b5\u30fc\u30d0\u30fc\u3092\u8a2d\u5b9a\u3002(skyway\u306f2.0.0a77\u6642\u70b9\u3067\u306f\u4f7f\u3063\u3066\u3044\u306a\u3044\u306e\u3067\u8a2d\u5b9a\u4e0d\u8981)<br \/>\ndist\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u4ee5\u4e0b\u3092nginx\u306edocumentoroot\u306a\u308a\u30b3\u30f3\u30c6\u30f3\u30c4\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u30b3\u30d4\u30fc<br \/>\n<H3>nginx\u306e\u8a2d\u5b9a<\/H3><br \/>\n<PRE><br \/>\nmap $http_upgrade $connection_upgrade {<\/p>\n<p>  default upgrade;<\/p>\n<p>  \u201d      close;<\/p>\n<p>}<\/p>\n<p>server {<\/p>\n<p>        listen 80;<\/p>\n<p>        listen [::]:80;<br \/>\n        root \/home\/quoridorn\/dist;<\/p>\n<p>        server_name quoridorn-test.onlinesession.app;<\/p>\n<p>        location \/ {<br \/>\n          try_files $uri $uri\/ @express;<br \/>\n        }<\/p>\n<p>        location @express {<br \/>\n                proxy_set_header Host $host;<br \/>\n                proxy_set_header X-Real-IP $remote_addr;<br \/>\n                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;<br \/>\n                proxy_set_header X-Forwarded-Proto https;<br \/>\n                proxy_set_header Proxy &#8220;&#8221;;<br \/>\n                proxy_pass_header Server;<\/p>\n<p>                proxy_pass http:\/\/127.0.0.1:8180;<br \/>\n                proxy_buffering off;<br \/>\n                proxy_redirect off;<br \/>\n                proxy_http_version 1.1;<br \/>\n                proxy_set_header Upgrade $http_upgrade;<br \/>\n                proxy_set_header Connection $connection_upgrade;<\/p>\n<p>                tcp_nodelay on;<br \/>\n        } <\/p>\n<p>        location \/s3\/ {<br \/>\n                # minio settings<br \/>\n                proxy_set_header Host $http_host;<br \/>\n                proxy_pass http:\/\/localhost:9000\/quoridorn\/;<br \/>\n        }<br \/>\n}<br \/>\n<\/PRE><br \/>\n\u3056\u3063\u304f\u308a\u8aac\u660e\u3059\u308b\u3068\u3001\u30d6\u30e9\u30a6\u30b6\u304c\u8981\u6c42\u3057\u305f\u30ea\u30af\u30a8\u30b9\u30c8\u3067\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u30d5\u30a1\u30a4\u30eb\u4ee5\u5916\u306f\u3001\/s3\/\u4ee5\u4e0b\u306fminio\u306b\u3001\u305d\u308c\u4ee5\u5916\u306fquoridorn-server\u306bproxy\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n<H3>\u6700\u5f8c\u306b<\/H3><br \/>\n\u304b\u306a\u308a\u3056\u3063\u304f\u308a\u8aac\u660e\u3067\u3001nginx\u306eHTTPS\u8a2d\u5b9a\u306e\u3084\u308a\u65b9\u3068\u304b\u3001firewalld\u306e\u7a74\u958b\u3051\u65b9\u6cd5\u3001HTTP\u2192HTTPS\u3078\u306e\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u8a2d\u5b9a\u3001certbot\u8a2d\u5b9a\u3001\u305d\u3082\u305d\u3082\u306emongodb\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u306a\u3069\u304b\u306a\u308a\u3092\u7aef\u6298\u3063\u3066\u3044\u307e\u3059\u3057\u30012.0.0a77\u6642\u70b9\u306e\u60c5\u5831\u306a\u306e\u3067\u666e\u901a\u306b\u30d3\u30eb\u30c9\u6210\u529f\u3057\u3066\u3082\u8272\u3005\u4e0d\u5177\u5408\u3084\u672a\u5b9f\u88c5\u306e\u6a5f\u80fd\u304c\u305f\u304f\u3055\u3093\u3042\u308b\u306e\u3067\u3001\u4eba\u67f1\u4e0a\u7b49\u3067\u3053\u306e\u3056\u3063\u304f\u308a\u8aac\u660e\u3092\u3061\u3083\u3093\u3068\u304b\u307f\u7815\u3044\u3066\u81ea\u5206\u7528\u306b\u7406\u89e3\u3057\u3066\u8a2d\u5b9a\u3067\u304d\u306a\u3044\u3068\u81ea\u9bd6\u904b\u55b6\u306f\u7121\u7406\u3060\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n\u306f\u3063\u304d\u308a\u3044\u3063\u3066\u3001\u81ea\u9bd6\u4f5c\u308b\u306e\u306f\u3069\u3069\u3093\u3068\u3075\u3088\u308a\u304b\u306a\u308a\u5c0e\u5165\u96e3\u6613\u5ea6\u306f\u9ad8\u3081\u3067\u3059\u3002\u30ac\u30d0\u30ac\u30d0\u8a2d\u5b9a\u306b\u3059\u308b\u3068\u52a0\u5bb3\u8005\u306b\u306a\u308b\u3053\u3068\u3082\u3042\u308a\u3048\u308b\u306e\u3067\u69cb\u7bc9\u306f\u614e\u91cd\u306b\u3054\u691c\u8a0e\u304f\u3060\u3055\u3044\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6ce8\u610f\uff01\uff012020\/09\/03\u306b\u516c\u958b\u3055\u308c\u305f\u300cclient\uff1aVer.2.0.0a80\u300d\u300cserver\uff1aVer1.0.0a50\u300d\u3067\u306f\u672c\u624b\u9806\u3067\u306f\u30d3\u30eb\u30c9\u3067\u304d\u307e\u305b\u3093\u3002\u624b\u9806\u3084\u8a2d\u5b9a\u5185\u5bb9\u304c\u5909\u308f\u3063\u3066\u3044\u307e\u3059\u3002 \u5fc5\u8981\u306a\u3082\u306e Linux\u304c\u52d5\u304f\u30b5\u30fc [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[24,48],"tags":[],"class_list":["post-7602","post","type-post","status-publish","format-standard","hentry","category-pc","category-48"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.taruki.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/7602","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.taruki.com\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.taruki.com\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.taruki.com\/wp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.taruki.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7602"}],"version-history":[{"count":0,"href":"https:\/\/www.taruki.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/7602\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.taruki.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7602"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.taruki.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7602"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.taruki.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7602"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}