Skip to content

Commit

Permalink
Merge branch 'bc-new-distros'
Browse files Browse the repository at this point in the history
  • Loading branch information
andrey-utkin committed Jul 10, 2024
2 parents 0cc20a5 + dd6f6ff commit cab3f77
Show file tree
Hide file tree
Showing 26 changed files with 123 additions and 355 deletions.
1 change: 1 addition & 0 deletions debian/control.in
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Depends: ${shlibs:Depends}, ssl-cert, ucf, curl, sysstat,
vainfo,
i965-va-driver,
cron,
certbot,
# python3-pip,
#focal php-sqlite3, php-gd, php-curl, php-mysql
#jammy php-sqlite3, php-gd, php-curl, php-mysql
Expand Down
38 changes: 36 additions & 2 deletions installer/v3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,29 @@ jammy_install()
systemctl restart bluecherry
}

# Ubuntu 23.10
mantic_install()
{
# Differences from jammy:
# Don't add ppa:ondrej/php, it fails for Mantic.
# Don't explicitly state which php packages to install
apt-get update
apt -y install gpg software-properties-common wget
wget -q https://dl.bluecherrydvr.com/key/bluecherry.asc -O- | sudo tee /etc/apt/trusted.gpg.d/bluecherry.asc
VERSION_CODENAME=mantic
: "${SRCLIST_URL:=https://dl.bluecherrydvr.com/sources.list.d/bluecherry-"$VERSION_CODENAME"-unstable.list}"
wget --output-document=/etc/apt/sources.list.d/bluecherry-"$VERSION_CODENAME".list "$SRCLIST_URL"
apt -y update
apt -y install bluecherry
systemctl restart bluecherry
}

# Ubuntu 24.04
noble_install()
{
jammy_install
}

centos_7_install()
{
setenforce 0
Expand Down Expand Up @@ -132,6 +155,12 @@ bullseye_install()
apt-get -y install mariadb-server bluecherry
}

# Debian 12
bookworm_install()
{
bullseye_install
}

check_distro()
{
if [[ -e /etc/lsb-release ]]
Expand Down Expand Up @@ -165,9 +194,14 @@ if [[ "$ID" == "ubuntu" && "$VERSION_ID" == "18.04" && "$VERSION_CODENAME" ==
elif [[ "$ID" == "ubuntu" && "$VERSION_ID" == "20.10" && "$VERSION_CODENAME" == "groovy" ]]; then groovy_install;
elif [[ "$ID" == "ubuntu" && "$VERSION_ID" == "20.04" && "$VERSION_CODENAME" == "focal" ]]; then focal_install;
elif [[ "$ID" == "ubuntu" && "$VERSION_ID" == "22.04" && "$VERSION_CODENAME" == "jammy" ]]; then jammy_install;
elif [[ "$ID" == "ubuntu" && "$VERSION_ID" == "23.10" && "$VERSION_CODENAME" == "mantic" ]]; then mantic_install;
elif [[ "$ID" == "ubuntu" && "$VERSION_ID" == "24.04" && "$VERSION_CODENAME" == "noble" ]]; then noble_install;
elif [[ "$ID" == "debian" && "$VERSION_ID" == "10" && "$VERSION_CODENAME" == "buster" ]]; then buster_install;
elif [[ "$ID" == "debian" && "$VERSION_ID" == "11" && "$VERSION_CODENAME" == "bullseye" ]]; then bullseye_install;
elif [[ "$ID" == "mint" && "$VERSION_ID" == "21.1" && "$VERSION_CODENAME" == "vera" ]]; then jammy_install; # Mint 21.1 Vera, based on Ubuntu 22.04 Jammy
elif [[ "$ID" == "debian" && "$VERSION_ID" == "12" && "$VERSION_CODENAME" == "bookworm" ]]; then bookworm_install;
elif [[ "$ID" == "linuxmint" && "$VERSION_ID" == "21.1" && "$VERSION_CODENAME" == "vera" ]]; then jammy_install; # Mint 21.1 Vera, based on Ubuntu 22.04 Jammy
elif [[ "$ID" == "linuxmint" && "$VERSION_ID" == "21.2" && "$VERSION_CODENAME" == "victoria" ]]; then jammy_install; # based on Ubuntu 22.04 Jammy
elif [[ "$ID" == "linuxmint" && "$VERSION_ID" == "21.3" && "$VERSION_CODENAME" == "virginia" ]]; then jammy_install; # based on Ubuntu 22.04 Jammy
else
echo "Currently we only support Ubuntu 18.04 (Bionic), Ubuntu 20.04 (Focal), Ubuntu 22.04 (Jammy) and Debian 10 (Buster), Linux Mint 21.1 (Vera) for unstable testing"
echo "Currently we only support Ubuntu 18.04 (Bionic), Ubuntu 20.04 (Focal), Ubuntu 22.04 (Jammy), Ubuntu 23.10 (Mantic), Ubuntu 24.04 (Noble) and Debian 10 (Buster), 11 (Bullseye), 12 (Bookworm), Linux Mint 21.1 (Vera), 21.2 (Victoria), 21.3 (Virginia) for unstable testing"
fi
2 changes: 1 addition & 1 deletion lib/lavf_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ int lavf_device::start()
if (ctx) return 0;

AVDictionary *avopt_open_input = NULL;
AVInputFormat *input_fmt = NULL;
const AVInputFormat *input_fmt = NULL;

bc_log(Debug, "Opening session from URL: %s", url);

Expand Down
2 changes: 1 addition & 1 deletion lib/v4l2_device_solo6x10.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ int v4l2_device_solo6x10::start()
av_dict_set(&open_opts, "input_format", fmtname, 0);
av_dict_set(&open_opts, "format_whitelist", "v4l2", 0);

AVInputFormat *input_fmt = av_find_input_format("v4l2");
const AVInputFormat *input_fmt = av_find_input_format("v4l2");
if (!input_fmt) {
bc_log(Error, "v4l2 input format not found");
return -1;
Expand Down
2 changes: 1 addition & 1 deletion lib/v4l2_device_tw5864.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ int v4l2_device_tw5864::start()
av_dict_set(&open_opts, "input_format", "h264", 0);
av_dict_set(&open_opts, "format_whitelist", "v4l2", 0);

AVInputFormat *input_fmt = av_find_input_format("v4l2");
const AVInputFormat *input_fmt = av_find_input_format("v4l2");
if (!input_fmt) {
bc_log(Error, "v4l2 input format not found");
return -1;
Expand Down
1 change: 1 addition & 0 deletions misc/BCMK
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ libav/config.mak:
--enable-protocol=pipe \
--enable-protocol=http \
--enable-protocol=https \
--enable-protocol=tls \
\
--enable-muxer=matroska \
--enable-muxer=mjpeg \
Expand Down
2 changes: 1 addition & 1 deletion misc/libav
Submodule libav updated 5286 files
51 changes: 39 additions & 12 deletions misc/postinstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,45 @@ function stop_nginx

function install_pip
{
# If already installed - nothing to do
if which pip3 >/dev/null; then
return
fi

if [[ $(cat /etc/os-release | grep "UBUNTU" | grep bionic) ]]
then
source /etc/os-release
if [[ "$ID" == ubuntu ]] && [[ "$VERSION_CODENAME" == bionic ]]; then
wget --output-document=/tmp/get-pip.py https://bootstrap.pypa.io/pip/3.6/get-pip.py
python3 /tmp/get-pip.py
else
wget --output-document=/tmp/get-pip.py https://bootstrap.pypa.io/get-pip.py
fi
python3 /tmp/get-pip.py
python3 /tmp/get-pip.py
fi
}

function install_certbot
{
source /etc/os-release
if [[ "$ID" == ubuntu ]] && [[ "$VERSION_CODENAME" == noble ]]; then
echo 'For Ubuntu 24.04 (noble) we rely on packaged certbot'
return
elif [[ "$ID" == ubuntu ]] && [[ "$VERSION_CODENAME" == mantic ]]; then
echo 'For Ubuntu 23.10 (mantic) we rely on packaged certbot'
return
elif [[ "$ID" == debian ]] && [[ "$VERSION_CODENAME" == bookworm ]]; then
echo 'For Debian 12 (bookworm) we rely on packaged certbot'
return
fi

export PATH=/usr/local/bin:"$PATH"

# Ubuntu 23+, Debian 12 make this step fail. Fall back to system package.
install_pip || return

# Install pip3 dependencies
pip3 install --user --upgrade setuptools_rust certbot certbot-dns-subdomain-provider
pip3 install --user --upgrade pip || true
pip3 install --user --upgrade cryptography
pip3 install pyopenssl --upgrade
}

function start_apache
Expand Down Expand Up @@ -407,16 +437,13 @@ case "$1" in
if test -f "/usr/share/bluecherry/nginx-includes/subdomain.conf"; then
sed -i 's/snakeoil.conf/subdomain.conf/g' /etc/nginx/sites-enabled/bluecherry.conf
fi

# Install pip from bootstrap

install_pip
# Debian 10 lacks version-agnostic link for php-fpm.sock. Add it in a compatible way.
if ! [[ -L /run/php/php-fpm.sock ]]; then
update-alternatives --install /run/php/php-fpm.sock php-fpm.sock /run/php/php*.*-fpm.sock 0
fi

# Install pip3 dependencies
/usr/local/bin/pip3 install --user --upgrade setuptools_rust certbot certbot-dns-subdomain-provider
/usr/local/bin/pip3 install --user --upgrade pip
/usr/local/bin/pip3 install --user --upgrade cryptography
/usr/local/bin/pip3 install pyopenssl --upgrade
install_certbot

# Install crontabs for subdomain renewal and SSL renewal using certbot
crontab -l 2>/dev/null || true; printf "* * */5 * * certbot renew --config-dir=/usr/share/bluecherry/nginx-includes/letsencrypt/ >/dev/null 2>&1\n*/5 * * * * curl -k https://localhost:7001/subdomainprovidercron >/dev/null 2>&1\n" | crontab -
Expand Down
2 changes: 1 addition & 1 deletion nginx-configs/bluecherry.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ server {
access_log /var/log/nginx/bluecherry-access.log;

include /usr/share/bluecherry/nginx-includes/snakeoil.conf;
include /usr/share/bluecherry/nginx-includes/__BLUECHERRY_DIST_CODENAME__.conf;
include /usr/share/bluecherry/nginx-includes/php-generic.conf;

# this is required for letsencrypt www challange
location /.well-known/ {
Expand Down
3 changes: 2 additions & 1 deletion nginx-configs/php/bionic.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Deprecated - use php-generic.conf
location ~ \.php$ {
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
Expand All @@ -7,4 +8,4 @@
fastcgi_param PATH_INFO $path_info;
fastcgi_param SCRIPT_FILENAME $document_root/index.php;
fastcgi_index index.php;
}
}
11 changes: 11 additions & 0 deletions nginx-configs/php/bookworm.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Deprecated - use php-generic.conf
location ~ \.php$ {
fastcgi_pass unix:/run/php/php8.2-fpm.sock;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi.conf;
set $path_info $fastcgi_path_info;
fastcgi_read_timeout 300;
fastcgi_param PATH_INFO $path_info;
fastcgi_param SCRIPT_FILENAME $document_root/index.php;
fastcgi_index index.php;
}
1 change: 1 addition & 0 deletions nginx-configs/php/bullseye.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Deprecated - use php-generic.conf
location ~ \.php$ {
fastcgi_pass unix:/run/php/php7.4-fpm.sock;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
Expand Down
1 change: 1 addition & 0 deletions nginx-configs/php/buster.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Deprecated - use php-generic.conf
location ~ \.php$ {
fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
Expand Down
1 change: 1 addition & 0 deletions nginx-configs/php/focal.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Deprecated - use php-generic.conf
location ~ \.php$ {
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
Expand Down
1 change: 1 addition & 0 deletions nginx-configs/php/groovy.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Deprecated - use php-generic.conf
location ~ \.php$ {
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
Expand Down
1 change: 1 addition & 0 deletions nginx-configs/php/hirsute.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Deprecated - use php-generic.conf
location ~ \.php$ {
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
Expand Down
1 change: 1 addition & 0 deletions nginx-configs/php/jammy.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Deprecated - use php-generic.conf
location ~ \.php$ {
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
Expand Down
1 change: 1 addition & 0 deletions nginx-configs/php/noble.conf
11 changes: 11 additions & 0 deletions nginx-configs/php/php-generic.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
location ~ \.php$ {
# Debian 10 php-fpm doesn't maintain /run/php/php-fpm.sock
fastcgi_pass unix:/etc/alternatives/php-fpm.sock;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi.conf;
set $path_info $fastcgi_path_info;
fastcgi_read_timeout 300;
fastcgi_param PATH_INFO $path_info;
fastcgi_param SCRIPT_FILENAME $document_root/index.php;
fastcgi_index index.php;
}
2 changes: 2 additions & 0 deletions nginx-configs/snakeoil.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ssl_certificate /etc/ssl/certs/ssl-cert-snakeoil.pem;
ssl_certificate_key /etc/ssl/private/ssl-cert-snakeoil.key;
32 changes: 3 additions & 29 deletions scripts/build_helper/post_make_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ then

mkdir -p ${DST_DIR}/usr/share/bluecherry/nginx-includes/
cp ${SRC_PATH}/nginx-configs/php/* ${DST_DIR}/usr/share/bluecherry/nginx-includes/
cp ${SRC_PATH}/nginx-configs/snakeoil.conf ${DST_DIR}/usr/share/bluecherry/nginx-includes/

if [[ $(cat /etc/os-release | grep "^ID=" | grep debian) ]]
then
Expand All @@ -60,38 +61,11 @@ then

mkdir -p ${DST_DIR}/etc/nginx/sites-enabled/

# This handling is probably because of snakeoil.conf/subdomain.conf dynamicity
if test -f /etc/nginx/sites-enabled/bluecherry.conf; then
cp /etc/nginx/sites-enabled/bluecherry.conf \
${DST_DIR}/etc/nginx/sites-enabled/
else
cat ${SRC_PATH}/nginx-configs/bluecherry.conf | sed \
-e "s/__BLUECHERRY_DIST_CODENAME__/$_CODENAME_/" \
> ${DST_DIR}/etc/nginx/sites-enabled/bluecherry.conf
cp ${SRC_PATH}/nginx-configs/bluecherry.conf ${DST_DIR}/etc/nginx/sites-enabled/bluecherry.conf
fi

touch ${DST_DIR}/usr/share/bluecherry/nginx-includes/snakeoil.conf
echo "ssl_certificate /etc/ssl/certs/ssl-cert-snakeoil.pem;" >> ${DST_DIR}/usr/share/bluecherry/nginx-includes/snakeoil.conf
echo "ssl_certificate_key /etc/ssl/private/ssl-cert-snakeoil.key;" >> ${DST_DIR}/usr/share/bluecherry/nginx-includes/snakeoil.conf
fi

# Apache configurations are no more required
#if [[ ${PKG_TYPE} == "deb" ]]
#then
# install -d ${DST_DIR}/etc/apache2/sites-available
# cat ${SRC_PATH}/debian/apache.conf | sed \
# -e "s/__BLUECHERRY_APACHE_ERROR_LOG__/\/var\/log\/apache2\/bluecherry-error.log/" \
# -e "s/__BLUECHERRY_APACHE_ACCESS_LOG__/\/var\/log\/apache2\/bluecherry-access.log/" \
# -e "s/__BLUECHERRY_APACHE_CERTIFICATE_FILE__/\/etc\/ssl\/certs\/ssl-cert-snakeoil.pem/" \
# -e "s/__BLUECHERRY_APACHE_CERTIFICATE_KEY_FILE__/\/etc\/ssl\/private\/ssl-cert-snakeoil.key/" \
# > ${DST_DIR}/etc/apache2/sites-available/bluecherry.conf
#else
# install -d ${DST_DIR}/etc/httpd/sites-available
# cat ${SRC_PATH}/debian/apache.conf | sed \
# -e "s/__BLUECHERRY_APACHE_ERROR_LOG__/\/var\/log\/httpd\/bluecherry_error_log/" \
# -e "s/__BLUECHERRY_APACHE_ACCESS_LOG__/\/var\/log\/httpd\/bluecherry_access_log/" \
# -e "s/__BLUECHERRY_APACHE_CERTIFICATE_FILE__/\/etc\/pki\/tls\/certs\/localhost.crt/" \
# -e "s/__BLUECHERRY_APACHE_CERTIFICATE_KEY_FILE__/\/etc\/pki\/tls\/private\/localhost.key/" \
# > ${DST_DIR}/etc/httpd/sites-available/bluecherry.conf
#fi
# install -m644${DST_DIR}.apparmor \
# ${DST_DIR}/etc/apparmor.d/usr.sbin.bc-server
Loading

0 comments on commit cab3f77

Please sign in to comment.