2022-11-22 12:49:03 +00:00
|
|
|
# Contributor: Stefan Reimer <stefan@zero-downtime.net>
|
|
|
|
# Maintainer: Stefan Reimer <stefan@zero-downtime.net>
|
|
|
|
pkgname=zdt-base
|
|
|
|
pkgver=0.0.1
|
|
|
|
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"
|
2022-12-03 17:04:13 +00:00
|
|
|
depends="logrotate syslog-ng neofetch monit file"
|
2022-11-22 12:49:03 +00:00
|
|
|
options="!check"
|
2022-11-24 19:01:40 +00:00
|
|
|
subpackages="$pkgname-openrc $pkgname-aws"
|
|
|
|
install="$pkgname.post-install"
|
2022-11-22 12:49:03 +00:00
|
|
|
|
2022-11-24 19:01:40 +00:00
|
|
|
source="
|
2022-12-03 17:04:13 +00:00
|
|
|
lib-base.sh
|
|
|
|
cb-mount-var.init
|
|
|
|
cb-volumes.startstop
|
2022-11-24 19:01:40 +00:00
|
|
|
zdt-sysctl.conf
|
|
|
|
https://raw.githubusercontent.com/pixelb/ps_mem/v3.14/ps_mem.py
|
|
|
|
syslog-ng.conf
|
|
|
|
syslog-ng.logrotate.conf
|
|
|
|
monitrc
|
|
|
|
monit_alert.sh.aws
|
|
|
|
neofetch.conf
|
|
|
|
zdt-ascii.txt
|
|
|
|
dhclient.conf
|
|
|
|
cloudbender.stop
|
|
|
|
route53.py
|
2022-11-22 12:49:03 +00:00
|
|
|
get_iam_sshkeys.py
|
|
|
|
"
|
|
|
|
|
|
|
|
build() {
|
2022-11-24 19:01:40 +00:00
|
|
|
sed -i -e 's,#!/usr/bin/env python,#!/usr/bin/env python3,' ps_mem.py
|
2022-11-22 12:49:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
package() {
|
2022-12-03 17:04:13 +00:00
|
|
|
# core library
|
|
|
|
install -Dm755 "$srcdir/lib-base.sh" "$pkgdir/usr/lib/cloudbender/base.sh"
|
|
|
|
|
2022-11-24 19:01:40 +00:00
|
|
|
# dhcp tuning for MTU
|
|
|
|
install -Dm644 "$srcdir"/dhclient.conf "$pkgdir"/etc/dhcp/dhclient.conf
|
|
|
|
|
|
|
|
# various sysctl tunings
|
|
|
|
install -Dm644 "$srcdir"/zdt-sysctl.conf "$pkgdir"/etc/sysctl.d/60-zdt.conf
|
|
|
|
|
2022-12-03 17:04:13 +00:00
|
|
|
# init script to mount var as early as possible, cannot use any network !
|
|
|
|
install -Dm755 "$srcdir/cb-mount-var.init" "$pkgdir/etc/init.d/cb-mount-var"
|
|
|
|
|
|
|
|
# ensure "local" init script runs before user-data
|
|
|
|
mkdir -p "$pkgdir/etc/conf.d"
|
|
|
|
echo 'rc_before="tiny-cloud-final"' > "$pkgdir/etc/conf.d/local"
|
|
|
|
install -Dm755 "$srcdir/cb-volumes.startstop" "$pkgdir/etc/local.d/cb-volumes.start"
|
|
|
|
( cd $pkgdir/etc/local.d; ln -s cb-volumes.start cb-volumes.stop; )
|
2022-11-24 19:01:40 +00:00
|
|
|
|
|
|
|
# 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
|
|
|
|
|
|
|
|
# monit
|
|
|
|
mkdir -p "$pkgdir"/etc/monit.d
|
|
|
|
install -Dm600 "$srcdir"/monitrc "$pkgdir"/etc/monitrc.zdt
|
|
|
|
|
|
|
|
# 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
|
2022-11-22 12:49:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
aws() {
|
2022-11-24 19:01:40 +00:00
|
|
|
# Basic AWS tools
|
2022-11-22 12:49:03 +00:00
|
|
|
mkdir -p "$subpkgdir"
|
|
|
|
install -Dm755 "$srcdir"/route53.py "$subpkgdir"/usr/sbin/route53.py
|
|
|
|
install -Dm755 "$srcdir"/get_iam_sshkeys.py "$subpkgdir"/usr/sbin/get_iam_sshkeys.py
|
2022-11-24 19:01:40 +00:00
|
|
|
|
|
|
|
# Cloudbender SNS integration
|
|
|
|
install -Dm755 "$srcdir"/cloudbender.stop "$subpkgdir"/etc/local.d/cloudbender.stop
|
|
|
|
install -Dm755 "$srcdir"/monit_alert.sh.aws "$pkgdir"/usr/bin/monit_alert.sh
|
|
|
|
mkdir -p "$subpkgdir"/etc/cloudbender/shutdown.d
|
2022-11-22 12:49:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
sha512sums="
|
2022-12-03 17:04:13 +00:00
|
|
|
62e5bd982d3e957ca445891b00cc9fcdc3df22414cd332321a6046ae4ee4c98f9646d3680d83a6d643f01ded229bfea6f968e5734a58a5d233ac899c92ce85da lib-base.sh
|
|
|
|
0d78bb09b143576b1bc582a62868236e4febed306aa9d085570e91cf9cfbc77dd379342ade9f99203d822f830bbd55d42dcba52cb934952c7b749e252fab1eb3 cb-mount-var.init
|
|
|
|
b4fbbf55c1a4d38c2877bade1d5e2ce5f1276a6704b0bb95b025e66a7c678710a60a8d4f37cb1f136af1435657cd4ffd03709e80fb61f8950ee39520c1a47f31 cb-volumes.startstop
|
2022-11-24 19:01:40 +00:00
|
|
|
b9479835d8667fa99f8b1b140f969f0464a9bb3c60c7d19b57e306cfe82357d453932791e446caded71fddd379161ae8328367f1ee75ae3afc1b85e12294b621 zdt-sysctl.conf
|
|
|
|
76e6a4f309f31bfa07de2d3b1faebe5670722752e18157b69d6e868cbe9e85eda393aed0728b0347a01a810eee442844c78259f86ff71e3136a013f4cbfaaea4 ps_mem.py
|
|
|
|
9d087f2d4403a9c6d4d2f06fbb86519f2b8b134d8eb305facaef07c183815f917fb7bac916d39d504dbab7fdf3321a3f70954dde57e8986cc223371715bb1c54 syslog-ng.conf
|
|
|
|
484bdcf001b71ce5feed26935db437c613c059790b99f3f5a3e788b129f3e22ba096843585309993446a88c0ab5d60fd0fa530ef3cfb6de1fd34ffc828172329 syslog-ng.logrotate.conf
|
|
|
|
b928ba547af080a07dc9063d44cb0f258d0e88e7c5a977e8f1cf1263c23608f0a138b8ffca0cdf5818ee72fccb3ce8433f877811be3107bb9c275dfff988179c monitrc
|
|
|
|
64944727d658ff37e7ff9d22a23869e225e104d9229756ba4fef1fc481c56f782472a1c74f8127636b4a98d4545ae30e7d35822a1f0a0fa31a59ec8eaf8c0396 monit_alert.sh.aws
|
|
|
|
346b0170ada6cc1207ffb7b8ef138a1570a63c7df4d57618aa4b6b6c0d2df2197b0f5b23578ec83c641ee5e724865ac06985222e125809c990467426a0851b72 neofetch.conf
|
|
|
|
532b8e2eb04942ab20bdc36b5dea1c60239fcbfcb85706123f3e05c18d65c938b85e9072d964ae5793177625a8db47b532db1f5bd5ed5ecbb70d5a331666ff54 zdt-ascii.txt
|
|
|
|
c565516121b9e6f9d5f769511eb900546753e67cc4208d1b388fdce44cd28699261a5c3905f9a168d4b2d45ac65ac3a2a6a95335f1bbd76d2f444d5f50ec5c9e dhclient.conf
|
2022-12-03 17:04:13 +00:00
|
|
|
cd7ddd7923d45370275fa26c0f2c6dea930c6788c8f55af4388eb42309125c15e5cbb34b186ab4aebbeac3470bed0ba2db9dd46ba8796242b59092f51c5cedf5 cloudbender.stop
|
2022-11-22 12:49:03 +00:00
|
|
|
2d419d5c25a3829e99326b09876f459e48ab66f5756a8ad39b406c0f2829f5a323e8ff512afd8f32b7b07f24c88efa911bee495ce6c4d1925194cb54d3ba57bd route53.py
|
|
|
|
00eaff6c0a506580340b2547c3b1602a54238bac6090a15516839411478a4b4fdc138668b8ad23455445131f3a3e3fda175ed4bb0dd375402641c0e7b69c3218 get_iam_sshkeys.py
|
|
|
|
"
|