mirror of
https://github.com/pschiffe/docker-pdns.git
synced 2024-11-13 03:47:56 +01:00
Update pdns admin to match the latest upstream
This commit is contained in:
parent
7feaa6bb42
commit
c8f3785b1d
6 changed files with 18 additions and 15 deletions
|
@ -22,11 +22,10 @@ WORKDIR /opt/powerdns-admin
|
|||
RUN pip3 install --no-cache-dir envtpl python-dotenv \
|
||||
&& pip3 install -r requirements.txt --no-cache-dir
|
||||
|
||||
ENV FLASK_APP=/opt/powerdns-admin/powerdnsadmin/__init__.py \
|
||||
PDNS_ADMIN_LOG_LEVEL="'INFO'" \
|
||||
PDNS_ADMIN_SAML_ENABLED=False
|
||||
ENV FLASK_APP=/opt/powerdns-admin/powerdnsadmin/__init__.py
|
||||
|
||||
COPY config.py.tpl /
|
||||
COPY run.py .
|
||||
|
||||
RUN envtpl < /config.py.tpl > /opt/powerdns-admin/config.py \
|
||||
&& sed -i '/SQLALCHEMY_DATABASE_URI/d' /opt/powerdns-admin/config.py
|
||||
|
|
|
@ -1,14 +1,17 @@
|
|||
import os
|
||||
basedir = os.path.abspath(os.path.dirname(__file__))
|
||||
|
||||
### BASIC APP CONFIG
|
||||
BIND_ADDRESS = '0.0.0.0'
|
||||
PORT = 9191
|
||||
HSTS_ENABLED = False
|
||||
|
||||
# SAML Authnetication
|
||||
SAML_ENABLED = False
|
||||
|
||||
{% for key, value in environment('PDNS_ADMIN_') %}{{ key }} = {{ value }}
|
||||
{% endfor %}
|
||||
|
||||
WTF_CSRF_ENABLED = True
|
||||
BIND_ADDRESS = '0.0.0.0'
|
||||
PORT = 9393
|
||||
LOG_FILE = ''
|
||||
UPLOAD_DIR = '/opt/powerdns-admin/upload'
|
||||
### DATABASE CONFIG
|
||||
SQLALCHEMY_DATABASE_URI = 'mysql://' + SQLA_DB_USER + ':' + SQLA_DB_PASSWORD + '@' + SQLA_DB_HOST + ':' + SQLA_DB_PORT + '/' + SQLA_DB_NAME
|
||||
SQLALCHEMY_MIGRATE_REPO = os.path.join(basedir, 'db_repository')
|
||||
SQLALCHEMY_TRACK_MODIFICATIONS = True
|
||||
|
|
5
pdns-admin-base-ngoduykhanh/run.py
Normal file
5
pdns-admin-base-ngoduykhanh/run.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
from powerdnsadmin import create_app
|
||||
|
||||
app = create_app()
|
|
@ -36,7 +36,7 @@ http {
|
|||
server_name _;
|
||||
|
||||
location /static/ {
|
||||
alias /opt/powerdns-admin/app/static/;
|
||||
alias /opt/powerdns-admin/powerdnsadmin/static/;
|
||||
}
|
||||
|
||||
location / {
|
||||
|
|
|
@ -7,14 +7,10 @@ RUN dnf -y --setopt=install_weak_deps=False install \
|
|||
|
||||
EXPOSE 9494
|
||||
|
||||
VOLUME [ "/opt/powerdns-admin/upload" ]
|
||||
|
||||
COPY docker-entrypoint.sh /
|
||||
COPY pdns-admin.ini /etc/uwsgi.ini
|
||||
RUN chown uwsgi: /etc/uwsgi.ini
|
||||
|
||||
ENV FLASK_APP=/opt/powerdns-admin/app/__init__.py
|
||||
|
||||
ENTRYPOINT [ "/docker-entrypoint.sh" ]
|
||||
|
||||
CMD [ "/usr/sbin/uwsgi", "--ini", "/etc/uwsgi.ini" ]
|
||||
|
|
|
@ -25,7 +25,7 @@ PDNS_ADMIN_SECRET_KEY="'$(cat /root/secret-key)'"
|
|||
|
||||
export PDNS_ADMIN_SECRET_KEY
|
||||
|
||||
envtpl < /config.py.tpl > /opt/powerdns-admin/config.py
|
||||
envtpl < /config.py.tpl > /opt/powerdns-admin/powerdnsadmin/default_config.py
|
||||
|
||||
# Initialize DB if needed
|
||||
MYSQL_COMMAND="mysql -h ${PDNS_ADMIN_SQLA_DB_HOST//\'/} -P ${PDNS_ADMIN_SQLA_DB_PORT//\'/} -u ${PDNS_ADMIN_SQLA_DB_USER//\'/} -p${PDNS_ADMIN_SQLA_DB_PASSWORD//\'/}"
|
||||
|
|
Loading…
Reference in a new issue