Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| howto:matrix-protocol [2026/03/19 07:46] – vidak | howto:matrix-protocol [2026/03/19 07:59] (current) – vidak | ||
|---|---|---|---|
| Line 15: | Line 15: | ||
| Follow this [guide](https:// | Follow this [guide](https:// | ||
| + | |||
| + | I found the trickiest bit to be installing the matrix-synapse repositories, | ||
| ``` | ``` | ||
| Line 24: | Line 26: | ||
| sudo apt install matrix-synapse-py3 | sudo apt install matrix-synapse-py3 | ||
| ``` | ``` | ||
| + | |||
| + | ## 4. Install Postgresql. | ||
| + | |||
| + | They said not to use SQLite in production, so I installed Postgresql inside the server container. | ||
| + | |||
| + | I will migrate it to a separate container later. The trick is that the port is exposed within the proxmox environment, | ||
| + | |||
| + | Follow this [guide](https:// | ||
| + | |||
| + | ## 5. Final homeserver.yaml configuration. | ||
| + | |||
| + | ``` | ||
| + | root@matrix: | ||
| + | ``` | ||
| + | |||
| + | ``` | ||
| + | # Configuration file for Synapse. | ||
| + | # | ||
| + | # This is set in / | ||
| + | # server_name: | ||
| + | |||
| + | pid_file: "/ | ||
| + | listeners: | ||
| + | - port: 8008 | ||
| + | resources: | ||
| + | - compress: false | ||
| + | names: | ||
| + | - client | ||
| + | - federation | ||
| + | - media | ||
| + | - metrics | ||
| + | - static | ||
| + | - health | ||
| + | tls: false | ||
| + | type: http | ||
| + | x_forwarded: | ||
| + | database: | ||
| + | name: psycopg2 | ||
| + | args: | ||
| + | user: XXXXXXXXXXXXXXX | ||
| + | password: XXXXXXXXXXXXXXXXX | ||
| + | dbname: XXXXXXXXXXXXXXXXX | ||
| + | host: localhost | ||
| + | cp_min: 5 | ||
| + | cp_max: 10 | ||
| + | log_config: "/ | ||
| + | media_store_path: | ||
| + | signing_key_path: | ||
| + | trusted_key_servers: | ||
| + | - server_name: | ||
| + | macaroon_secret_key: | ||
| + | public_baseurl: | ||
| + | serve_server_wellknown: | ||
| + | enable_registration: | ||
| + | enable_registration_without_verification: | ||
| + | registrations_require_3pid: | ||
| + | |||
| + | registration_shared_secret: | ||
| + | allow_public_rooms_over_federation: | ||
| + | web_client_location: | ||
| + | allow_public_rooms_without_auth: | ||
| + | admin_contact: | ||
| + | max_upload_size: | ||
| + | |||
| + | email: | ||
| + | smtp_host: " | ||
| + | smtp_port: 465 | ||
| + | smtp_user: " | ||
| + | smtp_pass: " | ||
| + | require_transport_security: | ||
| + | enable_tls: true | ||
| + | force_tls: true | ||
| + | notif_from: "Your Friendly %(app)s homeserver < | ||
| + | app_name: " | ||
| + | enable_notifs: | ||
| + | notif_for_new_users: | ||
| + | validation_token_lifetime: | ||
| + | invite_client_location: | ||
| + | |||
| + | subjects: | ||
| + | message_from_person_in_room: | ||
| + | message_from_person: | ||
| + | messages_from_person: | ||
| + | messages_in_room: | ||
| + | messages_in_room_and_others: | ||
| + | messages_from_person_and_others: | ||
| + | invite_from_person_to_room: | ||
| + | invite_from_person: | ||
| + | password_reset: | ||
| + | email_validation: | ||
| + | ``` | ||
| + | |||
| + | ## Final NGINX configuration | ||
| + | |||
| + | ``` | ||
| + | vidak@nginx: | ||
| + | ``` | ||
| + | |||
| + | ``` | ||
| + | # Default server configuration | ||
| + | # | ||
| + | server { | ||
| + | |||
| + | root / | ||
| + | |||
| + | # Add index.php to the list if you are using PHP | ||
| + | index index.html index.htm index.nginx-debian.html; | ||
| + | |||
| + | server_name solarpunk.au; | ||
| + | |||
| + | listen [::]:443 ssl; # managed by Certbot | ||
| + | listen 443 ssl; # managed by Certbot | ||
| + | ssl_certificate / | ||
| + | ssl_certificate_key / | ||
| + | include / | ||
| + | ssl_dhparam / | ||
| + | |||
| + | listen 8448 ssl default_server; | ||
| + | listen [::]:8448 ssl default_server; | ||
| + | |||
| + | location ~ ^(/ | ||
| + | # note: do not add a path (even a single /) after the port in `proxy_pass`, | ||
| + | # otherwise nginx will canonicalise the URI and cause signature verification | ||
| + | # errors. | ||
| + | proxy_pass http:// | ||
| + | proxy_set_header X-Forwarded-For $remote_addr; | ||
| + | proxy_set_header X-Forwarded-Proto $scheme; | ||
| + | proxy_set_header Host $host: | ||
| + | |||
| + | # Nginx by default only allows file uploads up to 1M in size | ||
| + | # Increase client_max_body_size to match max_upload_size defined in homeserver.yaml | ||
| + | client_max_body_size 100M; | ||
| + | | ||
| + | # Synapse responses may be chunked, which is an HTTP/1.1 feature. | ||
| + | proxy_http_version 1.1; | ||
| + | } | ||
| + | |||
| + | location / | ||
| + | return 200 ' | ||
| + | default_type application/ | ||
| + | add_header Access-Control-Allow-Origin *; | ||
| + | } | ||
| + | |||
| + | location / | ||
| + | return 200 ' | ||
| + | default_type application/ | ||
| + | add_header Access-Control-Allow-Origin *; | ||
| + | } | ||
| + | |||
| + | |||
| + | } | ||
| + | |||
| + | server { | ||
| + | if ($host = solarpunk.au) { | ||
| + | return 301 https:// | ||
| + | } # managed by Certbot | ||
| + | |||
| + | |||
| + | listen 80 default_server; | ||
| + | listen [::]:80 default_server; | ||
| + | |||
| + | server_name solarpunk.au; | ||
| + | return 404; # managed by Certbot | ||
| + | |||
| + | |||
| + | } | ||
| + | ``` | ||
| + | |||