• 0 Posts
  • 22 Comments
Joined 2 years ago
cake
Cake day: November 26th, 2023

help-circle

  • If you’re proficient it’s 30minutes

    Something like this for server.

    generate config

    docker run -it --rm \
        -v <your-data-path>:/data \
        -e SYNAPSE_SERVER_NAME=<your-public-address-subdomain> \
        -e SYNAPSE_REPORT_STATS=no \
        matrixdotorg/synapse:v1.136.0 generate
    

    run

    docker run -d \
      --restart=always \
      --name synapse \
      -e SYNAPSE_REPORT_STATS=no \
      -v <your-data-path>:/data \
      -p 8008:8008 matrixdotorg/synapse:v1.136.0
    

    register user

    docker exec -ti synapse register_new_matrix_user http://localhost:8008/ -c /data/homeserver.yaml -u <username> -p <password> --exists-ok
    

    Proxy it using ex. openresty / nginx

    location / {
            proxy_pass    http://127.0.0.1:8008/;
            proxy_http_version 1.1;
            proxy_set_header    Upgrade         $http_upgrade;
            proxy_set_header    Connection      "upgrade";
            proxy_set_header    Host            $host;
            proxy_set_header    X-Real-IP       $remote_addr;
            proxy_set_header    X-Forwarded-for $remote_addr;
            proxy_connect_timeout 600;
            proxy_read_timeout 86400;
        }
    

    For UI if you want element on your domain, download and unpack tar.gz from.
    https://github.com/element-hq/element-web/releases

    Point this location to your proxy server ex. openresty / nginx

    location / {
            root /opt/element-v1.11.109;
            index index.html;
        }
    

    Modify config.json inside /opt/element-v1.11.109 to point location to <your-public-address-subdomain>

    By default it’s using sqlite if you want postgres or other database then modify homeserver.yaml to use postgres






  • you can reverse proxy other ports than 443 and ex. upstream ssh, the advantage of having reverse proxy over everything is to have traffic in one place so you can manage it, that’s why for example kubernetes have ingress server, example nginx / openresty upstream ssh, you can restrict traffic to limited amount of IP etc.

    stream {
        upstream ssh {
            server          127.0.0.1:22;
        }
    
        server {
            listen          2222;
            ssl_preread     on;
            proxy_pass      ssh;
        }
    }
    

  • Buy refurbished / used Mini PC with at least 16GB RAM and 1Gbit network card. Don’t bother with M.2, SSD is enough.
    I have right now refurbished hp g4 ryzen 5 mini pc. There is 12 docker containers running there and couple applications in screen, I just add things. Don’t do ARM, as far as I remember running on ARM is compilation hell. Stick with x86. You want it to ease your life and not to make it harder.









  • vane@lemmy.worldtoSelfhosted@lemmy.worldNAS Power Consumption
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    8 months ago

    I remember to have it working with default software I got but it was 10 years ago. Then they added this bloatware like media streaming addon or notification center. I have now entware with minidlna and set minidlna scanning disk once per day because media streaming was scanning all the time. I haven’t figure out how to permanently kill their /usr/local/sbin/ncd, ncdb, qNoticeEngined, qulogdb, NotificationCenter, mariadb processes. If I figure out it it probably start working again.