django-ca icon indicating copy to clipboard operation
django-ca copied to clipboard

Config is not read

Open bennypi opened this issue 3 years ago • 0 comments

Hi there,

I'm trying to setup django-ca on kubernetes/rancher.

I prepared postgres and redis containers and created services so that the backend and frontend can access them. However it seems like the XAML configuration I prepared is not read and the applications use some kind of default configuration. Using a config map I mounted the following localsettings.yaml at /usr/src/django-ca/ca/conf-map:

# Configuration for django-ca. You can add/update settings here and then
# restart your containers.

# Where to find your database
DATABASES:
    default:
        ENGINE: django.db.backends.postgresql_psycopg2
        HOST: postgres
        PORT: 5432
        PASSWORD: xxx

CACHES:
    default:
        BACKEND: redis_cache.RedisCache
        LOCATION: redis://redis:6379
        OPTIONS:
            DB: 1
            PARSER_CLASS: redis.connection.HiredisParser

# django-ca will use Celery as an asynchronous task worker
CELERY_BROKER_URL: redis://redis:6379/0

# Default hostname to use when generating CRLs and OCSP responses
CA_DEFAULT_HOSTNAME: xxx.de

I also added the environment variables DJANGO_CA_CONFIGURATION_DIRECTIVE=/usr/src/django-ca/ca/conf-map/ and CONFIGURATION_DIRECTIVE=/usr/src/django-ca/ca/conf-map/ because I was unsure about the DANGO_CA_-prefix. But when starting the backend (mathiasertl/django-ca with the command .celery.sh) I get this output from the container:

Thu, Sep 15 2022 1:11:35 pm | + exec celery -A ca worker -B -s /var/lib/django-ca/celerybeat-schedule
Thu, Sep 15 2022 1:11:37 pm | [2022-09-15 13:11:37,071: WARNING/MainProcess] No hostname was supplied. Reverting to default 'localhost'
Thu, Sep 15 2022 1:11:37 pm |  
Thu, Sep 15 2022 1:11:37 pm | -------------- celery@django-ca-backend-57f67f89bc-7xsw6 v5.2.7 (dawn-chorus)
Thu, Sep 15 2022 1:11:37 pm | --- ***** -----
Thu, Sep 15 2022 1:11:37 pm | -- ******* ---- Linux-5.4.0-109-generic-x86_64-with 2022-09-15 13:11:37
Thu, Sep 15 2022 1:11:37 pm | - *** --- * ---
Thu, Sep 15 2022 1:11:37 pm | - ** ---------- [config]
Thu, Sep 15 2022 1:11:37 pm | - ** ---------- .> app: ca:0x7f6e560405b0
Thu, Sep 15 2022 1:11:37 pm | - ** ---------- .> transport: amqp://guest:**@localhost:5672//
Thu, Sep 15 2022 1:11:37 pm | - ** ---------- .> results: disabled://
Thu, Sep 15 2022 1:11:37 pm | - *** --- * --- .> concurrency: 256 (prefork)
Thu, Sep 15 2022 1:11:37 pm | -- ******* ---- .> task events: OFF (enable -E to monitor tasks in this worker)
Thu, Sep 15 2022 1:11:37 pm | --- ***** -----
Thu, Sep 15 2022 1:11:37 pm | -------------- [queues]
Thu, Sep 15 2022 1:11:37 pm | .> celery exchange=celery(direct) key=celery
Thu, Sep 15 2022 1:11:37 pm |  
Thu, Sep 15 2022 1:11:37 pm |  
Thu, Sep 15 2022 1:11:44 pm | [2022-09-15 13:11:44,945: ERROR/MainProcess] consumer: Cannot connect to amqp://guest:**@127.0.0.1:5672//: [Errno 111] Connection refused.
Thu, Sep 15 2022 1:11:44 pm | Trying again in 2.00 seconds... (1/100)
Thu, Sep 15 2022 1:11:44 pm |  
Thu, Sep 15 2022 1:11:46 pm | [2022-09-15 13:11:46,948: ERROR/MainProcess] consumer: Cannot connect to amqp://guest:**@127.0.0.1:5672//: [Errno 111] Connection refused.
Thu, Sep 15 2022 1:11:46 pm | Trying again in 4.00 seconds... (2/100)

To me this does not look like the YAML configuration is read. What am I doing wrong?

bennypi avatar Sep 15 '22 11:09 bennypi