KNowledgeOnWebScale / solid-calendar-store

Solid stores for managing calendars
6 stars 1 forks source link

Potentially incomplete set-up instructions and versioning issues #19

Closed renyuneyun closed 2 years ago

renyuneyun commented 2 years ago

I'm trying to set up this application and encountered some issues. Currently I find no way to work around all of them. They seem to mean the set up instructions in README is incomplete. Here they are:

  1. A directory personal/ should be created, otherwise error is thrown when doing npx.
  2. The file node_modules/@solid/community-server/config/ldp/permissions/acl.json is missing. I dig into the history of CSS, and found that this file was moved to config/ldp/modes/acl.json in commit e8dedf5c239f12c36b414c1dd9c6419a31f467de, and removed in commit 7f8b923399d0b9510ed1aaf4615e49b568ae5ea7. There is no longer this file in the current version of CSS.
  3. I temporarily work around the line requiring that acl.json, by deleting it. But it still gives errors: ErrorResourcesContext: Could not find (valid) component types for config "urn:solid-server:defau lt:ModesExtractor" among its types, or a requireName (the error message is quite long; I can supply if necessary).

This error does not look like anything I'm able to easily solve, so I'm asking for help, probably with an updated version of README and dependencies.

In addition, if I delete packages-lock.json and run npm i to regenerate it, it will be different from the one in the repo. Other errors will appear when running npm i, saying the errors below, and refuses to finish the "compilation" (tsc step):

^[src/google-calendar-get-store.ts:7:41 - error TS2307: Cannot find module '@solid/community-ser
ver/dist/ldp/representation/RepresentationPreferences' or its corresponding type declarations.  

7 import {RepresentationPreferences} from "@solid/community-server/dist/ldp/representation/Repre
sentationPreferences";                                                                          
                                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~                                                                           

src/http-get-store.ts:8:43 - error TS2307: Cannot find module '@solid/community-server/dist/ldp/
representation/RepresentationPreferences' or its corresponding type declarations.               

8 import { RepresentationPreferences } from "@solid/community-server/dist/ldp/representation/Rep
resentationPreferences";                                                                        
                                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~ 
pheyvaer commented 2 years ago

Hi @renyuneyun

Thanks for your issue! Can you include a minimum failing example? Can you also include how you installed the Community Solid Server, its version, and how you installed the Solid Calendar Store? Thanks!

renyuneyun commented 2 years ago

Hi @pheyvaer Thanks for the reply. Sure. The steps I did was:

  1. Clone solid-calendar-store: git clone https://github.com/KNowledgeOnWebScale/solid-calendar-store.git.
  2. Follow README:
    1. npm i.
    2. cp config/config-calendar-example.json config/config-calendar.json.
    3. Edit config/config-calendar.json: changed the TODO in line "GoogleCalendarGetStore:_options_calendarId": "TODO" to my calendar's .ics URL.
  3. Run server npx community-solid-server -c config.json -m .. It fails with complaint: personal/ directory does not exist.
  4. Create personal/ directory: mkdir personal.
  5. Re-run server. It fails with compliant: node_modules/@solid/community-server/config/ldp/permissions/acl.json is missing (i.e. error 2 reported above).
  6. In config/config-calendar.json, remove the line "files-scs:config/ldp/permissions/acl.json".
  7. Re-run server. It fails with the error 3 reported above.

In this setting, I did not change the configuration (in package.json) about CSS, so I believe solid-calendar-store gets CSS from npm repository. I did not change package-lock.json either.

The next comments describes the other case of changing CSS.

renyuneyun commented 2 years ago

To use local CSS version, I cloned CSS into another local directory /root/community-server. Then, I installed the relevant dependencies there npm install && npm ci. (I'm not sure if this is necessary for solid-calendar-store, but it is needed for community-server-recipe; otherwise an error will emerge saying tsc not found.)

After that, in the package.json of solid-calendar-store, change the line "@solid/community-server": "^2.0.1" to "@solid/community-server": "file:/root/community-server". The rest is the same as previously, about setting up / running solid-calendar-store.

Notice I did not actually change the version of CSS / tried different versions of CSS -- I used the latest version from upstream (v2.0.1 + patches). To find the history about acl.json, I merely used relevant git commands such as git log --follow -p -- config/ldp/modes/acl.json

pheyvaer commented 2 years ago

Thanks for the details! I have updated the documentation for running the store in this branch. Specifically, can you try the instructions in this section of the README? Thanks!

renyuneyun commented 2 years ago

Thanks @pheyvaer . I can make it running now! Probably it's also worth mentioning the need of personel/ directory -- I still encounter the error if that directory does not exist. Although, I'm not exactly sure why it is needed -- nothing is placed into that directory, even after querying the avaibility/ or even a calendar/ endpoint (with modification to config file, to point to the google calendar).

And maybe also mentioning the modification of (the new) configuration file in the set up part. Personally, I feel it's not that obvious this is needed, based on the description.

pheyvaer commented 2 years ago

personal folder should not be needed anymore now. Can you try again? I also updated the README.

renyuneyun commented 2 years ago

@pheyvaer I tested it again, including deleting package-lock.json, and it still requires it.

I found the cause: in package.json, there is a line "https://linkedsoftwaredependencies.org/bundles/npm/solid-calendar-store/^0.0.0/personal/": "personal/". After deleting it, there is no longer errors.

By the way, is there a web UI for the calendar? I can successfully use API endpoints with curl, but am just wondering.

pheyvaer commented 2 years ago

That's also what I changed. Did you pull the latest version?

You can let the stores output the ICS format, so you can use it in any calendar application that supports this, such as Google Calendar, Outlook, Apple Calendar. We are also working on KNoodle, which allows you to find slots between multiple people where they are all available, based on availability calendars

renyuneyun commented 2 years ago

@pheyvaer Thanks. Sorry, I was not aware that there was also update to other files. I tested it again, and it no longer requires that directory.

Thanks for the tips on using the data. I'll take a look into KNoodle. I also looked into the storage (-f ~/Documents), but found nothing in it. Is the calendar not cached, or not represented as an object/file (e.g. *.ics or *.ttl) in Solid (I'm also interested in what happens if there are multiple users, but probably that's too much to ask)?

pheyvaer commented 2 years ago

The data is not stored. The flow is as follows:

  1. Do GET request to CSS instance.
  2. Get data from store.
  3. Store fetched calendar and manipulates the events. Nothing is stored in the store.
  4. Optional, conversion to different data format happens.
  5. Events are returned.

It's possible to use caching in tools like NGINX. Personally, I haven't done this yet, but I would like to look into that.

renyuneyun commented 2 years ago

Thanks very much! Shall I close this issue, or wait until it's merged into master branch?

pheyvaer commented 2 years ago

Once it's in the master branch, I will close it. 😃

pheyvaer commented 2 years ago

Fixed with the new release.