Merge branch 'master' of github.com:webmin/webmin

This commit is contained in:
Jamie Cameron
2025-01-11 15:52:40 -08:00
4 changed files with 115 additions and 14 deletions

View File

@@ -4,18 +4,24 @@ on:
push:
branches:
- master
release:
types:
- published
- edited
jobs:
build:
uses: webmin/webmin-ci-cd/.github/workflows/testing-master-workflow.yml@main
uses: webmin/webmin-ci-cd/.github/workflows/master-workflow.yml@main
with:
build-type: package
project-name: webmin
is-release: ${{ github.event_name == 'release' }}
secrets:
DEV_GPG_PH: ${{ secrets.DEV_GPG_PH }}
DEV_IP_ADDR: ${{ secrets.DEV_IP_ADDR }}
DEV_IP_KNOWN_HOSTS: ${{ secrets.DEV_IP_KNOWN_HOSTS }}
DEV_UPLOAD_SSH_USER: ${{ secrets.DEV_UPLOAD_SSH_USER }}
DEV_UPLOAD_SSH_DIR: ${{ secrets.DEV_UPLOAD_SSH_DIR }}
PRERELEASE_UPLOAD_SSH_DIR: ${{ secrets.PRERELEASE_UPLOAD_SSH_DIR }}
DEV_SSH_PRV_KEY: ${{ secrets.DEV_SSH_PRV_KEY }}
DEV_SIGN_BUILD_REPOS_CMD: ${{ secrets.DEV_SIGN_BUILD_REPOS_CMD }}

View File

@@ -1,19 +1,52 @@
#!/sbin/runscript
# Copyright 1999-2002 Gentoo Technologies, Inc.
#!/sbin/openrc-run
# Copyright 2024 webmin & mckaygerhard
# Distributed under the terms of the GNU General Public License, v2 or later
name="webmin"
# config file must be in sync with setup script, so i will not touch cos process will be the same as webmin-systemd
# like calling updateboot.pl with a new procedure method defined as openrc and not just assumed sysvinit if not systemd is present
# and also atboot.pl with new procedure for openrc the alpine linux init system at the moment
#conf_file="WEBMIN_CONFIG/miniserv.conf"
conf_file="/etc/webmin/miniserv.conf"
depend() {
need net logger
need logger localmount
use net
after bootmisc
}
start() {
ebegin "Starting webmin"
/etc/webmin/start
eend $?
# same problem here.. we need to use WEBMIN_CONFIG variable to find the start script
# WEBMIN_CONFIG/start
/etc/webmin/start
eend $?
}
stop() {
ebegin "Stopping webmin"
/etc/webmin/stop
eend $?
# same problem here.. we need to use WEBMIN_CONFIG variable to find the stop script
# WEBMIN_CONFIG/stop
/etc/webmin/stop
eend $?
}
status() {
pidfile=`grep "^pidfile=" "${conf_file}" | sed -e 's/pidfile=//g'`
if [ -s $pidfile ]; then
pid=`cat $pidfile`
kill -0 $pid >/dev/null 2>&1
if [ "$?" = "0" ]; then
einfo "webmin (pid $pid) is running"
return 0
else
einfo "webmin is stopped"
return 0
fi
else
einfo "webmin is stopped"
return 0
fi
}

View File

@@ -20,7 +20,7 @@ repo_dist="stable"
repo_section="contrib"
repo_description="Webmin Releases"
repo_description_prerelease="Webmin Prerelease"
repo_description_unstable="Webmin Development Builds"
repo_description_unstable="Webmin Unstable"
install_check_binary="/usr/bin/webmin"
install_message="Webmin and Usermin can be installed with:"
install_packages="webmin usermin"
@@ -66,6 +66,7 @@ Repository configuration:
--key-suffix=<suffix> Repository key suffix for file naming
--auth-user=<user> Repository authentication username
--auth-pass=<pass> Repository authentication password
--pkg-prefs=<dist:pkg|pr*> Package preferences for repository
Repository metadata:
--name=<name> Base name for repository (default: webmin)
@@ -130,6 +131,9 @@ process_args() {
--auth-pass=*)
repo_auth_pass="${arg#*=}"
;;
--pkg-prefs=*)
repo_pkg_prefs="${arg#*=}"
;;
--name=*)
base_name="${arg#*=}"
repo_name="$base_name"
@@ -140,7 +144,7 @@ process_args() {
base_description="${arg#*=}"
repo_description="$base_description Releases"
repo_description_prerelease="${base_description} Prerelease"
repo_description_unstable="${base_description} Development Builds"
repo_description_unstable="${base_description} Unstable"
;;
--component=*)
repo_component="${arg#*=}"
@@ -326,6 +330,28 @@ check_gpg() {
fi
}
enforce_package_priority() {
repo_pkg_pref=$1
disttarget=$2
# Extract the relevant entries for the target distribution
match=$(echo "$repo_pkg_pref" | grep -o "${disttarget}:[^ =]*[^ ]*")
if [ -n "$match" ]; then
# Extract the package name
package=$(echo "$match" | sed -e "s/^${disttarget}:\([^=]*\).*/\1/")
# Extract the priority and version parameters (if present)
priority=$(echo "$match" | sed -n -e "s/^${disttarget}:[^=]*=\([^=]*\)=.*$/\1/p")
version=$(echo "$match" | sed -n -e "s/^${disttarget}:[^=]*=[^=]*=\(.*\)$/\1/p")
# Output package, priority, and version parameters (empty if not present)
echo "$package ${priority:-} ${version:-}"
return 0
fi
return 1
}
download_key() {
rm -f "/tmp/$repo_key"
echo " Downloading Webmin developers key .."
@@ -353,6 +379,20 @@ setup_repos() {
cp -f "$repo_key" \
"/etc/pki/rpm-gpg/RPM-GPG-KEY-$repo_key_suffix"
echo " .. done"
# Configure packages priority if provided
if [ -n "$repo_pkg_prefs" ]; then
repo_pkg_prefs_rs=$(enforce_package_priority "$repo_pkg_prefs" "rpm")
if [ $? -eq 0 ]; then
echo " Setting up package exclusion for repository .."
package=$(echo "$repo_pkg_prefs_rs" | awk '{print $1}')
repo_extra_opts="exclude=$package"
echo " .. done"
else
echo " Cleaning up package priority configuration .."
echo " .. done"
fi
fi
# Configure the repository
echo " Setting up ${repo_desc_formatted} repository .."
if [ "$repo_mode" = "stable" ]; then
repo_url="$active_repo_download/download/newkey/yum"
@@ -384,6 +424,28 @@ EOF
post_status $?
sources_list=$(grep -v "$repo_host" /etc/apt/sources.list)
echo "$sources_list" > /etc/apt/sources.list
# Configure packages priority if provided
debian_repo_prefs="/etc/apt/preferences.d/$repoid_debian_like-$repo_dist-package-priority"
if [ -n "$repo_pkg_prefs" ]; then
repo_pkg_prefs_rs=$(enforce_package_priority "$repo_pkg_prefs" "deb")
if [ $? -eq 0 ]; then
echo " Setting up package priority for repository .."
package=$(echo "$repo_pkg_prefs_rs" | awk '{print $1}')
priority=$(echo "$repo_pkg_prefs_rs" | awk '{print $2}')
version=$(echo "$repo_pkg_prefs_rs" | awk '{print $3}')
cat << EOF > "$debian_repo_prefs"
Package: $package
Pin: version /$version\$/
Pin-Priority: $priority
EOF
echo " .. done"
fi
else
echo " Cleaning up package priority configuration .."
rm -f "$debian_repo_prefs"
echo " .. done"
fi
# Configure the repository
echo " Setting up ${repo_desc_formatted} repository .."
if [ "$repo_mode" = "stable" ]; then
repo_line="deb [signed-by=/usr/share/keyrings/$repoid_debian_like-$repo_key_suffix.gpg] \
@@ -410,8 +472,8 @@ $active_repo_download $repo_dist $repo_component"
echo "machine $auth_domain login $repo_auth_user password $repo_auth_pass" >> "$auth_file"
chmod 600 "$auth_file"
fi
echo " .. done"
echo " Cleaning repository metadata .."
$clean 1>/dev/null 2>&1
echo " .. done"

View File

@@ -288,7 +288,7 @@ else {
my $hasapache = &foreign_installed("apache");
my $mode = $webroot eq 'dns' ? 3 :
$webroot ? 2 :
$hasapacehe ? 0 :
$hasapache ? 0 :
$letsencrypt_cmd ? 4 : 2;
if ($hasapache) {
&foreign_require("apache");