Skip to content

Instantly share code, notes, and snippets.

@R0GGER
R0GGER / _hsts.conf
Last active October 28, 2024 18:56
Workaround - Security Headers @ NGINX Proxy Manager
{% if certificate and certificate_id > 0 -%}
{% if ssl_forced == 1 or ssl_forced == true %}
{% if hsts_enabled == 1 or hsts_enabled == true %}
# HSTS (ngx_http_headers_module is required) (63072000 seconds = 2 years)
add_header Strict-Transport-Security "max-age=63072000;{% if hsts_subdomains == 1 or hsts_subdomains == true -%} includeSubDomains;{% endif %} preload" always;
add_header Referrer-Policy strict-origin-when-cross-origin;
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
add_header X-Frame-Options SAMEORIGIN;
add_header Content-Security-Policy upgrade-insecure-requests;
@matusnovak
matusnovak / README.md
Last active November 14, 2024 22:40
Matrix (Synapse + Riot) in Docker with Traefik and federation

Matrix

matrix.org chat is split into two parts, the server and the client. The server we are going to use is called Synapse and the client is Riot.im. The Synapse will also need Postgres database and Redis for caching.

0. Folders

Make sure your folder structure looks like this.

example/
#!/usr/bin/python
#-*- encoding: Utf-8 -*-
from xml.etree.ElementTree import fromstring
from getpass import getpass
from hashlib import sha256
from sys import argv
import hmac
try:
from Crypto.Cipher import AES