From 9b79cab3afefb2fe6e71aea0470f2fc921ddfea5 Mon Sep 17 00:00:00 2001 From: Nemo Date: Thu, 1 Jun 2023 14:00:49 +0530 Subject: [PATCH] gitea upgrade and fixes fixes the svg favicons, but these are not nice --- gitea/conf/conf.ini.tpl | 48 ++++++++++++++++++++++++-- gitea/conf/public/img/favicon.svg | 56 +++++++++++++++++++++++++++++++ gitea/conf/public/robots.txt | 2 ++ gitea/conf/robots.txt | 2 ++ gitea/data.tf | 2 +- gitea/main.tf | 31 ++++++++++++----- 6 files changed, 130 insertions(+), 11 deletions(-) create mode 100644 gitea/conf/public/img/favicon.svg diff --git a/gitea/conf/conf.ini.tpl b/gitea/conf/conf.ini.tpl index 5cc7f0a..a7bdc3a 100644 --- a/gitea/conf/conf.ini.tpl +++ b/gitea/conf/conf.ini.tpl @@ -2,7 +2,7 @@ ; Copy required sections to your own app.ini (default is custom/conf/app.ini) ; and modify as needed. ; See the cheatsheet at https://docs.gitea.io/en-us/config-cheat-sheet/ -; A sample file with all configuration documented is at https://github.com/go-gitea/gitea/blob/master/custom/conf/app.ini.sample +; A sample file with all configuration documented is at https://github.com/go-gitea/gitea/blob/main/custom/conf/app.example.ini ; App name that shows on every page title APP_NAME = Nemo's code @@ -17,6 +17,10 @@ USE_COMPAT_SSH_URI = false TEMP_PATH = /data/gitea/uploads [ui] + +;; Number of issues that are displayed on one page +ISSUE_PAGING_NUM = 20 + ; Value of `theme-color` meta tag, used by Android >= 5.0 ; An invalid color like "none" or "disable" will have the default style ; More info: https://developers.google.com/web/updates/2014/11/Support-for-theme-color-in-Chrome-39-for-Android @@ -36,6 +40,11 @@ NOTICE_PAGING_NUM = 25 ; Number of organization that are showed in one page ORG_PAGING_NUM = 50 +;; Whether to only show relevant repos on the explore page when no keyword is specified and default sorting is used. +;; A repo is considered irrelevant if it's a fork or if it has no metadata (no description, no icon, no topic). + +ONLY_SHOW_RELEVANT_REPOS = true + [ui.user] ; Number of repos that are showed in one page REPO_PAGING_NUM = 15 @@ -53,6 +62,9 @@ ENABLE_HARD_LINE_BREAK = false CUSTOM_URL_SCHEMES = git,magnet,steam,irc,slack FILE_EXTENSIONS = .md,.markdown,.mdown,.mkd +;; Enables math inline and block detection +ENABLE_MATH = true + ; Define allowed algorithms and their minimum key length (use -1 to disable a type) [ssh.minimum_key_sizes] ED25519 = 256 @@ -99,6 +111,7 @@ SQLITE_TIMEOUT = 500 ; ITERATE_BUFFER_SIZE = 50 ; Show the database generated SQL LOG_SQL = false +SQLITE_JOURNAL_MODE = WAL [picture] AVATAR_UPLOAD_PATH = /data/gitea/avatars @@ -164,7 +177,9 @@ ENABLED = true FROM = git@captnemo.in USER = git@captnemo.in PASSWD = ${smtp_password} -HOST = smtp.migadu.com:587 +PROTOCOL = smtps +SMTP_ADDR = smtp.migadu.com +SMTP_PORT = 465 SEND_AS_PLAIN_TEXT = true SUBJECT_PREFIX = "[git.captnemo.in] " @@ -183,6 +198,11 @@ COOKIE_SECURE = true ; SameSite settings. Either "none", "lax", or "strict" SAME_SITE = strict +[migrations] +ALLOWED_DOMAINS = github.com +ALLOW_LOCALNETWORKS = false + + [attachment] ; ; Whether attachments are enabled. Defaults to `true` ENABLE = true @@ -262,3 +282,27 @@ JWT_SECRET = "${oauth2-jwt-secret}" [federation] ENABLED=false +;; Enable/Disable user statistics for nodeinfo if federation is enabled +;SHARE_USER_STATISTICS = true +;; +;; Maximum federation request and response size (MB) +;MAX_SIZE = 4 +;; +;; WARNING: Changing the settings below can break federation. +;; +;; HTTP signature algorithms +;ALGORITHMS = rsa-sha256, rsa-sha512, ed25519 +;; +;; HTTP signature digest algorithm +;DIGEST_ALGORITHM = SHA-256 +;; +;; GET headers for federation requests +;GET_HEADERS = (request-target), Date +;; +;; POST headers for federation requests +;POST_HEADERS = (request-target), Date, Digest + + +[packages] +;; Enable/Disable package registry capabilities +ENABLED = true diff --git a/gitea/conf/public/img/favicon.svg b/gitea/conf/public/img/favicon.svg new file mode 100644 index 0000000..ae76976 --- /dev/null +++ b/gitea/conf/public/img/favicon.svg @@ -0,0 +1,56 @@ + + + + + +Created by potrace 1.16, written by Peter Selinger 2001-2019 + + + + + + diff --git a/gitea/conf/public/robots.txt b/gitea/conf/public/robots.txt index ae35f66..608cea2 100644 --- a/gitea/conf/public/robots.txt +++ b/gitea/conf/public/robots.txt @@ -18,3 +18,5 @@ User-agent: Xenu’s Disallow: / User-agent: Xenu’s Link Sleuth 1.1c Disallow: / +User-agent: AhrefsBot +Disallow: / diff --git a/gitea/conf/robots.txt b/gitea/conf/robots.txt index ae35f66..608cea2 100644 --- a/gitea/conf/robots.txt +++ b/gitea/conf/robots.txt @@ -18,3 +18,5 @@ User-agent: Xenu’s Disallow: / User-agent: Xenu’s Link Sleuth 1.1c Disallow: / +User-agent: AhrefsBot +Disallow: / diff --git a/gitea/data.tf b/gitea/data.tf index de0ddcb..18314d4 100644 --- a/gitea/data.tf +++ b/gitea/data.tf @@ -1,6 +1,6 @@ # https://github.com/go-gitea/gitea/releases data "docker_registry_image" "gitea" { - name = "gitea/gitea:1.17" + name = "gitea/gitea:1.19" } data "docker_registry_image" "redis" { diff --git a/gitea/main.tf b/gitea/main.tf index ce643f5..08f3d7e 100644 --- a/gitea/main.tf +++ b/gitea/main.tf @@ -23,29 +23,44 @@ resource "docker_container" "gitea" { host_path = docker_volume.gitea_volume.mountpoint } - # Logos - # TODO: Add svg + # For the following uploads, note that + # /data/gitea is GITEA_CUSTOM_PATH + # Logos + + # https://docs.gitea.com/next/administration/customizing-gitea#changing-the-logo + # PNG images upload { content_base64 = filebase64("${path.module}/conf/public/img/gitea-lg.png") - file = "/data/gitea/public/img/gitea-lg.png" + file = "/data/gitea/public/img/logo.png" } upload { - content_base64 = filebase64("${path.module}/conf/public/img/gitea-sm.png") - file = "/data/gitea/public/img/gitea-sm.png" + content_base64 = filebase64("${path.module}/conf/public/img/gitea-lg.png") + file = "/data/gitea/public/img/apple-touch-icon.png" } upload { content_base64 = filebase64("${path.module}/conf/public/img/gitea-sm.png") file = "/data/gitea/public/img/favicon.png" - executable = false + } + + # SVG images + upload { + content_base64 = filebase64("${path.module}/conf/public/img/favicon.svg") + file = "/data/gitea/public/img/logo.svg" } + upload { + content_base64 = filebase64("${path.module}/conf/public/img/favicon.svg") + file = "/data/gitea/public/img/favicon.svg" + } + + # Some files at top-level upload { content = file("${path.module}/../docker/conf/humans.txt") - file = "/data/gitea/public/humans.txt" + file = "/data/gitea/humans.txt" } upload { content = file("${path.module}/conf/public/robots.txt") - file = "/data/gitea/public/robots.txt" + file = "/data/gitea/robots.txt" } # Extra Links in header