summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorXiao Pan <xyz@flylightning.xyz>2025-07-10 08:08:59 +0000
committerXiao Pan <xyz@flylightning.xyz>2025-07-10 08:08:59 +0000
commit5abb40c5be90e5257cdfae51c165f00c5398f32c (patch)
tree40a115444d89d6f6c82b854c185790686d0bdb95 /etc
parent673c18cbf2c80de0aa5aa03b24cd026cf742412b (diff)
starting to move studio website to ca, now moving configs
Diffstat (limited to 'etc')
-rw-r--r--etc/cgitrc111
-rw-r--r--etc/highlight/filetypes.conf185
-rw-r--r--etc/nginx/nginx.conf190
-rw-r--r--etc/pacman.d/hooks/highlight-css.hook13
l---------etc/systemd/system/sockets.target.wants/uwsgi@cgit.socket1
-rw-r--r--etc/uwsgi/cgit.ini14
6 files changed, 514 insertions, 0 deletions
diff --git a/etc/cgitrc b/etc/cgitrc
new file mode 100644
index 00000000..df30d0a6
--- /dev/null
+++ b/etc/cgitrc
@@ -0,0 +1,111 @@
+# https://wiki.archlinux.org/title/Cgit#Configuration_of_cgit
+# https://wiki.gentoo.org/wiki/User:Halcon/HOWTO_cgit_uwsgi_nginx
+# `man cgitrc`
+
+cache-size=1000
+enable-index-owner=0
+mimetype-file=/etc/mime.types
+# https://stackoverflow.com/questions/16182421/cgit-and-nginx-url-rewrite
+virtual-root=/
+
+# useful but may makes page generation slow, maybe disable
+# can see the log via `journalctl -b -u uwsgi@cgit` and search less pager with sth. like `/[0-9]{3} msecs`
+#enable-blame=1
+#enable-log-filecount=1
+#enable-log-linecount=1
+# showing branch merge, ex: https://git.flylightning.xyz/dwm_fly/log/?h=fly
+#enable-commit-graph=1
+
+# not very useful, maybe disable
+#enable-follow-links=1
+#enable-subject-links=1
+
+# `man cgitrc` uses $CGIT_REPO_URL instead of $CGIT_REPO_NAME, I guess maybe because repo name can be different from repo url?
+clone-url=https://$HTTP_HOST/$CGIT_REPO_URL https://codeberg.org/flyxyz123/$CGIT_REPO_URL
+# $HTTP_HOST not working for clone-prefix, not sure why, therefore I prefer clone-url over clone-prefix
+#clone-prefix=https://git.flylightning.xyz/ https://codeberg.org/flyxyz123/
+
+source-filter=/usr/lib/cgit/filters/syntax-highlighting-edited.sh
+css=/mycgit.css
+
+about-filter=/usr/lib/cgit/filters/about-formatting-edited.sh
+#readme=:README.markdown
+#readme=:readme.markdown
+#readme=:README.mdown
+#readme=:readme.mdown
+readme=:README.md
+#readme=:readme.md
+#readme=:README.mkd
+#readme=:readme.mkd
+#readme=:README.rst
+#readme=:readme.rst
+#readme=:README.html
+#readme=:readme.html
+#readme=:README.htm
+#readme=:readme.htm
+#readme=:README.txt
+#readme=:readme.txt
+readme=:README
+#readme=:readme
+#readme=:INSTALL.markdown
+#readme=:install.markdown
+#readme=:INSTALL.mdown
+#readme=:install.mdown
+#readme=:INSTALL.md
+#readme=:install.md
+#readme=:INSTALL.mkd
+#readme=:install.mkd
+#readme=:INSTALL.rst
+#readme=:install.rst
+#readme=:INSTALL.html
+#readme=:install.html
+#readme=:INSTALL.htm
+#readme=:install.htm
+#readme=:INSTALL.txt
+#readme=:install.txt
+#readme=:INSTALL
+#readme=:install
+
+root-title=flylightning.xyz git repositories
+root-desc=
+
+repo.url=config_local_arch
+repo.path=/var/lib/gitolite/repositories/config_local_arch.git
+repo.desc=Device dependent config files for Arch Linux, managed by https://git.flylightning.xyz/fsh/tree/sh/cfg (git bare repo method)
+
+repo.url=xcross
+repo.path=/var/lib/gitolite/repositories/xcross.git
+repo.desc=X11 draw a cross at cursor across screen
+
+repo.url=public_archive_codes
+repo.path=/var/lib/gitolite/repositories/public_archive_codes.git
+repo.desc=My mostly not used, not maintained, archived codes/configs
+
+repo.url=fly
+repo.path=/var/lib/gitolite/repositories/fly.git
+repo.desc=Arch Linux custom local repository
+
+repo.url=aur
+repo.path=/var/lib/gitolite/repositories/aur.git
+repo.desc=PKGBUILDs I maintain for AUR
+
+repo.url=fsh
+repo.path=/var/lib/gitolite/repositories/fsh.git
+repo.desc=My shell utilities
+
+section=Archived. Have license issues.
+
+repo.url=remote_plot
+repo.path=/var/lib/gitolite/repositories/remote_plot.git
+repo.desc=Archived. Has license issues. Plot on GUI a remote file updating using https://git.flylightning.xyz/mycan
+
+repo.url=mycan
+repo.path=/var/lib/gitolite/repositories/mycan.git
+repo.desc=Archived. Has license issues. Read CAN and write to a file.
+
+section=forks
+
+repo.url=dwm_fly
+repo.path=/var/lib/gitolite/repositories/dwm_fly.git
+repo.desc=My fork of https://git.suckless.org/dwm
+#repo.readme=:dwm.1
diff --git a/etc/highlight/filetypes.conf b/etc/highlight/filetypes.conf
new file mode 100644
index 00000000..5028b5c3
--- /dev/null
+++ b/etc/highlight/filetypes.conf
@@ -0,0 +1,185 @@
+-- Filename and shebang mapping
+--
+-- Add an entry for a language syntax which is occupied by multiple source file extensions.
+-- If there is only one extension, just name the lang file accordingly and it will work (no entry needed here).
+-- The filetype entries in gui_files/ext/fileopenfilter.conf should also be updated for the GUI file dialogs.
+--
+-- Extensions can be configured for multiple languages (see "asm", which is assigned to assembler and fasm).
+-- The command line (CLI) and Qt GUI builds handle ambiguous assignments as follows:
+-- - CLI: the first association listed here will be used
+-- - GUI: a syntax selection prompt will be shown
+--
+-- If a filename has no extension by convention (ie. makefile), it may be added here nevertheless or be
+-- configured as "Shebang".
+--
+-- You can assign complete filenames to a syntax with "Filenames", see the "cmake" entry.
+-- To define both filenames and extensions, add two separate entries (see "sh" entry).
+--
+-- A default input encoding can be set with an EncodingHint attribute (requires v. 3.55).
+--
+-- The first filetypes.conf found in a highlight search directory wins. See README.adoc for search dirs.
+--
+-- You can override specific settings in ~/.highlight/filetypes.conf like this:
+--
+-- dofile "/etc/highlight/filetypes.conf"
+--
+-- table.insert(FileMapping, { Lang="yourlang", Shebang=[[^#!\s*(/usr)?(/local)?/bin/(env\s+)?yourlang]] })
+
+FileMapping = {
+
+ { Lang="abap", Extensions={"abp"} },
+ { Lang="ada", Extensions={"adb", "ads", "a", "gnad"} },
+ { Lang="agda", Extensions={"lagda"} },
+ { Lang="alan", Extensions={"alan", "i"} },
+ { Lang="algol", Extensions={"alg"} },
+ { Lang="ampl", Extensions={"dat", "run"} },
+ { Lang="amtrix", Extensions={"s4", "s4t", "s4h", "hnd", "t4"} },
+ { Lang="assembler", Extensions={"asm", "a51", "29k", "68s", "68x", "x86"} },
+ { Lang="fasm", Extensions={"asm", "inc"} },
+ { Lang="asp", Extensions={"aspx", "ashx", "ascx"} },
+ { Lang="ats", Extensions={"dats"} },
+ { Lang="aspect", Extensions={"was", "wud"} },
+ { Lang="ballerina", Extensions={"bal"} },
+ { Lang="bat", Extensions={"cmd"} },
+ { Lang="c", Extensions={"c++", "cpp", "cxx", "cc", "h", "hh", "hxx", "hpp", "cu", "inl", "ipp", "ino", "ixx", "cppm"} },
+ { Lang="cmake", Filenames={"CMakeLists.txt"} },
+ { Lang="charmm", Extensions={"inp"} },
+ { Lang="clojure", Extensions={"boot", "cl2", "clj", "cljscm", "cljx", "hic"} },
+ { Lang="coldfusion", Extensions={"cfc","cfm"} },
+ { Lang="cobol", Extensions={"cob", "cbl"} },
+ { Lang="crystal", Extensions={"cr"} },
+ { Lang="coffeescript", Extensions={"coffee", "cakefile", "cjsx", "coffee", "iced"} },
+ { Lang="conf", Extensions={"anacrontab"} },
+ { Lang="delphi", Extensions={"pas", "dpr"} },
+ { Lang="diff", Extensions={"patch"} },
+ { Lang="dts", Extensions={"dtsi"} },
+ { Lang="eiffel", Extensions={"e", "se"} },
+ { Lang="elixir", Extensions={"ex", "exs", "heex"} },
+ { Lang="erlang", Extensions={"hrl", "erl", "xrl", "yrl"} },
+ { Lang="euphoria", Extensions={"ex", "exw", "wxu", "ew", "eu"} },
+ { Lang="fortran77", Extensions={"f", "for", "ftn"} },
+ { Lang="fortran90", Extensions={"f95", "f90"} },
+ { Lang="gambas", Extensions={"class"} },
+ { Lang="gdscript", Extensions={"gd"} },
+ { Lang="haskell", Extensions={"hs"} },
+ { Lang="hugo", Extensions={"hug"} },
+ { Lang="ini", Extensions={"doxyfile", "desktop", "kdev3", "reg", "cfg", "inf", "config", ".gitconfig", "service", "network"} },
+ { Lang="jam", Extensions={"jam", "ham"} },
+ { Lang="java", Extensions={"groovy", "grv", "jenkinsfile", "gradle"} },
+ { Lang="javascript", Extensions={"js"} },
+ { Lang="julia", Extensions={"jl"} },
+ { Lang="kotlin", Extensions={"kt", "kts"} },
+ { Lang="limbo", Extensions={"b"} },
+ { Lang="lisp", Extensions={"cl", "clisp", "el", "lsp", "sbcl", "scom", "fas", "scm", "mud", "fasl" } },
+ { Lang="makefile", Extensions={"mak", "mk", "gnumakefile"} },
+ { Lang="meson", Filenames={ "meson.build", "meson_options.txt" } },
+ { Lang="snmp", Extensions={"mib", "smi"} },
+ { Lang="ocaml", Extensions={"ml","mli", "eliom", "eliomi", "ml4", "mll", "mly"} },
+ { Lang="mod2", Extensions={"mod", "def"} },
+ { Lang="mod3", Extensions={"m3", "i3"} },
+ { Lang="oberon", Extensions={"ooc"} },
+ { Lang="php", Extensions={"php3", "php4", "php5", "php6", "php7", "phps", "phpt"} },
+ { Lang="pike", Extensions={"pmod"} },
+ { Lang="pl1", Extensions={"ff", "fp", "fpp", "rpp","sf", "sp", "spb",
+ "spp","sps", "wp", "wf", "wpp","wps","wpb","bdy","spe"} },
+ { Lang="perl", Extensions={"pl","perl", "cgi", "pm", "plx", "plex"} },
+ { Lang="polygen", Extensions={"grm"} },
+ { Lang="pro", Extensions={"pro"} },
+ { Lang="qmake", Extensions={"pro"} },
+ { Lang="progress", Extensions={"p", "i", "w"} },
+ { Lang="purescript", Extensions={"purs"} },
+ { Lang="ruby", Extensions={"rb","ruby", "pp", "rjs", "gemfile", "rakefile", "appfile", "appraisals", "berksfile",
+ "brewfile", "capfile", "cgi", "cheffile", "config.ru", "deliverfile", "fastfile", "fcgi", "gemspec",
+ "guardfile", "irbrc", "jbuilder", "podfile", "podspec", "prawn", "rabl", "rake", "rantfile", "rbx",
+ "scanfile", "simplecov", "snapfile", "thor", "thorfile", "vagrantfile" } },
+ { Lang="rexx", Extensions={"rex", "rx", "the"} },
+ { Lang="shellscript", Filenames={".zshrc", ".bashrc"} },
+ { Lang="shellscript", Extensions={"sh", "bash", "zsh", "ebuild", "eclass"} },
+ { Lang="smalltalk", Extensions={"st", "gst", "sq"} },
+ { Lang="sybase", Extensions={"sp"} },
+ { Lang="tcl", Extensions={"wish", "itcl"} },
+ { Lang="tcsh", Extensions={"csh", "tcsh", ".cshrc", ".tcshrc"} },
+ { Lang="terraform", Extensions={"tf", "tfvars"} },
+ { Lang="tex", Extensions={"sty", "cls"} },
+ { Lang="vb", Extensions={"bas", "basic", "bi", "vbs"} },
+ { Lang="verilog", Extensions={"v"} },
+ { Lang="html", Extensions={"htm", "xhtml", "twig", "jinja"} },
+ { Lang="xml", Extensions={"sgm", "sgml", "nrm", "ent","hdr", "hub", "dtd", "glade",
+ "wml","vxml", "wml", "tld", "csproj","xsl", "ecf", "jnlp", "xsd",
+ "resx", "rng", "rss", "opml", "graphml"} },
+ { Lang="fsharp", Extensions={"fs","fsi","fsx"} },
+ { Lang="informix", Extensions={"4gl"} },
+ { Lang="blitzbasic", Extensions={"bb"} },
+ { Lang="innosetup", Extensions={"iss"} },
+ { Lang="lotus", Extensions={"ls"} },
+ { Lang="ascend", Extensions={"a4c"} },
+ { Lang="actionscript", Extensions={"as"} },
+ { Lang="express", Extensions={"exp"} },
+ { Lang="hare", Extensions={"ha"} },
+ { Lang="haxe", Extensions={"hx"} },
+ { Lang="pyrex", Extensions={"pyx"} },
+
+ { Lang="abap4", Extensions={"abp"} },
+ { Lang="csharp", Extensions={"cs"} },
+ { Lang="interlis", Extensions={"ili"} },
+ { Lang="logtalk", Extensions={"lgt"} },
+ { Lang="matlab", Extensions={"m"} },
+ { Lang="nsis", Extensions={"nsi", "nsh"} },
+ { Lang="bison", Extensions={"y"} },
+ { Lang="squirrel", Extensions={"nut"} },
+ { Lang="luban", Extensions={"lbn"} },
+ { Lang="maya", Extensions={"mel"} },
+ { Lang="nemerle", Extensions={"n"} },
+ { Lang="nim", Extensions={"nimble", "nimrod", "nims"} },
+ { Lang="paradox", Extensions={"sc"} },
+ { Lang="netrexx", Extensions={"nrx"} },
+ { Lang="clearbasic", Extensions={"cb"} },
+ { Lang="graphviz", Extensions={"dot"} },
+ { Lang="small", Extensions={"sma"} },
+ { Lang="autoit", Extensions={"au3"} },
+ { Lang="chill", Extensions={"chl"} },
+ { Lang="autohotkey", Extensions={"ahk"} },
+ { Lang="fame", Extensions={"fame"} },
+ { Lang="modelica", Extensions={"mo"} },
+ { Lang="maple", Extensions={"mpl"} },
+ { Lang="jasmin", Extensions={"j"} },
+ { Lang="snobol", Extensions={"sno"} },
+ { Lang="icon", Extensions={"icn"} },
+ { Lang="felix", Extensions={"flx"} },
+ { Lang="lindenscript", Extensions={"lsl"} },
+ { Lang="lilypond", Extensions={"ly"} },
+ { Lang="nasal", Extensions={"nas"} },
+ { Lang="clean", Extensions={"icl"} },
+ { Lang="bibtex", Extensions={"bib"} },
+ { Lang="python", Extensions={"py", "py3", "pyw", "pyi", "pyx", "pxd", "pxi", "rpy", "cpy",
+ "sconstruct", "gyp", "gypi", "snakefile", "wscript" } },
+ { Lang="python", Filenames={"SConstruct"} },
+ { Lang="rust", Extensions={"rs"} },
+
+ { Lang="txt", Extensions={"text"} },
+ { Lang="n3", Extensions={"ttl", "nt"} },
+ { Lang="biferno", Extensions={"bfr"} },
+ { Lang="scilab", Extensions={"sci", "sce"} },
+ { Lang="msl", Extensions={"nbs"} },
+ { Lang="yaml", Extensions={"yml"} },
+ { Lang="vimscript", Extensions={"vim", "vimrc", "gvimrc"} },
+ { Lang="purebasic", Extensions={"pb", "pbi", "pbf"} },
+ { Lang="markdown", Extensions={"md", "markdown", "mdwn", "mdx", "mkd", "mkdn", "mkdown", "ronn", "workbook"} },
+ { Lang="clojure", Extensions={"clj", "cljc", "cljs", "edn"} },
+ { Lang="solidity", Extensions={"sol"} },
+ { Lang="powershell", Extensions={"ps1", "psm1", "psd1"} },
+ { Lang="typescript", Extensions={"ts"} },
+
+ { Lang="exapunks", Extensions={"exapunks", "exa"} },
+ { Lang="exapunks", Shebang=[[^(?i:NOTE\sEXAPUNKS)\b]] },
+
+ { Lang="xml", Shebang=[[^\s*<\?xml\s+version=\"1\.0\"\s+[^(>)]*?>\s*$]] },
+ { Lang="shellscript", Shebang=[[^#!\s*(/usr)?(/local)?/bin/(env\s+)?([bd]ash|t?csh|[akz]?sh)]] },
+ { Lang="makefile",Shebang=[[^#!\s*(/usr)?(/local)?/bin/(env\s+)?make]] },
+ { Lang="awk", Shebang=[[^#!\s*(/usr)?(/local)?/bin/(env\s+)?[gnm]?awk]] },
+ { Lang="perl", Shebang=[[^#!\s*(/usr)?(/local)?/bin/(env\s+)?perl]] },
+ { Lang="python", Shebang=[[^#!\s*(/usr)?(/local)?/bin/(env\s+)?python]] },
+ { Lang="ruby", Shebang=[[^#!\s*(/usr)?(/local)?/bin/(env\s+)?ruby]] },
+ { Lang="php", Shebang=[[^#!\s*(/usr)?(/local)?/bin/(env\s+)?php]] },
+ { Lang="javascript", Shebang=[[^#!\s*(/usr)?(/local)?/bin/(env\s+)?node]] }
+}
diff --git a/etc/nginx/nginx.conf b/etc/nginx/nginx.conf
new file mode 100644
index 00000000..a837cf54
--- /dev/null
+++ b/etc/nginx/nginx.conf
@@ -0,0 +1,190 @@
+
+#user http;
+worker_processes 1;
+
+#error_log logs/error.log;
+#error_log logs/error.log notice;
+#error_log logs/error.log info;
+
+#pid logs/nginx.pid;
+
+
+events {
+ worker_connections 1024;
+}
+
+
+http {
+ include mime.types;
+ default_type application/octet-stream;
+
+ #log_format main '$remote_addr - $remote_user [$time_local] "$request" '
+ # '$status $body_bytes_sent "$http_referer" '
+ # '"$http_user_agent" "$http_x_forwarded_for"';
+
+ #access_log logs/access.log main;
+
+ sendfile on;
+ #tcp_nopush on;
+
+ #keepalive_timeout 0;
+ keepalive_timeout 65;
+
+ #gzip on;
+
+ # nginx warning in journal or `sudo nginx -t`: "could not build optimal types_hash, you should increase either types_hash_max_size: 1024 or types_hash_bucket_size: 64; ignoring types_hash_bucket_size"
+ # default is 1024, I increased to 2048 and still throws warning, I increase 4096 and warning is gone
+ # not fully understood
+ # https://wiki.archlinux.org/title/nginx#Warning:_Could_not_build_optimal_types_hash
+ # https://nginx.org/en/docs/http/ngx_http_core_module.html
+ # https://nginx.org/en/docs/hash.html
+ # https://nginx.org/en/docs/http/server_names.html
+ types_hash_max_size 4096;
+
+ server {
+ listen 80;
+ # needed for ipv6
+ listen [::]:80;
+ # https://nginx.org/en/docs/http/configuring_https_servers.html#single_http_https_server
+ listen 443 ssl;
+ listen [::]:443 ssl;
+ server_name flylightning.xyz;
+
+ ssl_certificate /etc/nginx/flylightning.pem;
+ ssl_certificate_key /etc/nginx/flylightning.key;
+
+ #charset koi8-r;
+
+ #access_log logs/host.access.log main;
+
+ location / {
+ root /srv/http/master;
+ index index.html;
+ }
+
+ #error_page 404 /404.html;
+
+ # redirect server error pages to the static page /50x.html
+ #
+ #error_page 500 502 503 504 /50x.html;
+ #location = /50x.html {
+ # root /usr/share/nginx/html;
+ #}
+
+ # proxy the PHP scripts to Apache listening on 127.0.0.1:80
+ #
+ #location ~ \.php$ {
+ # proxy_pass http://127.0.0.1;
+ #}
+
+ # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
+ #
+ #location ~ \.php$ {
+ # root html;
+ # fastcgi_pass 127.0.0.1:9000;
+ # fastcgi_index index.php;
+ # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
+ # include fastcgi_params;
+ #}
+
+ # deny access to .htaccess files, if Apache's document root
+ # concurs with nginx's one
+ #
+ #location ~ /\.ht {
+ # deny all;
+ #}
+ }
+
+
+ # another virtual host using mix of IP-, name-, and port-based configuration
+ #
+ #server {
+ # listen 8000;
+ # listen somename:8080;
+ # server_name somename alias another.alias;
+
+ # location / {
+ # root html;
+ # index index.html index.htm;
+ # }
+ #}
+
+
+ # HTTPS server
+ #
+ #server {
+ # listen 443 ssl;
+ # server_name localhost;
+
+ # ssl_certificate cert.pem;
+ # ssl_certificate_key cert.key;
+
+ # ssl_session_cache shared:SSL:1m;
+ # ssl_session_timeout 5m;
+
+ # ssl_ciphers HIGH:!aNULL:!MD5;
+ # ssl_prefer_server_ciphers on;
+
+ # location / {
+ # root html;
+ # index index.html index.htm;
+ # }
+ #}
+
+ server {
+ listen 80;
+ listen [::]:80;
+ listen 443 ssl;
+ listen [::]:443 ssl;
+ server_name mirrors.flylightning.xyz;
+
+ ssl_certificate /etc/nginx/flylightning.pem;
+ ssl_certificate_key /etc/nginx/flylightning.key;
+
+ location / {
+ root /srv/http/mirrors;
+ autoindex on;
+ }
+ }
+
+ # https://wiki.archlinux.org/title/Cgit#Using_uwsgi
+ # https://wiki.gentoo.org/wiki/User:Halcon/HOWTO_cgit_uwsgi_nginx
+ # https://uwsgi-docs.readthedocs.io/en/latest/Nginx.html
+ # https://nginx.org/en/docs/http/ngx_http_uwsgi_module.html
+ # https://stackoverflow.com/questions/16182421/cgit-and-nginx-url-rewrite
+ server {
+ listen 80;
+ listen [::]:80;
+ listen 443 ssl;
+ listen [::]:443 ssl;
+ server_name git.flylightning.xyz;
+ root /usr/share/webapps/cgit;
+
+ ssl_certificate /etc/nginx/flylightning.pem;
+ ssl_certificate_key /etc/nginx/flylightning.key;
+
+ # about nginx location regex:
+ # - https://nginx.org/en/docs/http/ngx_http_core_module.html#location
+ # - https://stackoverflow.com/a/59846239
+ # - note in nginx / only means / and no other meaning, so no need \/
+ # - ~ means case-sensitive regex
+ # about (?:) non-capturing group:
+ # - https://manifold.net/doc/radian/why_do_non-capture_groups_exist_.htm
+ # - non-capturing group won't capture things inside () which may use later like in sed \1
+ # - note: I don't think sed support ?: , because POSIX ERE and BRE doesn't seem to support ?:
+ # - maybe improve a little bit performance by not storing things (not tested, also I did not read the source code)
+ # Serve static files with nginx
+ location ~ ^/(?:cgit\.(?:css|png)|robots\.txt|highlight\.css|mycgit\.css)$ {
+ root /usr/share/webapps/cgit;
+ expires 30d;
+ }
+ location / {
+ include uwsgi_params;
+ uwsgi_modifier1 9;
+ uwsgi_pass unix:/run/uwsgi/cgit.sock;
+ }
+ }
+
+}
+
+# vim: expandtab
diff --git a/etc/pacman.d/hooks/highlight-css.hook b/etc/pacman.d/hooks/highlight-css.hook
new file mode 100644
index 00000000..f14acaa7
--- /dev/null
+++ b/etc/pacman.d/hooks/highlight-css.hook
@@ -0,0 +1,13 @@
+[Trigger]
+Type = Package
+Operation = Install
+Operation = Upgrade
+Target = highlight
+
+[Action]
+Description = Upgrading highlight.css for cgit syntax highlighting...
+When = PostTransaction
+# mycgit.css import this highlight.css and cgit.css, for syntax-highlighting-edited.sh
+# because cgit.css is not pacman backup file and will be overwritten when upgrade cgit
+Exec = /usr/bin/sh -c '/usr/bin/mkdir -p /usr/share/webapps/cgit && /usr/bin/highlight -O xhtml --print-style -o /usr/share/webapps/cgit/highlight.css'
+Depends = highlight
diff --git a/etc/systemd/system/sockets.target.wants/uwsgi@cgit.socket b/etc/systemd/system/sockets.target.wants/uwsgi@cgit.socket
new file mode 120000
index 00000000..ec2ebc97
--- /dev/null
+++ b/etc/systemd/system/sockets.target.wants/uwsgi@cgit.socket
@@ -0,0 +1 @@
+/usr/lib/systemd/system/uwsgi@.socket \ No newline at end of file
diff --git a/etc/uwsgi/cgit.ini b/etc/uwsgi/cgit.ini
new file mode 100644
index 00000000..e2f750cb
--- /dev/null
+++ b/etc/uwsgi/cgit.ini
@@ -0,0 +1,14 @@
+# https://wiki.archlinux.org/title/Cgit#Using_uwsgi
+# https://wiki.gentoo.org/wiki/User:Halcon/HOWTO_cgit_uwsgi_nginx
+# https://uwsgi-docs.readthedocs.io/en/latest/Configuration.html
+# https://uwsgi-docs.readthedocs.io/en/latest/Options.html
+[uwsgi]
+master = true
+plugins = cgi
+socket = /run/uwsgi/%n.sock
+uid = http
+gid = http
+procname-master = uwsgi cgit
+processes = 1
+threads = 2
+cgi = /usr/lib/cgit/cgit.cgi