From 88f81a4c2d19c0ad2d0422106c9db201f9f77e24 Mon Sep 17 00:00:00 2001 From: deniszh Date: Sat, 11 Jul 2020 22:24:48 +0200 Subject: [PATCH] I hope that finally fix admin user issue --- conf/etc/service/graphite/run | 9 +-------- conf/opt/graphite/bin/django_admin_init.exp | 22 --------------------- conf/opt/graphite/bin/django_admin_init.sh | 10 ++++++++++ 3 files changed, 11 insertions(+), 30 deletions(-) delete mode 100755 conf/opt/graphite/bin/django_admin_init.exp create mode 100755 conf/opt/graphite/bin/django_admin_init.sh diff --git a/conf/etc/service/graphite/run b/conf/etc/service/graphite/run index e4316ec..d647736 100755 --- a/conf/etc/service/graphite/run +++ b/conf/etc/service/graphite/run @@ -24,12 +24,7 @@ export DJANGO_SETTINGS_MODULE=graphite.settings /opt/graphite/bin/django-admin.py makemigrations /opt/graphite/bin/django-admin.py migrate auth /opt/graphite/bin/django-admin.py migrate --run-syncdb -if [ -e "/opt/graphite/storage/graphite.db" ]; then - # if graphite use sqlite database - create superuser - if grep ENGINE /opt/graphite/webapp/graphite/local_settings.py | grep -q django.db.backends.sqlite3; then - /opt/graphite/bin/django_admin_init.exp - fi -fi +/opt/graphite/bin/django_admin_init.sh || true if folder_empty /opt/graphite/webapp/graphite/functions/custom; then touch /opt/graphite/webapp/graphite/functions/custom/__init__.py @@ -42,8 +37,6 @@ export GRAPHITE_WSGI_REQUEST_LINE=${GRAPHITE_WSGI_REQUEST_LINE:-0} export GRAPHITE_WSGI_MAX_REQUESTS=${GRAPHITE_WSGI_MAX_REQUESTS:-1000} export GRAPHITE_WSGI_WORKER_CLASS=${GRAPHITE_WSGI_WORKER_CLASS:-"sync"} export GRAPHITE_WSGI_WORKER_CONNECTIONS=${GRAPHITE_WSGI_WORKER_CONNECTIONS:-1000} -export PYTHONPATH=/opt/graphite/webapp - if [ "${GRAPHITE_WSGI_WORKER_CLASS}" == "gevent" ]; then export GUNICORN_EXTRA_PARAMS="--worker-connections=${GRAPHITE_WSGI_WORKER_CONNECTIONS} " else diff --git a/conf/opt/graphite/bin/django_admin_init.exp b/conf/opt/graphite/bin/django_admin_init.exp deleted file mode 100755 index ea86687..0000000 --- a/conf/opt/graphite/bin/django_admin_init.exp +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env expect - -set timeout -1 -spawn /opt/graphite/bin/django-admin.py createsuperuser - -expect "Username (leave blank to use 'root'):" { - send "root\r" -} - -expect "Email address:" { - send "root.graphite@mailinator.com\r" -} - -expect "Password:" { - send "root\r" -} - -expect "Password *:" { - send "root\r" -} - -expect "Superuser created successfully" diff --git a/conf/opt/graphite/bin/django_admin_init.sh b/conf/opt/graphite/bin/django_admin_init.sh new file mode 100755 index 0000000..efcfbf8 --- /dev/null +++ b/conf/opt/graphite/bin/django_admin_init.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +cat <