ã¿ãªããã¡ã¿ãã¼ã¹çãä¸ãã£ã¦ã¾ããï¼ã¤ã³ãã©ã¨ã³ã¸ãã¢ã® nobuh ã§ãã
æåã®è¨äº Mozilla Hubs ã VirtualBox ã§ãã¹ããã¦ã¿ã ã¨ãã®ç¶ç·¨ ç¶ Mozilla Hubs â VirtualBox ã§ãã¹ãããèªä½ã·ã¼ã³ã«å
¥ã£ã¦ã¿ã ã«ç¶ã Mozilla Hubs ã®ãã£ã¦ã¿ãã·ãªã¼ãºæçµåã§ãï¼
ååã¾ã§ã®ç 究ã§ãããã©ã«ãã®ãã¡ã¤ã³ hubs.local 㧠/etc/hosts ã使ã£ã¦ç¤¾å
ã«ãµã¼ãã¼ãç«ã¦ãã¨ããã¾ã§ã¯ç®å¦ãç«ã¡ã¾ããããå®éã«ä½¿ã£ã¦ã¿ãã¨ã¦ã¼ã¶ã¼ãèªåã ãã§ã
- æ¯åº¦æ¯åº¦ãã©ã¦ã¶ã§ SSL 証ææ¸ãä¾å¤è¨±å¯ããã®ãã¤ãããâãæ£è¦ãª SSL 証ææ¸ãå¿ è¦ â 社å ã¨ã¯ããã¡ããã¨ãããã¡ã¤ã³ï¼ã«ã¹ã¿ã ãã¡ã¤ã³ï¼ãå¿ è¦
- ãã°ã¤ã³ã®åº¦ã« Reticulum ã®ãµã¼ãã¼ã®ãã°ãè¦ã¦ãURL ãæãåºãã®ãã¤ãã â ãã®ã¾ã¾ã§ã¯ä½åãã¦ããªãèªè¨¼ã¡ã¼ã«ããªãã¨ããã
ã¨ãã課é¡ãããã¾ãããä»åãããã«ã¤ãã¦çªç ´ãããã¨ãåºæ¥ã¾ããã®ã§ããã®æ¹æ³ã«ã¤ãã¦å
±æãããã¨æãã¾ãï¼
“Cyberpunk Bar” (https://skfb.ly/6tnVv) by Nick Slough is licensed under Creative Commons Attribution (http://creativecommons.org/licenses/by/4.0/)
ããã©ã«ã hubs.local çãè¸è¥²ãããµã¼ãã¼æ§ç¯
ãµã¼ãã¼ã«ã¤ãã¦ã¯ VirtualBox ã®ããªãã¸ã¢ã¼ãã§ããVPS ã§ããã¯ã©ã¦ãã§ã®ä»®æ³ãµã¼ãã¼ã§ããåãæ¹éã§è¡ãã¾ãã®ã§ã好ã¿ã®ãã®ããç¨æãã ããã
OS ããä¸ã®æ§ç¯ã®æ¹åæ§ã«ã¤ãã¦ã¯æ®ã©ã ç¶ Mozilla Hubs â VirtualBox ã§ãã¹ãããèªä½ã·ã¼ã³ã«å
¥ã£ã¦ã¿ã ã¨åãã«ãªãã¾ãã
ããã§ã¯ hubs.local çã¨ã¯ç°ãªãã¨ããã®ã¿ããã¯ã¢ãããã¦ãç´¹ä»ãããã¾ãï¼
ã«ã¹ã¿ã ãã¡ã¤ã³ã¨ SSL 証ææ¸
ã«ã¹ã¿ã ãã¡ã¤ã³ã SSL 証ææ¸ã«ã¤ãã¦ã¯ç¹ã«æå®ã¯ããã¾ãããï¼æ¬è¨äºã§ã¯ä»®ç§°ã® myhubs.infiniteloop.co.jp ã¨ãã¦ããã¾ãï¼
ä½æ¥ã¦ã¼ã¶ã¼ã® ~/certs ãã£ã¬ã¯ããªã«
- server.crt : ä¸é証ææ¸ãé£çµããããµã¼ãã¼è¨¼ææ¸ãLets Encrypt ãªã fullchain.pem
- server.key : 証ææ¸ç§å¯éµããµã¼ãã¼éç¨ã®ãããã¹ãã¬ã¼ãºãç¡ããã¦ãããã®ãLets Encrypt ãªã privkey.pem.
ãé ç½®ãã¦ããã ããã° OK ã§ãï¼
Hubs ã®å¤æ´ç¹
webpack.config.js å ã§ã®ãã¹ãåã hubs.local ã dev.reticulum.io ãã myhubs.infiniteloop.co.jp ã«å¤æ´ã npm run local ã§ã¹ã¿ã¼ããã¾ãã
- const host = process.env.HOST_IP || env.localDev || env.remoteDev ? "hubs.local" : "localhost"; + const host = "myhubs.infiniteloop.co.jp";
// be flexible with people accessing via a local reticulum on another port - app.use(cors({ origin: /hubs\.local(:\d*)?$/ })); + app.use(cors({ origin: /myhubs\.infiniteloop\.co\.jp$/ }));
Admin ã®å¤æ´ç¹
hubs ã¨åæ§ã« webpack.config.js å ã®ãã¹ãåãå¤æ´ã npm run local ã§ã¹ã¿ã¼ããã¾ãã
if (env.local) { Object.assign(process.env, { - HOST: "hubs.local", - RETICULUM_SOCKET_SERVER: "hubs.local", - CORS_PROXY_SERVER: "hubs-proxy.local:4000", - NON_CORS_PROXY_DOMAINS: "hubs.local,dev.reticulum.io", - BASE_ASSETS_PATH: "https://hubs.local:8989/", - RETICULUM_SERVER: "hubs.local:4000", + HOST: "nthubs.infiniteloop.co.jp", + RETICULUM_SOCKET_SERVER: "myhubs.infiniteloop.co.jp", + CORS_PROXY_SERVER: "myhubs.infiniteloop.co.jp:4000", + NON_CORS_PROXY_DOMAINS: "myhubs.infiniteloop.co.jp", + BASE_ASSETS_PATH: "https://myhubs.infiniteloop.co.jp:8989/", + RETICULUM_SERVER: "myhubs.infiniteloop.co.jp:4000", POSTGREST_SERVER: "", ITA_SERVER: "" }); }
- const defaultHostName = "hubs.local"; + const defaultHostName = "myhubs.infiniteloop.co.jp";
Spoke ã®å¤æ´ç¹
webpack.config.js ã§ã¯ããã ãã§ãã
-const defaultHostName = "hubs.local"; +const defaultHostName = "myhubs.infiniteloop.co.jp";
èµ·åã«ä½¿ã scripts/run-local-reticulum.sh ãå¤æ´ãã¾ãã
#!/usr/bin/env bash NODE_TLS_REJECT_UNAUTHORIZED=0 ROUTER_BASE_PATH=/spoke BASE_ASSETS_PATH=https://myhubs.infiniteloop.co.jp:9090/ãHUBS_SERVER=myhubs.infiniteloop.co.jp:4000 RETICULUM_SERVER=myhubs.infiniteloop.co.jp:4000 yarn start
Dialog ã®å¤æ´ç¹
MEDIASOUP_LISTEN_IP=0.0.0.0 MEDIASOUP_ANNOUNCED_IP=192.168.0.7 npm start
ã¨ããæ§ã« IP æå®ã§èµ·åãã¦ããã®ã¿ã§ hubs.local çããã®å¤æ´ã¯ããã¾ããã
Reticulum ã®å¤æ´ç¹
èªãµã¼ãã¼éç¨ã®éµãæ¡ã Elixir ã® Phoenix ãã¬ã¼ã ã¯ã¼ã¯ã§æ§ç¯ããã reticulum ã§ãããã¡ã㯠config/dev.exs ãå¤æ´ãã¾ãããå¤æ´ç¹ãå¤ãã®ã§é ã追ã£ã¦è§£èª¬ãã¦ããã¾ãã
ã¾ãåé ã®ãã¹ãã®è¨å®ã§ãããããã¯ä»¥ä¸ã®ããã« host ã®è¡ã®ã¿å¤æ´ãä»ã®ãã¹ãã¯ãã®ã¾ã¾ã«ãã¦ãã ãããå
¨ã¦ãç®çã®ãã¡ã¤ã³ã®è¨è¿°ã«å¤æ´ãã㨠port 4000 ã®ããããã¼ã¸ãã Exception ã¨ãªã£ã¦ãã¾ãããã§ãããã®è¾ºã®æåã®èª¿æ»ã¯ä»å¾ã®èª²é¡ã«ãªã£ã¦ãã¾ãã
-host = "hubs.local" +host = "myhubs.infiniteloop.co.jp" <=== ãã®è¡ã®ã¿å¤æ´ cors_proxy_host = "hubs-proxy.local" assets_host = "hubs-assets.local" link_host = "hubs-link.local"
dev_janus_host 㯠host å¤æ°ãæµç¨ããããã«è¨å®ãã¾ãã
-dev_janus_host = "dev-janus.reticulum.io" +dev_janus_host = host
ssl ãã¡ã¤ã«ã®å ´æ㯠hubs.local çã¨åæ§ã§ãã¾ãå¾è¿°ããçç±ã§ code_reloader ã®è¨å®è¡ã¯åé¤ãã¾ãã
port: 4000, otp_app: :ret, cipher_suite: :strong, - keyfile: "#{File.cwd!()}/priv/dev-ssl.key", - certfile: "#{File.cwd!()}/priv/dev-ssl.cert" + keyfile: "#{File.cwd!()}/priv/server.key", + certfile: "#{File.cwd!()}/priv/server.crt" ], cors_proxy_url: [scheme: "https", host: cors_proxy_host, port: 4000], assets_url: [scheme: "https", host: assets_host, port: 4000], link_url: [scheme: "https", host: link_host, port: 4000], imgproxy_url: [scheme: "http", host: host, port: 5000], debug_errors: true, - code_reloader: true, <==== åé¤ãã
å
ã
ã® dev.exs ã®è¨è¿°ã§ã¯ã¡ã¼ã«ã®éä¿¡ã« Bamboo ã©ã¤ãã©ãªã®ãã¼ã«ã«ã¡ã¼ã«ãµã¼ãã¼æ¥ç¶æ©è½ã使ãããã«æ§æããã¦ãã¾ãã
ãµã¼ãã¼ããã¡ã¼ã«ãåºãå ´åãæ£å¼ãªã¡ã¼ã«ãµã¼ãã¼ã¯å¥ã«åå¨ãã¦ãã¦ãSMTP ã§ã¢ã¯ã»ã¹ãã¦ã¡ã¼ã«ãéä¿¡ãããã¨ããã®ãéç¨ã§ã¯ããããæ§æã§ãã®ã§ãBamboo_smtp ã©ã¤ãã©ãªã® LocalAdapter ãã SMTPAdapter ã使ãè¨å®ã«å¤æ´ãã¾ãã
ã¡ã¼ã«ã¢ã«ã¦ã³ãããã¹ã¯ã¼ããSMTP ã®è¨å®é
ç®ã¯ã使ãã®ã¡ã¼ã«ãµã¼ãã¼ã«åããã¦ãã ããã
-config :ret, Ret.Mailer, adapter: Bamboo.LocalAdapter +config :ret, Ret.Mailer, + adapter: Bamboo.SMTPAdapter, + server: "<YOUR MAIL SERVER>", + port: XXX, + username: "hubs-admin@<YOUR DOMAIN>", + password: "<ãã¹ã¯ã¼ã>", + tls: :if_available, # ã¾ã㯠:always ã :never + ssl: true, # ããã¾ã§ä¾ã§ã + retries: 1 -config :ret, RetWeb.Email, from: "[email protected]" +config :ret, RetWeb.Email, from: "hubs-admin@<YOUR DOMAIN>"
hubs.local çã¨åæ§ perms_key ã«1è¡åãã dialog ã¨ã®éä¿¡ç¨ç§å¯éµãè¨å®ãã¾ãã
-config :ret, Ret.PermsToken, perms_key: (System.get_env("PERMS_KEY") || "") |> String.replace("\\n", "\n") +config :ret, Ret.PermsToken, perms_key: "-----BEGIN RSA PRIVATE çç¥ -----END RSA PRIVATE KEY-----"
Dialog ã®ãã¼ã㯠4443 ã使ãã¾ãã®ã§å¤æ´ãã¾ãã
-config :ret, Ret.JanusLoadStatus, default_janus_host: dev_janus_host, janus_port: 443 +config :ret, Ret.JanusLoadStatus, default_janus_host: dev_janus_host, janus_port: 4443
æå¾ã« config/dev.exs ããã®ã¾ã¾ prod.exs ã«ã³ãã¼ããã«ããè¡ããä¸å³ã¯ dev ç°å¢ã®æ§æã®ã¾ã¾ãprod ç°å¢ã¨ãã¦èµ·åãã¾ãã
cp -pf config/dev.exs config/prod.exs mix deps.get mix ecto.create PORT=4000 MIX_ENV=prod iex -S mix phx.server
reticulum ã®ããããã¼ã¸ã HTTP 500 ã«ãªããªã©åä½ãç°å¸¸ã«ãªã£ãå ´åã¯ãã¾ã _build/prod ã®ãã£ã¬ã¯ããªãåé¤ãã¦ãmix deps.get ããããç´ã対å¿ããè¦ããããã¾ãã
mix.exs ã§æå®ããã©ã¤ãã©ãªã§ã¯ãLive Reload æ©è½ã«ã¤ãã¦ã¯ dev ç°å¢ã®ã¿è¨å®ããã¦ãã¾ããä»å㯠prod ç°å¢ã§ä½¿ãããåè¿°ããããã« code_reloader è¨å®ã¯åé¤ãã¾ããã
è¨å®ãããã¡ã¤ã³ã® port 4000 ã®ããããã¼ã¸ãã Sigin In ãæ¼ããã¡ã¼ã«ã¢ãã¬ã¹ãæå®ãããã¨ã§ãã°ã¤ã³ãªã³ã¯ã®ã¡ã¼ã«ãå®éã«é£ã¹ã°å®æã§ãï¼
管çè
権éã®ç¡ãä¸è¬ã¦ã¼ã¶ã¼ã§ããæ°è¦ã«ã¼ã ä½ææã« Options ãæ¼ãã¦ãChange Scene ã®æ©è½ã使ãã°ãSpoke ä¸ã§ä½æã㦠Publish ãã¦ãããã·ã¼ã³ãé¸æãã¦ããã§é¨å±ãéå§åºæ¥ã¾ãã®ã§ãæ¯éã試ããã ããï¼
以ä¸ãã¾ã ã¨ã©ã¼ãåºã¦ããæ©è½ããã£ãããããããè©°ãããã¦ããªãã¨ããã¯ããã¾ãããã¡ã¿ãã¼ã¹ã®ãµã¼ãã¼ä¸å¼ãæå ã«æã¦ããã¨ã§ Mozilla Hubs ãçãä¸ããä¸å©ã«ãªãã°ã¨æãç¾æç¹ã§ã®ãã¦ãã¦ãã·ã§ã¢ããã¦é ãã¾ããï¼
å¼ç¤¾ã§ã¯ã¡ã¿ãã¼ã¹ã«èå³ã®ãã xR ã¨ã³ã¸ãã¢ãããã°ã©ããã¤ã³ãã©ã¨ã³ã¸ãã¢ãªã©ãç©æ¥µåéãã¦ããã¾ãã®ã§ããèå³ããæ¹ã¯ãã²ãå¿åãã ããã¼ãâæ¡ç¨æ å ±