Categorygithub.com/qdm12/updated
repository
0.1.0
Repository: https://github.com/qdm12/updated.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author

# README

Updated

Go program to update and push files periodically to a Git repository

updated

GitHub last commit GitHub commit activity GitHub issues

Features

  • Periodically builds
    • A list of unique malicious hostnames
    • A list of unique malicious IP addresses
    • A list of unique ads hostnames
    • A list of unique surveillance hostnames
    • InterNIC's named roots for DNS resolvers
    • Root anchors XML for DNS resolvers
    • Root keys to be used by Unbound
  • Optionally upload the changes to a Git repository using an SSH key
  • Based on the Scratch image with a total uncompressed size of 15.4MB
  • Compatible with amd64 only although it is easily cross CPU compiled if needed

Setup

Using Docker (recommended)

  1. For bind mounting, create a files directory with the right permissions:

    mkdir files
    chown 1000 files
    chmod 700 files
    
  2. Use the following command:

    docker run -d -v $(pwd)/files:/files qmcgaw/updated
    

    You can also use docker-compose.yml with:

    docker-compose up -d
    

    To use with Git, you will also need to bind mount some files:

    • SSH key file at /key by default
    • SSH key passphrase optionally at /passphrase, if your SSH key is encrypted
    • SSH known hosts at /known_hosts by default, the default contains only Github key And set their ownership to user ID 1000 also.
  3. Check logs with docker logs updated and update the image with docker pull qmcgaw/updated

Environment variables

This Go program only reads parameters from environment variables for ease of use with Docker.

  • Commonly used

    Environment variableDefaultPossible valuesDescription
    OUTPUT_DIR./filesAny absolute or relative directory pathDirectory where files are written to
    PERIOD24hInteger from 1Period in minutes between each run
    RESOLVE_HOSTNAMESnoyes or noResolve hostnames found to obtain IP addresses
    HTTP_TIMEOUT3sinteger from 1Default HTTP client timeout in milliseconds
    LOG_LEVELinfodebug, info, warning, errorLogging level
    TZAmerica/MontrealstringTimezone
  • Git operation

    Environment variableDefaultPossible valuesDescription
    GITnoyes or noDo Git operations or not
    GIT_URLSSH Git URL addressSSH URL to the remote repository, used only if GIT=yes
    SSH_KEY./keyFile pathFile path containing your SSH key, only used if GIT=yes
    SSH_KEY_PASSPHRASEFile pathOptional file path containing your SSH key passphrase, only used if GIT=yes. Does not work with OpenSSH keys
  • Checksums

    Environment variableDefaultPossible valuesDescription
    NAMED_ROOT_MD59cdf6a12db2dc558e299601015c37948MD5 hexadecimal sum or ""Named root MD5 sum. Disables checking if empty
    ROOT_ANCHORS_SHA25645336725f9126db810a59896ae93819de743c416262f79c4444042c92e520770SHA256 hexadecimal sum or ""Root anchors SHA256 sum. Disables checking if empty
  • Extras

    Environment variableDefaultPossible valuesDescription
    SHOUTRRR_SERVICESOne or more comma separated Shoutrrr URLsComma separated list of Shoutrrr URLs

Using Go

  1. Build the program

    go build cmd/updated/main.go -o updated
    
  2. Depending on your system, change its permissions chmod +x updated

  3. Run the program ./updated

Why

This container is used to periodically update files at github.com/qdm12/files which are used by several other projects.

TODOs

  • Compress long repetitive files
  • Unit tests (no time sorry)
  • Version in json file with updated files
  • Use lists from Blockada

License

This repository is under an MIT license