Skattlåda (pronounced skaht-loh-dah) is a Swedish word often used by Scandinavian beekeepers to describe the compartment in a beehive that is used to collect honey. This section of a hive is also known as the "honey super". While a beehive retains some of its honey to feed the colony, most of it gets shared with all of us. Of course, to access this honey, you have to follow a strict protocol to avoid getting stung!
Most file sharing is done within a closed system, where file access and identity are tightly coupled. This makes it difficult for someone to share a file with someone else outside of the system, without the recipient going through the hassle of setting up their own account. You can bypass some of the friction by supporting federation with well-known identity providers such as social login, but not everyone uses these.
Skattlåda makes this problem easier by allowing users to register and authenticate with FIDO2. Registration takes a few seconds and authentication is even easier. FIDO2 is more secure than traditional credentials, like passwords, because its phishing-resistant. And, of course, there are no passwords to create, forget, or reset.
Out of the box, share files from Google Drive. The server is extensible so its possible to share with other systems.
Skattlåda runs in Docker, so that's easy.
Export the environment variables specified in CONFIG. For local development, you can use a .env file.
If you are deploying a data provider that requires its own setup (eg. google-sheets) before it can be used, you can run the following command to create the necessary schema:
npm run schema:applyThis command reads configuration from the environment
You can also run this command in dry-run mode to see the changes that would be applied:
npm run schema:apply:dry-runWhen you first start the server, watch the console output for an INFO event with the message Root invite, then copy the url value and paste it into a browser. Follow the prompts to enroll the first admin account. The admin user can then create shares which is how they can invite more users.
To run Skattlåda outside of Docker, you just need to install the version of Node.js specified in the .nvmrc file. The easiest way to do this is use the nvm tool:
nvm install
nvm useWhen running in local development mode, the server uses HTTPS with a self-signed certificate for TLS communication. Generate and install the certificate using these commands:
sudo ./cert/create-dev-cert.sh
sudo ./cert/install-dev-cert.shThis creates a dev.crt (certificate) and dev.key (private key) file in the ./cert directory. It also installs the certificate so its trusted by your local machine.
Add the following line to the /etc/hosts file:
127.0.0.1 skattlada.dev
Install dependencies
npm installnpm run devIf you are developing with a data provider that has state that persists beyond a restart (eg. google-sheets), you can run the following command to delete the existing schema and data:
npm run schema:dropThis command reads configuration from the environment
Then you can apply the schema again so the data provider is ready to go for more testing.
You can also run this command in dry-run mode to see the changes that would be applied:
npm run schema:drop:dry-runRun all unit tests:
npm run test:unitRun a specific test file:
npm run test:unit ./src/app.test.tsRun all integration tests
npm run test:integration-allRun a specific test file:
npm run test:integration-single ./src/integration-tests/simple-registration-and-signin.tsExamples of Skattlåda in the wild:
- Add support for other data providers (eg. MongoDB)
- Add support for other file providers (eg. Dropbox)
- Support multiple file providers at once
- Make Skattlåda somehow able to share real honey
