diff options
| -rw-r--r-- | README.md | 12 | ||||
| -rw-r--r-- | cgit/cgitrc | 5 | ||||
| -rwxr-xr-x | cgit/filters/about.sh | 35 | ||||
| -rwxr-xr-x | cgit/filters/html-transform.py | 2 | ||||
| -rw-r--r-- | cgit/static/README.md | 9 | ||||
| -rw-r--r-- | cgit/static/cgit.css | 24 | ||||
| -rw-r--r-- | justfile | 3 | ||||
| -rwxr-xr-x | setup.sh | 4 |
8 files changed, 81 insertions, 13 deletions
@@ -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 '<div class="markdown">' md2html \ --fpermissive-url-autolinks --fpermissive-www-autolinks \ @@ -21,5 +21,38 @@ to_html() { esac } +render_discussions_modal() { + cat <<'HTML' + <div class="discussions"> + <button type="button" class="discussions-trigger" command="show-modal" commandfor="discussions"> + Leave a comment + </button> + + <dialog id="discussions" class="discussions-modal"> + <button type="button" class="discussions-close" command="close" commandfor="discussions"> + Close + </button> + <div id="discussions-comment"> + <script src="https://giscus.app/client.js" + data-repo="phenax/ediblemonad.dev" + data-repo-id="MDEwOlJlcG9zaXRvcnk3NTY4OTA5MQ==" + data-category="Repo discussions" + data-category-id="DIC_kwDOBILsg84DAnGD" + data-mapping="url" + data-strict="0" + data-reactions-enabled="1" + data-emit-metadata="0" + data-input-position="bottom" + data-theme="dark" + data-lang="en" + crossorigin="anonymous" + async> + </script> + </div> + </dialog> + </div> +HTML +} + (to_html "$@" | /usr/lib/cgit/filters/ediblemonad/html-transform.py) || \ (echo "<pre>Error rendering markdown</pre>" && 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: <a href="https://github.com/phenax" target="_blank _parent" rel="noopener">https://github.com/phenax</a> +I have these mirrored on <a href="https://github.com/phenax" target="_blank _parent" rel="noopener">my github</a>. 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 <akshay.n0@protonmail.com> with the subject line `PATCH <repo name>: <patch description>`. 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; +} + @@ -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? @@ -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 |
