aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVosjedev <vosje@vosjedev.net>2025-11-02 13:57:16 +0100
committerVosjedev <vosje@vosjedev.net>2025-11-02 13:57:16 +0100
commit3a938ee61938d77c4bb9b19fcd10161c2512eeb1 (patch)
tree2d8c82fb3b59eb2c52f48ad0899fb7c4d98914d2
parentf2ebbb7e9221eceefa457961dd4b32319807d737 (diff)
downloadacit-3a938ee61938d77c4bb9b19fcd10161c2512eeb1.tar.gz
acit-3a938ee61938d77c4bb9b19fcd10161c2512eeb1.tar.bz2
acit-3a938ee61938d77c4bb9b19fcd10161c2512eeb1.tar.xz
add example project generation script
-rwxr-xr-xexample-acit-list-projects.sh36
1 files changed, 36 insertions, 0 deletions
diff --git a/example-acit-list-projects.sh b/example-acit-list-projects.sh
new file mode 100755
index 0000000..80f81d4
--- /dev/null
+++ b/example-acit-list-projects.sh
@@ -0,0 +1,36 @@
+#!/usr/bin/bash
+
+# determine our domain
+# NOTE: preferably hardcode the domain in your script, or use another env var
+domain="${ACIT_MAIL_DOMAIN:-example.com}"
+if [[ -v "ACIT_USES_ALIASES" ]]; then
+ domain="${domain#bugs.}"
+fi
+domain="git.$domain"
+
+# read project list
+while read -r name; do
+ printf "%s\thttps://%s/%s\n" "$name" "$domain" "$name"
+done <<LIST
+nocat
+acit
+work/cgit
+work/linux
+LIST
+
+:<<-DOC
+For this example we use a hardcoded list. In production you're adviced
+to use eg gitolite's project list that it exposes and cgit also reads.
+example:
+
+while read -r name; do
+ # do magic
+done </var/lib/git/projects.list
+
+Of course you may use another language than bash, as long as you output
+as a line per project, each line the projectname, a tab, the url for this
+project.
+
+DOC
+
+