From 066327db639890abb4c6598b00b7751471836a5e Mon Sep 17 00:00:00 2001 From: Tolmachev Igor Date: Thu, 8 Jan 2026 03:01:07 +0900 Subject: Add examples --- examples/git.igorek.dev/README.md | 36 +++++++++ examples/git.igorek.dev/about/root.html | 1 + examples/git.igorek.dev/colors.css | 121 +++++++++++++++++++++++++++++ examples/git.igorek.dev/compose.yaml | 16 ++++ examples/git.igorek.dev/etc/cgitrc | 20 +++++ examples/git.igorek.dev/etc/repos | 4 + examples/git.igorek.dev/static/favicon.ico | Bin 0 -> 17014 bytes examples/git.igorek.dev/static/image.svg | 86 ++++++++++++++++++++ 8 files changed, 284 insertions(+) create mode 100644 examples/git.igorek.dev/README.md create mode 100644 examples/git.igorek.dev/about/root.html create mode 100644 examples/git.igorek.dev/colors.css create mode 100644 examples/git.igorek.dev/compose.yaml create mode 100644 examples/git.igorek.dev/etc/cgitrc create mode 100644 examples/git.igorek.dev/etc/repos create mode 100644 examples/git.igorek.dev/static/favicon.ico create mode 100644 examples/git.igorek.dev/static/image.svg diff --git a/examples/git.igorek.dev/README.md b/examples/git.igorek.dev/README.md new file mode 100644 index 0000000..d048150 --- /dev/null +++ b/examples/git.igorek.dev/README.md @@ -0,0 +1,36 @@ +# How to setup + +## Create git user + +Create a `git` user in the /repo folder + +```sh +sudo useradd --home-dir $PWD/repos/ git +sudo mkdir repos/ +sudo chown -R git:git repos/ +``` + +## Create some repos + +```sh +sudo su - git +git init --bare test +exit +``` + +## Edit a repos config file + +Put something like that into `./etc/repos` file + +```txt +repo.url=test +repo.path=/app/repos/test +repo.desc=The test repository +repo.readme=:README.md +``` + +## Run the docker image + +```ssh +docker compose --up -d +``` diff --git a/examples/git.igorek.dev/about/root.html b/examples/git.igorek.dev/about/root.html new file mode 100644 index 0000000..1e20823 --- /dev/null +++ b/examples/git.igorek.dev/about/root.html @@ -0,0 +1 @@ +

Git storage

diff --git a/examples/git.igorek.dev/colors.css b/examples/git.igorek.dev/colors.css new file mode 100644 index 0000000..03e15b0 --- /dev/null +++ b/examples/git.igorek.dev/colors.css @@ -0,0 +1,121 @@ +@media (prefers-color-scheme: dark) { + :root { + --color-primary: rgb(131 210 228); + --color-surface-tint: rgb(131 210 228); + --color-on-primary: rgb(0 54 63); + --color-primary-container: rgb(0 78 90); + --color-on-primary-container: rgb(164 238 255); + --color-secondary: rgb(178 203 209); + --color-on-secondary: rgb(28 52 57); + --color-secondary-container: rgb(51 74 80); + --color-on-secondary-container: rgb(205 231 237); + --color-tertiary: rgb(189 197 235); + --color-on-tertiary: rgb(38 47 77); + --color-tertiary-container: rgb(61 69 101); + --color-on-tertiary-container: rgb(220 225 255); + --color-error: rgb(255 180 171); + --color-on-error: rgb(105 0 5); + --color-error-container: rgb(147 0 10); + --color-on-error-container: rgb(255 218 214); + --color-background: rgb(14 20 22); + --color-on-background: rgb(222 227 229); + --color-surface: rgb(14 20 22); + --color-on-surface: rgb(222 227 229); + --color-surface-variant: rgb(63 72 75); + --color-on-surface-variant: rgb(191 200 203); + --color-outline: rgb(137 146 149); + --color-outline-variant: rgb(63 72 75); + --color-shadow: rgb(0 0 0); + --color-scrim: rgb(0 0 0); + --color-inverse-surface: rgb(222 227 229); + --color-inverse-on-surface: rgb(43 49 51); + --color-inverse-primary: rgb(0 104 119); + --color-primary-fixed: rgb(164 238 255); + --color-on-primary-fixed: rgb(0 31 37); + --color-primary-fixed-dim: rgb(131 210 228); + --color-on-primary-fixed-variant: rgb(0 78 90); + --color-secondary-fixed: rgb(205 231 237); + --color-on-secondary-fixed: rgb(5 31 36); + --color-secondary-fixed-dim: rgb(178 203 209); + --color-on-secondary-fixed-variant: rgb(51 74 80); + --color-tertiary-fixed: rgb(220 225 255); + --color-on-tertiary-fixed: rgb(17 26 55); + --color-tertiary-fixed-dim: rgb(189 197 235); + --color-on-tertiary-fixed-variant: rgb(61 69 101); + --color-surface-dim: rgb(14 20 22); + --color-surface-bright: rgb(52 58 60); + --color-surface-container-lowest: rgb(9 15 17); + --color-surface-container-low: rgb(23 29 30); + --color-surface-container: rgb(27 33 34); + --color-surface-container-high: rgb(37 43 44); + --color-surface-container-highest: rgb(48 54 55); + + color-scheme: dark; + } +} + +@media (prefers-color-scheme: light) { + :root { + --color-primary: rgb(0 104 119); + --color-surface-tint: rgb(0 104 119); + --color-on-primary: rgb(255 255 255); + --color-primary-container: rgb(164 238 255); + --color-on-primary-container: rgb(0 78 90); + --color-secondary: rgb(75 98 104); + --color-on-secondary: rgb(255 255 255); + --color-secondary-container: rgb(205 231 237); + --color-on-secondary-container: rgb(51 74 80); + --color-tertiary: rgb(84 93 126); + --color-on-tertiary: rgb(255 255 255); + --color-tertiary-container: rgb(220 225 255); + --color-on-tertiary-container: rgb(61 69 101); + --color-error: rgb(186 26 26); + --color-on-error: rgb(255 255 255); + --color-error-container: rgb(255 218 214); + --color-on-error-container: rgb(147 0 10); + --color-background: rgb(245 250 252); + --color-on-background: rgb(23 29 30); + --color-surface: rgb(245 250 252); + --color-on-surface: rgb(23 29 30); + --color-surface-variant: rgb(219 228 231); + --color-on-surface-variant: rgb(63 72 75); + --color-outline: rgb(111 121 123); + --color-outline-variant: rgb(191 200 203); + --color-shadow: rgb(0 0 0); + --color-scrim: rgb(0 0 0); + --color-inverse-surface: rgb(43 49 51); + --color-inverse-on-surface: rgb(236 242 243); + --color-inverse-primary: rgb(131 210 228); + --color-primary-fixed: rgb(164 238 255); + --color-on-primary-fixed: rgb(0 31 37); + --color-primary-fixed-dim: rgb(131 210 228); + --color-on-primary-fixed-variant: rgb(0 78 90); + --color-secondary-fixed: rgb(205 231 237); + --color-on-secondary-fixed: rgb(5 31 36); + --color-secondary-fixed-dim: rgb(178 203 209); + --color-on-secondary-fixed-variant: rgb(51 74 80); + --color-tertiary-fixed: rgb(220 225 255); + --color-on-tertiary-fixed: rgb(17 26 55); + --color-tertiary-fixed-dim: rgb(189 197 235); + --color-on-tertiary-fixed-variant: rgb(61 69 101); + --color-surface-dim: rgb(213 219 221); + --color-surface-bright: rgb(245 250 252); + --color-surface-container-lowest: rgb(255 255 255); + --color-surface-container-low: rgb(239 244 246); + --color-surface-container: rgb(233 239 240); + --color-surface-container-high: rgb(227 233 235); + --color-surface-container-highest: rgb(222 227 229); + + color-scheme: light; + } +} + +/* Custom logic for diffs */ +:root { + --diff-add-bg: var(--color-tertiary-container); + --diff-add-fg: var(--color-on-tertiary-container); + --diff-del-bg: var(--color-error-container); + --diff-del-fg: var(--color-on-error-container); + --diff-changed-bg: var(--color-primary-container); + --diff-changed-fg: var(--color-on-primary-container); +} diff --git a/examples/git.igorek.dev/compose.yaml b/examples/git.igorek.dev/compose.yaml new file mode 100644 index 0000000..5bd5fba --- /dev/null +++ b/examples/git.igorek.dev/compose.yaml @@ -0,0 +1,16 @@ +services: + cgit: + image: igorechek06/cgit-material + restart: on-failure + + ports: + - 8888:80 + + volumes: + - ./repos/:/app/repos/ + - ./static/:/app/www/static/ + - ./about/:/app/about/ + - ./etc/:/app/etc/ + + # bind custom colors + - ./colors.css:/app/www/css/colors.css diff --git a/examples/git.igorek.dev/etc/cgitrc b/examples/git.igorek.dev/etc/cgitrc new file mode 100644 index 0000000..545a346 --- /dev/null +++ b/examples/git.igorek.dev/etc/cgitrc @@ -0,0 +1,20 @@ +root-title=git.igorek.dev +root-desc=Git repositories hosted at igorek.dev +root-readme=/app/about/root.html + +favicon=/static/favicon.ico +logo=/static/image.svg + +clone-url=https://git.igorek.dev/$CGIT_REPO_URL + +summary-branches=3 +summary-log=3 +summary-tags=3 +enable-log-filecount=1 +enable-log-linecount=1 +enable-commit-graph=1 +enable-http-clone=1 +side-by-side-diffs=1 +snapshots=tar.gz zip + +include=/app/etc/repos diff --git a/examples/git.igorek.dev/etc/repos b/examples/git.igorek.dev/etc/repos new file mode 100644 index 0000000..66a5ac2 --- /dev/null +++ b/examples/git.igorek.dev/etc/repos @@ -0,0 +1,4 @@ +repo.url=test +repo.path=/app/repos/test +repo.desc=The test repository +repo.readme=:README.md diff --git a/examples/git.igorek.dev/static/favicon.ico b/examples/git.igorek.dev/static/favicon.ico new file mode 100644 index 0000000..a69271a Binary files /dev/null and b/examples/git.igorek.dev/static/favicon.ico differ diff --git a/examples/git.igorek.dev/static/image.svg b/examples/git.igorek.dev/static/image.svg new file mode 100644 index 0000000..70001b0 --- /dev/null +++ b/examples/git.igorek.dev/static/image.svg @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + ~/i + + -- cgit v1.2.3