Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set up SolidOS to work on CSS on local development #149

Closed
timea-solid opened this issue Apr 8, 2022 · 16 comments
Closed

Set up SolidOS to work on CSS on local development #149

timea-solid opened this issue Apr 8, 2022 · 16 comments
Assignees
Labels
enhancement New feature or request

Comments

@timea-solid
Copy link
Member

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 timea-solid added the help wanted Extra attention is needed label Apr 8, 2022
@ewingson
Copy link
Member

ewingson commented Apr 8, 2022

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.

@jeff-zucker
Copy link
Collaborator

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
Copy link
Collaborator

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
Copy link
Collaborator

jeff-zucker commented Apr 8, 2022

See this diagram

@timea-solid
Copy link
Member Author

timea-solid commented Apr 13, 2022

@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.

@ewingson
Copy link
Member

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.

@angelo-v
Copy link
Collaborator

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/

@timea-solid
Copy link
Member Author

timea-solid commented Apr 28, 2022

According to: #66 (comment) CSS is ready to be set up with mashlib.

@ewingson
Copy link
Member

ewingson commented Jul 4, 2022

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

@timea-solid
Copy link
Member Author

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.

@ewingson
Copy link
Member

ewingson commented Nov 19, 2022

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.

@bourgeoa
Copy link
Contributor

bourgeoa commented Nov 19, 2022

@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
Copy link
Contributor

bourgeoa commented Nov 20, 2022

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

@timea-solid
Copy link
Member Author

@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.

@bourgeoa
Copy link
Contributor

@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

@timea-solid timea-solid added enhancement New feature or request and removed help wanted Extra attention is needed labels Nov 24, 2022
@bourgeoa
Copy link
Contributor

Done with 4bfea9b
and a few updates

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

No branches or pull requests

5 participants