From cbb056319b4d37697b0e268cae84124487e4fa5a Mon Sep 17 00:00:00 2001 From: Stefan Reimer Date: Mon, 6 Jan 2025 17:26:58 +0000 Subject: [PATCH] feat: improvements for V3.21 --- Dockerfile | 4 +- Makefile | 4 +- abuilder | 2 +- kubezero/containerd/APKBUILD | 2 +- kubezero/containerd/containerd.confd | 2 +- kubezero/edk2/APKBUILD | 43 +- kubezero/falco/APKBUILD | 5 +- kubezero/fluent-bit/APKBUILD | 34 +- kubezero/openvpn-auth-oauth2/APKBUILD | 4 +- kubezero/openvpn3/APKBUILD | 11 +- kubezero/zdt-base/APKBUILD | 50 +- kubezero/zdt-base/aws-certbot.sh | 50 ++ kubezero/zdt-base/boot.sh | 2 +- kubezero/zdt-base/common.sh | 2 +- kubezero/zdt-base/fastfetch.jsonc | 49 ++ kubezero/zdt-base/monitd.conf | 6 + kubezero/zdt-base/monitrc | 19 - kubezero/zdt-base/starship.toml | 1021 +++++++++++++++++++++++ kubezero/zdt-base/zdt-ascii.txt | 28 +- kubezero/zdt-base/zdt-base.post-install | 41 +- kubezero/zdt-base/zdt-profile.sh | 11 + 21 files changed, 1270 insertions(+), 120 deletions(-) create mode 100755 kubezero/zdt-base/aws-certbot.sh create mode 100644 kubezero/zdt-base/fastfetch.jsonc create mode 100644 kubezero/zdt-base/monitd.conf delete mode 100644 kubezero/zdt-base/monitrc create mode 100644 kubezero/zdt-base/starship.toml create mode 100644 kubezero/zdt-base/zdt-profile.sh diff --git a/Dockerfile b/Dockerfile index b2f6aae..1c45cfb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ -FROM alpine:3.20 -ARG ALPINE="v3.20" +FROM alpine:3.21 +ARG ALPINE="v3.21" ARG BUILDUSER=alpine RUN echo "http://dl-cdn.alpinelinux.org/alpine/${ALPINE}/main" > /etc/apk/repositories && \ diff --git a/Makefile b/Makefile index 654e6ff..b30be67 100644 --- a/Makefile +++ b/Makefile @@ -46,7 +46,7 @@ apk: packages distfiles -v ${HOME}/.gitconfig/:/home/alpine/.gitconfig:ro \ -v ${HOME}/.abuild/:/home/alpine/.abuild:ro \ --env DEBUG=$(DEBUG) \ - $(REGISTRY)/$(IMAGE):$(ALPINE_RELEASE) $(PKG) + $(REGISTRY)/$(IMAGE):v$(ALPINE_MAJOR) $(PKG) download: aws s3 sync s3://zero-downtime-web-cdn/alpine/v$(ALPINE_MAJOR)/kubezero/x86_64/ packages/kubezero/x86_64/ --exclude APKINDEX.tar.gz @@ -62,4 +62,4 @@ upload: invalidate_cdn #aws s3 cp packages/kubezero/aarch64/APKINDEX.tar.gz s3://zero-downtime-web-cdn/alpine/v$(ALPINE_MAJOR)/kubezero/aarch64/ --cache-control max-age=1 init_apk_repo: - aws s3 cp s3://zero-downtime-web-cdn/alpine/v3.19/kubezero/x86_64/APKINDEX.tar.gz s3://zero-downtime-web-cdn/alpine/v$(ALPINE_MAJOR)/kubezero/x86_64/APKINDEX.tar.gz + aws s3 cp s3://zero-downtime-web-cdn/alpine/v3.20/kubezero/x86_64/APKINDEX.tar.gz s3://zero-downtime-web-cdn/alpine/v$(ALPINE_MAJOR)/kubezero/x86_64/APKINDEX.tar.gz diff --git a/abuilder b/abuilder index 7a7c762..7eab8a3 100755 --- a/abuilder +++ b/abuilder @@ -3,7 +3,7 @@ set -e [ -n "$DEBUG" ] && set -x -doas apk update && doas apk upgrade +doas apk -U upgrade if [ "$1" = 'aarch64-toolchain' ]; then aarch64-toolchain.sh diff --git a/kubezero/containerd/APKBUILD b/kubezero/containerd/APKBUILD index 4f246d7..d4320a3 100644 --- a/kubezero/containerd/APKBUILD +++ b/kubezero/containerd/APKBUILD @@ -127,7 +127,7 @@ stress() { sha512sums=" 4cb003a6ef2f9fe856665c3b7099e13b23cf07c77ed9a9ed50988d74de1933e3fe9463ae123635230f25cde38cd8a487133b11e20d829a79517c4d7fbe2ce012 containerd-1.7.23.tar.gz -5fb37b88554422738cc75b944b75836c123d87d418a16c6a25b9d49da023bd0e654d1aa694e60026de42c055ccf7469f5b4778a4876e94720ec2f40d618db580 containerd.confd +75a882a95167578bb4f289822256e770ecf2f74d7a50181e622c15e847383120d3622100e5e5629b94b58e2082f990de1cc3daa2f69b0ee48827072c1e9dde0e containerd.confd 8315a8d58b4ba7e19ebed2cd82c7b5eaab45da630f9818a9e6cc8f3c8e88f159432474299798f79e6e465e843c91c0f50df04030083c8913c385ea1d73e81e6a containerd.initd dfb92fffeac35310956da6c6ad5f8c43eba3a5355ecbfabeec0f9c7445a08e309312b56b6855a17a471fd6012cc099d6abb39dc8bd26279112d0fe936624023d config.toml " diff --git a/kubezero/containerd/containerd.confd b/kubezero/containerd/containerd.confd index d5173da..0a5f883 100644 --- a/kubezero/containerd/containerd.confd +++ b/kubezero/containerd/containerd.confd @@ -26,7 +26,7 @@ #log_owner=root:root # to override the default supervise_daemon_args -#supervise_daemon_args="" +supervise_daemon_args="-N 1" # log directory (defaults to current directory) #LOGPROXY_LOG_DIRECTORY=/var/log diff --git a/kubezero/edk2/APKBUILD b/kubezero/edk2/APKBUILD index 5078407..25d94f0 100644 --- a/kubezero/edk2/APKBUILD +++ b/kubezero/edk2/APKBUILD @@ -6,14 +6,14 @@ pkgver=0.0.202308 _realver=edk2-stable${pkgver##*.} _sslver=3.0.9 _sfver=3e -pkgrel=0 +pkgrel=2 pkgdesc="EFI Development Kit II" url="https://github.com/tianocore/tianocore.github.io/wiki/EDK-II/" arch="x86_64 aarch64" license="BSD-2-Clause-Patent" makedepends="bash python3 iasl nasm util-linux-dev util-linux-misc" options="!archcheck !check" # has no checks -subpackages="$pkgname-pyc" +subpackages="$pkgname-pyc $pkgname-shell:_shell" _mipisyst_commit=370b5944c046bab043dd8b133727b2135af7747a source="$pkgname-$pkgver.tar.gz::https://github.com/tianocore/edk2/archive/$_realver.tar.gz mipisyst-$_mipisyst_commit.tar.gz::https://github.com/MIPI-Alliance/public-mipi-sys-t/archive/$_mipisyst_commit.tar.gz @@ -25,19 +25,20 @@ source="$pkgname-$pkgver.tar.gz::https://github.com/tianocore/edk2/archive/$_rea " builddir="$srcdir/$pkgname-$_realver" +PLATFORM="ShellPkg/ShellPkg.dsc" case "$CARCH" in x86) TARGET_ARCH=IA32 - PLATFORM=OvmfPkg/OvmfPkgIa32X64.dsc + PLATFORM="$PLATFORM OvmfPkg/OvmfPkgIa32X64.dsc" ;; x86_64) TARGET_ARCH=X64 - PLATFORM="OvmfPkg/OvmfPkgX64.dsc OvmfPkg/OvmfXen.dsc OvmfPkg/CloudHv/CloudHvX64.dsc" - subpackages="$subpackages ovmf:_ovmf:noarch ovmf-xen:_xen:noarch cloudhv:_cloudhv:noarch" + PLATFORM="$PLATFORM OvmfPkg/OvmfPkgX64.dsc OvmfPkg/OvmfXen.dsc" + subpackages="$subpackages ovmf:_ovmf:noarch ovmf-xen:_xen:noarch" ;; aarch64) TARGET_ARCH=AARCH64 - PLATFORM=ArmVirtPkg/ArmVirtQemu.dsc + PLATFORM="$PLATFORM ArmVirtPkg/ArmVirtQemu.dsc" subpackages="$subpackages aavmf::noarch" ;; esac @@ -110,12 +111,28 @@ package() { done } +_shell() { + pkgdesc="EDK2 UEFI Shell" + + # taken from arch + # minimal UEFI shell, as defined in ShellPkg/Application/Shell/Shell.inf + local _min='7C04A583-9E3E-4f1c-AD65-E05268D0B4D1' + # full UEFI shell, as defined in ShellPkg/ShellPkg.dsc + local _full='EA4BB293-2D7F-4456-A681-1F22F42CD0BC' + + install -Dm644 "$builddir"/Build/Shell/"$RELEASE"_"$TOOLCHAIN"/$TARGET_ARCH/Shell_$_min.efi \ + "$subpkgdir"/usr/share/edk2-shell/Shell.efi + + install -Dm644 "$builddir"/Build/Shell/"$RELEASE"_"$TOOLCHAIN"/$TARGET_ARCH/Shell_$_full.efi \ + "$subpkgdir"/usr/share/edk2-shell/ShellFull.efi +} + _ovmf() { pkgdesc="Open Virtual Machine Firmware (OVMF) BIOS" license="BSD MIT" for fw in "$builddir"/Build/OvmfX64/"$RELEASE"_"$TOOLCHAIN"/FV/*.fd; do - install -D $fw "$subpkgdir"/usr/share/OVMF/${fw##*/} + install -Dm644 $fw "$subpkgdir"/usr/share/OVMF/${fw##*/} done # dont ship memfd for now to save space @@ -129,16 +146,16 @@ _xen() { pkgdesc="Open Virtual Machine Firmware (OVMF) - Xen build" license="BSD MIT" - install -D "$builddir"/Build/OvmfXen/"$RELEASE"_"$TOOLCHAIN"/FV/OVMF.fd \ + install -Dm644 "$builddir"/Build/OvmfXen/"$RELEASE"_"$TOOLCHAIN"/FV/OVMF.fd \ "$subpkgdir"/usr/lib/xen/boot/ovmf.bin } _cloudhv() { - pkgdesc="EDK2 EFI Firmware - Cloud-Hypervisor build" - license="BSD MIT" + pkgdesc="EDK2 EFI Firmware - Cloud-Hypervisor build" + license="BSD MIT" - install -D "$builddir"/Build/CloudHvX64/"$RELEASE"_"$TOOLCHAIN"/FV/CLOUDHV.fd \ - "$subpkgdir"/usr/share/cloudhv/CLOUDHV.fd + install -Dm644 "$builddir"/Build/CloudHvX64/"$RELEASE"_"$TOOLCHAIN"/FV/CLOUDHV.fd \ + "$subpkgdir"/usr/share/cloudhv/CLOUDHV.fd } aavmf() { @@ -156,7 +173,7 @@ aavmf() { bs=1M seek=64 count=0 for fw in "$builddir"/Build/*/"$RELEASE"_"$TOOLCHAIN"/FV/*.fd; do - install -D $fw "$subpkgdir"/usr/share/AAVMF/${fw##*/} + install -Dm644 $fw "$subpkgdir"/usr/share/AAVMF/${fw##*/} done } diff --git a/kubezero/falco/APKBUILD b/kubezero/falco/APKBUILD index 6b35a23..a5e010d 100644 --- a/kubezero/falco/APKBUILD +++ b/kubezero/falco/APKBUILD @@ -1,7 +1,7 @@ # Contributor: Stefan Reimer # Maintainer: Stefan Reimer pkgname=falco -pkgver=0.39.1 +pkgver=0.39.2 pkgrel=0 pkgdesc="Falco is the open source solution for runtime security for hosts, containers, Kubernetes and the cloud" url="https://github.com/falcosecurity/falco" @@ -48,6 +48,7 @@ build() { -DCMAKE_INSTALL_PREFIX=/usr \ -DFALCO_ETC_DIR=/etc/falco \ -DUSE_BUNDLED_DEPS=On \ + -DUSE_JEMALLOC=On \ -DMINIMAL_BUILD=On \ -DUSE_DYNAMIC_LIBELF=Off \ -DMUSL_OPTIMIZED_BUILD=On \ @@ -79,7 +80,7 @@ package() { } sha512sums=" -bb547691640fed21cc4976f469cf3813f888d9cc55e1a4631133c8cd9e6b1adce1d279dddfdf6b191442eeacd0e635a48d4ffa10913059f6117b5710e284899e falco-0.39.1.tar.gz +198405e9383625ca4d78822de7674c62863d15b3108ba5b06d4cf6ff20850f7eec9123fe7d98d049acc2931b98e4b09d7ef0d66136a31363ce59a64ad9e8eda0 falco-0.39.2.tar.gz b152fcf6cd81895efa37797ab7ff1aac7350b5f51f2648aa9e3cce9d5ece55791ddf82c396e9da216293e2379a785a294cc972f28a91162dc5bc88ab09e1ab08 falco.patch b6cf8bda946b71241b332d25bcde73e73159ae0993be4291c158e23e44f927b4432d53b9d6d730aee442c94ffc75e119b9f6467e94a0950a19a5f1369afb4e13 rules.patch 9d1292a99bab7792bfe344940fa41ccf01318d5f30f854b01457e9f53ccca27f7f334466c061a11fbe8ebf918aeeb7f723b16a233c9e3bd60dd632d831ae9f5c falco.initd diff --git a/kubezero/fluent-bit/APKBUILD b/kubezero/fluent-bit/APKBUILD index 93f09d9..12f500e 100644 --- a/kubezero/fluent-bit/APKBUILD +++ b/kubezero/fluent-bit/APKBUILD @@ -1,12 +1,13 @@ # Contributor: Stefan Reimer # Maintainer: Stefan Reimer pkgname=fluent-bit -pkgver=3.1.9 +pkgver=3.1.10 pkgrel=0 pkgdesc="Fast and Lightweight Log processor and forwarder" url="https://fluentbit.io/" -# riscv64: does not support bundled luajit -arch="all !ppc64le !s390x !riscv64" +# riscv64, loongarch64: does not support bundled luajit +# arm: doesn't build +arch="all !armhf !armv7 !ppc64le !s390x !riscv64 !loongarch64" license="Apache-2.0" makedepends=" bison @@ -44,6 +45,7 @@ build() { # default CORE_STACK_SIZE=((3 * PTHREAD_STACK_MIN) / 2)=3072 is invalid # set default to 24576 # Disable stream processor due to issue see: https://github.com/fluent/fluent-bit/issues/2464 + cmake -B build \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_INSTALL_LIBDIR=lib \ @@ -51,12 +53,21 @@ build() { -DFLB_CORO_STACK_SIZE=24576 \ -DFLB_RELEASE=Yes \ -DFLB_DEBUG=Off \ + -DFLB_SIMD=Yes \ -DFLB_SHARED_LIB=Off \ -DFLB_JEMALLOC=Yes \ - -DFLB_IN_SYSTEMD=Off \ -DFLB_PROXY_GO=No \ - -DFLB_TLS=Yes \ - -DFLB_HTTP_SERVER=Yes \ + -DFLB_PROFILES=No \ + -DFLB_AWS=No \ + -DFLB_SIGNV4=No \ + -DFLB_FILTER_AWS=No \ + -DFLB_OUT_S3=No \ + -DFLB_OUT_CLOUDWATCH_LOGS=No \ + -DFLB_OUT_KINESIS_FIREHOSE=No \ + -DFLB_OUT_KINESIS_STREAMS=No \ + -DFLB_OUT_BIGQUERY=No \ + -DFLB_EXAMPLES=No \ + -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \ $CMAKE_CROSSOPTS . make -C build #-DCMAKE_FIND_LIBRARY_SUFFIXES=".a" \ @@ -65,15 +76,6 @@ build() { #-DFLB_LUAJIT=Yes \ #-DFLB_FILTER_LUA=Off \ #-DFLB_TESTS_INTERNAL=Yes \ - #-DFLB_AWS=No \ - #-DFLB_SIGNV4=No \ - #-DFLB_OUT_S3=No \ - #-DFLB_OUT_CLOUDWATCH_LOGS=No \ - #-DFLB_OUT_KINESIS_FIREHOSE=No \ - #-DFLB_OUT_KINESIS_STREAMS=No \ - #-DFLB_OUT_BIGQUERY=No \ - #-DFLB_FILTER_AWS=No \ - #-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \ } check() { @@ -101,7 +103,7 @@ package() { } sha512sums=" -fbf6a8c8b35cafb8fc2f95e5a52dee835c86af9f1bcded9edabca9586c41cf9c4ded776018dfecc0f96b7f7a68587f263fb19704c458f8606b6b1033a323034e fluent-bit-3.1.9.tar.gz +88f63cd81aced94a0081ddf6963d5f92be1744a6ac27b20ca8c1e690629bfdd6c56d4d2cb72976feebb2dff8fefc6aeac988deba9efb4ddcb87c18131399f5ac fluent-bit-3.1.10.tar.gz 8ba6c8e84dee90176f9b4375fb2c6444fa5d32fa601d9bcf3ea7960fec87f1ef664f175caf08bd0b052843e971efdbf08e2a5cd180ad9a8f23ff2c5cb233814f fluent-bit.initd 6bd7d8b4da93a17f29b6ea1e0286ea226d0e376024284741110936779b3229bd8d6cd03ffbdc5d3b4842294e7f32a888de0dd16b0851b65d91b062ca58530ea0 chunkio-static-lib-fts.patch aa1449f8f4599330e1a01c2837f22cb1d10ce5926d9cb92f92fb89939c7b6af3116d3339566709ad466ebf6e37a5b178e84619ec6a1608327241a0374992be81 exclude-luajit.patch diff --git a/kubezero/openvpn-auth-oauth2/APKBUILD b/kubezero/openvpn-auth-oauth2/APKBUILD index df35131..5b4b2a1 100644 --- a/kubezero/openvpn-auth-oauth2/APKBUILD +++ b/kubezero/openvpn-auth-oauth2/APKBUILD @@ -1,7 +1,7 @@ # Contributor: Stefan Reimer # Maintainer: Stefan Reimer pkgname=openvpn-auth-oauth2 -pkgver=1.22.0 +pkgver=1.22.4 pkgrel=0 pkgdesc="OpenVPN management client that handles the single sign-on (SSO) authentication against various OIDC providers" url="https://github.com/jkroepke/openvpn-auth-oauth2" @@ -28,6 +28,6 @@ package() { } sha512sums=" -872b8a637a07c689d4c1699993b5173732714e8070b0e4253d126ef0caf667dd936c0f66bd90cfdd227c717a0c9d346bb11f7d26dbc8a1d377148807a8d4a05e openvpn-auth-oauth2-1.22.0.tar.gz +c5c8d85eab9859ac6e1c80a9a61b79236d64acf457053584d35beb40d4d56e6f4ad8b78a13d98bb6612b4f65371ac80cf0ce4216f18d3bc7b5b1dadc9425ced9 openvpn-auth-oauth2-1.22.4.tar.gz 6dcaa021d495c4e7ddb3501e9ce11a09d7c286a6eda579cff75a2c6b6e12794ec35069941d81ce411209212cab6d0707cc0a00e99327be13b10acb23b83c6f35 openvpn-auth-oauth2.initd " diff --git a/kubezero/openvpn3/APKBUILD b/kubezero/openvpn3/APKBUILD index 5e88b43..4ad8c39 100644 --- a/kubezero/openvpn3/APKBUILD +++ b/kubezero/openvpn3/APKBUILD @@ -1,21 +1,21 @@ # Contributor: Patrycja Rosa # Maintainer: Patrycja Rosa pkgname=openvpn3 -pkgver=3.8.5 +pkgver=3.10.4 pkgrel=0 pkgdesc="C++ class library that implements the functionality of an OpenVPN client" url="https://github.com/OpenVPN/openvpn3" arch="all !s390x" # broken tests due to endianness assumptions license="AGPL-3.0-only" -depends_dev="lz4-dev asio-dev libcap-dev jsoncpp-dev xxhash-dev" -makedepends="cmake samurai gtest-dev $depends_dev" +makedepends="cmake samurai gtest-dev lz4-dev asio-dev libcap-dev jsoncpp-dev xxhash-dev" subpackages="$pkgname-dev" source="https://github.com/OpenVPN/openvpn3/archive/refs/tags/release/$pkgver/openvpn3-$pkgver.tar.gz - unvendor.patch " + #unvendor.patch builddir="$srcdir/openvpn3-release-$pkgver" build() { + sh cmake -G Ninja -B build \ -DCMAKE_INSTALL_PREFIX=/usr \ -DBUILD_SHARED_LIBS=False \ @@ -37,6 +37,5 @@ package() { } sha512sums=" -01e750267857d8ae23b4da4460a1e515ebbfadc17e0ff8ad0513368f51c0cf53fc5a41a92422f04812161be2b2b2f3fbc793a72150a8c902af201c2ee9028025 openvpn3-3.8.5.tar.gz -8bd3e9c92734b75701f0845398e831086a8a6d1e7f595f3873e0b599604379a0f99f9764f9ba19a16eb6a63216875ae8607a50c8fc0145ddcf05934a2ba1fb91 unvendor.patch +3309c7f7581fabc93615d118cb4dc7a4fd163bfd23910b021b2c3f350996f2d92c8745fb7de213a25277f165ac8b0dafd6aaf5104039ff76394e4c65b376de38 openvpn3-3.10.4.tar.gz " diff --git a/kubezero/zdt-base/APKBUILD b/kubezero/zdt-base/APKBUILD index 073cf02..7d04984 100644 --- a/kubezero/zdt-base/APKBUILD +++ b/kubezero/zdt-base/APKBUILD @@ -1,13 +1,13 @@ # Contributor: Stefan Reimer # Maintainer: Stefan Reimer pkgname=zdt-base -pkgver=0.3.20 +pkgver=0.3.21 pkgrel=0 pkgdesc="ZeroDownTime Alpine additions and customizations" url="https://git.zero-downtime.net/ZeroDownTime/alpine-overlay/src/branch/master/kubezero/zdt-base" arch="noarch" license="AGPL-3.0" -depends="logrotate syslog-ng neofetch monit file tiny-cloud dhcpcd" +depends="logrotate syslog-ng fastfetch monit file tiny-cloud dhcpcd starship" options="!check" subpackages="$pkgname-openrc $pkgname-aws $pkgname-nocloud" install="$pkgname.post-install" @@ -27,14 +27,17 @@ source=" cloudbender.stop cloudbender.start dhcpcd-mtu.hook - monitrc + monitd.conf monit_alert.sh.aws - neofetch.conf + fastfetch.jsonc zdt-ascii.txt route53.py get_iam_sshkeys.py uniq_hostname.py write_parameters.py + zdt-profile.sh + starship.toml + aws-certbot.sh " build() { @@ -62,24 +65,27 @@ package() { install -Dm755 "$srcdir/cloudbender.start" "$pkgdir/etc/local.d/cloudbender.start" install -Dm755 "$srcdir/cloudbender.stop" "$pkgdir/etc/local.d/cloudbender.stop" - - # syslog-ng configs, json all into messages - install -Dm644 "$srcdir"/syslog-ng.conf "$pkgdir"/lib/zdt/syslog-ng.conf - install -Dm644 "$srcdir"/syslog-ng.logrotate.conf "$pkgdir"/lib/zdt/syslog-ng.logrotate.conf - install -Dm644 "$srcdir"/syslog-ng.apparmor "$pkgdir"/lib/zdt/syslog-ng.apparmor + # syslog-ng configs, json all into messages - installed via postinstall + install -Dm644 "$srcdir"/syslog-ng.conf "$pkgdir"/usr/lib/zdt/syslog-ng.conf + install -Dm644 "$srcdir"/syslog-ng.logrotate.conf "$pkgdir"/usr/lib/zdt/syslog-ng.logrotate.conf + install -Dm644 "$srcdir"/syslog-ng.apparmor "$pkgdir"/usr/lib/zdt/syslog-ng.apparmor # monit mkdir -p "$pkgdir"/etc/monit.d - install -Dm600 "$srcdir"/monitrc "$pkgdir"/etc/monitrc.zdt + install -Dm644 "$srcdir"/monitd.conf "$pkgdir"/etc/monit.d/zdt-base.conf # ps_mem install -Dm755 "$srcdir"/ps_mem.py "$pkgdir"/usr/sbin/ps_mem - # Neofetch - install -Dm644 "$srcdir"/neofetch.conf "$pkgdir"/etc/neofetch.conf - install -Dm644 "$srcdir"/zdt-ascii.txt "$pkgdir"/etc/neofetch-logo.txt - mkdir -p "$pkgdir"/etc/profile.d - echo '[ -n "$SSH_TTY" -a "$SHLVL" -eq 1 ] && neofetch --config /etc/neofetch.conf' > "$pkgdir"/etc/profile.d/motd.sh + # fastfetch + install -Dm644 "$srcdir"/fastfetch.jsonc "$pkgdir"/etc/fastfetch.jsonc + install -Dm644 "$srcdir"/zdt-ascii.txt "$pkgdir"/etc/zdt-ascii.txt + + # starship + install -Dm644 "$srcdir"/starship.toml "$pkgdir"/etc/starship.toml + + # zdt shell profile + install -Dm644 "$srcdir"/zdt-profile.sh "$pkgdir"/etc/profile.d/zdt-base.sh } aws() { @@ -93,6 +99,7 @@ aws() { install -Dm755 "$srcdir"/uniq_hostname.py "$subpkgdir"/usr/sbin/uniq_hostname.py install -Dm755 "$srcdir"/get_iam_sshkeys.py "$subpkgdir"/usr/sbin/get_iam_sshkeys.py install -Dm755 "$srcdir"/write_parameters.py "$subpkgdir"/usr/sbin/write_parameters.py + install -Dm755 "$srcdir"/aws-certbot.sh "$pkgdir"/usr/sbin/aws-certbot.sh # Cloudbender SNS integration install -Dm755 "$srcdir"/monit_alert.sh.aws "$pkgdir"/usr/bin/monit_alert.sh @@ -106,8 +113,8 @@ nocloud() { } sha512sums=" -4fc38f503ca4e89a39457c07d4c845419a1f54c8989bc97f6b824c277df1369c186f454264d73dfd43bee5642f800fc763f5e57f83149324df126f2b1a2e8c7e common.sh -cf8b75a81bb35e853761d21b15b5b109f15350c54daaf66d2912541a20f758c3ca237d58932e5608d2d3867fe15a07ebd694fd1c313a8290d15afc2b27a575dd boot.sh +d1656d36d48b58102e3b1aee581801c8c94aa7a52a5a441bd44a59ed09e8c041eb8fa44b1fd5b6bde758c72826bbe563ecbfbac078a27840b88920c6eaf27fd7 common.sh +d494e3b65de86a49f84a6c5adf4a9425ab3f7dfa87719954f45e2e3883cf82a27e2c4a88038a69bbdf1568aa1b519f5bcdd5fdc7d5f783abe0883b0a301c7f81 boot.sh eb7d5b6f92f500dbaba04a915cdd8d66e90456ca86bed86b3a9243f0c25577a9aa42c2ba28c3cad9dda6e6f2d14363411d78eff35656c7c60a6a8646f43dcba5 cloudbender-early.init cac71c605324ad8e60b72f54b8c39ee0924205fcd1f072af9df92b0e8216bcde887ffec677eb2f0eacce3df430f31d5b5609e997d85f14389ee099fbde3c478f cloudbender.init f4f1b1f67e6b368f61482f4dfcc48a32ccf75cf12349f82680b93f572534bef97ed1b4c0273e4e57fe89289f4383b15c2dafb39ae20416fc6dab96e92b8d678d cloud-aws.sh @@ -120,12 +127,15 @@ e86eed7dd2f4507b04050b869927b471e8de26bc7d97e7064850478323380a0580a92de302509901 cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e cloudbender.stop f106f3e9befdeaad6beef4bada0c774eb7745568b8d29eb86970ac9ea73d1aaac080676d399a11d462973d10e1aef08125bf78d7a362db47a53a2ba06df7d9b4 cloudbender.start f8c052c7ec12c71937c7b8bc05d8374c588f345e303b30eda9c8612dff8f8f34a87a433648a3e9b85b278196ece198533b29680a303ff6478171d43f8e095189 dhcpcd-mtu.hook -e00a8f296c76446fe1241bf804c0108f47a2676f377a413ee9fede0943362a6582cad30fe13edd93f3d0daab0e2d7696553fb9458dca62adc05572dce339021a monitrc +d3ebf236391bd7ae4f0a8674135e0f86e868d1c48161f5ca6485bf58eccb8132308123194691cb60e3b3987835a13295a9501c04d9052f10dca69459b67c289a monitd.conf c955dabe692c0a4a2fa2b09ab9096f6b14e83064b34ae8d22697096daf6551f00b590d837787d66ea1d0030a7cc30bef583cc4c936c980465663e73aec5fa2dc monit_alert.sh.aws -2c02a1d454881dd7197548286c6cf24c1453dd9d726f3e5445703c12414853b0e12205e5b6a0c3ae09b76097d2bdfcfd6e1bc9a122dd9f66c6d6d03ab41f748a neofetch.conf -532b8e2eb04942ab20bdc36b5dea1c60239fcbfcb85706123f3e05c18d65c938b85e9072d964ae5793177625a8db47b532db1f5bd5ed5ecbb70d5a331666ff54 zdt-ascii.txt +30610b53264e31dd55394bbf581f32720b91c53d845315ac9d86efe14e320121c87cd8d2d40bd114372b0ae0e448dcd8f9b020cc51b675225076d4cde5563b06 fastfetch.jsonc +9e34401b682454821ec91d44c4b31a5c2fcb14140ca2ec52eed9bf85edbd3fef4915b2ac30f97a61133c12e2814cfc99d7f4125d6c0d256e6602d868549033b6 zdt-ascii.txt 816049360aa442f9e9aa4d6525795913cfe3dc7c6c14dc4ccad59c0880500f9d42f198edc442fe036bc84ba2690d9c5bc8ae622341d8276b3f14947db6b879b1 route53.py 7da28446762a36a6737c5b30becbce78775bd943b4d0c5ef938a50f49b4f51f66708434aa79004c19d16c56c83f54c8d6d68e1502ebc250c73f8aae12bed83c0 get_iam_sshkeys.py ae1941fc45e61fa8d211f5ef7eff2dd01510a6d364c4302cab267812321a10e7434ecc8d8c9263d8671ce5604d04d6531601bf42886a55fb6aec7f321651e1dc uniq_hostname.py ee4264337d86ad99ba6cf9ec3017986c804ac208c0beb5fc8651345bd277bb6de03e7c3a8c1b751767647be48f9d45ac47a7d14cf040d9c827780984394e826d write_parameters.py +72b7120a5b7e928b6c351fa6b9fb9bc1697a61922d080d58e1aa5c6f680c54ce55de8375a5992cf66921b3a7be741ebc09746fcf41ab7de8d36c48922315701e zdt-profile.sh +459f4957b10e6be8f9af04394f7bc1bd51364e629b687050607f7f4a8d60d92e90903ad7ef89ffed472f77506049ec7e163338a1b25ca6a65c6f1599cc13cfcf starship.toml +58d431dc4342997712fbf5c2092e51e9ef474372ca6a4dd1a4c53ce25333c4a406ef3549a120ef0c6ead1a5965574e8d2df7983621ebdbb4d8a3e2d3e8233738 aws-certbot.sh " diff --git a/kubezero/zdt-base/aws-certbot.sh b/kubezero/zdt-base/aws-certbot.sh new file mode 100755 index 0000000..887515f --- /dev/null +++ b/kubezero/zdt-base/aws-certbot.sh @@ -0,0 +1,50 @@ +#!/bin/bash +set -x +# Certbot wrapper with S3 persistence support + +CERTBOT_CERTNAME=$1 +CERTBOT_EMAIL=$2 +CERTBOT_DOMAIN=$3 +CERTBOT_BACKEND=$4 + +LETSENCRYPT_PATH=/etc/letsencrypt + +if [ -z "$CERTBOT_BACKEND" -o -z "$CERTBOT_EMAIL" -o -z "$CERTBOT_DOMAIN" -o -z "$CERTBOT_CERTNAME" ]; then + echo "CertbotBackend, CertbotEmail,Certbot_CertName or CertbotDomain are missing!" + exit 1 +fi + +function sync_to_s3 { + local links="$LETSENCRYPT_PATH/links.txt" + local expr=$(sed 's@\/@\\\/@g' <<< "'$LETSENCRYPT_PATH/") + + find /etc/letsencrypt/ -type l | xargs -I% sh -c "echo -n \'; readlink -fn %; echo \"' '%'\"" | sed -e "s/$expr/'/g" > "$links" + + aws s3 --no-follow-symlinks sync "$LETSENCRYPT_PATH" "$CERTBOT_BACKEND" +} + +function sync_from_s3 { + local s3location=$CERTBOT_BACKEND + local links="$LETSENCRYPT_PATH/links.txt" + local currDir=$(pwd) + + aws s3 sync "$s3location" "$LETSENCRYPT_PATH" + + if [ -f $links ]; then + cd "$LETSENCRYPT_PATH" + xargs -I% sh -c "ln -f -s $LETSENCRYPT_PATH/%" < "$links" + cd "$currDir" + fi +} + + +sync_from_s3 + +certbot certonly \ + --non-interactive \ + --dns-route53 \ + --agree-tos \ + --email $CERTBOT_EMAIL \ + --domain $CERTBOT_DOMAIN \ + --cert-name $CERTBOT_CERTNAME && \ + sync_to_s3 diff --git a/kubezero/zdt-base/boot.sh b/kubezero/zdt-base/boot.sh index 322ac19..c088e50 100644 --- a/kubezero/zdt-base/boot.sh +++ b/kubezero/zdt-base/boot.sh @@ -2,7 +2,7 @@ # We have no metadata nor instance parameters yet! # We built on top of tiny-cloud -. /lib/tiny-cloud/common +. /usr/lib/tiny-cloud/common # archive orig /var, mount new var on top and restore orig var copy_and_mount() { diff --git a/kubezero/zdt-base/common.sh b/kubezero/zdt-base/common.sh index 55fb7f8..db6dc39 100644 --- a/kubezero/zdt-base/common.sh +++ b/kubezero/zdt-base/common.sh @@ -1,5 +1,5 @@ # We built on top of tiny-cloud -. /lib/tiny-cloud/common +. /usr/lib/tiny-cloud/common . /usr/lib/cloudbender/cloud/"$CLOUD".sh # boolean flags diff --git a/kubezero/zdt-base/fastfetch.jsonc b/kubezero/zdt-base/fastfetch.jsonc new file mode 100644 index 0000000..60a2b0b --- /dev/null +++ b/kubezero/zdt-base/fastfetch.jsonc @@ -0,0 +1,49 @@ +{ + "$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json", + "display": { + "size": { + "maxPrefix": "MB", + "ndigits": 0 + } + }, + "logo": { + "source": "/etc/zdt-ascii.txt", + "type": "file", + "color": { + "1": "38;2;32;120;108" + } + }, + "modules": [ + "break", + { + "type": "custom", + "format": "{#2}Welcome to Alpine - ZeroDownTime edition" + }, + { + "type": "custom", + "format": "-> {#3}https://kubezero.com/releases/v1.31" + }, + "break", + "title", + "separator", + "os", + "host", + { + "type": "kernel", + "format": "{release}" + }, + "uptime", + "cpu", + { + "type": "gpu", + "key": "GPU" + }, + { + "type": "memory", + "format": "{} / {}" + }, + "swap", + "disk", + "localIP" + ] +} diff --git a/kubezero/zdt-base/monitd.conf b/kubezero/zdt-base/monitd.conf new file mode 100644 index 0000000..8327d28 --- /dev/null +++ b/kubezero/zdt-base/monitd.conf @@ -0,0 +1,6 @@ +# Basic rootfs check +# >80%: emergency logrotate +# >90%: warning +check filesystem rootfs with path / + if space usage > 80% then exec "/etc/periodic/daily/logrotate" + if space usage > 90% then exec "/usr/bin/monit_alert.sh warning" diff --git a/kubezero/zdt-base/monitrc b/kubezero/zdt-base/monitrc deleted file mode 100644 index abec2e2..0000000 --- a/kubezero/zdt-base/monitrc +++ /dev/null @@ -1,19 +0,0 @@ -set daemon 30 -# add `for 2 cycles` might be better than this intial block -# with start delay 120 - -set log syslog - -set httpd port 2812 and - use address localhost - allow localhost - allow admin:localmonit - -# Basic rootfs check -# >80%: emergency logrotate -# >90%: warning -check filesystem rootfs with path / - if space usage > 80% then exec "/etc/periodic/hourly/logrotate" - if space usage > 90% then exec "/usr/bin/monit_alert.sh warning" - -include /etc/monit.d/*.conf diff --git a/kubezero/zdt-base/starship.toml b/kubezero/zdt-base/starship.toml new file mode 100644 index 0000000..f19354f --- /dev/null +++ b/kubezero/zdt-base/starship.toml @@ -0,0 +1,1021 @@ +# M.y.t.h. Orange Slanted (left only) config for Starship +# Copyright (c) 2023 by Mick Hohamnn (@mickimnet), last changed: 2023-05-07 18:11 +# Note: comments for symbols refer to the class name of Nerd Fonts +# Starship version support: 1.14.2 +"$schema" = 'https://starship.rs/config-schema.json' + +### Generic prompt configurations +scan_timeout = 30 # default = 30 +command_timeout = 500 # default = 500 +add_newline = false # Don't print a new line before the start of the prompt +continuation_prompt = "[](bg:color_background_base fg:color_base_orange)[](fg:color_background_base)" +palette = "myth-orange-dark" # select the color palette to be used + +### Order of modules on prompt +format = """\ + $os\ + ([](bg:color_background_base fg:color_foreground_dark)$shell[](bg:color_background_base fg:color_foreground_dark))\ + ([](bg:color_background_base fg:color_sudo)$sudo[](bg:color_background_base fg:color_sudo))\ + ([](bg:color_background_base fg:color_root)${custom.root}[](bg:color_background_base fg:color_root))\ + ([](bg:color_background_base fg:color_username)${custom.ssh_user}[](bg:color_background_base fg:color_username))\ + ([](bg:color_background_base fg:color_root)${custom.ssh_root}[](bg:color_background_base fg:color_root))\ + ([](bg:color_background_base fg:color_hostname)${custom.ssh_host}[](bg:color_background_base fg:color_hostname))\ + ([](bg:color_background_base fg:color_username)$username[](bg:color_background_base fg:color_username))\ + ([](bg:color_background_base fg:color_hostname)$hostname[](bg:color_background_base fg:color_hostname))\ + (↓ Styling of the directory module is handled in the module section ↓)\ + ($directory)\ + (↓ Cloud provider modules ↓)\ + ([](bg:color_background_base fg:color_cloud)$aws[](bg:color_background_base fg:color_cloud))\ + ([](bg:color_background_base fg:color_cloud)$azure[](bg:color_background_base fg:color_cloud))\ + ([](bg:color_background_base fg:color_cloud)$gcloud[](bg:color_background_base fg:color_cloud))\ + ([](bg:color_background_base fg:color_cloud)$openstack[](bg:color_background_base fg:color_cloud))\ + (↑ Cloud provider modules ↑)\ + (↓ Container modules ↓)\ + ([](bg:color_background_base fg:color_container)$kubernetes[](bg:color_background_base fg:color_container))\ + ([](bg:color_background_base fg:color_container)$docker_context[](bg:color_background_base fg:color_container))\ + ([](bg:color_background_base fg:color_container)$container[](bg:color_background_base fg:color_container))\ + ([](bg:color_background_base fg:color_container)$opa[](bg:color_background_base fg:color_container))\ + ([](bg:color_background_base fg:color_container)$pulumi[](bg:color_background_base fg:color_container))\ + ([](bg:color_background_base fg:color_container)$singularity[](bg:color_background_base fg:color_container))\ + ([](bg:color_background_base fg:color_container)$terraform[](bg:color_background_base fg:color_container))\ + ([](bg:color_background_base fg:color_container)$vagrant[](bg:color_background_base fg:color_container))\ + (↑ Container modules ↑)\ + (↓ Source control ↓)\ + ([](bg:color_background_base fg:color_sourcecontrol)$fossil_branch[](bg:color_background_base fg:color_sourcecontrol))\ + ([](bg:color_background_base fg:color_sourcecontrol)$hg_branch[](bg:color_background_base fg:color_sourcecontrol))\ + ([](bg:color_background_base fg:color_sourcecontrol)$pijul_channel[](bg:color_background_base fg:color_sourcecontrol))\ + ([](bg:color_background_base fg:color_sourcecontrol)${custom.giturl})\ + ([ ](bg:color_sourcecontrol fg:color_foreground_dark)$git_branch[](bg:color_background_base fg:color_sourcecontrol))\ + ([](bg:color_sourcecontrol fg:color_git_commit)$git_commit[](bg:color_background_base fg:color_git_commit))\ + ([](bg:color_background_base fg:color_git_status)$git_status[](bg:color_background_base fg:color_git_status))\ + ([](bg:color_background_base fg:color_git_state)$git_state[](bg:color_background_base fg:color_git_state))\ + ([](bg:color_background_base fg:color_git_metrics)$git_metrics[](bg:color_background_base fg:color_git_metrics))\ + ([](bg:color_background_base fg:color_vcsh)$vcsh[](bg:color_background_base fg:color_vcsh))\ + (↑ Source control ↑)\ + (↓ Toolchain version modules ↓)\ + ([](bg:color_background_base fg:color_toolchain)$bun[](bg:color_background_base fg:color_toolchain))\ + ([](bg:color_background_base fg:color_toolchain)$c[](bg:color_background_base fg:color_toolchain))\ + ([](bg:color_background_base fg:color_toolchain)$cobol[](bg:color_background_base fg:color_toolchain))\ + ([](bg:color_background_base fg:color_toolchain)$crystal[](bg:color_background_base fg:color_toolchain))\ + ([](bg:color_background_base fg:color_toolchain)$daml[](bg:color_background_base fg:color_toolchain))\ + ([](bg:color_background_base fg:color_toolchain)$dart[](bg:color_background_base fg:color_toolchain))\ + ([](bg:color_background_base fg:color_toolchain)$deno[](bg:color_background_base fg:color_toolchain))\ + ([](bg:color_background_base fg:color_toolchain)$dotnet[](bg:color_background_base fg:color_toolchain))\ + ([](bg:color_background_base fg:color_toolchain)$elixir[](bg:color_background_base fg:color_toolchain))\ + ([](bg:color_background_base fg:color_toolchain)$elm[](bg:color_background_base fg:color_toolchain))\ + ([](bg:color_background_base fg:color_toolchain)$erlang[](bg:color_background_base fg:color_toolchain))\ + ([](bg:color_background_base fg:color_toolchain)$fennel[](bg:color_background_base fg:color_toolchain))\ + ([](bg:color_background_base fg:color_toolchain)$golang[](bg:color_background_base fg:color_toolchain))\ + ([](bg:color_background_base fg:color_toolchain)$haskell[](bg:color_background_base fg:color_toolchain))\ + ([](bg:color_background_base fg:color_toolchain)$haxe[](bg:color_background_base fg:color_toolchain))\ + ([](bg:color_background_base fg:color_toolchain)$java[](bg:color_background_base fg:color_toolchain))\ + ([](bg:color_background_base fg:color_toolchain)$julia[](bg:color_background_base fg:color_toolchain))\ + ([](bg:color_background_base fg:color_toolchain)$kotlin[](bg:color_background_base fg:color_toolchain))\ + ([](bg:color_background_base fg:color_toolchain)$lua[](bg:color_background_base fg:color_toolchain))\ + ([](bg:color_background_base fg:color_toolchain)$nim[](bg:color_background_base fg:color_toolchain))\ + ([](bg:color_background_base fg:color_toolchain)$nodejs[](bg:color_background_base fg:color_toolchain))\ + ([](bg:color_background_base fg:color_toolchain)$ocaml[](bg:color_background_base fg:color_toolchain))\ + ([](bg:color_background_base fg:color_toolchain)$perl[](bg:color_background_base fg:color_toolchain))\ + ([](bg:color_background_base fg:color_toolchain)$php[](bg:color_background_base fg:color_toolchain))\ + ([](bg:color_background_base fg:color_toolchain)$purescript[](bg:color_background_base fg:color_toolchain))\ + ([](bg:color_background_base fg:color_toolchain)$python[](bg:color_background_base fg:color_toolchain))\ + ([](bg:color_background_base fg:color_toolchain)$raku[](bg:color_background_base fg:color_toolchain))\ + ([](bg:color_background_base fg:color_toolchain)$red[](bg:color_background_base fg:color_toolchain))\ + ([](bg:color_background_base fg:color_toolchain)$rlang[](bg:color_background_base fg:color_toolchain))\ + ([](bg:color_background_base fg:color_toolchain)$ruby[](bg:color_background_base fg:color_toolchain))\ + ([](bg:color_background_base fg:color_toolchain)$rust[](bg:color_background_base fg:color_toolchain))\ + ([](bg:color_background_base fg:color_toolchain)$scala[](bg:color_background_base fg:color_toolchain))\ + ([](bg:color_background_base fg:color_toolchain)$swift[](bg:color_background_base fg:color_toolchain))\ + ([](bg:color_background_base fg:color_toolchain)$vlang[](bg:color_background_base fg:color_toolchain))\ + ([](bg:color_background_base fg:color_toolchain)$zig[](bg:color_background_base fg:color_toolchain))\ + (↑ Toolchain version modules ↑)\ + (↓ Package modules ↓)\ + ([](bg:color_background_base fg:color_package)$package[](bg:color_background_base fg:color_package))\ + ([](bg:color_background_base fg:color_package)$buf[](bg:color_background_base fg:color_package))\ + ([](bg:color_background_base fg:color_package)$cmake[](bg:color_background_base fg:color_package))\ + ([](bg:color_background_base fg:color_package)$conda[](bg:color_background_base fg:color_package))\ + ([](bg:color_background_base fg:color_package)$gradle[](bg:color_background_base fg:color_package))\ + ([](bg:color_background_base fg:color_package)$helm[](bg:color_background_base fg:color_package))\ + ([](bg:color_background_base fg:color_package)$meson[](bg:color_background_base fg:color_package))\ + ([](bg:color_background_base fg:color_package)$spack[](bg:color_background_base fg:color_package))\ + (↑ Package modules ↑)\ + ([](bg:color_background_base fg:color_memory)$memory_usage[](bg:color_background_base fg:color_memory))\ + ([](bg:color_background_base fg:color_env_var)${env_var.FIRST}[](bg:color_background_base fg:color_env_var))\ + ([](bg:color_background_base fg:color_battery)$battery[](bg:color_background_base fg:color_battery))\ + ([](bg:color_background_base fg:color_time)$time[](bg:color_background_base fg:color_time))\ + (↑ above input line ↑)\ + (↓ Configuration shell modules ↓)\ + ([](bg:color_background_base fg:color_shellix)$guix_shell[](bg:color_background_base fg:color_shellix))\ + ([](bg:color_background_base fg:color_shellix)$nix_shell[](bg:color_background_base fg:color_shellix))\ + (↑ Configuration shell modules ↑)\ + (\ + [](bg:none fg:color_background_base)\ + $line_break\ + )\ + (↓ on input line ↓)\ + ($localip)\ + ($cmd_duration)\ + ($shlvl)\ + ($jobs)\ + ($status)\ + ($character)\ +""" + +[palettes.myth-orange-dark] +## Generics +color_foreground_light = "#EDEDED" +color_foreground_dark = "#121212" +color_background_base = "#464347" +color_base_orange = "#FFA200" +color_base_red = "#E83017" +color_base_red_light = "#FF620D" +color_base_green = "#C6FF1A" +color_base_yellow = "#FFD90D" +## General colors +color_os = "#C6FF1A" # color_base_green +color_os_text = "#121212" # color_foreground_dark +color_sudo = "#E83017" # color_base_red +color_sudo_text = "#EDEDED" # color_foreground_light +color_hostname = "#22AA22" +color_username = "#1988FF" +color_root = "#E83017" # color_base_red_light +color_directory = "#6F6A70" +color_directory_read_only = "#E83017" # color_base_red +color_directory_repo_before = "#8A848B" +color_memory = "#BBBBBB" +color_memory_text = "#121212" # color_foreground_dark +color_env_var = "#BBBBBB" # color_memory +color_env_var_text = "#121212" # color_foreground_dark +color_shell_level = "#464347" # color_background_base +color_shell_level_text = "#FFD90D" # color_base_yellow +color_battery = "#FF620D" # color_base_red_light +color_battery_text = "#EDEDED" # color_foreground_light +color_time = "#FF620D" # color_base_red_light +color_time_text = "#EDEDED" # color_foreground_light +## Cloud provider colors +color_cloud = "#27385D" +color_cloud_text = "#EDEDED" # color_foreground_light +## Container colors +color_container = "#003E80" +color_container_text = "#EDEDED" # color_foreground_light +## Source control colors +color_sourcecontrol = "#98B359" +color_sourcecontrol_text = "#121212" # color_foreground_dark +color_git_commit = "#5D6B38" +color_git_metrics = "#6F6A70" # color_directory +color_git_metrics_added = "#C6FF1A" +color_git_metrics_deleted = "#E83017" # color_base_red +color_git_state = "#5D6B38" # color_git_commit +color_git_status = "#B4AB5F" +color_vcsh = "#121212" # color_foreground_dark +color_vcsh_text = "#EDEDED" # color_foreground_light +## Toolchain version colors +color_toolchain = "#FF7500" +color_toolchain_text = "#EDEDED" # color_foreground_light +## Package colors +color_package = "#6F6A70" # color_directory +color_package_text = "#EDEDED" # color_foreground_light +## Configuration shell modules +color_shellix = "#27385D" # color_cloud +color_shellix_text = "#EDEDED" # color_foreground_light + +## Generic prompt configurations +[character] +success_symbol = "[](bg:color_base_green fg:color_background_base)[](fg:color_base_green)" +error_symbol = "[](bg:color_base_red fg:color_background_base)[](fg:color_base_red)" +vicmd_symbol = "[](bg:color_background_base fg:color_base_green)[  ](bold bg:color_base_green fg:color_foreground_dark)[](bg:color_base_green fg:color_foreground_dark)" +vimcmd_visual_symbol = "[](bg:color_background_base fg:color_base_yellow)[  ](bold bg:color_base_yellow fg:color_foreground_dark)[](bg:color_base_yellow fg:color_foreground_dark)" +vimcmd_replace_symbol = "[](bg:color_background_base fg:color_base_orange)[  ](bold bg:color_base_orange fg:color_foreground_dark)[](bg:color_base_orange fg:color_foreground_dark)" +vimcmd_replace_one_symbol = "[](bg:color_background_base fg:color_base_orange)[  ](bold bg:color_base_orange fg:color_foreground_light)[](bg:color_base_orange fg:color_foreground_dark)" +format = "$symbol " + +[line_break] +disabled = true + +### Module configurations +### General section +[os] +# disabled = false +style = "bg:color_os fg:color_os_text" +# format = '[$symbol(v$version)(  $edition)(  $codename)(  $type)]($style)[](bg:color_background_base fg:color_os)' +## uncomment the format above for all available information and comment out the line below +format = '[$symbol]($style)[](bg:color_background_base fg:color_os)' +## other variables: +## name = The current operating system name +## type = The current operating system type +## codename = The current operating system codename, if applicable +## edition = The current operating system edition, if applicable +## version = The current operating system version, if applicable + +[os.symbols] +Alpaquita = " " # nf-fa-bell +Alpine = " " # nf-linux-alpine +Amazon = " " # nf-fa-amazon +Android = " " # nf-dev-android +Arch = " " # nf-linux-archlinux +Artix = " " # nf-linux-artix +CentOS = " " # nf-linux-centos +Debian = " " # nf-linux-debian +DragonFly = " " # nf-fae-butterfly +Emscripten = " " # nf-fa-toggle_on +EndeavourOS = " " # nf-linux-endeavour +Fedora = " " # nf-linux-fedora +FreeBSD = " " # nf-linux-freebsd +Garuda = "󰛓 " # nf-md-feather +Gentoo = " " # nf-linux-gentoo +HardenedBSD = "󰔇 " # nf-md-tennis_ball +Illumos = " " # nf-linux-illumos +Linux = " " # nf-linux-tux +Mabox = "󰆦 " # nf-fa-cube +Macos = " " # nf-linux-apple +Manjaro = " " # nf-linux-manjaro +Mariner = " " # nf-fa-life_saver +MidnightBSD = " " # nf-fa-moon_o +Mint = "󰣭 " # nf-md-linux_mint +NetBSD = " " # nf-fa-flag +NixOS = " " # nf-linux-nixos +OpenBSD = " " # nf-linux-openbsd +OpenCloudOS = " " # nf-fa-cloud +openEuler = "󰏒 " # nf-md-owl +openSUSE = " " # nf-linux-opensuse +OracleLinux = "󰌷 " # nf-md-link +Pop = " " # nf-linux-pop_os +Raspbian = " " # nf-linux-raspberry_pi +Redhat = "󱄛 " # nf-md-redhat +RedHatEnterprise = " " # nf-linux-redhat +Redox = "󰀘 " # nf-md-orbit +Solus = " " # nf-linux-solus +SUSE = " " # nf-linux-opensuse +Ubuntu = " " # nf-linux-ubuntu +Unknown = " " # nf-fa-question_circle +Windows = " " # nf-fa-windows + +[shell] +disabled = false +bash_indicator = '\$_' +fish_indicator = "" # Empty string as Fish Shell is my default shell +# fish_indicator = "⋖⋗⋖" # if Fish Shell is not the default shell +zsh_indicator = "%_" +powershell_indicator = "" # nf-seti-powershell +ion_indicator = '(\$_)' +elvish_indicator = "󰘧" # nf-md-lambda +tcsh_indicator = "󰇥 " # nf-md-duck +nu_indicator = "[󰥭](fg:color_base_green)" # nf-md-greater_than +xonsh_indicator = "🐚" # seashell emoji +cmd_indicator = "" # nf-cod-terminal_cmd +unknown_indicator = " " # nf-fa-question_circle +style = "bg:color_foreground_dark fg:color_foreground_light" +format = "[$indicator]($style)" + +[time] +disabled = true +## color is set to dark orange, to get ones attention for e. g. R&R time, based on the configured time_range ;) +style = "bg:color_time fg:color_time_text" +# use_12hr = true +time_format = "%H:%M" +time_range = "20:00:00-06:00:00" +format = "[ $time]($style)" #  = nf-oct-clock + +[custom.root] +# disabled = true +description = "Only display username, if sudo or different from standard user" +style = "bold bg:color_root fg:color_foreground_light" +command = "echo $USER" +when = '[[ -z "$SSH_CONNECTION" ]] && ([[ -n "$DOAS_USER" ]] || [[ "$USER" != "$LOGNAME" ]])' +shell = ["bash", "--noprofile", "--norc"] +format = "[$output]($style)" + +[custom.ssh_user] +# disabled = true +description = "Display username, if on a ssh session, but not in tmux" +style = "bg:color_username fg:color_foreground_light" +command = "echo $USER" +when = '([[ -n "$SSH_CONNECTION" ]] && [[ -z "$TMUX" ]]) && ([[ "$USER" != "root" ]] && [[ -z "$DOAS_USER" ]] && [[ "$USER" == "$LOGNAME" ]])' +shell = ["bash", "--noprofile", "--norc"] +format = "[$output]($style)" + +[custom.ssh_root] +# disabled = true +description = "Display username on a ssh session, if different from standard user" +style = "bold bg:color_root fg:color_foreground_light" +command = "echo $USER" +when = '[[ -n "$SSH_CONNECTION" ]] && ([[ "$USER" == "root" ]] || [[ -n "$DOAS_USER" ]] || [[ "$USER" != "$LOGNAME" ]])' +shell = ["bash", "--noprofile", "--norc"] +format = "[$output]($style)" + +[custom.ssh_host] +# disabled = true +description = "Display hostname if on a ssh session, but not inside a tmux session" +style = "bold bg:color_hostname fg:color_foreground_dark" +command = "uname -n" +when = '[[ -n "$SSH_CONNECTION" ]] && [[ -z "$TMUX" ]]' +shell = ["bash", "--noprofile", "--norc"] +format = "[$output]($style)" + +[username] +disabled = true +# show_always = true +style_root = "bold bg:color_username fg:color_base_red" +style_user = "bg:color_username fg:color_foreground_light" +format = "[$user]($style)" + +[hostname] +disabled = true +style = "bg:color_hostname fg:color_foreground_light" +ssh_symbol = "󰱠 " # nf-md-console_network_outline +# ssh_only = false +trim_at = "." +format = "[($ssh_symbol)$hostname]($style)" + +[directory] +# disabled = true +## If you change the home_symbol, you need the change the directory.substitutions below, as well +home_symbol = " " # nf-seti-home +# home_symbol = "󰮧" # nf-md-home_variant_outline +# home_symbol = "" # nf-oct-home +# home_symbol = "" # nf-cod-home +read_only = "" # nf-fa-lock +style = "italic bg:color_directory fg:color_foreground_light" +read_only_style = "bg:color_directory_read_only fg:color_foreground_light" +# before_repo_root_style = "italic bg:color_directory_repo_before fg:color_foreground_light" +repo_root_style = "italic bold bg:color_directory fg:color_foreground_light" +# truncate_to_repo = false +truncation_length = 4 # default = 3 +truncation_symbol = "… " # default = "" +# fish_style_pwd_dir_length = 3 # default = 0 +# use_logical_path = false +# use_os_path_sep = false +format = "([](bg:color_background_base fg:color_directory_read_only)[$read_only]($read_only_style)[](bg:color_background_base fg:color_directory_read_only))[](bg:color_background_base fg:color_directory)[$path]($style)[](bg:color_background_base fg:color_directory)" +repo_root_format = """\ + ([](bg:color_background_base fg:color_directory_read_only)[$read_only]($read_only_style)[](bg:color_background_base fg:color_directory_read_only))\ + [](bg:color_background_base fg:color_directory)\ + [$repo_root]($repo_root_style)\ + [$path]($style)\ + [](bg:color_background_base fg:color_directory)\ +""" + +[directory.substitutions] +" /Documents" = "󰈚 " # nf-md-text_box +" /Downloads" = " " # nf-fa-download +" /Music" = "" # nf-fa-music +# " /Music" = "󰝚 " # nf-md-music +" /Movies" = "󰿎 " # nf-md-movie_open +# " /Movies" = "" # nf-fa-video_camera +" /Pictures" = "" # nf-fa-image +# " /Pictures" = "󰔉 " # nf-md-image_filter_hdr +" /Sources" = "󰗀" # nf-md-xml +# " /Sources" = "" # nf-dev-opensource +# " /Sources" = "" # nf-cod-code +"/" = "  " + + +### Cloud provider section +[aws] +# disabled = true +symbol = "󰸏 " # nf-md-aws +# symbol = " " # nf-weather-cloud +style = "bg:color_cloud fg:color_cloud_text" +expiration_symbol = ' ' +force_display = true +format = '[$symbol$profile(\($region\))(\[$duration\])]($style)' + +[aws.region_aliases] + +[aws.profile_aliases] + +[azure] +# disabled = false +symbol = " " # nf-cod-azure +# symbol = "󰠅 " # nf-md-microsoft_azure +style = "bg:color_cloud fg:color_cloud_text" +format = '[$symbol($subscription)]($style)' + +[gcloud] +disabled = true +symbol = "󱇶 " # nf-md-google_cloud +style = "bg:color_cloud fg:color_cloud_text" +format = '[$symbol$account(@$domain)(\($region\))]($style)' +## other variables: +## active = The active config name written in ~/.config/gcloud/active_config +## project = The current GCP project + +[gcloud.region_aliases] + +[gcloud.project_aliases] + +[openstack] +# disabled = true +symbol = " " # nf-weather-cloud +style = "bg:color_cloud fg:color_cloud_text" +format = '[$symbol$cloud(\($project\))]($style)' + + +### Container section +[kubernetes] +disabled = false +symbol = "󱃾 " # nf-md-kubernetes +style = "bg:color_container fg:color_container_text" +format = '[$symbol$context(\($namespace\))]($style)' +## other variables: +## cluster = contains the current kubernetes cluster +## user = contains the current kubernetes user + +[kubernetes.context_aliases] + +[kubernetes.user_aliases] + +[docker_context] +# disabled = true +symbol = " " # nf-linux-docker +# symbol = " " # nf-seti-docker +style = "bg:color_container fg:color_container_text" +# only_with_files = false +format = "[$symbol$context]($style)" + +[container] +# disabled = true +symbol = "󰏖 " # nf-md-package_variant +style = "bg:color_package fg:color_container_text dimmed" +format = '[$symbol\[$name\]]($style)' + +[opa] +# disabled = true +symbol = "󱅧 " # nf-md-police_badge +# symbol = "󱢼 " # nf-md-shield_crown +style = "bg:color_container fg:color_container_text" +format = "[$symbol($version)]($style)" + +[pulumi] +# disabled = true +symbol = " " # nf-fa-cube +style = "bg:color_container fg:color_container_text" +search_upwards = true +# format = '[$symbol($version) ($username@)$stack]($style)' +## uncomment the format above to also see the version and comment out the line below +format = "[$symbol($username@)$stack]($style)" + +[singularity] # now Apptainer +# disabled = true +symbol = "󰰣 " # nf-md-alpha_s_circle_outline +style = "bg:color_container fg:color_container_text" +format = '[$symbol\[$env\]]($style)' + +[terraform] +disabled = true +symbol = "󱁢 " # nf-md-terraform +# symbol = " " # nf-seti-terraform +style = "bg:color_container fg:color_container_text" +# format = '[$symbol($version)\($workspace\)]($style)' +## uncomment the format above to see the version and comment out the line below +format = '[$symbol$workspace]($style)' + +[vagrant] +disabled = true +symbol = "⍱ " # apl functional symbol down caret tilde - U+2371 +style = "bg:color_container fg:color_container_text" +format = "[$symbol($version)]($style)" + + +### Source control section +[vcsh] +# disabled = true +symbol = "󰳏 " # nf-md-source_repository +style = "bg:color_vcsh fg:color_vcsh_text" +format = "[$symbol$repo]($style)" + +[fossil_branch] +# disabled = false +symbol = "󰘬" # nf-md-source_branch +style = "bg:color_sourcecontrol fg:color_foreground_dark" +# truncation_length = 4 # default = 9223372036854775807 +# truncation_symbol = "" # default = "…" +format = "[$symbol$branch]($style) " + +# Mercurial +[hg_branch] +disabled = false +symbol = "󰘬" # nf-md-source_branch +style = "bg:color_sourcecontrol fg:color_foreground_dark" +# truncation_length = 8 # default = 9223372036854775807 +# truncation_symbol = "" # default = "…" +format = "[$symbol$branch]($style)" + +[pijul_channel] +# disabled = false +symbol = "󰘬" # nf-md-source_branch +style = "bg:color_sourcecontrol fg:color_foreground_dark" +# truncation_length = 4 # default = 9223372036854775807 +# truncation_symbol = "" # default = "…" +format = "[$symbol$channel]($style) " + +[custom.giturl] +# disabled = true +description = "Display icon for remote Git server" +command = """ + GIT_REMOTE=$(command git ls-remote --get-url 2> /dev/null) + if [[ "$GIT_REMOTE" =~ "github" ]]; then + # GIT_REMOTE_SYMBOL="" # nf-cod-github_inverted + GIT_REMOTE_SYMBOL="" # nf-fa-github + elif [[ "$GIT_REMOTE" =~ "gitlab" ]]; then + GIT_REMOTE_SYMBOL="" # nf-fa-gitlab + elif [[ "$GIT_REMOTE" =~ "bitbucket" ]]; then + GIT_REMOTE_SYMBOL="" # nf-fa-bitbucket + elif [[ "$GIT_REMOTE" =~ "git" ]]; then + GIT_REMOTE_SYMBOL="" # nf-fa-git_square + else + GIT_REMOTE_SYMBOL="󰊢 " # nf-md-git + # GIT_REMOTE_SYMBOL="" # nf-fa-unlink + # GIT_REMOTE_SYMBOL="󰜛" # nf-md-source_commit_local + fi + echo "$GIT_REMOTE_SYMBOL " +""" +require_repo = true +when = true +shell = ["bash", "--noprofile", "--norc"] +format = "[$output ](bg:color_sourcecontrol fg:color_foreground_dark)" + +[git_branch] +# disabled = true +symbol = "" # nf-oct-git_branch +# symbol = "󰊢 " # nf-md-git +style = "bg:color_sourcecontrol fg:color_foreground_dark" +# always_show_remote = true +# truncation_length = 4 # default = 9223372036854775807 +# truncation_symbol = "" # default = "…" +# only_attached = true +# ignore_branches = ["main", "master"] +format = "[$symbol $branch(:$remote_name)]($style)" +## other variables: +## remote_branch = The name of the branch tracked on remote_name + +[git_commit] +# disabled = true +style = "bg:color_git_commit fg:color_foreground_light" +commit_hash_length = 4 # default = 7 +# only_detached = false +tag_disabled = false +tag_symbol = "󰓹 " # nf-md-tag +# tag_max_candidates = 0 +format = "[ $hash $tag]($style)" #  = nf-fa-hashtag + +[git_status] +# disabled = true +style = "bg:color_git_status fg:color_foreground_dark" +staged = " ${count}" # nf-fa-check +modified = "  ${count}" # nf-fa-edit +# modified = "  ${count}" # nf-fa-pencil +renamed = "󰗧${count}" # nf-md-cursor_text +untracked = " ${count}" # nf-fa-question +deleted = "  ${count}" # nf-fa-remove +conflicted = "${count}" # nf-fa-flag +stashed = "  ${count}" # nf-fa-bank +# stashed = "  ${count}" # nf-fa-inbox +up_to_date = "" +ahead = "󰞙 ${count}" # nf-md-arrow_expand_up +behind = "󰞖 ${count}" # nf-md-arrow_expand_down +diverged = "󰡏 ${ahead_count} ${behind_count}" # nf-md-arrow_expand_vertical +# diverged = "󰯎 ${ahead_count} ${behind_count}" # nf-md-swap_vertical_bold +# ignore_submodules = true +format = "[($staged$modified$renamed$untracked$deleted$conflicted$stashed$ahead_behind )]($style)" + +[git_state] +# disabled = true +style = "bg:color_git_state fg:color_foreground_dark" +rebase = "rebasing" +merge = "merging" +revert = "reverting" +cherry_pick = " picking" # nf-fae-cherry +bisect = "bisecting" +am = "am'ing" +am_or_rebase = "am/rebase" +format = '[$state($progress_current/$progress_total)]($style)' + +[git_metrics] +disabled = false +added_style = 'bg:color_git_metrics fg:color_foreground_light' +deleted_style = 'bg:color_git_metrics fg:color_foreground_light' +# only_nonzero_diffs = false +# format = '([󰺪 $added]($added_style))([ 󰺨 $deleted]($deleted_style))' # 󰺪 = nf-md-text_box_plus // 󰺨 = nf-md-text_box_minus +format = '([󰺪 ](bg:color_git_metrics fg:color_git_metrics_added)[$added]($added_style))([ 󰺨 ](bg:color_git_metrics fg:color_git_metrics_deleted)[$deleted]($deleted_style))' # 󰺪 = nf-md-text_box_plus // 󰺨 = nf-md-text_box_minus + + +### Toolchain version section +[bun] +disabled = true +symbol = " " # nf-oct-smiley +style = "bg:color_toolchain fg:color_toolchain_text" +format = "[$symbol($version)]($style)" + +[c] +disabled = true +symbol = " " # nf-custom-c +# symbol = "󰙱 " # nf-md-language_c +# symbol = "C " # plain character +style = "bg:color_toolchain fg:color_toolchain_text" +format = "[$symbol($version(-$name))]($style)" + +[cobol] +disabled = true +symbol = " " # nf-fa-cog +style = "bg:color_toolchain fg:color_toolchain_text" +format = "[$symbol($version)]($style)" + +[crystal] +disabled = true +symbol = " " # nf-custom-crystal +# symbol = "󰬯" # nf-md-crystal_ball +style = "bg:color_toolchain fg:color_toolchain_text" +format = "[$symbol($version)]($style)" + +[daml] +disabled = true +symbol = "𝜦 " # Capital lambda - U+1D726 +style = "bg:color_toolchain fg:color_toolchain_text" +format = "[$symbol($version)]($style)" + +[dart] +disabled = true +symbol = " " # nf-dev-dart +# symbol = " " # nf-seti-dart +style = "bg:color_toolchain fg:color_toolchain_text" +format = "[$symbol($version)]($style)" + +[deno] +disabled = true +symbol = " " # nf-dev-javascript_badge +style = "bg:color_toolchain fg:color_toolchain_text" +format = "[$symbol($version)]($style)" + +[dotnet] +disabled = true +symbol = " " # nf-dev-dotnet +style = "bg:color_toolchain fg:color_toolchain_text" +heuristic = true +format = "[$symbol($version)( 󰓾 $tfm)]($style)" # 󰓾 = nf-md-target + +[elixir] +disabled = true +symbol = " " # nf-custom-elixir +style = "bg:color_toolchain fg:color_toolchain_text" +format = '[$symbol($version) (\(OTP:$otp_version\))]($style)' + +[elm] +disabled = true +symbol = " " # nf-custom-elm +# symbol = " " # nf-fae-tree +style = "bg:color_toolchain fg:color_toolchain_text" +format = "[$symbol($version)]($style)" + +[erlang] +disabled = true +symbol = " " # nf-dev-erlang +style = "bg:color_toolchain fg:color_toolchain_text" +format = "[$symbol($version)]($style)" + +[fennel] +disabled = true +symbol = "󰬍 " # nf-md-alpha_f_box +# symbol = " " # nf-fa-smile_o +style = "bg:color_toolchain fg:color_toolchain_text" +format = "[$symbol($version)]($style)" + +[golang] +disabled = true +symbol = " " # nf-seti-go +# symbol = "󰟓 " # nf-md-language_go +style = "bg:color_toolchain fg:color_toolchain_text" +format = "[$symbol($version)]($style)" + +[haskell] +disabled = true +symbol = " " # nf-seti-haskell +# symbol = "[λ](bold bg:color_toolchain fg:color_toolchain_text)" # Small greek lambda - U+03BB +style = "bg:color_toolchain fg:color_toolchain_text" +format = "[$symbol($version)]($style)" +## other variables: +## snapshot = Currently selected Stack snapshot +## ghc_version = Currently installed GHC version + +[haxe] +disabled = true +symbol = " " # nf-seti-haxe +# symbol = "󰐴 " # nf-md-quadcopter +style = "bg:color_toolchain fg:color_toolchain_text" +format = "[$symbol($version)]($style)" + +[java] +disabled = true +symbol = " " # nf-fae-java +style = "bg:color_toolchain fg:color_toolchain_text" +format = "[$symbol($version)]($style)" + +[julia] +disabled = true +symbol = " " # nf-seti-julia +style = "bg:color_toolchain fg:color_toolchain_text" +format = "[$symbol($version)]($style)" + +[kotlin] +disabled = true +symbol = "󱈙 " # nf-md-language_kotlin +style = "bg:color_toolchain fg:color_toolchain_text" +format = "[$symbol($version)]($style)" + +[lua] +disabled = true +symbol = "󰢱 " # nf-md-language_lua +style = "bg:color_toolchain fg:color_toolchain_text" +format = "[$symbol($version)]($style)" + +[nim] +disabled = true +symbol = "" # nf-seti-nim +# symbol = " " # nf-fae-crown +style = "bg:color_toolchain fg:color_toolchain_text" +format = "[$symbol($version)]($style)" + +[nodejs] +disabled = true +symbol = "󰎙 " # nf-md-nodejs +style = "bg:color_toolchain fg:color_toolchain_text" +not_capable_style = "bg:color_toolchain fg:color_foreground_dark" +format = "[$symbol($version)]($style)" + +[ocaml] +disabled = true +symbol = " " # nf-seti-ocaml +style = "bg:color_toolchain fg:color_toolchain_text" +format = '[$symbol($version)( \($switch_indicator$switch_name\))]($style)' + +[perl] +disabled = true +symbol = "" # nf-seti-perl +# symbol = " " # nf-dev-perl +style = "bg:color_toolchain fg:color_toolchain_text" +format = "[$symbol($version)]($style)" + +[php] +disabled = true +symbol = " " # nf-dev-php +# symbol = "󰌟 " # nf-md-language_php +# symbol = "" # nf-seti-php +style = "bg:color_toolchain fg:color_toolchain_text" +format = "[$symbol($version)]($style)" + +[purescript] +disabled = true +symbol = "" # nf-custom-purescript +# symbol = "⇔ " # left right double arrow - U+21D4 +style = "bg:color_toolchain fg:color_toolchain_text" +format = "[$symbol($version)]($style)" + +[python] +disabled = true +symbol = "󰌠 " # nf-md-language_python +# symbol = " " # nf-fae-python +style = "bg:color_toolchain fg:color_toolchain_text" +python_binary = [ "python3", "python", "python2" ] +# pyenv_version_name = true +# pyenv_prefix = "pyenv " # default +format = '[${symbol}(${pyenv_prefix}${version})(\($virtualenv\))]($style)' + +[raku] +disabled = true +symbol = " " # nf-fae-butterfly +style = "bg:color_toolchain fg:color_toolchain_text" +format = "[$symbol($version)(-$vm_version)]($style)" + +[red] +disabled = true +symbol = "󱥒 " # nf-md-pyramid +style = "bg:color_toolchain fg:color_toolchain_text" +format = "[$symbol($version)]($style)" + +[rlang] +disabled = true +symbol = "󰟔 " # nf-md-language_r +style = "bg:color_toolchain fg:color_toolchain_text" +format = "[$symbol($version)]($style)" + +[ruby] +disabled = true +symbol = "󰴭 " # nf-md-language_ruby +# symbol = " " # nf-fae-ruby +# symbol = " " # nf-oct-ruby +style = "bg:color_toolchain fg:color_toolchain_text" +format = "[$symbol($version)]($style)" + +[rust] +disabled = true +symbol = "󱘗 " # nf-md-language_rust +style = "bg:color_toolchain fg:color_toolchain_text" +format = "[$symbol($version)]($style)" + +[scala] +disabled = true +symbol = " " # nf-dev-scala +style = "bg:color_toolchain fg:color_toolchain_text" +format = "[$symbol($version)]($style)" + +[swift] +disabled = true +symbol = "󰛥 " # nf-md-language_swift +# symbol = "" # nf-seti-swift +style = "bg:color_toolchain fg:color_toolchain_text" +format = "[$symbol($version)]($style)" + +[vlang] +disabled = true +symbol = "󱑹 " # nf-md-cosine_wave +style = "bg:color_toolchain fg:color_toolchain_text" +format = "[$symbol($version)]($style)" + +[zig] +disabled = true +symbol = "" # nf-seti-zig +# symbol = '\[Z\] ' +style = "bg:color_toolchain fg:color_toolchain_text" +format = "[$symbol($version)]($style)" + + +### Package section +[package] +# disabled = true +symbol = " " # nf-oct-package +style = "bg:color_package fg:color_package_text" +display_private = true +format = "[$symbol($version)]($style)" + +[buf] +# disabled = true +symbol = " " # nf-fa-barcode +style = "bg:color_package fg:color_package_text" +format = "[$symbol($version)]($style)" + +[cmake] +# disabled = true +symbol = "󰔷 " # nf-md-triangle_outline +# symbol = "󰔶 " # nf-md-triangle +style = "bg:color_package fg:color_package_text" +format = "[$symbol($version)]($style)" + +[conda] +# disabled = true +# symbol = " " # nf-fa-circle_o +symbol = "🅒 " # Negative Circled Latin Capital Letter C +style = "bg:color_package fg:color_package_text" +# ignore_base = false +# truncation_length = 0 # no truncation +format = "[$symbol$environment]($style)" + +[gradle] +# disabled = true +symbol = " " # nf-seti-gradle +# symbol = "󰟆 " # nf-md-elephant +style = "bg:color_package fg:color_package_text" +# recursive = true +format = "[$symbol($version)]($style)" + +[helm] +disabled = true +symbol = "󰠳 " # nf-md-ship_wheel +style = "bg:color_package fg:color_package_text" +format = "[$symbol($version)]($style)" + +[meson] +# disabled = true +symbol = "󰔶 " # nf-md-triangle +# symbol = "▲" # black up-pointing triangle +style = "bg:color_package fg:color_package_text" +# truncation_length = 20 # default = 4294967295 +# truncation_symbol = "" # default = "…" +format = "[$symbol$project]($style)" + +[spack] +# disabled = true +symbol = "󰦻 " # nf-md-arrow_decision +style = "bg:color_package fg:color_package_text" +# truncation_length = 0 # default = 1 +format = '[$symbol$environment]($style)' + + +### Information section 1 +[memory_usage] +# disabled = false +symbol = "󰍛 " # nf-md-memory +style = "bg:color_memory fg:color_memory_text" +# threshold = 75 # default +format = "[$symbol$ram(:$swap)]($style)" +## other variables: +## ram_pct = The percentage of the current system memory +## swap_pct = The swap memory percentage of the current system swap memory file + +[env_var.FIRST] ## change to your likings +disabled = true +symbol = "" # nf-fa-dollar +style = "bg:color_env_var fg:color_env_var_text" +variable = "STARSHIP_CONFIG" +default = " 󱃓 " # shows if not defined - nf-md-circle_off_outline +format = "[$symbol$env_value]($style)" + +[battery] +disabled = true +full_symbol = "󰁹 " # nf-md-battery +charging_symbol = "󱊥 " # nf-md-battery_charging_medium +discharging_symbol = "󱊡 " # nf-md-battery_low +unknown_symbol = "󰂑 " # nf-md-battery_unknown +empty_symbol = "󰂎 " # nf-md-battery_outline +format = "[$symbol$percentage]($style)" +[[battery.display]] +threshold = 10 +style = "bold bg:color_battery fg:color_battery_text" +[[battery.display]] +threshold = 20 +style = "bg:color_battery fg:color_battery_text" +[[battery.display]] # uncomment this section to always see your battery information +threshold = 100 +style = "bg:color_battery fg:color_battery_text" + +### Configuration shell section +[guix_shell] +# disabled = true +symbol = " " # nf-linux-gnu_guix +# symbol = "󰆚 " # nf-md-cow +style = "bg:color_shellix fg:color_shellix_text" +format = '[$symbol]($style)[shell]($style)' + +[nix_shell] +# disabled = true +symbol = " " # nf-linux-nixos +style = "bg:color_shellix fg:color_shellix_text" +impure_msg = '[](bg:color_shellix fg:color_base_red_light)' # nf-weather-gale_warning - personal setting +pure_msg = '[ ](bg:color_shellix fg:color_base_green)' # nf-weather-day_sunny - personal setting +# impure_msg = '[\(impure\)](bg:color_shellix fg:color_base_red_light)' +# pure_msg = '[\(pure\)](bg:color_shellix fg:color_base_green)' +unknown_msg = '[ ](bg:color_shellix fg:color_base_red)' # nf-weather-na +# heuristic = true +format = '[$symbol$name]($style)[\($state\)](bg:color_shellix fg:color_directory_repo_before)' + + +### Information section 2 +[localip] +# disabled = false +style = "bg:color_background_base fg:color_base_orange" +# ssh_only = false +format = "[ 󰩠 $localipv4]($style)" # 󰩠 = nf-md-ip_network + +[cmd_duration] +disabled = true +style = "bg:color_background_base fg:color_base_yellow" +show_milliseconds = true +# show_notifications = true +# notification_timeout = 60000 +format = "[ 󰔛 $duration]($style)" + +[shlvl] +disabled = false +symbol = " " # nf-fa-level_up +style = "bold bg:color_shell_level fg:color_shell_level_text" +# repeat = true +# threshold = 3 # default = 2 +format = "[$symbol$shlvl]($style)" + +[jobs] +# disabled = true +symbol = "  " # nf-fa-list +style = "bold bg:color_background_base fg:color_base_orange" +# symbol_threshold = 1 # default +# number_threshold = 2 # default +format = "[$symbol$number]($style)" + +[sudo] +disabled = false +symbol = " 󱫖 " # nf-md-timer_lock_open_outline +style = "bg:color_sudo fg:color_sudo_text" +# allow_windows = true +format = "[$symbol]($style)" + +[status] +# disabled = false +symbol = "" # nf-fa-exclamation +success_symbol = "" +not_executable_symbol = " " # nf-fa-times_circle +not_found_symbol = " " # nf-fa-question_circle +sigint_symbol = " " # nf-fa-stop_circle +signal_symbol = "󰉁 " # nf-md-flash +style = "bg:color_background_base fg:color_base_red" +map_symbol = true +# recognize_signal_code = false +# pipestatus = true +pipestatus_separator = "|" +pipestatus_format = '\[$pipestatus\] => [$symbol$common_meaning$signal_name$maybe_int]($style)' +format = "[$symbol$status]($style)" + +[fill] +# disabled = true +symbol = ' ' +# symbol = '' # nf-cod-dash +# symbol = '' # nf-oct-dash +# symbol = '━' # box drawings heavy horizontal +style = 'none' +# style = 'fg:color_background_base' diff --git a/kubezero/zdt-base/zdt-ascii.txt b/kubezero/zdt-base/zdt-ascii.txt index b3e74e5..2220873 100644 --- a/kubezero/zdt-base/zdt-ascii.txt +++ b/kubezero/zdt-base/zdt-ascii.txt @@ -1,12 +1,12 @@ -\x1b[38;2;32;120;108m .. - ox@@@@@x - -x@@@@@@@@@@@@x- - .x@@@x- -x@@@x. - ox@@@@x ox@@@@@@@@x- x@@@@xo - @@@@@@@@ x@@@@@@@@@@@@x @@@@@@@@o - o @@@@@x -x@@@@@@@@x- x@@@@@ o - @@@x- @@@x- -x@@@o .x@@@. - @@@@@@@x. x@@@@@@@@@@@@@ o@@@@@@@. + .. + ox@@@@@x + -x@@@@@@@@@@@@x- + .x@@@x- -x@@@x. + ox@@@@x ox@@@@@@@@x- x@@@@xo + @@@@@@@@ x@@@@@@@@@@@@x @@@@@@@@o + o @@@@@x -x@@@@@@@@x- x@@@@@ o + @@@x- @@@x- -x@@@o .x@@@. + @@@@@@@x. x@@@@@@@@@@@@@ o@@@@@@@. @@@@@@@@@@xo @@@@@@ -x@@@@@xx@@@. @@@@@@@@@@@@@@x- .x@@@@@x- -@@@. @@@@@@@@ @@@@@@@@ x@@@@@x ox x@@@. @@ -14,8 +14,8 @@ @@@@x @ @@@@@@@@ @@@x .-o .x@@@. @@@@@x @xoo@@@@ @@@@xx .xxx -@@@. @@@@@@@ @@@@ @@@@@ x@xo x@@@. - @@@@@@@. -x@@@@@@ @@@@ x. -x@@@@@ - .@@@@@@@@@@@@@ @@@x .x@@@@@x - x@@@@@@@@@ @@@@x@@@@@ - @@@@@@ @@@@@@. - o@@ @@x + @@@@@@@. -x@@@@@@ @@@@ x. -x@@@@@ + .@@@@@@@@@@@@@ @@@x .x@@@@@x + x@@@@@@@@@ @@@@x@@@@@ + @@@@@@ @@@@@@. + o@@ @@x diff --git a/kubezero/zdt-base/zdt-base.post-install b/kubezero/zdt-base/zdt-base.post-install index 2d3a709..62f654c 100644 --- a/kubezero/zdt-base/zdt-base.post-install +++ b/kubezero/zdt-base/zdt-base.post-install @@ -1,6 +1,16 @@ #!/bin/sh -. /lib/tiny-cloud/common +# usage: add_once ... +add_once() { + local file="$1" + shift + for line; do + if ! grep -x -F "$line" "$file" 2>/dev/null; then + mkdir -p "${file%/*}" + printf "%s\n" "$line" >> "$file" + fi + done +} # Enable SSH keepalive sed -i -e 's/^[\s#]*TCPKeepAlive\s.*/TCPKeepAlive yes/' -e 's/^[\s#]*ClientAliveInterval\s.*/ClientAliveInterval 60/' /etc/ssh/sshd_config @@ -20,25 +30,18 @@ sed -i -e 's/^[\s#]*FAST_STARTUP=.*/FAST_STARTUP=yes/' /etc/conf.d/chronyd #echo 'enable parallel openRC' # Setup syslog-ng json logging and apparmor tweaks -cp /lib/zdt/syslog-ng.conf /etc/syslog-ng/syslog-ng.conf -cp /lib/zdt/syslog-ng.logrotate.conf /etc/logrotate.d/syslog-ng -cp /lib/zdt/syslog-ng.apparmor /etc/apparmor.d/local/sbin.syslog-ng - -[ -f /etc/periodic/daily/logrotate ] && mv /etc/periodic/daily/logrotate /etc/periodic/hourly/ -echo 'syslog-ng: all to /var/log/messages as json, rotate hourly' +cp /usr/lib/zdt/syslog-ng.conf /etc/syslog-ng/syslog-ng.conf +cp /usr/lib/zdt/syslog-ng.logrotate.conf /etc/logrotate.d/syslog-ng +cp /usr/lib/zdt/syslog-ng.apparmor /etc/apparmor.d/local/sbin.syslog-ng +echo 'syslog-ng: all to /var/log/messages as json' # use init to spawn monit -add_once /etc/inittab ":2345:respawn:/usr/bin/monit -Ic /etc/monitrc.zdt" >/dev/null -echo 'Enable monit via inittab' +add_once /etc/inittab ":2345:respawn:/usr/bin/monit -I" >/dev/null +add_once /etc/monitrc "include /etc/monit.d/*.conf" >/dev/null +echo 'enabled monit via inittab' -# QoL - color prompt even for doas bash -[ -f /etc/profile.d/color_prompt.sh.disabled ] && mv /etc/profile.d/color_prompt.sh.disabled /etc/profile.d/color_prompt.sh -ln -sf /etc/profile.d/color_prompt.sh /etc/bash/color_prompt.sh +# QoL - make bash default shell for root too +sed -i -e '/root/ s#\:[^\:]*$#\:/bin/bash#g' /etc/passwd -cat < /etc/profile.d/zdt-alias.sh -alias rs='doas bash' -alias sudo='doas' -alias cu='doas cat /var/log/user-data.log' -alias cl="doas cat /var/log/messages | jq -r '\"\(.time): \(.message)\"'" -alias tl="doas tail -f /var/log/messages | jq -r '\"\(.time): \(.message)\"'" -EOF +add_once /etc/bash/bashrc "export STARSHIP_CONFIG=/etc/starship.toml" >/dev/null +add_once /etc/bash/bashrc 'eval -- "$(/usr/bin/starship init bash --print-full-init)"' >/dev/null diff --git a/kubezero/zdt-base/zdt-profile.sh b/kubezero/zdt-base/zdt-profile.sh new file mode 100644 index 0000000..ad1de99 --- /dev/null +++ b/kubezero/zdt-base/zdt-profile.sh @@ -0,0 +1,11 @@ +# fastfetch for first login shell +[ -n "$SSH_TTY" -a "$SHLVL" -eq 1 ] && fastfetch -c /etc/fastfetch.jsonc + +# default aliases +alias rs='doas bash' +alias sudo='doas' +alias monit_status='monit status -c /etc/monitrc.zdt' + +alias cu='doas cat /var/log/user-data.log' +alias cl="doas cat /var/log/messages | jq -r '\"\(.time): \(.message)\"'" +#alias tl="doas tail -f /var/log/messages | jq -r '\"\(.time): \(.message)\"'"