diff --git a/archivebox/config.py b/archivebox/config.py index 719ee34a..64d3d0a2 100644 --- a/archivebox/config.py +++ b/archivebox/config.py @@ -91,8 +91,8 @@ CONFIG_SCHEMA: Dict[str, ConfigDefaultDict] = { 'OUTPUT_PERMISSIONS': {'type': str, 'default': '644'}, 'RESTRICT_FILE_NAMES': {'type': str, 'default': 'windows'}, 'URL_BLACKLIST': {'type': str, 'default': r'\.(css|js|otf|ttf|woff|woff2|gstatic\.com|googleapis\.com/css)(\?.*)?$'}, # to avoid downloading code assets as their own pages - 'ADMIN_USERNAME': {'type': str, 'default': None}, - 'ADMIN_PASSWORD': {'type': str, 'default': None}, + 'ADMIN_USERNAME': {'type': str, 'default': None}, + 'ADMIN_PASSWORD': {'type': str, 'default': None}, 'URL_WHITELIST': {'type': str, 'default': None}, 'ENFORCE_ATOMIC_WRITES': {'type': bool, 'default': True}, 'TAG_SEPARATOR_PATTERN': {'type': str, 'default': r'[,]'}, diff --git a/archivebox/main.py b/archivebox/main.py index e811a496..b3c59633 100755 --- a/archivebox/main.py +++ b/archivebox/main.py @@ -424,9 +424,9 @@ def init(force: bool=False, quick: bool=False, setup: bool=False, out_dir: Path= from django.contrib.auth.models import User - if (ADMIN_USERNAME and ADMIN_PASSWORD) and not User.objects.filter(username=ADMIN_USERNAME, is_superuser=True).exists(): + if (ADMIN_USERNAME and ADMIN_PASSWORD) and not User.objects.filter(username=ADMIN_USERNAME).exists(): User.objects.create_superuser(username=ADMIN_USERNAME, password=ADMIN_PASSWORD) - print('{green}[+] New ADMIN_USERNAME and ADMIN_PASSWORD configuration options found. Creating new admin user.{reset}'.format(ADMIN_USERNAME, ADMIN_PASSWORD, **ANSI)) + print('{green}[+] Found ADMIN_USERNAME and ADMIN_PASSWORD configuration options, creating new admin user.{reset}'.format(**ANSI)) if existing_index: print('{green}[√] Done. Verified and updated the existing ArchiveBox collection.{reset}'.format(**ANSI))