Skip to content

v2.3.0 - Docker support + Improved caching + README overhaul + more

Latest
Compare
Choose a tag to compare
@Someguy123 Someguy123 released this 29 Jun 20:21
· 9 commits to master since this release

v2.3.0 - Docker support + Improved caching

  • Docker Support

    • Added Dockerfile for building a Docker image (python3.9-alpine based for minimal size) from the project.
    • Added example-docker-compose.yml - which is used as a base for the user's docker-compose.yml for easy management of the app inside of Docker, with Redis linked to it.
    • Added dkr/ folder to store docker-related files and folders, including various example files in dkr/config folder
    • Added prep-docker.sh and start-docker.sh for generating config files from the example files, and easily preparing an environment to use docker-compose
    • Added .dockerignore
  • Improved Caching

    • The application is no longer tightly bound to Redis, though it's still recommended. It now uses privex-helpers' Cache Abstraction Layer, which allows the use of Redis, Memcached, SQLite, in-memory cache, or other future adapters.
    • The REDIS_ settings in settings.py now also change the ones in privex.helpers.settings so that redis env vars configure the privex-helpers' cache abstraction
    • The heart of core.get_rdns was refactored into get_rdns_base, while get_rdns calls it, and is wrapped by r_cache for transparent caching via the selected privex-helpers' cache abstraction adapter
    • app.get_geodata now uses core.get_cache (wrapper for privex-helpers' adapter_get and adapter_set) instead of get_redis
    • core.get_redis has been commented out, since it's no longer used
  • Other stuff

    • Removed "full" extra from privex-helpers, and simply added the actual optional extra packages that the project needs by hand, since pipenv install was taking a very long time.
    • Improved example.env including adding more example ENV variables
    • Improved .gitignore
    • Updated shebang in run.sh to use /usr/bin/env bash instead of just /bin/bash
    • Updated update_geoip.sh with PATH, env shebang, overridable env vars, automatic sudo, and now rsync's the DB files from files.privex.io instead of wget'ing from the dead maxmind download URLs.
  • Overhauled the README

    • Added Table of Contents near the start, thanks to this small web app: https://ecotrust-canada.github.io/markdown-toc/
    • Added Features section under first heading, which explains what the index HTML page can do, as well as the various API functionalities
    • Updated requirements to confirm py3.8 and 3.9 work great
    • Added section for Docker, including running a solo container, and running with docker compose
    • Added section on keeping GeoIP2 databases up to date using maxmind's geoipupdate tool, with detailed instructions on installation and config on ubuntu/debian
    • Reformatted thanks for reading section, as the line was way too long.
  • Plus probably some other stuff that I've forgot to mention :)