solidos icon indicating copy to clipboard operation
solidos copied to clipboard

Set up SolidOS to work on CSS on local development

Open timea-solid opened this issue 2 years ago • 9 comments

In the process of switching NSS to CSS on solidcommunity.net I propose that we move our local development practices also to CSS. Basically when I clone SolidOS and I run npm run setup I would want to have CSS running and not NSS (if possible).

timea-solid avatar Apr 08 '22 09:04 timea-solid

cause I'm running CSS in a production environment and not local I am not really helpful in this topic. a) maybe the switch is an opportunity for me to contribute useful code. b) I really hope solidweb.me is hardened and stealthed enough.

ewingson avatar Apr 08 '22 09:04 ewingson

Data-Kitchen is an instance of CSS local running SolidOS. I have not updated to most recent versions of of CSS or mashlib and I need to revise the package.json to download them automatically. But currently npm install + nmp run start give you a functioning CSS running SolidOS on a local server.

jeff-zucker avatar Apr 08 '22 17:04 jeff-zucker

A slight modification of the SolidOS build process could put Data-Kitchen into the build process so that instead of NSS at the end it would install CSS.

jeff-zucker avatar Apr 08 '22 17:04 jeff-zucker

See this diagram

jeff-zucker avatar Apr 08 '22 17:04 jeff-zucker

@ewingson did first try to deploy SolidOS on a CSS server on https://solidweb.me. We see some problems which we will make gitIssues for. (discussion on how to do was done on gitter here)

To locally test: build mashlib and start the static mashlib (there is a npm script for it) and navigate to a CSS user with it.

timea-solid avatar Apr 13 '22 16:04 timea-solid

I have 4.0.0 running and will share every issue and every aspect I can focus on to help to upgrade solidcommunity.net . recipe working.

ewingson avatar Apr 20 '22 15:04 ewingson

This is the docker-compose file I am using for locally running CSS with mashlib:

version: '3.7'
services:
  server:
    image: solidproject/community-server:4
    pull_policy: always
    restart: unless-stopped

    ports:
      - "3000:3000"

    volumes:
      - ./data:/opt/solid/data
      - ./config:/opt/solid/config
      - /path/to/local/mashlib:/opt/solid/mashlib

    command: ["--port", "3000" ,"-c" ,"/opt/solid/config/mashlib.json", "--rootFilePath", "/opt/solid/data" ]

config/mashlib.json is from the CSS recipe but you have to adjust the mashlib pathes for docker from ./node_modules/mashlib to /opt/solid/mashlib/

angelo-v avatar Apr 27 '22 17:04 angelo-v

According to: https://github.com/SolidOS/solidos/issues/66#issuecomment-1111288442 CSS is ready to be set up with mashlib.

timea-solid avatar Apr 28 '22 08:04 timea-solid

yep, mashlib is working with CSS on https://solidweb.me .

can I give this issue some tender loving care ?

but I would need some detailed instructions, howto... guidance.

@timea-solid @jeff-zucker

ewingson avatar Jul 04 '22 19:07 ewingson

I am looking for something which does not need a container (docker). Something more like how we have it now: you clone solidOS and NSS is out of the box started for you with the 'npm start'. It would be cool if upon start one can select which server to be spinned up, NSS or CSS. I do not have an idea how to achieve this in our code yet.

timea-solid avatar Nov 19 '22 15:11 timea-solid

dunno how to achieve this. I did not use docker. NSS and CSS seem to have been developed independently. for completeness I'll leave two docs. both servers run on the same dedicated machine.

NSS : https://gist.github.com/ewingson/c6e97a996aa51eac9f7fd1b7eaf14dc4

CSS : https://gist.github.com/ewingson/dbfee4d329c803aed0b0bd87e7a2fa00

[edit] the latter is not 100% actual because of the mashlib recipe running now.

ewingson avatar Nov 19 '22 15:11 ewingson

@timea-solid One way to do that could be to start a simple CSS instance http://localhost:3000 + a NSS one https://localhost:8443 and use mashlib app https:localhost:8443/browse.html. This should cover 99.9% of all functions.

This may be done with something like that in solidos/package.json : (inspiration from https://github/solidcryptpad/solidcryptpad/package.json)

  • in scripts :
    • add "css": "community-solid-server -p 3000 -c ./custom-css-config/file-no-setup.json -f ./community-solid-server"
    • modify "start": "npm run css && scripts/start"
  • add dev-dependencies "@solid/community-server": "^4.0.1" (to be updated to CSS latest)
  • add a file-no-setup.json (to be updated to CSS latest)

bourgeoa avatar Nov 19 '22 18:11 bourgeoa

Finally I think a better way is to create a new repo in https://github.com/SolidOS/css-solidos or any equivalent. The repo will contain :

  • a config folder with :
    • https-file.json for pod's like https://localhost:3000/user/
    • https-subdomain-file.json for pod's like https://user.localhost:3000/
  • a package.json
  • a README.md
  • a certs folder (may be not we can use the certs created by solidos setup)
  • a templates folder

We could then integrate the repo in SolidOS setup:

  • modify scripts/start to scripts/start-nss
  • add 2 scripts/start-css with 2 steps :
    • copy templates to ./node_modules/@solid/community-server/templates
    • community-solid-server -c /https-config-file.json -f /data -b https://localhost:3000
  • modify solidos/package.json :
    • to include "start:css" : "npm scripts/start-css
    • modify "start" to "start:nss"
    • add a new "start" : "start:nss && start:css"

@timea-solid I can prepare the repo test its workability and then integrate to SolidOS setup

bourgeoa avatar Nov 20 '22 10:11 bourgeoa

@bourgeoa I like where your suggestions are going! Is we have a css subdirectory in solidOS like nss is what I was thinking but was not sure if it would work. But if you say it would work it would be really cool! Can you try it out locally? I want to know if this setup influences the build time of solidOS project.

timea-solid avatar Nov 20 '22 16:11 timea-solid

@timea-solid I have :

  • added htpps://github.com/SolidOS/css-mashlib repo
  • updated htpps://github.com/SolidOS/solidos to install both NSS and CSS You can now run separately or at the same time NSS and CSS for testing mashlib.
  • I have not updated watch Actually it runs NSS ? Don't tried to run CSS with watch

I shall try to update the README.md's as soon as possible. And think I will also lock CSS to only one account Please try and report issues.

For CSS the easiest is to chose choose : sign me up for an account Choosing root or subdomain you can test the impact on mashlib of the different installations (suffix or subdomain)

image

bourgeoa avatar Nov 22 '22 20:11 bourgeoa

Done with https://github.com/SolidOS/solidos/commit/4bfea9b819a1c584d6da4e5d55710c7a15cac51d and a few updates

bourgeoa avatar Nov 24 '22 17:11 bourgeoa