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

help-circle
  • I have a git repo with some directory convention and bash scripts. Ex stop is just

    #!/bin/bash
    name=synapse
    docker stop $name
    docker rm $name
    

    etc. depending on what actions I need to do against container I have bash script for that and if I need to perform same action against other container I just copy paste this file and change name variable. I pull this repo to my containers host and just type ./bin/synapse/stop and I stop synapse.

    Hope that makes sense.



  • 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 won’t get those numbers from internet requests, they do it locally or in cloud vpc, honestly those benchmarks are shit unless you are ISP. It’s because you have ISP and your router involved before you even receive request. If you have traffic from all over the world there is also speed of light delay. Then you have linux tcp/ip stack and number of open files.

    I use openresty, I could add lru cache on top but it doesn’t even make sense because each bot just tries one unique request so you would have to generate html files manually instead of hosting gitea instance.

    Gitea is on sqlite database on nvme so db doesn’t really matter. I could put the sqlite on ramdisk as server is using UPS so I don’t care about power outage but this would be ridiculous.

    Anyways simplest way is just block ip ranges in firewall and move on.



  • I don’t know from theory or counting but I know that my 8 cores depleted sooner than my bandwidth and I have like 60 Mb/s uplink. My linux network stack parameters are pretty aggressive. The way I figured out that something is not right was when I heard loud fan noise from my server inside room. I logged in and all cores were red and logs were showing corporate fuckers trying to burn my house.





  • I have around 10-20GB github / gitlab mirror. I am constantly under attack from crawlers from top US technology corporations and LLM startups. Whenever I ban one IP range they switch to other - I don’t know if those fuckers have tickets in their systems to do it manually or they just deploy this shit all over the planet. From what I observe during attacks that I mitigate the best way to poison them is to just create gitea instance with poisoned code repository and couple hundred revisions. It’s because what they are most interested in is html representation of diff between two git revisions.