Skip to content

Instantly share code, notes, and snippets.

View michalg-'s full-sized avatar
🐙

Michał Gilewski michalg-

🐙
  • Startup House Development
  • Poland
View GitHub Profile
@JamesCullum
JamesCullum / immich-docker-config.md
Last active January 20, 2025 13:01
docker-compose.yml for immich with WAF, DDoS protection, image resizing and without port forwarding

Setup Immich via Docker Compose with WAF, CDN, DDoS protection, no port forwarding and automated image resizing

In this guide, we are using the docker compose setup that is recommended by the Immich team. Once everything is configured and running in your local network, we can expand on it.

The first recommended step is to use Cloudflare Tunnel to make your local instance globally available. This is free and you benefit from the native DDoS protection, WAF and CDN from Cloudflare. The cloudflared daemon basically makes an outgoing connection to Cloudflare and makes the designed interfaces available on the internet, without granting access to undesired parts of the network.

Start off by creating a Cloudflare account, going into the "Zero Trust" portion of the account and add a new tunnel.

@kylev
kylev / Dockerfile
Last active September 21, 2022 00:43
A complete Alpine docker-compose Rails workflow with PostgreSQL and Redis
FROM ruby:2.6-alpine
# Additional runtime facilities provided by the OS.
RUN apk add --no-cache libxml2 libxslt postgresql-libs tzdata
# Tell bundler how to use the OS.
RUN gem install bundler -v '~> 1.17' && \
bundle config build.nokogiri --use-system-libraries
WORKDIR /opt/app
RUN mkdir -p tmp/pids tmp/cache
@soulmachine
soulmachine / jwt-expiration.md
Last active April 10, 2025 12:28
How to deal with JWT expiration?

First of all, please note that token expiration and revoking are two different things.

  1. Expiration only happens for web apps, not for native mobile apps, because native apps never expire.
  2. Revoking only happens when (1) uses click the logout button on the website or native Apps;(2) users reset their passwords; (3) users revoke their tokens explicitly in the administration panel.

1. How to hadle JWT expiration

A JWT token that never expires is dangerous if the token is stolen then someone can always access the user's data.

Quoted from JWT RFC: