Skip to content

Instantly share code, notes, and snippets.

@cleanunicorn
Last active February 23, 2023 10:21
Show Gist options
  • Save cleanunicorn/8ef2232fca25e684d3dcf10d30eaac7a to your computer and use it in GitHub Desktop.
Save cleanunicorn/8ef2232fca25e684d3dcf10d30eaac7a to your computer and use it in GitHub Desktop.
Solid Pod installation

Solid pod

Installation

Using an Ubuntu vm for this.

Install nvm/node.

npm i -g solid-server

Setup

$ solid init
? Path to the folder you want to serve. Default is /home/daniel/data
? SSL port to run on. Default is 8443
? Solid server uri (with protocol, hostname and port) https://0.0.0.0:8443
? Enable WebID authentication Yes
? Serve Solid on URL path /
? Path to the config directory (for example: ./config) ./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
>> You must enter a valid path

I started answering the questions and then I realized I had to generate a ssl key first. So I stopped the process and did that.

openssl req -newkey rsa:2048 -new -nodes -x509 -days 3650 -keyout key.pem -out cert.pem

Finally I initialized my solid server.

~ solid init
? Path to the folder you want to serve. Default is /home/daniel/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: ./config) ./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 ./ssl-keys/key.pem
? Path to the SSL certificate key in PEM format ./ssl-keys/cert.pem
? Enable multi-user mode No
? Do you want to set up an email service? No
? A name for your server (not required, but will be presented on your server's frontpage) solid-home
? A description of your server (not required)
? A logo that represents you, your brand, or your server (not required)
config created on /home/daniel/config.json

I got an error while starting the server because I had enabled webid, and it doesn't like self signed certificates.

 solid start
  solid:settings Server URI: https://localhost:8443 +0ms
  solid:settings Auth method: oidc +1ms
  solid:settings Strict origins: true +1ms
  solid:settings Allowed origins:  +0ms
  solid:settings Db path: ./.db +0ms
  solid:settings Config path: ./config +0ms
  solid:settings Suffix Acl: undefined +0ms
  solid:settings Suffix Meta: undefined +0ms
  solid:settings Allow WebID authentication: true +0ms
  solid:settings Live-updates: true +0ms
  solid:settings Multi-user: false +0ms
  solid:settings Suppress default data browser app: undefined +0ms
  solid:settings Default data browser app file path: default +0ms
  solid:settings Base URL (--mount): / +13ms
  solid:settings SSL Private Key path: ./ssl-keys/key.pem +0ms
  solid:settings SSL Certificate path: ./ssl-keys/cert.pem +0ms
Solid server (5.7.4) running on https://localhost:8443/
Press <ctrl>+c to stop
  solid:authentication No provider keys found, generating fresh ones +0ms
  solid:authentication Provider keychain initialized +1s
  solid:authentication Not sleeping before client registration... +1ms
  solid:authentication Client not present for issuer https://localhost:8443, initializing new client +0ms
  solid:authentication Registering new client for issuer  https://localhost:8443 +1ms
  solid:authentication Error registering a new client:  FetchError: request to https://localhost:8443/.well-known/openid-configuration failed, reason: self-signed certificate
    at ClientRequest.<anonymous> (/home/daniel/.nvm/versions/node/v19.7.0/lib/node_modules/solid-server/node_modules/node-fetch/lib/index.js:1505:11)
    at ClientRequest.emit (node:events:512:28)
    at TLSSocket.socketErrorListener (node:_http_client:496:9)
    at TLSSocket.emit (node:events:512:28)
    at emitErrorNT (node:internal/streams/destroy:151:8)
    at emitErrorCloseNT (node:internal/streams/destroy:116:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  type: 'system',
  errno: 'DEPTH_ZERO_SELF_SIGNED_CERT',
  code: 'DEPTH_ZERO_SELF_SIGNED_CERT'
} +11ms
  solid:authentication Error initializing local RP client:  FetchError: request to https://localhost:8443/.well-known/openid-configuration failed, reason: self-signed certificate
    at ClientRequest.<anonymous> (/home/daniel/.nvm/versions/node/v19.7.0/lib/node_modules/solid-server/node_modules/node-fetch/lib/index.js:1505:11)
    at ClientRequest.emit (node:events:512:28)
    at TLSSocket.socketErrorListener (node:_http_client:496:9)
    at TLSSocket.emit (node:events:512:28)
    at emitErrorNT (node:internal/streams/destroy:151:8)
    at emitErrorCloseNT (node:internal/streams/destroy:116:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  type: 'system',
  errno: 'DEPTH_ZERO_SELF_SIGNED_CERT',
  code: 'DEPTH_ZERO_SELF_SIGNED_CERT'
} +1ms

Thus, I stopped the server and edited my config.json to disable webid.

I edited my ./config.json and set this variable from true to false.

"webid": false,

Then I started the server again.

solid start
  solid:settings Server URI: https://localhost:8443 +0ms
  solid:settings Auth method: oidc +1ms
  solid:settings Strict origins: true +0ms
  solid:settings Allowed origins:  +0ms
  solid:settings Db path: ./.db +0ms
  solid:settings Config path: ./config +0ms
  solid:settings Suffix Acl: undefined +0ms
  solid:settings Suffix Meta: undefined +0ms
  solid:settings Allow WebID authentication: false +0ms
  solid:settings Live-updates: true +0ms
  solid:settings Multi-user: false +0ms
  solid:settings Suppress default data browser app: undefined +0ms
  solid:settings Default data browser app file path: default +0ms
  solid:settings Base URL (--mount): / +3ms
  solid:settings SSL Private Key path: ./ssl-keys/key.pem +0ms
  solid:settings SSL Certificate path: ./ssl-keys/cert.pem +0ms
Solid server (5.7.4) running on https://localhost:8443/
Press <ctrl>+c to stop

Once I had this working I had no idea what to do next. 🤷‍♂️

Clicking on the Register to get a Pod generates an error

 solid:get GET -- Error: 404 Can't find file requested: [object Object] +0ms

So that's unhelpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment