Enclosed
Enclosed is a minimalistic web application designed for sending private and secure notes. Whether you need to share sensitive information or just want a simple way to send encrypted messages, Enclosed provides a user-friendly interface with strong security features to ensure your data remains confidential.
References
Make directory
mkdir -p {{{DOCKER_PATH_VAR}}}/enclosed && cd {{{DOCKER_PATH_VAR}}}/enclosed
Generate key and cert
openssl req -x509 -newkey rsa:2048 -nodes -sha256 -subj '/CN=localhost' -keyout private-key.pem -out certificate.pem
Docker run
docker run -d --name enclosed --restart unless-stopped -p 8787:8787 \ -v ./data:/app/.data \ -e SERVER_USE_HTTPS=true \ -e SERVER_HTTPS_KEY="$(cat ./private-key.pem)" \ -e SERVER_HTTPS_CERT="$(cat ./certificate.pem)" \ -e PUBLIC_IS_AUTHENTICATION_REQUIRED=true \ -e AUTHENTICATION_JWT_SECRET="$(openssl rand -base64 32 | tr -d '/+=')" \ corentinth/enclosed
Docker compose
docker-compose.yml
nano docker-compose.yml
services: enclosed: container_name: enclosed image: corentinth/enclosed ports: - 8787:8787 environment: SERVER_USE_HTTPS: ${SERVER_USE_HTTPS} SERVER_HTTPS_KEY: ${SERVER_HTTPS_KEY} SERVER_HTTPS_CERT: ${SERVER_HTTPS_CERT} PUBLIC_IS_AUTHENTICATION_REQUIRED: ${PUBLIC_IS_AUTHENTICATION_REQUIRED} AUTHENTICATION_JWT_SECRET: ${AUTHENTICATION_JWT_SECRET} AUTHENTICATION_USERS: ${AUTHENTICATION_USERS} volumes: - ./data:/app/.data restart: unless-stopped
docker-compose-up.sh
nano docker-compose-up.sh
#!/bin/bash
# Clear the contents of the .env file> .env
# Add the necessary environment variables to .envecho "SERVER_USE_HTTPS=true" > .envecho "SERVER_HTTPS_KEY=\"$(cat private-key.pem)\"" >> .envecho "SERVER_HTTPS_CERT=\"$(cat certificate.pem)\"" >> .envecho "PUBLIC_IS_AUTHENTICATION_REQUIRED=true" >> .env
# Generate and add the JWT secret to .envAUTHENTICATION_JWT_SECRET=$(openssl rand -base64 32 | tr -d '/+=')echo "AUTHENTICATION_JWT_SECRET=\"$AUTHENTICATION_JWT_SECRET\"" >> .env
# Generate and add the hashed user credential to .env# https://docs.enclosed.cc/self-hosting/users-authentication-key-generatorUSER_PASSWORD='$$2a$$10$$NCkptt9QmnwtijTvg8eWEO0WLCqI.CZvsE/l8seG85upSw8yNSr82'echo 'AUTHENTICATION_USERS="'"$USER_EMAIL:$USER_PASSWORD"'"' >> .env
# Run Docker Composedocker compose up -d
Make script executable
chmod +x docker-compose-up.sh
Start container
./docker-compose-up.sh