Skip to content

Releases: Privex/whats-my-ip

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

29 Jun 20:21
Compare
Choose a tag to compare

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 :)

v2.2.0 - many fixes and improvements, especially related to API output type handling

29 Jun 20:24
Compare
Choose a tag to compare
  • removed hardcoded host context from view_api_docs so that it uses the flask global template context
  • changed default bformat for index to None so it doesn't interfere with Accepts header
  • refactored body of tpl_add_hosts into _tpl_add_hosts so that it can be called independently without going via the context processing engine
  • changed wants_type default fmt from 'html' to '' (empty string), so that it doesn't interfere with MIME detection via Accepts header
  • added some more debugging statements across the project, inc. wants_type
  • fixed FILTER_HOSTS handling in _tpl_add_hosts, so that trusted_hosts can actually be disabled
  • changed main_host references in api.md to host - so that it shows URLs based on which domain you're accessing the docs from.
  • added Quickstart section to api.md which contains all important API queries via curl for easy copy pasting
  • symlinked wsgi.py into myip/ to help with referencing it
  • added __main__.py to myip so the app can be ran in development using python3 -m myip
  • made wsgi.py, __main__.py, and app.py executable, so they can simply be executed on nix systems to start the flask dev server
  • probably some other minor fixes I forgot