mirror of
https://github.com/YunoHost/install_script.git
synced 2024-09-03 20:06:25 +02:00
Merge branch 'buster-experimental' into buster-experimental-with-kitchen
This commit is contained in:
commit
97544d587d
2 changed files with 83 additions and 68 deletions
96
Makefile
96
Makefile
|
@ -1,78 +1,60 @@
|
||||||
# YUNoHost locations
|
# YUNoHost locations
|
||||||
YNH_BUILD_DIR = /ynh-build
|
YNH_BUILD_DIR = /ynh-build/
|
||||||
YNH_SOURCE = https://github.com/yunohost
|
YNH_SOURCE = https://github.com/yunohost
|
||||||
|
|
||||||
BUILD_DEPS = git git-buildpackage postfix python-setuptools
|
BUILD_DEPS = git git-buildpackage postfix python-setuptools
|
||||||
APT_OPTS = -o Dpkg::Options::="--force-confold" -y
|
APT_OPTS = -o Dpkg::Options::="--force-confold" -y #--force-yes
|
||||||
|
|
||||||
.PHONY: init metronome ssowat moulinette yunohost install uninstall mrproper \
|
.PHONY: init metronome ssowat moulinette yunohost install uninstall mrproper
|
||||||
postinstall appinstall
|
|
||||||
|
|
||||||
init:
|
init:
|
||||||
@ apt $(APT_OPTS) install $(BUILD_DEPS)
|
apt $(APT_OPTS) install $(BUILD_DEPS)
|
||||||
@ mkdir -vp "$(YNH_BUILD_DIR)"
|
mkdir -p "$(YNH_BUILD_DIR)"
|
||||||
@ cd "$(YNH_BUILD_DIR)" \
|
cd "$(YNH_BUILD_DIR)"; \
|
||||||
&& git clone "$(YNH_SOURCE)/moulinette" \
|
git clone "$(YNH_SOURCE)"/moulinette; \
|
||||||
&& git clone "$(YNH_SOURCE)/ssowat" \
|
git clone "$(YNH_SOURCE)"/ssowat; \
|
||||||
&& git clone "$(YNH_SOURCE)/metronome" \
|
git clone "$(YNH_SOURCE)"/metronome; \
|
||||||
&& git clone "$(YNH_SOURCE)/yunohost"
|
git clone "$(YNH_SOURCE)"/yunohost;
|
||||||
@ cd "$(YNH_BUILD_DIR)/moulinette" \
|
apt $(APT_OPTS) build-dep \
|
||||||
&& git checkout buster-unstable
|
"$(YNH_BUILD_DIR)"/moulinette \
|
||||||
@ cd "$(YNH_BUILD_DIR)/yunohost" \
|
"$(YNH_BUILD_DIR)"/ssowat \
|
||||||
&& git checkout buster-unstable
|
"$(YNH_BUILD_DIR)"/metronome \
|
||||||
@ apt $(APT_OPTS) build-dep \
|
"$(YNH_BUILD_DIR)"/yunohost
|
||||||
"$(YNH_BUILD_DIR)/moulinette" \
|
|
||||||
"$(YNH_BUILD_DIR)/ssowat" \
|
|
||||||
"$(YNH_BUILD_DIR)/metronome" \
|
|
||||||
"$(YNH_BUILD_DIR)/yunohost"
|
|
||||||
|
|
||||||
metronome:
|
metronome:
|
||||||
@ cd "$(YNH_BUILD_DIR)" \
|
cd "$(YNH_BUILD_DIR)"; \
|
||||||
&& rm -vf metronome_* \
|
rm -f metronome_*; \
|
||||||
&& cd metronome \
|
cd metronome; \
|
||||||
&& dpkg-buildpackage -rfakeroot -uc -b -d
|
dpkg-buildpackage -rfakeroot -uc -b -d
|
||||||
|
|
||||||
ssowat:
|
ssowat:
|
||||||
@ cd "$(YNH_BUILD_DIR)" \
|
cd "$(YNH_BUILD_DIR)"; \
|
||||||
&& rm -vf ssowat_* \
|
rm -f ssowat_*; \
|
||||||
&& cd ssowat \
|
cd ssowat; \
|
||||||
&& debuild -us -uc
|
debuild -us -uc
|
||||||
|
|
||||||
moulinette:
|
moulinette:
|
||||||
@ cd "$(YNH_BUILD_DIR)" \
|
cd "$(YNH_BUILD_DIR)"; \
|
||||||
&& rm -vf moulinette_* \
|
rm -f moulinette_*; \
|
||||||
&& cd moulinette \
|
cd moulinette; \
|
||||||
&& debuild -us -uc
|
debuild -us -uc
|
||||||
|
|
||||||
yunohost:
|
yunohost:
|
||||||
@ cd "$(YNH_BUILD_DIR)" \
|
cd "$(YNH_BUILD_DIR)"; \
|
||||||
&& rm -vf yunohost_* \
|
rm -f yunohost_*; \
|
||||||
&& cd yunohost \
|
cd yunohost; \
|
||||||
&& debuild -us -uc
|
debuild -us -uc
|
||||||
|
|
||||||
install:
|
install:
|
||||||
@ cd "$(YNH_BUILD_DIR)" \
|
cd "$(YNH_BUILD_DIR)"; \
|
||||||
&& debconf-set-selections < debconf \
|
debconf-set-selections < debconf; \
|
||||||
&& apt install $(APT_OPTS) \
|
SUDO_FORCE_REMOVE=yes apt install $(APT_OPTS) /ynh-build/*.deb;
|
||||||
./metronome_*.deb \
|
|
||||||
./moulinette_*.deb \
|
|
||||||
./ssowat_*.deb \
|
|
||||||
&& SUDO_FORCE_REMOVE=yes apt install $(APT_OPTS) ./yunohost_*.deb;
|
|
||||||
|
|
||||||
postinstall:
|
mrproper:
|
||||||
@ yunohost tools postinstall -d e.org -p Yunohost
|
|
||||||
|
|
||||||
appinstall:
|
|
||||||
@ yunohost app install https://github.com/YunoHost-Apps/helloworld_ynh
|
|
||||||
appuninstall:
|
|
||||||
@ yunohost app remove helloworld
|
|
||||||
|
|
||||||
mrproper: uninstall
|
|
||||||
@ rm "$(YNH_BUILD_DIR)" -rfv
|
@ rm "$(YNH_BUILD_DIR)" -rfv
|
||||||
|
|
||||||
uninstall:
|
uninstall:
|
||||||
@ apt -y --allow-remove-essential purge \
|
apt remove slapd yunohost moulinette --purge -y
|
||||||
yunohost moulinette slapd nginx-common
|
rm -rf /usr/share/yunohost/
|
||||||
@ rm -rvf /usr/share/yunohost/
|
rm -rf /usr/lib/moulinette/
|
||||||
@ rm -rvf /usr/lib/moulinette/
|
rm -rf /etc/yunohost/
|
||||||
@ rm -rvf /etc/yunohost/
|
|
||||||
|
|
|
@ -110,7 +110,7 @@ function main()
|
||||||
#step setup_package_source || die "Setting up deb package sources failed"
|
#step setup_package_source || die "Setting up deb package sources failed"
|
||||||
#step apt_update || die "Error caught during 'apt-get update'"
|
#step apt_update || die "Error caught during 'apt-get update'"
|
||||||
#step register_debconf || die "Unable to insert new values into debconf database"
|
#step register_debconf || die "Unable to insert new values into debconf database"
|
||||||
#step workaround_avahi_installation || die "Unable to install workaround for avahi installation"
|
#step workarounds_because_sysadmin_sucks || die "Unable to run stupid workarounds"
|
||||||
#step install_yunohost_packages || die "Installation of Yunohost packages failed"
|
#step install_yunohost_packages || die "Installation of Yunohost packages failed"
|
||||||
#step restart_services || die "Error caught during services restart"
|
#step restart_services || die "Error caught during services restart"
|
||||||
|
|
||||||
|
@ -213,7 +213,10 @@ function apt_get_wrapper() {
|
||||||
-- \
|
-- \
|
||||||
apt-get $*
|
apt-get $*
|
||||||
else
|
else
|
||||||
apt-get $* 2>&1 | tee -a $YUNOHOST_LOG
|
# Why we need pipefail : https://stackoverflow.com/a/6872163
|
||||||
|
set -o pipefail
|
||||||
|
apt-get $* 2>&1 | tee -a $YUNOHOST_LOG || return 1
|
||||||
|
set +o pipefail
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -231,19 +234,19 @@ function check_assertions()
|
||||||
# Assert we're on Debian
|
# Assert we're on Debian
|
||||||
# Note : we do not rely on lsb_release to avoid installing a dependency
|
# Note : we do not rely on lsb_release to avoid installing a dependency
|
||||||
# only to check this...
|
# only to check this...
|
||||||
[[ -f "/etc/debian_version" ]] || die "This script can only be ran on Debian."
|
[[ -f "/etc/debian_version" ]] || die "This script can only be ran on Debian 9 (Stretch)."
|
||||||
|
|
||||||
# Assert we're on Buster
|
# Assert we're on Buster
|
||||||
# Note : we do not rely on lsb_release to avoid installing a dependency
|
# Note : we do not rely on lsb_release to avoid installing a dependency
|
||||||
# only to check this...
|
# only to check this...
|
||||||
[[ "$(cat /etc/debian_version)" =~ ^10.* ]] || die "This script can only be ran on Debian Buster."
|
[[ "$(cat /etc/debian_version)" =~ ^10.* ]] || die "This script can only be ran on Debian Buster, you are using '$(cat /etc/debian_version)."
|
||||||
|
|
||||||
# Forbid people from installing on Ubuntu or Linux mint ...
|
# Forbid people from installing on Ubuntu or Linux mint ...
|
||||||
if [[ -f "/etc/lsb-release" ]];
|
if [[ -f "/etc/lsb-release" ]];
|
||||||
then
|
then
|
||||||
if cat /etc/lsb-release | grep -q -i "Ubuntu\|Mint"
|
if cat /etc/lsb-release | grep -q -i "Ubuntu\|Mint"
|
||||||
then
|
then
|
||||||
die "Please don't try to install YunoHost on an Ubuntu or Linux Mint system ... You need a 'raw' Debian."
|
die "Please don't try to install YunoHost on an Ubuntu or Linux Mint system ... You need a 'raw' Debian 9 (Stretch)."
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -262,6 +265,10 @@ function check_assertions()
|
||||||
user_pi_logged_out || die "The user pi should be logged out."
|
user_pi_logged_out || die "The user pi should be logged out."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Check we aren't running in docker or other weird containers that we can't probably install on
|
||||||
|
systemd-detect-virt | grep -v -q -w "docker\|container-other" || [[ "$FORCE" == "1" ]] \
|
||||||
|
|| die "It seems like you are trying to install YunoHost in docker or a weird container technology which probably is not supported by this install script (or YunoHost as a whole). If you know what you are doing, you can run this script with -f."
|
||||||
|
|
||||||
# Check possible conflict with apache, bind9.
|
# Check possible conflict with apache, bind9.
|
||||||
[[ -z "$(dpkg --get-selections | grep -v deinstall | grep 'bind9\s')" ]] || [[ "$FORCE" == "1" ]] \
|
[[ -z "$(dpkg --get-selections | grep -v deinstall | grep 'bind9\s')" ]] || [[ "$FORCE" == "1" ]] \
|
||||||
|| die "Bind9 is installed and might conflict with dnsmasq. Uninstall it first, or if you know what you are doing, run this script with -f."
|
|| die "Bind9 is installed and might conflict with dnsmasq. Uninstall it first, or if you know what you are doing, run this script with -f."
|
||||||
|
@ -281,7 +288,7 @@ function upgrade_system() {
|
||||||
# perl is yolomacnuggets :|
|
# perl is yolomacnuggets :|
|
||||||
# Stuff like "Can't locate object method "new" via package "Text::Iconv""
|
# Stuff like "Can't locate object method "new" via package "Text::Iconv""
|
||||||
apt_get_wrapper -o Dpkg::Options::="--force-confold" \
|
apt_get_wrapper -o Dpkg::Options::="--force-confold" \
|
||||||
-y --force-yes install \
|
-y install \
|
||||||
libtext-iconv-perl \
|
libtext-iconv-perl \
|
||||||
|| return 1
|
|| return 1
|
||||||
|
|
||||||
|
@ -300,7 +307,7 @@ function upgrade_system() {
|
||||||
|
|
||||||
if is_raspbian ; then
|
if is_raspbian ; then
|
||||||
apt_get_wrapper -o Dpkg::Options::="--force-confold" \
|
apt_get_wrapper -o Dpkg::Options::="--force-confold" \
|
||||||
-y --force-yes install rpi-update \
|
-y install rpi-update \
|
||||||
|| return 3
|
|| return 3
|
||||||
|
|
||||||
if [[ "$BUILD_IMAGE" != "1" ]] ; then
|
if [[ "$BUILD_IMAGE" != "1" ]] ; then
|
||||||
|
@ -321,7 +328,7 @@ function install_script_dependencies() {
|
||||||
|
|
||||||
apt_update
|
apt_update
|
||||||
apt_get_wrapper -o Dpkg::Options::="--force-confold" \
|
apt_get_wrapper -o Dpkg::Options::="--force-confold" \
|
||||||
-y --force-yes install \
|
-y install \
|
||||||
$DEPENDENCIES \
|
$DEPENDENCIES \
|
||||||
|| return 1
|
|| return 1
|
||||||
}
|
}
|
||||||
|
@ -391,7 +398,7 @@ Do you agree to let YunoHost apply those changes to your configuration and there
|
||||||
[[ "$sshd_config_possible_issues" == "0" ]] && return 0
|
[[ "$sshd_config_possible_issues" == "0" ]] && return 0
|
||||||
|
|
||||||
# Otherwise, we ask the user to confirm
|
# Otherwise, we ask the user to confirm
|
||||||
if ! whiptail --title "SSH Configuration" --yesno "$text" 20 78 --defaultno --scrolltext ; then
|
if ! whiptail --title "SSH Configuration" --yesno "$text" 20 78 --defaultno ; then
|
||||||
|
|
||||||
# Keep a copy to be restored during the postinstall
|
# Keep a copy to be restored during the postinstall
|
||||||
# so that the ssh confs behaves as manually modified.
|
# so that the ssh confs behaves as manually modified.
|
||||||
|
@ -445,7 +452,20 @@ postsrsd postsrsd/domain string yunohost.org
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
function workaround_avahi_installation() {
|
function workarounds_because_sysadmin_sucks() {
|
||||||
|
|
||||||
|
# ######################## #
|
||||||
|
# Workarounds for fail2ban #
|
||||||
|
# ######################## #
|
||||||
|
|
||||||
|
# We need to create auth.log in case it does not exists, because in some situation,
|
||||||
|
# this file does not exists, fail2ban will miserably fail to start because
|
||||||
|
# the default fail2ban jail include the sshd jail ... >.>
|
||||||
|
touch /var/log/auth.log
|
||||||
|
|
||||||
|
# ######################## #
|
||||||
|
# Workarounds for avahi #
|
||||||
|
# ######################## #
|
||||||
|
|
||||||
# When attempting several installation of Yunohost on the same host
|
# When attempting several installation of Yunohost on the same host
|
||||||
# with a light VM system like LXC
|
# with a light VM system like LXC
|
||||||
|
@ -483,6 +503,7 @@ function workaround_avahi_installation() {
|
||||||
--home /var/run/avahi-daemon --no-create-home \
|
--home /var/run/avahi-daemon --no-create-home \
|
||||||
--gecos "Avahi mDNS daemon" --group avahi \
|
--gecos "Avahi mDNS daemon" --group avahi \
|
||||||
--uid $avahi_id
|
--uid $avahi_id
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function install_yunohost_packages() {
|
function install_yunohost_packages() {
|
||||||
|
@ -494,11 +515,20 @@ function install_yunohost_packages() {
|
||||||
# We need to make it mutable for the resolvconf dependency to be installed
|
# We need to make it mutable for the resolvconf dependency to be installed
|
||||||
chattr -i /etc/resolv.conf 2>/dev/null || true
|
chattr -i /etc/resolv.conf 2>/dev/null || true
|
||||||
|
|
||||||
|
# Install those damn deps independently ...
|
||||||
|
# otherwise they make the install crash for random reasons ~.~
|
||||||
|
# c.f. https://github.com/YunoHost/issues/issues/1382
|
||||||
|
apt_get_wrapper \
|
||||||
|
-o Dpkg::Options::="--force-confold" \
|
||||||
|
-y install \
|
||||||
|
debhelper dh-autoreconf \
|
||||||
|
|| true
|
||||||
|
|
||||||
# Install YunoHost
|
# Install YunoHost
|
||||||
apt_get_wrapper \
|
apt_get_wrapper \
|
||||||
-o Dpkg::Options::="--force-confold" \
|
-o Dpkg::Options::="--force-confold" \
|
||||||
-o APT::install-recommends=true \
|
-o APT::install-recommends=true \
|
||||||
-y --force-yes install \
|
-y install \
|
||||||
yunohost yunohost-admin postfix \
|
yunohost yunohost-admin postfix \
|
||||||
|| return 1
|
|| return 1
|
||||||
}
|
}
|
||||||
|
@ -516,6 +546,9 @@ function restart_services() {
|
||||||
function fix_locales() {
|
function fix_locales() {
|
||||||
# This function tries to fix the whole locale and perl mess about missing locale files
|
# This function tries to fix the whole locale and perl mess about missing locale files
|
||||||
|
|
||||||
|
# Install 'locales' if locale-gen does not exists yet
|
||||||
|
command -v locale-gen > /dev/null || apt_get_wrapper -o Dpkg::Options::="--force-confold" -y install locales
|
||||||
|
|
||||||
# Generate at least en_US.UTF-8
|
# Generate at least en_US.UTF-8
|
||||||
sed -i 's/^# *\(en_US.UTF-8\)/\1/' /etc/locale.gen && locale-gen
|
sed -i 's/^# *\(en_US.UTF-8\)/\1/' /etc/locale.gen && locale-gen
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue