mirror of
https://github.com/searxng/searxng.git
synced 2024-11-25 12:21:00 +00:00
[fix] scripts: elimination of limitations on dedicated distributions
The restriction of shell scripts to certain distributions is only required for certain actions such as the installation of a SearXNG instance. The maintenance scripts and build processes were previously also restricted to these specific distributions. With this patch, the build processes (such as the build of online documentation) can now also be executed on all Linux distributions. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
parent
0b832f19bf
commit
d026486ce3
3 changed files with 25 additions and 15 deletions
21
utils/lib.sh
21
utils/lib.sh
|
@ -958,7 +958,6 @@ nginx_distro_setup() {
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
nginx_distro_setup
|
|
||||||
|
|
||||||
install_nginx(){
|
install_nginx(){
|
||||||
info_msg "installing nginx ..."
|
info_msg "installing nginx ..."
|
||||||
|
@ -1127,8 +1126,6 @@ apache_distro_setup() {
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
apache_distro_setup
|
|
||||||
|
|
||||||
install_apache(){
|
install_apache(){
|
||||||
info_msg "installing apache ..."
|
info_msg "installing apache ..."
|
||||||
pkg_install "$APACHE_PACKAGES"
|
pkg_install "$APACHE_PACKAGES"
|
||||||
|
@ -1291,8 +1288,6 @@ uWSGI_distro_setup() {
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
uWSGI_distro_setup
|
|
||||||
|
|
||||||
install_uwsgi(){
|
install_uwsgi(){
|
||||||
info_msg "installing uwsgi ..."
|
info_msg "installing uwsgi ..."
|
||||||
pkg_install "$uWSGI_PACKAGES"
|
pkg_install "$uWSGI_PACKAGES"
|
||||||
|
@ -1685,13 +1680,15 @@ LXC_BASE_PACKAGES_fedora="bash git @development-tools python"
|
||||||
# yum packages
|
# yum packages
|
||||||
LXC_BASE_PACKAGES_centos="bash git python3"
|
LXC_BASE_PACKAGES_centos="bash git python3"
|
||||||
|
|
||||||
case $DIST_ID in
|
lxc_distro_setup() {
|
||||||
ubuntu|debian) LXC_BASE_PACKAGES="${LXC_BASE_PACKAGES_debian}" ;;
|
case $DIST_ID in
|
||||||
arch) LXC_BASE_PACKAGES="${LXC_BASE_PACKAGES_arch}" ;;
|
ubuntu|debian) LXC_BASE_PACKAGES="${LXC_BASE_PACKAGES_debian}" ;;
|
||||||
fedora) LXC_BASE_PACKAGES="${LXC_BASE_PACKAGES_fedora}" ;;
|
arch) LXC_BASE_PACKAGES="${LXC_BASE_PACKAGES_arch}" ;;
|
||||||
centos) LXC_BASE_PACKAGES="${LXC_BASE_PACKAGES_centos}" ;;
|
fedora) LXC_BASE_PACKAGES="${LXC_BASE_PACKAGES_fedora}" ;;
|
||||||
*) err_msg "$DIST_ID-$DIST_VERS: pkg_install LXC_BASE_PACKAGES not yet implemented" ;;
|
centos) LXC_BASE_PACKAGES="${LXC_BASE_PACKAGES_centos}" ;;
|
||||||
esac
|
*) err_msg "$DIST_ID-$DIST_VERS: pkg_install LXC_BASE_PACKAGES not yet implemented" ;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
lxc_install_base_packages() {
|
lxc_install_base_packages() {
|
||||||
info_msg "install LXC_BASE_PACKAGES in container $1"
|
info_msg "install LXC_BASE_PACKAGES in container $1"
|
||||||
|
|
|
@ -135,6 +135,8 @@ main() {
|
||||||
local exit_val
|
local exit_val
|
||||||
local _usage="unknown or missing $1 command $2"
|
local _usage="unknown or missing $1 command $2"
|
||||||
|
|
||||||
|
lxc_distro_setup
|
||||||
|
|
||||||
# don't check prerequisite when in recursion
|
# don't check prerequisite when in recursion
|
||||||
if [[ ! $1 == __* ]] && [[ ! $1 == --help ]]; then
|
if [[ ! $1 == __* ]] && [[ ! $1 == --help ]]; then
|
||||||
if ! in_container; then
|
if ! in_container; then
|
||||||
|
|
|
@ -164,9 +164,16 @@ EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
required_commands \
|
case $1 in
|
||||||
sudo systemctl install git wget curl \
|
install|remove|instance)
|
||||||
|| exit
|
nginx_distro_setup
|
||||||
|
apache_distro_setup
|
||||||
|
uWSGI_distro_setup
|
||||||
|
required_commands \
|
||||||
|
sudo systemctl install git wget curl \
|
||||||
|
|| exit
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
local _usage="unknown or missing $1 command $2"
|
local _usage="unknown or missing $1 command $2"
|
||||||
|
|
||||||
|
@ -898,6 +905,10 @@ _searxng.instance.inspect() {
|
||||||
}
|
}
|
||||||
|
|
||||||
searxng.doc.rst() {
|
searxng.doc.rst() {
|
||||||
|
|
||||||
|
local APACHE_SITES_AVAILABLE="/etc/apache2/sites-available"
|
||||||
|
local NGINX_APPS_AVAILABLE="/etc/nginx/default.apps-available"
|
||||||
|
|
||||||
local debian="${SEARXNG_PACKAGES_debian}"
|
local debian="${SEARXNG_PACKAGES_debian}"
|
||||||
local arch="${SEARXNG_PACKAGES_arch}"
|
local arch="${SEARXNG_PACKAGES_arch}"
|
||||||
local fedora="${SEARXNG_PACKAGES_fedora}"
|
local fedora="${SEARXNG_PACKAGES_fedora}"
|
||||||
|
|
Loading…
Reference in a new issue