diff --git a/README.md b/README.md index 0380716..dc0d684 100644 --- a/README.md +++ b/README.md @@ -32,10 +32,10 @@ services: ## Redis By default Just Short It saves all the redirects in a in-memory distributed Cache, which get's lost -whenever the container restarts, so if you want to keep your redirects you wanna use a redis DB. +whenever the container restarts, so if you want to keep your redirects you wanna use redis. -You can confiure the connection to redis using the environment variables `JSI_Redis__ConnectionString` -and optional `JSI_Redis__InstanceName` (it's default is "JustShortIt"). +You can configure the connection to redis using the environment variables `JSI_Redis__ConnectionString` +and optional `JSI_Redis__InstanceName` (default is "JustShortIt"). If you want to run both with compose, the most simple setup looks like this: @@ -67,6 +67,88 @@ volumes: There you go, now your urls survive a restart! +# Https + +Just Short It! is not supporting Https, I reconmend using a reverse Proxy for hosting +that handles SSL. I can highly reconmend jwilders +[nginx-proxy](https://github.com/nginx-proxy/nginx-proxy) togehter with +[acme-companion](https://github.com/nginx-proxy/acme-companion), +there is no easier way to get a reverse proxy with automatic certificate renewal. + +Here is an Example of how to use Just Short It! togehter with nginx-proxy: + +```docker-compose +version: '3.4' + +services: + # Just Short It + just-short-it: + container_name: JustShortIt + image: miawinter/just-short-it:latest + environment: + - "JSI_BaseUrl=" + - "JSI_Account__Username=" + - "JSI_Account__Password=" + - "JSI_Redis__ConnectionString=redis,password=" + environment: + - "VIRTUAL_HOST=" + - "LETSENCRYPT_HOST=" + depends_on: + - redis + - acme-companion + redis: + container_name: Redis + image: redis:alpine + environment: + - "REDIS_PASSWORD=" + volumes: + - redis:/data + + # nginx-proxy with acme-companion + nginx-proxy: + container_name: nginx-proxy + restart: unless-stopped + image: jwilder/nginx-proxy:alpine + ports: + - "80:80" + - "443:443" + volumes: + - /var/run/docker.sock:/tmp/docker.sock:ro + - certs:/etc/nginx/certs:ro + - conf:/etc/nginx/conf.d + - vhost:/etc/nginx/vhost.d + - html:/usr/share/nginx/html + environment: + - "DHPARAM_GENERATION=false" # Not sure you need this actually + - "DISABLE_ACCESS_LOGS" # Always nice to comply with GDPR + acme-companion: + container_name: acme-companion + restart: unless-stopped + image: nginxproxy/acme-companion + volumes: + - /var/run/docker.sock:/var/run/docker.sock:ro + - certs:/etc/nginx/certs:rw + - conf:/etc/nginx/conf.d + - vhost:/etc/nginx/vhost.d + - html:/usr/share/nginx/html + - /etc/acme.sh:/etc/acme.sh + environment: + - "DEFAULT_EMAIL=" + - "NGINX_PROXY_CONTAINER=nginx-proxy" + depends_on: + - nginx + +volumes: + # Just Short It! + redis: + # Proxy + certs: + conf: + vhost: + html: + +``` + # License and Attribution Just Short It by [Mia Winter](https://miawinter.de/) is licensed under the [MIT License](https://en.wikipedia.org/wiki/MIT_License).