generate a random url for the django admin

This commit is contained in:
wh1te909 2020-01-18 02:05:29 +00:00
parent 5e574c7635
commit 3661eab8eb
3 changed files with 7 additions and 1 deletions

View File

@ -2,6 +2,8 @@ SECRET_KEY = 'changeme'
ALLOWED_HOSTS = ['api.example.com']
ADMIN_URL = "somerandomstring/"
CORS_ORIGIN_WHITELIST = ["https://rmm.example.com",]
DEBUG = False

View File

@ -1,10 +1,11 @@
from django.contrib import admin
from django.urls import path, include
from django.conf import settings
from knox import views as knox_views
from accounts.views import LoginView, installer_twofactor
urlpatterns = [
path("admin/", admin.site.urls),
path(settings.ADMIN_URL, admin.site.urls),
path("login/", LoginView.as_view()),
path("logout/", knox_views.LogoutView.as_view()),
path("logoutall/", knox_views.LogoutAllView.as_view()),

View File

@ -8,6 +8,7 @@ fi
DJANGO_SEKRET=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 50 | head -n 1)
SALTPW=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1)
ADMINURL=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 30 | head -n 1)
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
@ -163,6 +164,8 @@ DEBUG = False
ALLOWED_HOSTS = ['${rmmdomain}']
ADMIN_URL = "${ADMINURL}/"
CORS_ORIGIN_WHITELIST = [
"https://${frontenddomain}"
]