summaryrefslogtreecommitdiff
path: root/hosts/denpa/cgit
diff options
context:
space:
mode:
Diffstat (limited to 'hosts/denpa/cgit')
-rw-r--r--hosts/denpa/cgit/cgitrc33
-rw-r--r--hosts/denpa/cgit/custom.css414
-rwxr-xr-xhosts/denpa/cgit/email-libravatar.py38
-rw-r--r--hosts/denpa/cgit/readme_in_summary_no_about.diff154
4 files changed, 0 insertions, 639 deletions
diff --git a/hosts/denpa/cgit/cgitrc b/hosts/denpa/cgit/cgitrc
deleted file mode 100644
index 31e23d8..0000000
--- a/hosts/denpa/cgit/cgitrc
+++ /dev/null
@@ -1,33 +0,0 @@
-enable-http-clone=0
-enable-index-owner=0
-enable-commit-graph=1
-repository-sort=age
-branch-sort=age
-
-logo=
-css=/custom.css
-
-source-filter=/usr/local/lib/cgit/filters/syntax-highlighting.py
-email-filter=/usr/local/lib/cgit/filters/email-libravatar.py
-
-remove-suffix=1
-
-virtual-root=/
-clone-url=https://git.akon.city/$CGIT_REPO_URL
-
-root-title=Akon City Software Inc.
-root-desc=
-
-snapshots=tar.gz tar.bz2 zip
-
-mimetype.gif=image/gif
-mimetype.html=text/html
-mimetype.jpg=image/jpeg
-mimetype.jpeg=image/jpeg
-mimetype.pdf=application/pdf
-mimetype.png=image/png
-mimetype.svg=image/svg+xml
-
-readme=./README.html
-
-scan-path=/mnt/git
diff --git a/hosts/denpa/cgit/custom.css b/hosts/denpa/cgit/custom.css
deleted file mode 100644
index 1f7dd9c..0000000
--- a/hosts/denpa/cgit/custom.css
+++ /dev/null
@@ -1,414 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
-
-@import url("cgit.css");
-
-/* @TODO: Create new palette type. Add/Delete/Modifiy (Green/Red/Yellow) + 2-3 Accent colors.
- * Then fill out pygments colors.
- * */
-:root {
- --background: #fdfbfc;
- --highlight1: 249, 119, 158; /* #f9779e */
- --highlight2: 132, 146, 95; /* #84925f */
- --highlight3: 238, 186, 179; /* #eebab3 */
- --highlight4: 89, 160, 254; /* #59a8fe */
- --color1: #f1f5ff;
- --color2: #e8eefc;
- --color3: #fdfbfc;
- --black: #13090c;
- --gray: 119, 119, 119; /* #777777 */
- --gray0: #393232;
- --gray1: #777;
- --gray2: #aaa;
-}
-
-div#cgit a.tag-annotated-deco {
- color: var(--black);
- margin: 0px 0.5em;
- padding: 0px 0.25em;
- border: solid 1px var(--black);
- background: linear-gradient(90deg, #eebab3 0%, #f7afab 12%, #eebab3 37%, #ffe5dc 50%, #eebab3 62%, #f7afab 79%, #eebab3 100%);
- animation: shine 3.45s infinite;
- background-size: 200%;
- background-position: left;
- background-repeat: repeat-x;
- -webkit-animation-timing-function: linear;
- -webkit-animation-duration: 3.45s;
-}
-
-div#cgit a:hover.tag-annotated-deco {
- color: var(--black) !important;
-}
-
-@keyframes shine {
- 0% {background-position:-100%;}
- 100% {background-position:100%;}
-}
-
-* {
- line-height: 1.35em;
-}
-
-body {
- background-color: var(--background);
-}
-
-h2 {
- border-bottom: 1px solid rgb(var(--gray));
-}
-
-h1, h2 {
- margin: 1.0em 0em 0.30em 0em;
-}
-
-h3, h4, h5 {
- margin: 0.8em 0em -0.10em 0em;
-}
-
-pre {
- margin: 0.50em 0em;
-}
-
-p {
- margin: 0.4em 0em;
-}
-
-a:hover {
- color: rgb(var(--highlight4)) !important;
-}
-
-ul {
- padding-left: 1.25rem;
-}
-
-p code {
- padding: 0em 0.1em;
-}
-
-.listingblock,
-code {
- font-family: monospace;
- font-size: 11pt;
- background-color: var(--color1);
- background-size: cover;
-}
-
-.listingblock {
- text-wrap: stable;
- word-break: break-all;
- display: inline-block;
- border: solid 1px var(--gray2);
- margin: 0.35em 0em;
- padding: 0em 0.4em !important;
-}
-
-div#cgit {
- margin: auto;
- font-family: monospace;
- font-size: 11pt;
- -moz-tab-size: 4;
- tab-size: 4;
- background: var(--background);
- color: var(--gray0);
-}
-
-div#cgit table.tabs {
- border-bottom: solid 2px var(--color1);
-}
-
-div#cgit table.tabs td {
- padding: 2px 0.75em;
-}
-
-div#cgit table.tabs td a {
- padding: 1px 0.75em;
- color: var(--gray1);
- font-size: 110%;
-}
-
-div#cgit table.tabs td a.active {
- color: var(--gray0);
- background: var(--color1);
- border-bottom: solid 2px var(--gray2);
-}
-
-div#cgit table#header td.main {
- font-size: 2em;
-}
-
-div#cgit table#header td.main a {
- color: var(--gray0);
-}
-
-div#cgit table#header td.sub {
- border-top: none;
-}
-
-div#cgit table#header td.sub.right {
- padding-right: 1em;
-}
-
-div#cgit div.content {
- border-bottom: none;
- padding: 0em;
-}
-
-div#cgit table.list th a {
- color: inherit;
-}
-
-div#cgit table.list tr:nth-child(even) {
- background: inherit;
-}
-
-div#cgit table.list tr:nth-child(odd) {
- background: var(--color1);
-}
-
-div#cgit table.list tr:hover {
- background: var(--color2);
-}
-
-div#cgit table.list tr.nohover {
- background: inherit;
-}
-
-div#cgit table.list tr.nohover:hover {
- background: inherit;
-}
-
-div#cgit table.list tr.nohover-highlight:hover:nth-child(even) {
- background: inherit;
-}
-
-div#cgit table.blob td.linenumbers a:target {
- color: goldenrod;
- text-decoration: underline;
- outline: none;
-}
-
-div#cgit a.deco {
- background-color: rgba(var(--highlight1), 0.65);
- border: solid 1px var(--black);
-}
-
-div#cgit a:hover.deco {
- color: var(--black) !important;
-}
-
-div#cgit a.branch-deco {
- background-color: rgba(var(--highlight2), 0.65);
- border: solid 1px var(--black);
-}
-
-div#cgit a:hover.branch-deco {
- color: var(--black) !important;
-}
-
-div#cgit div#summary {
- max-width: 90ch;
- margin: 0.5em;
- overflow-wrap: break-word;
-}
-
-div#cgit table.diffstat {
- border-collapse: collapse;
- border: solid 1px var(--gray2);
- background-color: var(--color3);
-}
-
-div#cgit table.diffstat td.graph td.add {
- background-color: rgba(var(--highlight2), 0.75);
-}
-
-div#cgit table.diffstat td.graph td.rem {
- background-color: rgba(var(--highlight1), 0.75);
-}
-
-div#cgit table.diffstat td.add a {
- color: rgba(var(--highlight2), 0.85);
-}
-
-div#cgit table.diffstat td.del a {
- color: rgba(var(--highlight1), 0.85);
-}
-
-div#cgit table.diffstat td.upd a {
- color: rgba(var(--highlight3), 0.9);
-}
-
-div#cgit table.diff td div.head {
- color: var(--gray0);
-}
-
-div#cgit table.diff td div.del {
- color: rgba(var(--highlight1), 1.0);
-}
-
-div#cgit table.diff td div.add {
- color: rgba(var(--highlight2), 1.0);
-}
-
-div#cgit table.diff td div.hunk {
- color: rgba(var(--highlight3), 0.9);
-}
-
-div#cgit div.cgit-panel table {
- border-collapse: collapse;
- border: solid 1px var(--gray2);
- background-color: var(--color3);
-}
-
-div#cgit input,
-div#cgit select {
- background-color: var(--color3);
- border: solid 1px var(--gray2);
- border-radius: 0.25em;
-}
-
-div#cgit input.txt {
- background-color: var(--color3);
-}
-
-div#cgit div.path {
- margin: 0px;
- padding: 5px 2em 2px 2em;
- color: var(--black);
- background-color: var(--background);
-}
-
-div#cgit a {
- color: rgba(var(--highlight4), 1.0);
-}
-
-div#cgit a.permalink {
- color: inherit;
-}
-
-/*
-div#cgit span.age-hours {
- color: #080;
-}
-
-div#cgit span.age-days {
- color: #040;
-}
-
-div#cgit span.age-weeks {
- color: #444;
-}
-
-div#cgit span.age-months {
- color: #888;
-}
-
-div#cgit span.age-years {
- color: #bbb;
-}
-
-div#cgit span.insertions {
- color: #080;
-}
-
-div#cgit span.deletions {
- color: #800;
-}
-*/
-
-/* https://git.zx2c4.com/cgit.css:905 */
-div#cgit span.libravatar img.onhover {
- display: none;
- border: solid 1px var(--gray2);
- padding: 0em;
- border-radius: 3px;
- width: 12em;
- height: 12em;
-}
-
-div#cgit span.libravatar img.inline {
- width: 1.5em;
- height: 1.5em;
- margin-right: 0.2em;
- border-radius: 3px;
- vertical-align: bottom;
-}
-
-div#cgit span.libravatar:hover > img.onhover {
- display: block;
- position: absolute;
- margin-left: 1.5em;
- background-color: var(--background);
- box-shadow: 0.15em 0.15em 0.4em rgba(var(--gray), 0.75);
-}
-
-pre.pygments .hll { background-color: #ffffcc }
-pre.pygments { background: #f8f8f8; }
-pre.pygments .tok-c { color: #3D7B7B; font-style: italic } /* Comment */
-pre.pygments .tok-err { border: 1px solid #FF0000 } /* Error */
-pre.pygments .tok-k { color: #008000; font-weight: bold } /* Keyword */
-pre.pygments .tok-o { color: #666666 } /* Operator */
-pre.pygments .tok-ch { color: #3D7B7B; font-style: italic } /* Comment.Hashbang */
-pre.pygments .tok-cm { color: #3D7B7B; font-style: italic } /* Comment.Multiline */
-pre.pygments .tok-cp { color: #9C6500 } /* Comment.Preproc */
-pre.pygments .tok-cpf { color: #3D7B7B; font-style: italic } /* Comment.PreprocFile */
-pre.pygments .tok-c1 { color: #3D7B7B; font-style: italic } /* Comment.Single */
-pre.pygments .tok-cs { color: #3D7B7B; font-style: italic } /* Comment.Special */
-pre.pygments .tok-gd { color: #A00000 } /* Generic.Deleted */
-pre.pygments .tok-ge { font-style: italic } /* Generic.Emph */
-pre.pygments .tok-ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */
-pre.pygments .tok-gr { color: #E40000 } /* Generic.Error */
-pre.pygments .tok-gh { color: #000080; font-weight: bold } /* Generic.Heading */
-pre.pygments .tok-gi { color: #008400 } /* Generic.Inserted */
-pre.pygments .tok-go { color: #717171 } /* Generic.Output */
-pre.pygments .tok-gp { color: #000080; font-weight: bold } /* Generic.Prompt */
-pre.pygments .tok-gs { font-weight: bold } /* Generic.Strong */
-pre.pygments .tok-gu { color: #800080; font-weight: bold } /* Generic.Subheading */
-pre.pygments .tok-gt { color: #0044DD } /* Generic.Traceback */
-pre.pygments .tok-kc { color: #008000; font-weight: bold } /* Keyword.Constant */
-pre.pygments .tok-kd { color: #008000; font-weight: bold } /* Keyword.Declaration */
-pre.pygments .tok-kn { color: #008000; font-weight: bold } /* Keyword.Namespace */
-pre.pygments .tok-kp { color: #008000 } /* Keyword.Pseudo */
-pre.pygments .tok-kr { color: #008000; font-weight: bold } /* Keyword.Reserved */
-pre.pygments .tok-kt { color: #B00040 } /* Keyword.Type */
-pre.pygments .tok-m { color: #666666 } /* Literal.Number */
-pre.pygments .tok-s { color: #BA2121 } /* Literal.String */
-pre.pygments .tok-na { color: #687822 } /* Name.Attribute */
-pre.pygments .tok-nb { color: #008000 } /* Name.Builtin */
-pre.pygments .tok-nc { color: #0000FF; font-weight: bold } /* Name.Class */
-pre.pygments .tok-no { color: #880000 } /* Name.Constant */
-pre.pygments .tok-nd { color: #AA22FF } /* Name.Decorator */
-pre.pygments .tok-ni { color: #717171; font-weight: bold } /* Name.Entity */
-pre.pygments .tok-ne { color: #CB3F38; font-weight: bold } /* Name.Exception */
-pre.pygments .tok-nf { color: #0000FF } /* Name.Function */
-pre.pygments .tok-nl { color: #767600 } /* Name.Label */
-pre.pygments .tok-nn { color: #0000FF; font-weight: bold } /* Name.Namespace */
-pre.pygments .tok-nt { color: #008000; font-weight: bold } /* Name.Tag */
-pre.pygments .tok-nv { color: #19177C } /* Name.Variable */
-pre.pygments .tok-ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
-pre.pygments .tok-w { color: #bbbbbb } /* Text.Whitespace */
-pre.pygments .tok-mb { color: #666666 } /* Literal.Number.Bin */
-pre.pygments .tok-mf { color: #666666 } /* Literal.Number.Float */
-pre.pygments .tok-mh { color: #666666 } /* Literal.Number.Hex */
-pre.pygments .tok-mi { color: #666666 } /* Literal.Number.Integer */
-pre.pygments .tok-mo { color: #666666 } /* Literal.Number.Oct */
-pre.pygments .tok-sa { color: #BA2121 } /* Literal.String.Affix */
-pre.pygments .tok-sb { color: #BA2121 } /* Literal.String.Backtick */
-pre.pygments .tok-sc { color: #BA2121 } /* Literal.String.Char */
-pre.pygments .tok-dl { color: #BA2121 } /* Literal.String.Delimiter */
-pre.pygments .tok-sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */
-pre.pygments .tok-s2 { color: #BA2121 } /* Literal.String.Double */
-pre.pygments .tok-se { color: #AA5D1F; font-weight: bold } /* Literal.String.Escape */
-pre.pygments .tok-sh { color: #BA2121 } /* Literal.String.Heredoc */
-pre.pygments .tok-si { color: #A45A77; font-weight: bold } /* Literal.String.Interpol */
-pre.pygments .tok-sx { color: #008000 } /* Literal.String.Other */
-pre.pygments .tok-sr { color: #A45A77 } /* Literal.String.Regex */
-pre.pygments .tok-s1 { color: #BA2121 } /* Literal.String.Single */
-pre.pygments .tok-ss { color: #19177C } /* Literal.String.Symbol */
-pre.pygments .tok-bp { color: #008000 } /* Name.Builtin.Pseudo */
-pre.pygments .tok-fm { color: #0000FF } /* Name.Function.Magic */
-pre.pygments .tok-vc { color: #19177C } /* Name.Variable.Class */
-pre.pygments .tok-vg { color: #19177C } /* Name.Variable.Global */
-pre.pygments .tok-vi { color: #19177C } /* Name.Variable.Instance */
-pre.pygments .tok-vm { color: #19177C } /* Name.Variable.Magic */
-pre.pygments .tok-il { color: #666666 } /* Literal.Number.Integer.Long */
diff --git a/hosts/denpa/cgit/email-libravatar.py b/hosts/denpa/cgit/email-libravatar.py
deleted file mode 100755
index 045ca17..0000000
--- a/hosts/denpa/cgit/email-libravatar.py
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/usr/bin/env python3
-
-# This script may be used with the email-filter or repo.email-filter settings in cgitrc.
-#
-# The following environment variables can be used to retrieve the configuration
-# of the repository for which this script is called:
-# CGIT_REPO_URL ( = repo.url setting )
-# CGIT_REPO_NAME ( = repo.name setting )
-# CGIT_REPO_PATH ( = repo.path setting )
-# CGIT_REPO_OWNER ( = repo.owner setting )
-# CGIT_REPO_DEFBRANCH ( = repo.defbranch setting )
-# CGIT_REPO_SECTION ( = section setting )
-# CGIT_REPO_CLONE_URL ( = repo.clone-url setting )
-#
-# It receives an email address on argv[1] and text on stdin. It prints
-# to stdout that text prepended by a gravatar at 10pt.
-
-import sys
-import hashlib
-import codecs
-
-email = sys.argv[1].lower().strip()
-if email[0] == "<":
- email = email[1:]
-if email[-1] == ">":
- email = email[0:-1]
-
-page = sys.argv[2]
-
-sys.stdin = codecs.getreader("utf-8")(sys.stdin.detach())
-sys.stdout = codecs.getwriter("utf-8")(sys.stdout.detach())
-
-md5 = hashlib.md5(email.encode()).hexdigest()
-text = sys.stdin.read().strip()
-
-baseurl = "https://seccdn.libravatar.org"
-
-print(f"<span class='libravatar'><img class='inline' src='{baseurl}/avatar/{md5}?s=32&amp;d=retro'/><img class='onhover' src='{baseurl}/avatar/{md5}?s=192&amp;d=retro'/></span>" + text)
diff --git a/hosts/denpa/cgit/readme_in_summary_no_about.diff b/hosts/denpa/cgit/readme_in_summary_no_about.diff
deleted file mode 100644
index 73267e0..0000000
--- a/hosts/denpa/cgit/readme_in_summary_no_about.diff
+++ /dev/null
@@ -1,154 +0,0 @@
-diff --git a/cmd.c b/cmd.c
-index 0eb75b1..be316f4 100644
---- a/cmd.c
-+++ b/cmd.c
-@@ -49,7 +49,7 @@ static void about_fn(void)
- cgit_redirect(redirect, true);
- free(currenturl);
- free(redirect);
-- } else if (ctx.repo->readme.nr)
-+ } else if (0)
- cgit_print_repo_readme(ctx.qry.path);
- else if (ctx.repo->homepage)
- cgit_redirect(ctx.repo->homepage, false);
-diff --git a/ui-shared.c b/ui-shared.c
-index 6fae72d..c5b609a 100644
---- a/ui-shared.c
-+++ b/ui-shared.c
-@@ -1082,7 +1082,7 @@ void cgit_print_pageheader(void)
-
- html("<table class='tabs'><tr><td>\n");
- if (ctx.env.authenticated && ctx.repo) {
-- if (ctx.repo->readme.nr)
-+ if (0)
- reporevlink("about", "about", NULL,
- hc("about"), ctx.qry.head, NULL,
- NULL);
-diff --git a/ui-summary.c b/ui-summary.c
-index 947812a..23c07aa 100644
---- a/ui-summary.c
-+++ b/ui-summary.c
-@@ -40,31 +40,6 @@ static void print_url(const char *url)
- html("</a></td></tr>\n");
- }
-
--void cgit_print_summary(void)
--{
-- int columns = 3;
--
-- if (ctx.repo->enable_log_filecount)
-- columns++;
-- if (ctx.repo->enable_log_linecount)
-- columns++;
--
-- cgit_print_layout_start();
-- html("<table summary='repository info' class='list nowrap'>");
-- cgit_print_branches(ctx.cfg.summary_branches);
-- htmlf("<tr class='nohover'><td colspan='%d'>&nbsp;</td></tr>", columns);
-- cgit_print_tags(ctx.cfg.summary_tags);
-- if (ctx.cfg.summary_log > 0) {
-- htmlf("<tr class='nohover'><td colspan='%d'>&nbsp;</td></tr>", columns);
-- cgit_print_log(ctx.qry.head, 0, ctx.cfg.summary_log, NULL,
-- NULL, NULL, 0, 0, 0);
-- }
-- urls = 0;
-- cgit_add_clone_urls(print_url);
-- html("</table>");
-- cgit_print_layout_end();
--}
--
- /* The caller must free the return value. */
- static char* append_readme_path(const char *filename, const char *ref, const char *path)
- {
-@@ -99,25 +74,11 @@ static char* append_readme_path(const char *filename, const char *ref, const cha
- return full_path;
- }
-
--void cgit_print_repo_readme(const char *path)
-+static void print_readme_file(const char *path)
- {
-- char *filename, *ref, *mimetype;
-+ char *filename, *ref;
- int free_filename = 0;
-
-- mimetype = get_mimetype_for_filename(path);
-- if (mimetype && (!strncmp(mimetype, "image/", 6) || !strncmp(mimetype, "video/", 6))) {
-- ctx.page.mimetype = mimetype;
-- ctx.page.charset = NULL;
-- cgit_print_plain();
-- free(mimetype);
-- return;
-- }
-- free(mimetype);
--
-- cgit_print_layout_start();
-- if (ctx.repo->readme.nr == 0)
-- goto done;
--
- filename = ctx.repo->readme.items[0].string;
- ref = ctx.repo->readme.items[0].util;
-
-@@ -125,7 +86,7 @@ void cgit_print_repo_readme(const char *path)
- free_filename = 1;
- filename = append_readme_path(filename, ref, path);
- if (!filename)
-- goto done;
-+ return;
- }
-
- /* Print the calculated readme, either from the git repo or from the
-@@ -142,6 +103,54 @@ void cgit_print_repo_readme(const char *path)
- html("</div>");
- if (free_filename)
- free(filename);
-+}
-+
-+void cgit_print_summary(void)
-+{
-+ int columns = 3;
-+
-+ if (ctx.repo->enable_log_filecount)
-+ columns++;
-+ if (ctx.repo->enable_log_linecount)
-+ columns++;
-+
-+ cgit_print_layout_start();
-+ html("<table summary='repository info' class='list nowrap'>");
-+ cgit_print_branches(ctx.cfg.summary_branches);
-+ htmlf("<tr class='nohover'><td colspan='%d'>&nbsp;</td></tr>", columns);
-+ cgit_print_tags(ctx.cfg.summary_tags);
-+ if (ctx.cfg.summary_log > 0) {
-+ htmlf("<tr class='nohover'><td colspan='%d'>&nbsp;</td></tr>", columns);
-+ cgit_print_log(ctx.qry.head, 0, ctx.cfg.summary_log, NULL,
-+ NULL, NULL, 0, 0, 0);
-+ }
-+ urls = 0;
-+ cgit_add_clone_urls(print_url);
-+ html("</table>");
-+ if (ctx.repo->readme.nr)
-+ print_readme_file(ctx.qry.path);
-+ cgit_print_layout_end();
-+}
-+
-+void cgit_print_repo_readme(const char *path)
-+{
-+ char *mimetype;
-+
-+ mimetype = get_mimetype_for_filename(path);
-+ if (mimetype && (!strncmp(mimetype, "image/", 6) || !strncmp(mimetype, "video/", 6))) {
-+ ctx.page.mimetype = mimetype;
-+ ctx.page.charset = NULL;
-+ cgit_print_plain();
-+ free(mimetype);
-+ return;
-+ }
-+ free(mimetype);
-+
-+ cgit_print_layout_start();
-+ if (ctx.repo->readme.nr == 0)
-+ goto done;
-+
-+ print_readme_file(path);
-
- done:
- cgit_print_layout_end();