* Add directory download as zip feature Implements the ability for users to download directories as zip files if enabled in config. Adds a new API route for directory zipping, updates UI components to show a download button for directories, and introduces related config and type changes. Also includes a new download icon. * Windows path bugfix * Include empty directories in zip archive * Address feedback - `isDirectoryDownloadsAllowed` -> `areDirectoryDownloadsAllowed` - send `parentPath` & `name` to API instead of resolving `fullPath` on client - call `ensureUserPathIsValidAndSecurelyAccessible` before zipping - set config `allowDirectoryDownloads` default to `false` - add `zip` to Dockerfile and replace in-house zip algorithm - replace `download.svg` with heroicon's `arrow-down-tray` - `replace` with glob -> `replaceAll` with string * Cleanup apt-get command * Remove unused zip archive and directory functions
bewCloud
This is the bewCloud app built using Fresh and deployed using docker compose.
If you're looking for the desktop sync app, it's at bewcloud-desktop.
If you're looking for the mobile app, it's at bewcloud-mobile.
Self-host it!
Or on your own machine, start with these commands:
mkdir data-files data-radicale radicale-config # local directories for storing user-uploaded files, radicale data, and radicale config (these last two are necessary only if you're using CalDav/CardDav/Contacts)
Now, download/copy the following configuration files (and tweak their contents as necessary, though no changes should yield a working — but very unsafe — setup):
docker-compose.yml.env.sampleand save it as.envbewcloud.config.sample.tsand save it asbewcloud.config.tsradicale-config/configand save it asradicale-config/config(necessary only if you're using CalDav/CardDav/Contacts)
Finally, run these commands:
docker compose up -d # makes the app available at http://localhost:8000
docker compose run --rm website bash -c "cd /app && make migrate-db" # initializes/updates the database (only needs to be executed the first time and on any data updates)
Note
If you run into permission issues, you can try running
sudo chown -R 1993:1993 data-filesto fix them.
1993:1993above comes from deno's docker image where1993is the default user id in it. It might change in the future since I don't control it.
If you're interested in building/contributing, check the Development section below.
Important
Even with signups disabled (
config.auth.allowSignups=false), the first signup will work and become an admin.
Sponsors
These are the amazing entities or individuals who are sponsoring this project for this current month. If you'd like to show up here, check the GitHub Sponsors page or make a donation above $50 ($100 to show up on the website)!
Development
Requirements
Important
Don't forget to set up your
.envfile based on.env.sample. Don't forget to set up yourbewcloud.config.tsfile based onbewcloud.config.sample.ts.
- This was tested with
Deno's version stated in the.dvmrcfile, though other versions may work. - For the postgres dependency (used when running locally or in CI), you should have
Dockeranddocker composeinstalled.
Commands
docker compose -f docker-compose.dev.yml up # (optional) runs docker with postgres, locally
make migrate-db # runs any missing database migrations
make start # runs the app
make format # formats the code
make test # runs tests
Other less-used commands
make exec-db # runs psql inside the postgres container, useful for running direct development queries like `DROP DATABASE "bewcloud"; CREATE DATABASE "bewcloud";`
make build # generates all static files for production deploy
Structure
- Routes are defined at
routes/. - Static files are defined at
static/. - Frontend-only components are defined at
components/. - Isomorphic components are defined at
islands/. - Cron jobs are defined at
crons/. - Reusable bits of code are defined at
lib/. - Database migrations are defined at
db-migrations/.
Deployment
Just push to the main branch.
How does Contacts/CardDav and Calendar/CalDav work?
CalDav/CardDav is now available since v2.3.0, using Radicale via Docker, which is already very efficient (and battle-tested). The "Contacts" client for CardDav is available since v2.4.0 and the "Calendar" client for CalDav is available since v2.5.0. Check this tag/release for custom-made server code where it was all mostly working, except for many edge cases, if you're interested.
In order to share a calendar, you can either have a shared user, or you can symlink the calendar to the user's own calendar (simply ln -s /<absolute-path-to-data-radicale>/collections/collection-root/<owner-user-id>/<calendar-to-share> /<absolute-path-to-data-radicale>/collections/collection-root/<user-id-to-share-with>/).
Note
If you're running radicale with docker, the symlink needs to point to the container's directory, usually starting with
/dataif you didn't change theradicale-config/config, otherwise the container will fail to load the linked directory.
How does private file sharing work?
Public file sharing is now possible since v2.2.0. Check this PR for advanced sharing with internal and external users, with read and write access that was being done and almost working, if you're interested. I ditched all that complexity for simply using symlinks for internal sharing, as it served my use case (I have multiple data backups and trust the people I provide accounts to, with the symlinks).
You can simply ln -s /<absolute-path-to-data-files>/<owner-user-id>/<directory-to-share> /<absolute-path-to-data-files>/<user-id-to-share-with>/ to create a shared directory between two users, and the same directory can have different names, now.
Note
If you're running the app with docker, the symlink needs to point to the container's directory, usually starting with
/appif you didn't change theDockerfile, otherwise the container will fail to load the linked directory.
How does it look?
Check the website for screenshots or the YouTube channel for 1-minute demos.