Git Product home page Git Product logo

hemmeligorg / hemmelig.app Goto Github PK

View Code? Open in Web Editor NEW
645.0 6.0 53.0 15.41 MB

Keep your sensitive information out of chat logs, emails, and more with encrypted secrets.

Home Page: https://hemmelig.app

License: MIT License

Dockerfile 0.32% JavaScript 94.95% CSS 3.56% Shell 0.02% TypeScript 1.14%
secret safe encryption decryption onetimesecret password personal-data gdpr sensitive-data security

hemmelig.app's Introduction

Docker pulls Quality Gate Status Better Uptime Badge

hemmelig

Encrypted secret sharing for everyone!

This application is designed for sharing encrypted information across organizations or among private individuals. Hemmelig places a high priority on safeguarding your privacy and will make every effort to maintain it. We trust you will find value in using our product.

SaaS

Hemmelig is available at https://hemmelig.app

Desktop

How it works

You enter https://hemmelig.app, write your sensitive information, expire time, optional password, and click create a secret link. You share the secret link. The receiver of the link opens it, writes the optional password, and retrieves the sensitive information. When a secret link is created, it gets its unique decryption key that is not saved to the database and only will be part of the URL. This is how the encryption works: encrypt(DATA, YOUR_UNIQUE_ENCRYPTION_KEY). The encryption of the text and files is done in the client; this means the server will get the encrypted information, and nothing in clear text.

Features

  • Client side encryption
  • Text formatting and inline image upload (mark the text for the popup)
  • Encrypted sensitive information sharing
  • Encrypted file upload for signed in users
  • Secret lifetime
  • Set max views per secret
  • Optional encrypted title
  • Optional password protection
  • Optional IP address restriction
  • QR Code of the secret link
  • Decryption key is part of the URL, and not saved to the database for an extra layer of security
  • Possible to send the secret link and the decryption key separately
  • Convert the secret to base64 on read
  • Rate limited API
  • Self-hosted version. Keywords: Regulatory compliance
  • CLI Support
  • Using Prisma with SQLite
  • Public pastes
    • These will not be encrypted
    • Not allowed with file uploads
    • The IP address will be recorded
    • List public pastes based on username
  • User account
    • Expiration time upgraded to 14 and 28 days
    • File upload
    • List and delete secrets
  • Admin settings
    • Disable user registration / sign in
    • Set Hemmelig to be in read only mode by non admin users
    • Disable file upload
    • Disable user account creation
    • Allow organization email domain only for user registration

Linode Referral

Hemmelig.app is running on Linode, and is not being sponsored by anyone. If you want to support Hemmelig, and use Linode. Here is a referral link that we get free credit if you use. By using this link you will get $100 of credit as well: https://www.linode.com/lp/refer/?r=a47390eeafc5a46b8e5407a5d2bf28368d474993

Docker image

Hemmelig strongly advice you to ue the tagged docker images as the main branch will have breaking changes now and then. For Hemmelig versions supporting Redis, use <= v4.4.0.

Supported docker platforms: amd/64, arm/64.

  • hemmeligapp/hemmelig:latest (Is created on each version release)
  • hemmeligapp/hemmelig:v5.19.4 see tags for all version
  • hemmeligapp/hemmelig:weekly (pushed every week on Friday)
  • hemmeligapp/hemmelig:daily

Self-hosting

If you have to follow some sort of compliance, and have to self-host, https://hemmelig.app is available as a docker image. The following is the bare minimum to run the docker image.

mkdir -p data/hemmelig database
chown 1000:1000 data/hemmelig database

docker run -p 3000:3000 -d --name=hemmelig \
   -v ./data/hemmelig/:/var/tmp/hemmelig/upload/files \ # For the file uploads
   -v ./database/:/home/node/hemmelig/database/ \       # For the sqlite database
   hemmeligapp/hemmelig:v5.19.4

Alternatively you can use docker-compose:

# fetch docker-compose.yml
wget https://raw.githubusercontent.com/HemmeligOrg/Hemmelig.app/main/docker-compose.yml

# create volumes directories
mkdir -p data/hemmelig database

# set permissions (Node user has UID 1000 within the container)
chown 1000:1000 data/hemmelig database

# start hemmelig 
docker-compose up -d

# stop containers
docker-compose down

Have a look at the Dockerfile for a full example of how to run this application.

CLI

Hemmelig can be used as a CLI to create secrets on the fly!

# Pipe data to hemmelig
cat mysecretfile | npx hemmelig

# For the documentaiton
npx hemmelig --help

Environment variables

ENV vars Description Default
SECRET_LOCAL_HOSTNAME The local hostname for the fastify instance 0.0.0.0
SECRET_PORT The port number for the fastify instance 3000
SECRET_HOST Used for i.e. set cors/cookies to your domain name ""
SECRET_MAX_TEXT_SIZE The max text size for the secret. Is set in kb. i.e. 256 for 256kb. 256
SECRET_JWT_SECRET Override this for the secret signin JWT tokens for log in good_luck_have_fun
SECRET_ROOT_USER Override this for the root account username groot
SECRET_ROOT_PASSWORD This is the root password, override it with your own password iamgroot
SECRET_ROOT_EMAIL This is the root email, override it with your own email [email protected]
SECRET_FILE_SIZE Set the total allowed upload file size in mb. 4
SECRET_FORCED_LANGUAGE Set the default language for the application. en
SECRET_UPLOAD_RESTRICTION Set the restriction for uploads to signed in users "true"
SECRET_RATE_LIMIT_MAX The maximum allowed requests each time frame 1000
SECRET_RATE_LIMIT_TIME_WINDOW The time window for the requests before being rate limited in seconds 60
SECRET_DO_SPACES_ENDPOINT The Digital Ocean Spaces/AWS s3 endpoint ""
SECRET_DO_SPACES_KEY The Digital Ocean Spaces/AWS s3 key ""
SECRET_DO_SPACES_SECRET The Digital Ocean Spaces/AWS s3 secret ""
SECRET_DO_SPACES_BUCKET The Digital Ocean Spaces/AWS s3 bucket name ""
SECRET_DO_SPACES_FOLDER The Digital Ocean Spaces/AWS s3 folder for the uploaded files ""
SECRET_AWS_S3_REGION The Digital AWS s3 region ""
SECRET_AWS_S3_KEY The Digital AWS s3 key ""
SECRET_AWS_S3_SECRET The Digital AWS s3 secret ""
SECRET_AWS_S3_BUCKET The Digital AWS s3 bucket name ""
SECRET_AWS_S3_FOLDER The Digital AWS s3 folder for the uploaded files ""

Supported languages

Have a look at the public/locales/ folder.

Run locally

npm install

# Start the frontend/backend
npm run dev
# http://0.0.0.0:3001

Database

Hemmelig has changed from using Redis as an backend to sqlite. Here we are using Prisma, and the sqlite file is available here: /database/hemmelig.db. Have a look at the docker-compose file for how to handle the database.

Admin, roles and settings

Admins have access to adjust certain settings in Hemmelig. If you go to the account -> instance settings, you can see all the settings.

We also have different roles.

  • Admin
  • Creator
  • User

The difference here is that if you i.e. set Hemmelig to be in read only mode, only admin and creator is allowed to create secrets, but non signed in users, and users with the role user can only view them.

Admins are also allowed to create new users in the settings. This is great if you want to limit who your users are by the disable user account creation setting.

My lovely contributors

Contribution

Feel free to contribute to this repository. Have a look at CONTRIBUTION.md for the guidelines.

Common errors

If this errors occur on the first run of your hemmelig instance, this means there are some issues with the ownership of the files/directory for the database.

Datasource "db": SQLite database "hemmelig.db" at "file:../database/hemmelig.db"

Error: Migration engine error:
SQLite database error
unable to open database file: ../database/hemmelig.db

If you have any issues with uploading files for your instance, you will need the following as well:

Here is an example of how you would solve that:

sudo chown -R username.group /home/username/data/
sudo chown -R username.group /home/username/database/

hemmelig.app's People

Contributors

adan89lion avatar ajtak avatar bhattabhi013 avatar bjarneo avatar bytebone avatar casperklein avatar dependabot[bot] avatar frflo avatar hello-woof avatar itouakirai avatar jodaatgithub avatar joeywas avatar josiasklaus avatar loviuz avatar ltguillaume avatar lucianomilani avatar luismanson avatar m4-droid avatar mxmeeple avatar najeebkp avatar nyable avatar pranjalagni avatar rhythmicc avatar robertripoll avatar sankalpafernando avatar tanelir avatar thehijacker avatar theonly1me avatar trivikr avatar tryallthethings avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

hemmelig.app's Issues

Image burn after

If the secret has the flag checked where the secret should be burned after the time expires. It should be possible to download the image until then.

IP restrictions

Allow certain IP range. I.e. if is on a VPN. Per share? Account sets restriction?

Create statistics

  • Collect how many secrets that are currently active
  • Collect how many secrets are burned
  • Collect how many visits to the page

Important: Do not track personal data at all.

None of these should be tracked by 3d party applications.

Fix spelling errors in readme.md

There are a couple of spelling errors in README.md -- I've forked the repo and will submit a pull request with the corrections

Attachment upload refactor

This code requires a bit of refactoring. Pushed the feature for testing, and will come back to this. Will also enable multi upload for more filetypes. Not just images. Use Signal input field as inspiration

Kubernetes manifests

i18n support

Hi, I'm the guy who asked about translation support in Reddit. Would you consider a PR with some support? Frontend maybe.. I think I can add some basic implementation of react-i18n...

PWA install prompt

Add script to prompt the user if they want to add the app to their home screen.

Dark mode

This might be by default, then light mode has to be turned on.

New logo

Currently, a new logo is in the making.

Refactor secret deletion

Considering to create a queue mechanism here to trigger an event when the time is up for deletion

Diffie-Hellman for the encryption

Just as mentioned in my original reddit comment

Ideally the way I think it should be implemented is with an "Expert mode" option. This way non-technical users won't struggle with it.

  1. Alice creates a link and this generates a key pair

  2. Alice sends the link (which contains the public key) to bob

  3. Bob opens the link, and a key pair is created for bob

  4. Bob is prompted to send the public key he has to alice using that same unencrypted channel. Meanwhile the shared key is created and put into a cookie using bobs private key and Alices public key

  5. Alice puts bobs key in the link they generated. This creates the shared key on Alices end.

  6. Alice then puts the secret data they want to send to bob. The Shared key encrypts the data being sent.

  7. Bob then see's the information is available, and decrypts the note because their browser has the shared secret in a cookie.

What does log in do?

Really, nothing yet. Just providing basic auth name / secret for later usage.

ZAP Full Scan Report

File upload directly to disk

Create an adapter which makes it possible to upload directly to the server where hemmelig is running. By doing this it is possible to eliminate using DO or s3

Branding

Make it possible to brand the self-hosted version.

Make password part of the encryption

It makes it hard though while using bcrypt. Which means the hash is always different. However, might be able to inject the password as a sha, which again is encrypted by tweetnacl. Look into this.

Configurable allowed IP / rate limit header

So, currently the only support for this repository is the "do-connecting-ip" header for digital ocean to fetch the user IP. However, if people self host, they most likely do not have this header.

To do:
Rewrite this part of the code to accept a string from a ENV var injected to the docker container to decide what header to look for. https://github.com/HemmeligOrg/Hemmelig.app/blob/main/src/server/decorators/allowed-ip.js#L15
Set the default header to "do-connecting-ip".

Note, update this code as well: https://github.com/HemmeligOrg/Hemmelig.app/blob/main/src/server/decorators/rate-limit.js#L21

Security audit

Feel free to audit this application. Would be highly appreciated.

ZAP Full Scan Report

API section

Update the API section with information for devs. First, implement create account page. Have to assign the user key:token.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.