MangoCubes / cryptomator-web

Access Cryptomator vault over WebDAV in browser without installing any programs
MIT License
5 stars 1 forks source link

Can't host cryptomator-web on my local server #4

Closed burningscript closed 1 year ago

burningscript commented 1 year ago

Hello, I am trying to host cryptomator-web on my server, I don't know much about npm or react, but after I installed cryptomator-web (npm install) and trying to npm build it it just says " Module not found: Error: Can't resolve 'cryptomator-ts' in '/var/www/vhosts/domain/httpdocs/src/web'.

Any Idea?

Already change the cryptomator-ts depency in the package.json file to "file:../cryptomator-ts" instead of "link" (because it link is outdated)

Regards

MangoCubes commented 1 year ago

I did not know link was outdated. Anyways, I was able to build this project by following these steps. (This should work with npm, but I recommend using yarn. This can be installed using sudo npm i -g yarn, then check using yarn --version)

  1. Clone both cryptomator-ts and cryptomator-web in the same directory. Note that if you are on Windows, use "Download as ZIP" instead of git clone for cryptomator-ts, as it contains test cases on extended file name length, which are not compatible with Windows, and will not pull some essential files that comes after the test folder (namely, tsconfig.json).
  2. Go into cryptomator-ts, and install dependencies using yarn install.
  3. Build the library using tsc. This should not print anything.
  4. Go to cryptomator-web. Install the dependencies using yarn install. After this, you should see cryptomator-ts folder under node_modules.
  5. Edit homepage in package.json so that it points to where you will be hosting this. I have an instance hosted in https://skew.ch/cryptomator/, and I had to set homepage to that. (Accessible by entering https://skew.ch/cryptomator/index.html since I can't be bothered to edit Nginx config)
  6. Build it using yarn build.
  7. Upload everything in the "build" folder.

I can confirm that this worked, both using link and file. One thing you may missed is the "building the library" step (step 2 and 3). Do reply if it still does not work.

Here is a full video: https://youtu.be/wfr96L1Jp_Q

burningscript commented 1 year ago

Thank you!! I will try it later :) Yes, true! I think I missed building the library!

burningscript commented 1 year ago

Thank you! It works :)

(The issue was my missing knowledge of react and npm haha)

burningscript commented 1 year ago

Just two things more:

MangoCubes commented 1 year ago

It is already supported, but you have to do some "register your app" thing on Microsoft website. I did it, but I forgot how. I'll upload a tutorial when I have time. As for streaming, I don't think it is possible. Current design downloads the file completely, then decrypts it in the browser. Once the decryption is done, the download is triggered. I might be able to do it after making some major changes, but even then I'm not sure if it would work. Sorry.

burningscript commented 1 year ago

Alright, thank you very much for your friendly help. It is really nice that someone is working on something like that :)