diff --git a/karbs/apps.py b/karbs/apps.py index af72bd2..773b6ed 100644 --- a/karbs/apps.py +++ b/karbs/apps.py @@ -2,5 +2,5 @@ from django.apps import AppConfig class KarbsConfig(AppConfig): - default_auto_field = 'django.db.models.BigAutoField' - name = 'karbs' + default_auto_field = "django.db.models.BigAutoField" + name = "karbs" diff --git a/karbs/urls.py b/karbs/urls.py index 2fa0da0..cec7e31 100644 --- a/karbs/urls.py +++ b/karbs/urls.py @@ -2,6 +2,6 @@ from django.urls import path from . import views urlpatterns = [ - path('', views.karbs, name='karbs'), - path('instructions', views.instructions, name='instructions'), + path("", views.karbs, name="karbs"), + path("instructions", views.instructions, name="instructions"), ] diff --git a/karbs/views.py b/karbs/views.py index d0778dd..81a16c1 100644 --- a/karbs/views.py +++ b/karbs/views.py @@ -3,9 +3,9 @@ from django.shortcuts import render, redirect def instructions(request): """Karbs Instruction""" - return render(request, 'karbs/instructions.html', {'title': 'Karbs Instructions'}) + return render(request, "karbs/instructions.html", {"title": "Karbs Instructions"}) def karbs(request): """Karbs install script""" - return render(request, 'karbs/karbs.sh', {'title': 'KARBS'}) + return render(request, "karbs/karbs", {"title": "KARBS"}) diff --git a/kristofersxyz/asgi.py b/kristofersxyz/asgi.py index 3556909..4001571 100644 --- a/kristofersxyz/asgi.py +++ b/kristofersxyz/asgi.py @@ -11,6 +11,6 @@ import os from django.core.asgi import get_asgi_application -os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'kristofersxyz.settings') +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "kristofersxyz.settings") application = get_asgi_application() diff --git a/kristofersxyz/settings.py b/kristofersxyz/settings.py index 50bfd16..6fa768c 100644 --- a/kristofersxyz/settings.py +++ b/kristofersxyz/settings.py @@ -1,7 +1,7 @@ """ Django settings for kristofersxyz project. -Generated by 'django-admin startproject' using Django 4.0.5. +Generated by "django-admin startproject" using Django 4.0.5. For more information on this file, see https://docs.djangoproject.com/en/4.0/topics/settings/ @@ -14,81 +14,77 @@ import json from pathlib import Path -# Build paths inside the project like this: BASE_DIR / 'subdir'. +# Build paths inside the project like this: BASE_DIR / "subdir". BASE_DIR = Path(__file__).resolve().parent.parent -if Path(BASE_DIR, 'debug').is_file(): # if `debug` files exists - # SECURITY WARNING: don't run with debug turned on in production! - DEBUG = True - with open(Path(BASE_DIR, 'config.json'), 'r', encoding='UTF-8') as config_file: - config = json.load(config_file) -else: - DEBUG = False - with open('/etc/config.json', 'r', encoding='UTF-8') as config_file: - config = json.load(config_file) +# SECURITY WARNING: don"t run with debug turned on in production! +DEBUG = Path(BASE_DIR, "debug").is_file() +with open(Path(BASE_DIR, "config.json"), "r", encoding="UTF-8") as config_file: + config = json.load(config_file) + # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/4.0/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = config['SECRET_KEY'] +SECRET_KEY = config["SECRET_KEY"] -ALLOWED_HOSTS = config['ALLOWED_HOSTS'] +ALLOWED_HOSTS = config["ALLOWED_HOSTS"] # Application definition INSTALLED_APPS = [ - 'django.contrib.admin', - 'django.contrib.auth', - 'django.contrib.contenttypes', - 'django.contrib.sessions', - 'django.contrib.messages', - 'django.contrib.staticfiles', - 'main', - 'karbs', + "django.contrib.admin", + "django.contrib.auth", + "django.contrib.contenttypes", + "django.contrib.sessions", + "django.contrib.messages", + "django.contrib.staticfiles", + "main", + "karbs", ] MIDDLEWARE = [ - 'django.middleware.security.SecurityMiddleware', - 'django.contrib.sessions.middleware.SessionMiddleware', - 'django.middleware.common.CommonMiddleware', - 'django.middleware.csrf.CsrfViewMiddleware', - 'django.contrib.auth.middleware.AuthenticationMiddleware', - 'django.contrib.messages.middleware.MessageMiddleware', - 'django.middleware.clickjacking.XFrameOptionsMiddleware', + "django.middleware.security.SecurityMiddleware", + "django.contrib.sessions.middleware.SessionMiddleware", + "django.middleware.common.CommonMiddleware", + "django.middleware.csrf.CsrfViewMiddleware", + "django.contrib.auth.middleware.AuthenticationMiddleware", + "django.contrib.messages.middleware.MessageMiddleware", + "django.middleware.clickjacking.XFrameOptionsMiddleware", ] -ROOT_URLCONF = 'kristofersxyz.urls' +ROOT_URLCONF = "kristofersxyz.urls" TEMPLATES = [ { - 'BACKEND': 'django.template.backends.django.DjangoTemplates', - 'DIRS': [Path.joinpath(BASE_DIR, 'templates')], - 'APP_DIRS': True, - 'OPTIONS': { - 'context_processors': [ - 'django.template.context_processors.debug', - 'django.template.context_processors.request', - 'django.contrib.auth.context_processors.auth', - 'django.contrib.messages.context_processors.messages', + "BACKEND": "django.template.backends.django.DjangoTemplates", + "DIRS": [Path.joinpath(BASE_DIR, "templates")], + "APP_DIRS": True, + "OPTIONS": { + "context_processors": [ + "django.template.context_processors.debug", + "django.template.context_processors.request", + "django.contrib.auth.context_processors.auth", + "django.contrib.messages.context_processors.messages", ], }, }, ] -WSGI_APPLICATION = 'kristofersxyz.wsgi.application' +WSGI_APPLICATION = "kristofersxyz.wsgi.application" # Database # https://docs.djangoproject.com/en/4.0/ref/settings/#databases DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': BASE_DIR / 'db.sqlite3', + "default": { + "ENGINE": "django.db.backends.sqlite3", + "NAME": BASE_DIR / "db.sqlite3", } } @@ -98,16 +94,16 @@ DATABASES = { AUTH_PASSWORD_VALIDATORS = [ { - 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', + "NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator", }, { - 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', + "NAME": "django.contrib.auth.password_validation.MinimumLengthValidator", }, { - 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', + "NAME": "django.contrib.auth.password_validation.CommonPasswordValidator", }, { - 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', + "NAME": "django.contrib.auth.password_validation.NumericPasswordValidator", }, ] @@ -115,9 +111,9 @@ AUTH_PASSWORD_VALIDATORS = [ # Internationalization # https://docs.djangoproject.com/en/4.0/topics/i18n/ -LANGUAGE_CODE = 'en-us' +LANGUAGE_CODE = "en-us" -TIME_ZONE = 'Europe/Riga' +TIME_ZONE = "Europe/Riga" USE_I18N = True @@ -127,11 +123,13 @@ USE_TZ = True # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/4.0/howto/static-files/ -STATIC_URL = '/static/' -STATIC_ROOT = Path.joinpath(BASE_DIR, 'static') +# STATIC_URL = Path.joinpath(BASE_DIR, "static") +STATIC_URL = "/static/" +STATIC_ROOT = Path.joinpath(BASE_DIR, "static") +MEDIA_ROOT = Path.joinpath(BASE_DIR, "media") # Default primary key field type # https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field -DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' +DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField" diff --git a/kristofersxyz/urls.py b/kristofersxyz/urls.py index 0bfde44..537c605 100644 --- a/kristofersxyz/urls.py +++ b/kristofersxyz/urls.py @@ -5,13 +5,13 @@ The `urlpatterns` list routes URLs to views. For more information please see: Examples: Function views 1. Add an import: from my_app import views - 2. Add a URL to urlpatterns: path('', views.home, name='home') + 2. Add a URL to urlpatterns: path("", views.home, name="home") Class-based views 1. Add an import: from other_app.views import Home - 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') + 2. Add a URL to urlpatterns: path("", Home.as_view(), name="home") Including another URLconf 1. Import the include() function: from django.urls import include, path - 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) + 2. Add a URL to urlpatterns: path("blog/", include("blog.urls")) """ from django.contrib import admin from django.urls import path, include @@ -19,9 +19,9 @@ from django.conf import settings from django.conf.urls.static import static urlpatterns = [ - path('admin/', admin.site.urls), - path('', include('main.urls')), - path('karbs.sh/', include('karbs.urls')), + path("admin/", admin.site.urls), + path("", include("main.urls")), + path("karbs/", include("karbs.urls")), ] urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) diff --git a/kristofersxyz/wsgi.py b/kristofersxyz/wsgi.py index e53ac91..159568b 100644 --- a/kristofersxyz/wsgi.py +++ b/kristofersxyz/wsgi.py @@ -11,6 +11,6 @@ import os from django.core.wsgi import get_wsgi_application -os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'kristofersxyz.settings') +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "kristofersxyz.settings") application = get_wsgi_application() diff --git a/main/apps.py b/main/apps.py index 167f044..34f1451 100644 --- a/main/apps.py +++ b/main/apps.py @@ -2,5 +2,5 @@ from django.apps import AppConfig class MainConfig(AppConfig): - default_auto_field = 'django.db.models.BigAutoField' - name = 'main' + default_auto_field = "django.db.models.BigAutoField" + name = "main" diff --git a/main/urls.py b/main/urls.py index 0a9d3a3..59006af 100644 --- a/main/urls.py +++ b/main/urls.py @@ -2,6 +2,6 @@ from django.urls import path from . import views urlpatterns = [ - path('', views.index, name='home'), - path('lightsaber', views.lightsaber, name='lightsaber'), + path("", views.index, name="home"), + path("lightsaber", views.lightsaber, name="lightsaber"), ] diff --git a/main/views.py b/main/views.py index 18c5b81..28126fe 100644 --- a/main/views.py +++ b/main/views.py @@ -3,9 +3,9 @@ from django.shortcuts import render def index(request): """Homepage""" - return render(request, 'main/index.html', {'title': 'Kristofers Solo Webpage'}) + return render(request, "main/index.html", {"title": "Kristofers Solo Webpage"}) def lightsaber(request): """Lightsaber page""" - return render(request, 'main/lightsaber.html', {'title': 'Lightsaber'}) + return render(request, "main/lightsaber.html", {"title": "Lightsaber"}) diff --git a/manage.py b/manage.py index e3f2adb..b8303a4 100755 --- a/manage.py +++ b/manage.py @@ -1,12 +1,12 @@ -#!/usr/bin/env python -"""Django's command-line utility for administrative tasks.""" +#!/usr/bin/env python3 +"""Django"s command-line utility for administrative tasks.""" import os import sys def main(): """Run administrative tasks.""" - os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'kristofersxyz.settings') + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "kristofersxyz.settings") try: from django.core.management import execute_from_command_line except ImportError as exc: @@ -18,5 +18,5 @@ def main(): execute_from_command_line(sys.argv) -if __name__ == '__main__': +if __name__ == "__main__": main() diff --git a/static/karbs/css/karbs.css b/static/karbs/css/karbs.css index aba56ea..7f926d0 100644 --- a/static/karbs/css/karbs.css +++ b/static/karbs/css/karbs.css @@ -12,10 +12,14 @@ hr { h1 { text-align: center; + font-size: 32px; + font-weight: bold; } h2 { margin: 40px 0 0 0; + font-size: 24px; + font-weight: bold; } p { @@ -57,3 +61,11 @@ aside { .list { margin: 10px 40px; } + +.upper { + list-style-type: circle; +} + +.sub { + list-style-type: disc; +} diff --git a/templates/karbs/instructions.html b/templates/karbs/instructions.html index 79140fe..bb96e10 100644 --- a/templates/karbs/instructions.html +++ b/templates/karbs/instructions.html @@ -1,4 +1,4 @@ -{% extends 'layout.html' %} +{% extends "layout.html" %} {% load static %} {% block title %}{{ title }}{% endblock %} {% block meta %} @@ -27,28 +27,28 @@ Artix Linux, make sure curl is installed and just run the following as the root user:

-
curl -LO krisrofers.xyz/karbs.sh
-sh karbs.sh
+
curl -LO krisrofers.xyz/karbs
+sh karbs

Note that the KARBS scripts will not partition any drives or wipe anything, but when it deploys the dotfiles, it will overwrite any preexisting files: e.g. the KARBS .zshrc will replace your old .zshrc, etc.

What does KARBS install?


- You can check out the programs list that KARBS parses for installation right here!

Here is some idea of the programs installed:

-