How to use Zinc

Find out all you need to know about using Zinc, from installing and running it, to development and running tests.

Installing and Running

The recommended way to get up and running is using our Docker container.

$ cd contrib/
$ docker-compose up

Config

If you run the Django project with default settings, you can configure zinc by setting environment variables. If you’re using the provided docker-compose.yml you can set the environment in ./zinc.env

The following are essential and required:

ZINC_AWS_KEY # AWS Key
ZINC_AWS_SECRET # AWS Secret
ZINC_SECRET_KEY # Django secret

You can also set the following:

ZINC_ALLOWED_HOSTS # Django Allowed Hosts
ZINC_BROKER_URL # Celery Broker URL, defaults to ${REDIS_URL}/0
ZINC_CELERY_RESULT_BACKEND # Celery Result Backend, defaults to ${REDIS_URL}/1
ZINC_DATA_DIR # PROJECT_ROOT
ZINC_DB_ENGINE # The Django db engine to use. Defaults to 'django.db.backends.sqlite3'
ZINC_DB_HOST #
ZINC_DB_NAME # zinc
ZINC_DB_PASSWORD # password
ZINC_DB_PORT #
ZINC_DB_USER # zinc
ZINC_DEBUG # Django debug. Defaults to False. Set to the string "True" to turn on debugging.
ZINC_DEFAULT_TTL # 300
ZINC_ENV_NAME # The environment for sentry reporting.
ZINC_GOOGLE_OAUTH2_KEY # For use with social-django. If you don't set this, social-django will be disabled.
ZINC_GOOGLE_OAUTH2_SECRET # For use with social-django.
ZINC_SOCIAL_AUTH_ADMIN_EMAILS # List of email addresses that will be automatically granted admin access.
ZINC_SOCIAL_AUTH_GOOGLE_OAUTH2_WHITELISTED_DOMAINS # see http://python-social-auth.readthedocs.io/en/latest/configuration/settings.html?highlight=whitelisted#whitelists
ZINC_HEALTH_CHECK_FQDN # Hostname to use in Health Checks. Defaults to 'node.presslabs.net.'
ZINC_LOCK_SERVER_URL # Used with redis-lock. Defaults to ${REDIS_URL}/2.
ZINC_LOG_LEVEL # Defaults to INFO
ZINC_NS_CHECK_RESOLVERS # NameServers to use when checking zone propagation. Default: ['8.8.8.8']
ZINC_REDIS_URL # Defaults to 'redis://localhost:6379'
ZINC_SECRET_KEY # The secret key used by the Django app.
ZINC_SENTRY_DSN # Set this to enable sentry error reporting.
ZINC_STATIC_URL # Defaults to '/static/'
ZINC_ZONE_OWNERSHIP_COMMENT # Set this comment on records, to Defaults to 'zinc'

Development

NOTE

Don’t use production AWS credentials when developing or testing Zinc.

After you’ve cloned the code:

$ pip install -r requirements.dev.txt
$ python setup.py develop
$ cp local_settings.py.example local_settings.py
# open local_settings.py in your favorite editor, and set AWS credentials
$ vi local_settings.py

To run the tests:

# all tests
$ py.test .

# to skip tests that need AWS
$ py.test -k 'not with_aws' .