• 1 Post
  • 232 Comments
Joined 2 years ago
cake
Cake day: June 1st, 2023

help-circle
  • mbirth@lemmy.mltoSelfhosted@lemmy.worldSelf hosted place check-ins
    link
    fedilink
    English
    arrow-up
    6
    ·
    edit-2
    7 hours ago

    If you like to checkin manually to places, there’s PrivateSquare which will query places around you from Foursquare (so, 4sq will still see whereabout you are), but store the actual checkin in a local database.

    If you want some automated tracking, I’m mostly happy with OwnTracks which logs to my DaWarIch instance. (I’ve previously used Traccar and php-owntracks-recorder.)

    While I don’t see any battery usage from OwnTracks, my only gripe is that it can’t increase the amount of points logged when it detects movement because of Apple iOS limitations.

    (For iOS, there’s also Geory which will log into a local database and CAN increase the logging by spawning a Live Activity. It gives me the most accurate logs so far. But they have to be exported manually to be stored elsewhere and the author wants to keep the app simple and doesn’t want to implement logging to external systems.)



  • In the Traefik static configuration (usually traefik.yml), add this to load the CrowdSec plugin:

    experimental:
      plugins:
        crowdsec-bouncer-traefik-plugin:
          moduleName: "github.com/maxlerebourg/crowdsec-bouncer-traefik-plugin"
          version: "v1.4.2"
    

    (The name for the plugin is defined here as crowdsec-bouncer-traefik-plugin.)

    Then, in your dynamic configuration, add this (I’ve used a separate file dynamic_conf/050-plugin-crowdsec-bouncer.yml):

    http:
      middlewares:
        crowdsec-bouncer:
          plugin:
            crowdsec-bouncer-traefik-plugin:
              CrowdsecLapiKey: "...YOUR CROWDSEC LAPI KEY HERE..."
              Enabled: true
    

    (The name for this new middleware defined here is crowdsec-bouncer. It uses the crowdsec-bouncer-traefik-plugin defined in the previous step. Make sure these names match.)

    You can get the LAPI key by registering a new bouncer in CrowdSec.

    And, finally, make sure all incoming traffic routes through the bouncer plugin. You can do this individually, or in general via the static config:

    entryPoints:
    
      websecure:
        address: :443
        http:
          middlewares:
            - crowdsec-bouncer@file
            - secure-headers@file
    

    The middlewares are processed top to bottom.

    Any change to the static configuration requires a restart of Traefik to become active.



  • I had fail2ban running for several years before switching to CrowdSec late last year. They both work in a similar fashion and watch your logfiles for break in attempts. With the small difference that CrowdSec also lets you use blocklists from the “crowd” to block malicious actors before they even get to try their luck on your machine(s).

    I’m using CrowdSec with Traefik and nftables. But there are some bouncer plugins for nginx and OpnSense, too.

    I just followed their example configurations for Docker, Docker Compose and then started tinkering with the config until everything worked as desired.








  • And if you want some customisation, e.g. some repeating string over and over, you can use something like this:

    yes "b0M" | tr -d '\n' | head -c 10G | gzip -c > 10GB.gz
    

    yes repeats the given string (followed by a line feed) indefinitely - originally meant to type “yes” + ENTER into prompts. tr then removes the line breaks again and head makes sure to only take 10GB and not have it run indefinitely.

    If you want to be really fancy, you can even add some HTML header and footer to some files like header and footer and then run it like this:

    yes "b0M" | tr -d '\n' | head -c 10G | cat header - footer | gzip -c > 10GB.gz
    






  • Ohh, SQLite isn’t “one” db. SQLite is file-based. I.e. a database in e.g. PostgreSQL (containing several tables, views, indexes, etc.) would translate to one SQLite file (e.g. mydatabase.db3 or myappdata.sqlite). And each app has its own file/database. If the file corrupts, then it’s only affecting that specific app. (However, SQLite is pretty robust.) And since these are just files, you can backup them together with the application. No need to export data or shutdown the database first.