LoginSignup
5
4

More than 5 years have passed since last update.

分散型ウェブSolidをMac上で動かす

Last updated at Posted at 2018-10-02

最初に

World Wide Webの創始者、Tim Berners-Leeが新しいプロジェクトをはじめましたね。
その名もSolid
logo.png

ロゴかっこいい。
GitHubに書いてあるとおり、分散型ウェブを作ろうとしているようです。

Re-decentralizing the web

ここで思い出すのは、人気ドラマシリコンバレー

主人公率いるスタートアップ企業「パイドパイパー」はまさに分散型インターネットである「新インターネット」を作ろうと奮闘します。

このドラマが大好きなので、ぜひ新しいインターネットを触りたい!と思い、本エントリーを書きます。

動かしてみる

幸いなことに、Solidは自分の大好きなNodeJsで書かれているようです。早速npm pkgをインストールしましょう

$ npm install -g solid-server

次に適当にディレクトリを作ってinitしましょう、とその前に

Solidプロジェクトを動かすには、certificate、privateKeyが必要なので、前もって作っておきましょう。

# 適当にディレクトリを作る
$ mkdir Work/solid-pj

# privateKey作成
$ openssl genrsa 2048 > ../localhost.key
# certificate作成
$ openssl req -new -x509 -nodes -sha256 -days 3650 -key ./localhost.key -subj '/CN=*.localhost' > ./localhost.cert

# init
$ solid init

いろいろ聞かれるのですが、自分は以下のように回答しました

$ solid init
? Path to the folder you want to serve. Default is /Users/username/Work/solid-pj/data
? SSL port to run on. Default is 8443
? Solid server uri (with protocol, hostname and port) https://localhost:8443
? Enable WebID authentication Yes
? Serve Solid on URL path /
? Path to the config directory (for example: /etc/solid-server) ./config
? Path to the config file (for example: ./config.json) ./config.json
? Path to the server metadata db directory (for users/apps etc) ./.db
? Path to the SSL private key in PEM format ./localhost.key
? Path to the SSL certificate key in PEM format ./localhost.cert
? Enable multi-user mode No
? Do you want to set up an email service? No

それでは早速nodeサーバを立ち上げてみましょう

$ solid start
Solid server () running on https://localhost:8443/

無事に立ち上がりました!
https://localhost:8443/ にアクセスしてみましょう
solid-top.png

早速Registerしてみます!
登録成功!
solid-login.png

これがSolidで言うところのPOD(パーソナル・オンライン・データ・ストア)ということですかね。

ユーザーは、PODに自分の情報を持ち、外部からの情報のアクセス権などを自分で操作できるようです。

参考

5
4
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
4