snapshot of https://github.com/zulip/zulip.git @ 48c69911c7dd4e03b20552eb3bd77ad8151c1357 (2026-09-15)
Some checks failed
Code scanning / CodeQL (push) Failing after 15s
Zulip production suite / Ubuntu 22.04 production build (push) Failing after 26s
Zulip production suite / Debian 12 production install with custom db name and user (push) Has been skipped
Zulip production suite / Ubuntu 22.04 production install and PostgreSQL upgrade with pgroonga (push) Has been skipped
Zulip production suite / Ubuntu 24.04 production install (push) Has been skipped
Zulip production suite / Ubuntu 26.04 production install (push) Has been skipped
Zulip production suite / Debian 13 production install (push) Has been skipped
Zulip production suite / 7.0 Version Upgrade (push) Has been skipped
Zulip production suite / 8.0 Version Upgrade (push) Has been skipped
Zulip production suite / 6.0 Version Upgrade (push) Has been skipped
Zulip production suite / 10.0 Version Upgrade (push) Has been skipped
Zulip production suite / 9.0 Version Upgrade (push) Has been skipped
Zulip production suite / 12.0 Version Upgrade (push) Has been skipped
Zulip production suite / 11.0 Version Upgrade (push) Has been skipped
GitHub Actions Security Analysis with zizmor / zizmor (push) Failing after 3s
Zulip CI / Debian 12 (Python 3.11, backend + documentation) (push) Failing after 26s
Zulip CI / Ubuntu 22.04 (Python 3.10, backend + frontend) (push) Failing after 3s
Zulip CI / Ubuntu 24.04 (Python 3.12, backend) (push) Failing after 25s
Zulip CI / Ubuntu 26.04 (Python 3.14, backend) (push) Failing after 25s
Zulip CI / Debian 13 (Python 3.13, backend) (push) Failing after 28s
Zulip production suite / Required jobs (push) Has been cancelled
Zulip CI / Required jobs (push) Has been cancelled
API Documentation Update Check / check-feature-level-updated (push) Has been cancelled
API Documentation Update Check / notify-if-api-docs-changed (push) Has been cancelled

This commit is contained in:
upstream-mirror
2026-09-15 15:05:30 +05:00
commit 64898b2c79
8999 changed files with 1757358 additions and 0 deletions

40
tools/test-install/destroy-all Executable file
View File

@@ -0,0 +1,40 @@
#!/usr/bin/env bash
set -e
usage() {
echo "usage: destroy-all -f" >&2
exit 1
}
args="$(getopt -o +f --long help,force -- "$@")"
eval "set -- $args"
while true; do
case "$1" in
--help) usage ;;
-f | --force)
FORCE=1
shift
;;
--)
shift
break
;;
*) usage ;;
esac
done
if [ -z "$FORCE" ] || [ "$#" -gt 0 ]; then
usage
fi
if [ "$EUID" -ne 0 ]; then
echo "error: this script must be run as root" >&2
exit 1
fi
lxc-ls -f \
| perl -lane '$_ = $F[0]; print if (/^zulip-install-/ && !/-base$/)' \
| while read -r c; do
echo "$c"
lxc-destroy -f -n "$c"
done

91
tools/test-install/install Executable file
View File

@@ -0,0 +1,91 @@
#!/usr/bin/env bash
set -e
usage() {
echo "usage: install -r RELEASE {TARBALL|DIR} [...installer opts..]" >&2
exit 1
}
args="$(getopt -o +r: --long help,release: -- "$@")"
eval "set -- $args"
while true; do
case "$1" in
--help) usage ;;
-r | --release)
RELEASE="$2"
shift
shift
;;
--)
shift
break
;;
*) usage ;;
esac
done
INSTALLER="$1"
shift || usage
INSTALLER_ARGS=("$@")
set --
if [ -z "$RELEASE" ] || [ -z "$INSTALLER" ]; then
usage
fi
if [ "$EUID" -ne 0 ]; then
echo "error: this script must be run as root" >&2
exit 1
fi
set -x
THIS_DIR="$(dirname "$(readlink -f "$0")")"
BASE_CONTAINER_NAME=zulip-install-"$RELEASE"-base
if ! lxc-info -n "$BASE_CONTAINER_NAME" >/dev/null 2>&1; then
"$THIS_DIR"/prepare-base "$RELEASE"
fi
while [ -z "$CONTAINER_NAME" ] || lxc-info -n "$CONTAINER_NAME" >/dev/null 2>&1; do
shared_dir="$(mktemp -d --tmpdir "$RELEASE"-XXXXX)"
CONTAINER_NAME=zulip-install-"$(basename "$shared_dir")"
done
message="$(
cat <<EOF
Container:
sudo lxc-attach --clear-env -n $CONTAINER_NAME
Unpacked tree:
sudo ls $shared_dir/mnt/zulip-server
EOF
)"
trap 'set +x; echo "$message"' EXIT
if [ -d "$INSTALLER" ]; then
installer_dir="$(readlink -f "$INSTALLER")"
else
installer_dir="$(mktemp -d --tmpdir zulip-server-XXXXX)"
tar -xf "$INSTALLER" -C "$installer_dir" --transform='s,^[^/]*,zulip-server,'
fi
mkdir -p /srv/zulip/test-install/pip-cache
mkdir "$shared_dir"/upper "$shared_dir"/work "$shared_dir"/mnt
mount -t overlay overlay \
-o lowerdir="$installer_dir",upperdir="$shared_dir"/upper,workdir="$shared_dir"/work \
"$shared_dir"/mnt
lxc-copy --ephemeral --keepdata -n "$BASE_CONTAINER_NAME" -N "$CONTAINER_NAME" \
-m bind="$shared_dir"/mnt:/mnt/src/,bind=/srv/zulip/test-install/pip-cache:/root/.cache/pip
"$THIS_DIR"/lxc-wait -n "$CONTAINER_NAME"
run() {
lxc-attach --clear-env -n "$CONTAINER_NAME" -- "$@"
}
run eatmydata -- /mnt/src/zulip-server/scripts/setup/install --self-signed-cert "${INSTALLER_ARGS[@]}"
# TODO settings.py, initialize-database, create realm

72
tools/test-install/lxc-wait Executable file
View File

@@ -0,0 +1,72 @@
#!/usr/bin/env bash
set -e
usage() {
echo "usage: lxc-wait -n CONTAINER" >&2
exit 1
}
args="$(getopt -o +n: --long help,name: -- "$@")"
eval "set -- $args"
while true; do
case "$1" in
--help) usage ;;
-n | --name)
CONTAINER_NAME="$2"
shift
shift
;;
--)
shift
break
;;
*) usage ;;
esac
done
if [ -z "$CONTAINER_NAME" ] || [ "$#" -gt 0 ]; then
usage
fi
if [ "$EUID" -ne 0 ]; then
echo "error: this script must be run as root" >&2
exit 1
fi
# We poll.
poll_runlevel() {
for _ in {1..60}; do
echo "lxc-wait: $CONTAINER_NAME: polling for boot..." >&2
runlevel="$(lxc-attach --clear-env -n "$CONTAINER_NAME" -- runlevel 2>/dev/null)" \
|| {
sleep 1
continue
}
if [ "$runlevel" != "${0%[0-9]}" ]; then
echo "lxc-wait: $CONTAINER_NAME: booted!" >&2
poll_network
fi
sleep 1
done
echo "error: timeout waiting for container to boot" >&2
exit 1
}
poll_network() {
for _ in {1..60}; do
echo "lxc-wait: $CONTAINER_NAME: polling for network..." >&2
# New hosts don't have `host` or `nslookup`
lxc-attach --clear-env -n "$CONTAINER_NAME" -- \
ping -q -c 1 archive.ubuntu.com 2>/dev/null >/dev/null \
|| {
sleep 1
continue
}
echo "lxc-wait: $CONTAINER_NAME: network is up!" >&2
exit 0
done
echo "error: timeout waiting for container to get network" >&2
exit 1
}
poll_runlevel

64
tools/test-install/prepare-base Executable file
View File

@@ -0,0 +1,64 @@
#!/usr/bin/env bash
set -e
if [ "$EUID" -ne 0 ]; then
echo "error: this script must be run as root" >&2
exit 1
fi
RELEASE="$1"
ARCH=amd64 # TODO: maybe i686 too
case "$RELEASE" in
jammy)
extra_packages=(python3-pip)
;;
*)
echo "error: unsupported target release: $RELEASE" >&2
exit 1
;;
esac
THIS_DIR="$(dirname "$(readlink -f "$0")")"
set -x
CONTAINER_NAME=zulip-install-$RELEASE-base
if ! lxc-info -n "$CONTAINER_NAME" >/dev/null 2>&1; then
lxc-create -n "$CONTAINER_NAME" -t download -- -d ubuntu -r "$RELEASE" -a "$ARCH"
fi
lxc-start -n "$CONTAINER_NAME"
"$THIS_DIR"/lxc-wait -n "$CONTAINER_NAME"
run() {
lxc-attach --clear-env -n "$CONTAINER_NAME" -- "$@"
}
run passwd -d root
run apt-get update
run apt-get dist-upgrade -y
# As an optimization, we install a bunch of packages the installer
# would install for itself.
run apt-get install -y --no-install-recommends \
xvfb parallel unzip zip jq python3-pip curl eatmydata \
git crudini openssl ssl-cert \
build-essential python3-dev \
memcached redis-server \
hunspell-en-us supervisor libssl-dev puppet \
gettext libffi-dev libfreetype6-dev zlib1g-dev libjpeg-dev \
libldap2-dev \
libxml2-dev libxslt1-dev libpq-dev \
virtualenv \
"${extra_packages[@]}"
run ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime
run locale-gen C.UTF-8 || true
echo "LC_ALL=C.UTF-8" | run tee /etc/default/locale
# TODO: on failure, either stop or print message
lxc-stop -n "$CONTAINER_NAME"