package update
This commit is contained in:
@@ -61,16 +61,22 @@ jobs:
|
||||
local pkg_dir="/opt/${pkg_name}_${VERSION}_${ARCH}"
|
||||
local deb_dir="${pkg_dir}/DEBIAN"
|
||||
|
||||
mkdir -p "${pkg_dir}/usr/sbin" "${pkg_dir}/nginx" \
|
||||
"${pkg_dir}/etc/systemd/system" "${pkg_dir}/var/log/nginx" \
|
||||
mkdir -p "${pkg_dir}/usr/sbin" \
|
||||
"${pkg_dir}/etc/systemd/system" \
|
||||
"${pkg_dir}/usr/lib" \
|
||||
"${pkg_dir}/hostdata/default/public_html" \
|
||||
"${pkg_dir}/usr/nginx_lua"
|
||||
"${pkg_dir}/usr/nginx_lua" \
|
||||
"${pkg_dir}/usr/share/twiy/defaults/nginx" \
|
||||
"${pkg_dir}/usr/share/twiy/defaults/hostdata"
|
||||
|
||||
cp /usr/sbin/nginx "${pkg_dir}/usr/sbin/"
|
||||
cp -R /nginx/* "${pkg_dir}/nginx/" || true
|
||||
# Pristine configs + default site go into a defaults stash, NOT the
|
||||
# live /nginx and /hostdata trees. postinst seeds them from here
|
||||
# without clobbering local edits (writes <file>.new when a target
|
||||
# already exists). The live files stay untracked by dpkg, so an
|
||||
# upgrade never overwrites a customised config.
|
||||
cp -R /nginx/. "${pkg_dir}/usr/share/twiy/defaults/nginx/" || true
|
||||
cp -R /hostdata/default "${pkg_dir}/usr/share/twiy/defaults/hostdata/" || true
|
||||
cp "${unit_src}" "${pkg_dir}/etc/systemd/system/nginx.service"
|
||||
cp -R /hostdata/default "${pkg_dir}/hostdata/" || true
|
||||
cp -R /usr/nginx_lua "${pkg_dir}/usr/" || true
|
||||
|
||||
for d in /usr/local/aws-lc /usr/local/LuaJIT /usr/local/modsecurity /usr/local/zlib-ng; do
|
||||
@@ -89,14 +95,9 @@ jobs:
|
||||
"${pkg_name}" "${VERSION}" "${ARCH}" "${conflicts}" "${conflicts}" "${pkg_name}" "${TARGET}" \
|
||||
> "${deb_dir}/control"
|
||||
|
||||
printf '%s\n' '#!/bin/bash' \
|
||||
'useradd -r -s /bin/false nginx 2>/dev/null || true' \
|
||||
'install -d -o nginx -g nginx -m 0755 /var/log/nginx' \
|
||||
'chown -R nginx:nginx /var/log/nginx /nginx 2>/dev/null || true' \
|
||||
'systemctl daemon-reload 2>/dev/null || true' \
|
||||
'systemctl enable nginx.service 2>/dev/null || true' \
|
||||
'systemctl restart nginx.service 2>/dev/null || true' \
|
||||
'exit 0' > "${deb_dir}/postinst"
|
||||
# Shared maintainer script: seeds /nginx + /hostdata from the
|
||||
# defaults stash without overwriting files the admin already has.
|
||||
cp "${REPO_ROOT}/build/deb/postinst" "${deb_dir}/postinst"
|
||||
chmod 755 "${deb_dir}/postinst"
|
||||
|
||||
dpkg-deb --build "${pkg_dir}"
|
||||
|
||||
Reference in New Issue
Block a user