From 4c142d2a977a2c377ea3bef30fa986010056ba3e Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Tue, 7 Jul 2026 13:04:42 +0530 Subject: Add comment modal + color changes --- README.md | 12 ++++++++++-- cgit/cgitrc | 5 +---- cgit/filters/about.sh | 35 ++++++++++++++++++++++++++++++++++- cgit/filters/html-transform.py | 2 ++ cgit/static/README.md | 9 +++++++-- cgit/static/cgit.css | 24 +++++++++++++++++++++--- justfile | 3 +++ setup.sh | 4 +++- 8 files changed, 81 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 02a6aa5..8640f80 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ `just upload` #### Server setup -`just setup setup` +`just setup configure && just setup enable_firewall` #### Run core services `just setup core up -d` @@ -24,6 +24,14 @@ #### Update `just setup update` -#### Local stuff for the above +#### Local stuff for the above (same stuff running locally for testing) `just local-setup ...` + +## Tasks +- [ ] Anubis +- [ ] add toc links for readme headers +- [ ] Back up cmd (+ periodic pulls?) +- [ ] Add health checks +- [ ] Add safe service restart +- [ ] auth/private repos (https://github.com/zx2c4/cgit/blob/master/filters/simple-authentication.lua) diff --git a/cgit/cgitrc b/cgit/cgitrc index d4297f5..bed7047 100644 --- a/cgit/cgitrc +++ b/cgit/cgitrc @@ -1,5 +1,5 @@ root-title=Akshay's git repos -root-desc=this is where my cooler projects live +root-desc=this is where my projects live root-readme=/usr/share/webapps/cgit/ediblemonad/README.md # Theme @@ -9,9 +9,6 @@ favicon=/favicon.ico head-include=/usr/share/webapps/cgit/ediblemonad/header.html footer=/usr/share/webapps/cgit/ediblemonad/footer.html -# TODO: submodule links -# module-link=/cgit/submodule/%s/commit?id=%s - source-filter=/usr/lib/cgit/filters/syntax-highlighting.py about-filter=/usr/lib/cgit/filters/ediblemonad/about.sh diff --git a/cgit/filters/about.sh b/cgit/filters/about.sh index 9455ce7..f1c660b 100755 --- a/cgit/filters/about.sh +++ b/cgit/filters/about.sh @@ -3,8 +3,8 @@ set -eu -# TODO: Add toc links for headers in markdown md_to_html() { + render_discussions_modal echo '
' md2html \ --fpermissive-url-autolinks --fpermissive-www-autolinks \ @@ -21,5 +21,38 @@ to_html() { esac } +render_discussions_modal() { + cat <<'HTML' +
+ + + + +
+ +
+
+
+HTML +} + (to_html "$@" | /usr/lib/cgit/filters/ediblemonad/html-transform.py) || \ (echo "
Error rendering markdown
" && cat) diff --git a/cgit/filters/html-transform.py b/cgit/filters/html-transform.py index 51b3538..4579ee0 100755 --- a/cgit/filters/html-transform.py +++ b/cgit/filters/html-transform.py @@ -1,6 +1,8 @@ #!/usr/bin/env python3 # Rewrite image urls in about section +# TODO: Add toc links for headers in markdown + import sys from html.parser import HTMLParser import html diff --git a/cgit/static/README.md b/cgit/static/README.md index 895f456..ab53933 100644 --- a/cgit/static/README.md +++ b/cgit/static/README.md @@ -1,5 +1,10 @@ # Hey! -I keep my projects here. +You can find my projects here. -Also have these mirrored on github with some more things: https://github.com/phenax +I have these mirrored on my github. I also write about things I find interesting [here](https://ediblemonad.dev). + + +### Contributing + +If you'd like to contribute to any of the repositories hosted here, you can email a patch to with the subject line `PATCH : `. diff --git a/cgit/static/cgit.css b/cgit/static/cgit.css index 2fa54e2..6a3040a 100644 --- a/cgit/static/cgit.css +++ b/cgit/static/cgit.css @@ -2,9 +2,9 @@ html, body { background-color: black; line-height: 1.6; font-size: 18px; - --color-accent: #00a0a0; - --color-accent-1: #009090; - --color-accent-2: #007070; + --color-accent: #61f9b0; + --color-accent-1: #51e9a0; + --color-accent-2: #31c980; } input[type=search], input[type=text], select { @@ -1108,3 +1108,21 @@ div#cgit table.ssdiff td.space div { background-color: transparent; } +.discussions { + text-align: right; +} +.discussions-modal { + text-align: left; + background-color: black; + border: 2px solid #222; + box-shadow: 0 0 20px 10px rgb(255, 255, 255, 0.1); + max-width: 800px; + width: 100%; +} +.discussions-modal::backdrop { + background-color: rgb(0,0,0,0.6); +} +.discussions-close { + float: right; +} + diff --git a/justfile b/justfile index 312bf01..a1abce4 100644 --- a/justfile +++ b/justfile @@ -26,3 +26,6 @@ local-setup *args: GIT_REPOS_ROOT="$HOME/dev/projects" \ SEND_UPLOADS_ROOT="$PWD/tmp/uploads" SEND_USER="$(id -u):$(id -g)" \ ./setup.sh "$@" + +# TODO: pull /git for backup +# TODO: Add service on home server to backup automatically? diff --git a/setup.sh b/setup.sh index 3e39d40..7c7a9f4 100755 --- a/setup.sh +++ b/setup.sh @@ -64,6 +64,8 @@ configure_firewall() { ufw limit 22/tcp } +enable_firewall() { ufw enable; } + configure_user() { echo "== User ==" mkdir -p /home/git @@ -88,7 +90,7 @@ update() { cmd="$1"; shift; case "$cmd" in - update|start|startfg|stop|services|core|cache_clear) "$cmd" "$@" ;; + update|start|startfg|stop|services|core|cache_clear|enable_firewall) "$cmd" "$@" ;; configure|configure_firewall|configure_user|configure_fs|configure_packages|configure_git) "$cmd" "$@" ;; *) echo "Invalid command: $cmd"; exit 1 ;; esac -- cgit v1.3.1