commit 7d1be7d4e927f7099d5dbe2fc9d94c1a8b8c1276 Author: Ben Goldsworthy Date: Sun Jul 7 14:55:03 2024 +0200 initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1a06e8e --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +data/* +!data/gitea/public/* +!data/gitea/templates/* +!data/gitea/conf/* diff --git a/data/gitea/conf/app.ini b/data/gitea/conf/app.ini new file mode 100644 index 0000000..a5181d3 --- /dev/null +++ b/data/gitea/conf/app.ini @@ -0,0 +1,103 @@ +APP_NAME = Code | Ben Goldsworthy +RUN_MODE = prod +RUN_USER = git +WORK_PATH = /data/gitea + +[repository] +ROOT = /data/git/repositories +MAX_CREATION_LIMIT = 0 + +[repository.local] +LOCAL_COPY_PATH = /data/gitea/tmp/local-repo + +[repository.upload] +TEMP_PATH = /data/gitea/uploads +FILE_MAX_SIZE = 100 +MAX_FILES = 50 + +[server] +APP_DATA_PATH = /data/gitea +DOMAIN = https://code.bengoldsworthy.net +SSH_DOMAIN = code.bengoldsworthy.net +HTTP_PORT = 3000 +ROOT_URL = https://code.bengoldsworthy.net/ +DISABLE_SSH = false +SSH_PORT = 22 +SSH_LISTEN_PORT = 22 +LFS_START_SERVER = true +LFS_JWT_SECRET = Kc-bJH6_HeSmMK-e5VtoTMfHur0vRsYi7Nh6G9ZDRpA +OFFLINE_MODE = false + +[lfs] +PATH = /data/git/lfs + +[database] +PATH = /data/gitea/gitea.db +DB_TYPE = sqlite3 +HOST = localhost:3306 +NAME = gitea +USER = root +PASSWD = +LOG_SQL = false +SCHEMA = +SSL_MODE = disable +CHARSET = utf8 + +[indexer] +ISSUE_INDEXER_PATH = /data/gitea/indexers/issues.bleve + +[session] +PROVIDER_CONFIG = /data/gitea/sessions +PROVIDER = file + +[picture] +AVATAR_UPLOAD_PATH = /data/gitea/avatars +REPOSITORY_AVATAR_UPLOAD_PATH = /data/gitea/repo-avatars +DISABLE_GRAVATAR = false +ENABLE_FEDERATED_AVATAR = true + +[attachment] +PATH = /data/gitea/attachments + +[log] +MODE = console +LEVEL = info +logger.router.MODE = console +ROOT_PATH = /data/gitea/log + +[security] +INSTALL_LOCK = true +SECRET_KEY = +REVERSE_PROXY_LIMIT = 1 +REVERSE_PROXY_TRUSTED_PROXIES = * +INTERNAL_TOKEN = eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYmYiOjE2NTkzNTk4NTB9.S_N6odCl3AKKWzU5IoKvMVBq6xJyzaM2712EYIMG3Sw +PASSWORD_HASH_ALGO = pbkdf2 + +[admin] +DISABLE_REGULAR_ORG_CREATION = true + +[service] +DISABLE_REGISTRATION = false +REQUIRE_SIGNIN_VIEW = false +REGISTER_EMAIL_CONFIRM = false +ENABLE_NOTIFY_MAIL = false +ALLOW_ONLY_EXTERNAL_REGISTRATION = true +ENABLE_CAPTCHA = false +DEFAULT_KEEP_EMAIL_PRIVATE = false +DEFAULT_ALLOW_CREATE_ORGANIZATION = false +DEFAULT_ENABLE_TIMETRACKING = true +NO_REPLY_ADDRESS = noreply.localhost + +[mailer] +ENABLED = false + +[openid] +ENABLE_OPENID_SIGNIN = true +ENABLE_OPENID_SIGNUP = true + +[ui] +THEMES = forgejo-auto,omphaloskepsis +DEFAULT_THEME = forgejo-auto + +[oauth2] +JWT_SECRET = SAq1P6hNRdAgY1es-NAo3Ez5_KzgPU-67ahvLBTBUUE diff --git a/data/gitea/public/assets/css/theme-omphaloskepsis.css b/data/gitea/public/assets/css/theme-omphaloskepsis.css new file mode 100644 index 0000000..18790de --- /dev/null +++ b/data/gitea/public/assets/css/theme-omphaloskepsis.css @@ -0,0 +1,318 @@ +.chroma .bp { + color:#999 +} +.chroma .c, +.chroma .c1, +.chroma .ch { + color:#6a737d +} +.chroma .cm { + color:#998 +} +.chroma .cp { + color:#109295 +} +.chroma .cpf { + color:#4c4dbc +} +.chroma .cs { + color:#999 +} +.chroma .dl { + color:#106303 +} +.chroma .gd { + color:#000; + background-color:#fdd +} +.chroma .ge { + color:#000 +} +.chroma .gh { + color:#999 +} +.chroma .gi { + color:#000; + background-color:#dfd +} +.chroma .go { + color:#888 +} +.chroma .gp { + color:#555 +} +.chroma .gr, +.chroma .gt { + color:#a00 +} +.chroma .gu { + color:#aaa +} +.chroma .il { + color:#099 +} +.chroma .k, +.chroma .kc, +.chroma .kd, +.chroma .kn, +.chroma .kp, +.chroma .kr { + color:#d73a49 +} +.chroma .kt { + color:#458 +} +.chroma .m, +.chroma .mb, +.chroma .mf, +.chroma .mh, +.chroma .mi, +.chroma .mo { + color:#099 +} +.chroma .na { + color:#d73a49 +} +.chroma .nb { + color:#005cc5 +} +.chroma .nc { + color:#458 +} +.chroma .nd { + color:#3c5d5d +} +.chroma .ne { + color:#900 +} +.chroma .nf { + color:#005cc5 +} +.chroma .ni { + color:#6f42c1 +} +.chroma .nl { + color:#900 +} +.chroma .nn { + color:#555 +} +.chroma .no { + color:teal +} +.chroma .nt { + color:#22863a +} +.chroma .nv { + color:teal +} +.chroma .nx { + color:#24292e +} +.chroma .o, +.chroma .ow { + color:#d73a49 +} +.chroma .s, +.chroma .s1, +.chroma .s2 { + color:#106303 +} +.chroma .sa { + color:#cc7a00 +} +.chroma .sb { + color:#106303 +} +.chroma .sc { + color:#cc7a00 +} +.chroma .sd { + color:#106303 +} +.chroma .se { + color:#940 +} +.chroma .sh { + color:#106303 +} +.chroma .si { + color:#cc7a00 +} +.chroma .sr { + color:#4c4dbc +} +.chroma .ss { + color:#940 +} +.chroma .sx { + color:#106303 +} +.chroma .vc, +.chroma .vg, +.chroma .vi { + color:teal +} +.chroma .w { + color:#bbb +} + +:root { + --dark: #020202; + --light: #fffff0; + + /* Gitea font overrides */ + --color-primary: var(--dark, #020202); + --color-secondary: var(--dark, #020202); + --color-primary-contrast: var(--light, #fffff0); + --color-light-border: var(--dark, #020202); + --color-primary-hover: var(--dark, #020202); + --color-input-border: var(--dark, #020202); + --color-tooltip-bg: var(--dark, #020202); + --color-tooltip-text: var(--light, #fffff0); + --color-body: var(--light, #fffff0); + --color-menu: var(--light, #fffff0); + --color-code-bg: #e8e8d7; + --color-file-bg: #e8e8d7; + --color-label-bg: #e8e8d7; + + --color-red-badge: darkred; + --color-red-badge-bg: #fc3a3a; + --color-red-badge-hover-bg: #b91c1c44; + --color-green-badge: #16a34a; + --color-green-badge-bg: #16a34a22; + --color-green-badge-hover-bg: #16a34a44; + --color-yellow-badge: #ca8a04; + --color-yellow-badge-bg: #ca8a0422; + --color-yellow-badge-hover-bg: #ca8a0444; + --color-orange-badge: #ea580c; + --color-orange-badge-bg: #ea580c22; + --color-orange-badge-hover-bg: #ea580c44; + + --zinc-50: #fafafa; + --zinc-100: #f4f4f5; + --zinc-150: #ececee; + --zinc-200: #e4e4e7; + --zinc-250: #dcdce0; + --zinc-300: #d4d4d8; + --zinc-350: #babac1; + --zinc-400: #a1a1aa; + --zinc-450: #898992; + --zinc-500: #71717a; + --zinc-550: #61616a; + --zinc-600: #52525b; + --zinc-650: #484850; + --zinc-700: #3f3f46; + --zinc-750: #333338; + --zinc-800: #27272a; + --zinc-850: #1f1f23; + --zinc-900: #18181b; + --color-primary-dark-1: #c2410c; + --color-primary-dark-2: #9a3412; + --color-primary-dark-3: #9a3412; + --color-primary-dark-4: #7c2d12; + --color-primary-dark-5: #7c2d12; + --color-primary-dark-6: #7c2d12; + --color-primary-dark-7: #7c2d12; + --color-primary-light-1: #ea580c; + --color-primary-light-2: #f97316; + --color-primary-light-3: #fb923c; + --color-primary-light-4: #fdba74; + --color-primary-light-5: #fed7aa; + --color-primary-light-6: #ffedd5; + --color-primary-light-7: #fff7ed; + --color-secondary: var(--zinc-200); + --color-secondary-dark-1: var(--zinc-200); + --color-secondary-dark-2: var(--zinc-300); + --color-secondary-dark-3: var(--zinc-300); + --color-secondary-dark-4: var(--zinc-400); + --color-secondary-dark-5: var(--zinc-400); + --color-secondary-dark-6: var(--zinc-500); + --color-secondary-dark-7: var(--zinc-500); + --color-secondary-dark-8: var(--zinc-600); + --color-secondary-dark-9: var(--zinc-600); + --color-secondary-dark-10: var(--zinc-700); + --color-secondary-dark-11: var(--zinc-700); + --color-secondary-dark-12: var(--zinc-800); + --color-secondary-dark-13: var(--zinc-800); + --color-secondary-light-1: var(--zinc-200); + --color-secondary-light-2: var(--zinc-100); + --color-secondary-light-3: var(--zinc-100); + --color-secondary-light-4: var(--zinc-50); + --color-secondary-alpha-10: #d4d4d819; + --color-secondary-alpha-20: #d4d4d833; + --color-secondary-alpha-30: #d4d4d84b; + --color-secondary-alpha-40: #d4d4d866; + --color-secondary-alpha-50: #d4d4d880; + --color-secondary-alpha-60: #d4d4d899; + --color-secondary-alpha-70: #d4d4d8b3; + --color-secondary-alpha-80: #d4d4d8cc; + --color-secondary-alpha-90: #d4d4d8e1; + --color-secondary-hover: var(--color-secondary-dark-2); + --color-secondary-active: var(--color-secondary-dark-4); + + --fonts-proportional: "Palatino Linotype", "Book Antiqua", Palatino, serif !important; + /* TODO: Get Input Sans license + --fonts-monospace: "Input Sans", Consolas, monospace !important;*/ +} + +* { + scrollbar-color: inherit; +} + +a, +.ui.breadcrumb a, +.home a { + color: var(--dark, #020202); + opacity: 0.7; + text-decoration-skip-ink: auto; + text-decoration: underline; +} + +a:hover, +.ui.breadcrumb a:hover, +.home a:hover { + opacity: 1; +} + +.home .hero .svg { + color: var(--dark, #020202); +} + +.home .hero .title { + font-size: 4em; + margin-bottom: 1em; +} + +.home .hero h2 { + font-size: 2rem; +} + +h1, h2, h3, h4, h5, h6 { + font-weight: normal; +} + +/* + * Typography + */ + +body { + font-size: 16px; + color: var(--color-primary, #020202); + background-color: var(--light, #fffff0); +} + +.ui.button { + border: 2px solid var(--color-primary); + background-color: var(--color-primary-contrast); + padding: 0.4em 1em; + cursor: pointer; +} + +.ui.button::hover { + box-shadow: 2px 2px gray; +} + +#user-heatmap { + --color-primary: #fb923c; +} diff --git a/data/gitea/public/assets/img/favicon.png b/data/gitea/public/assets/img/favicon.png new file mode 100644 index 0000000..8fafe76 Binary files /dev/null and b/data/gitea/public/assets/img/favicon.png differ diff --git a/data/gitea/public/assets/img/icon.jpg b/data/gitea/public/assets/img/icon.jpg new file mode 100644 index 0000000..0a4d9bf Binary files /dev/null and b/data/gitea/public/assets/img/icon.jpg differ diff --git a/data/gitea/templates/custom/extra_links.tmpl b/data/gitea/templates/custom/extra_links.tmpl new file mode 100644 index 0000000..5fc7845 --- /dev/null +++ b/data/gitea/templates/custom/extra_links.tmpl @@ -0,0 +1,3 @@ + + Web Site + diff --git a/data/gitea/templates/home.tmpl b/data/gitea/templates/home.tmpl new file mode 100644 index 0000000..5352409 --- /dev/null +++ b/data/gitea/templates/home.tmpl @@ -0,0 +1,17 @@ +{{template "base/head" .}} +
+
+
+
+

+ Ben Goldsworthy's Code +

+

Repositories

+

Organisations

+ +
+
+
+
+{{template "base/footer" .}} + diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..0c80bf9 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,31 @@ +services: + server: + image: codeberg.org/forgejo/forgejo:7 + container_name: forgejo + environment: + VIRTUAL_HOST: code.bengoldsworthy.net + VIRTUAL_PORT: 3000 + LETSENCRYPT_HOST: code.bengoldsworthy.net + USER_UID: 1000 + USER_GID: 1000 + restart: always + volumes: + - ./data:/data + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + ports: + - "3000:3000" + - "222:22" + expose: + - 80 + - 443 + deploy: + resources: + limits: + cpus: '0.50' + +networks: + default: + name: nginx-proxy + external: true + diff --git a/package.json b/package.json new file mode 100644 index 0000000..cdb4399 --- /dev/null +++ b/package.json @@ -0,0 +1,55 @@ +{ + "name": "code.bengoldsworthy.net", + "version": "1.0.0", + "description": "Ben Goldsworthy's personal code repository.", + "scripts": { + "deploy": "rsync -rP --delete ./data/gitea/conf ./data/gitea/public ./data/gitea/templates ovhvps:~/code/data/gitea/ && rsync -rP --delete ./docker-compose.yml ovhvps:~/code/", + "lint": "npm run lint:css", + "lint:fix": "npm run lint:css:fix", + "lint:css": "stylelint \"./gitea/gitea/public/css/*.css\" --cache --cache-location .cache/ .stylelintcache", + "lint:css:fix": "npm run lint:css -- --fix" + }, + "lint-staged": { + "*.s?[ca]ss": [ + "npm run spellcheck", + "npm run lint:css", + "git add" + ], + "*.md": [ + "npm run spellcheck", + "npm run format:md", + "npm run lint:md", + "git add" + ], + "*.html?": [ + "npm run spellcheck", + "npm run format:html", + "git add" + ], + "*.json": [ + "npm run spellcheck", + "npm run lint:json", + "git add" + ] + }, + "dependencies": { + "mathjax": "^3.2.2" + }, + "devDependencies": { + "cspell": "^7.0.0", + "eslint": "^8.45.0", + "husky": "^8.0.1", + "jsonlint": "^1.6.3", + "lint-staged": "^13.0.3", + "markdownlint": "^0.26.2", + "markdownlint-cli": "^0.35.0", + "prettier": "^2.7.1", + "sentences-per-line": "^0.2.1", + "stylelint": "^14.9.1", + "stylelint-config-prettier": "^9.0.3", + "stylelint-config-standard-scss": "^5.0.0", + "stylelint-prettier": "^2.0.0", + "stylelint-scss": "^4.3.0", + "stylelint-selector-bem-pattern": "^3.0.0" + } +}