Browse Source

feat: add port settings

master
Dnomd343 2 years ago
parent
commit
2da60d7c30
  1. 20
      init.sh
  2. 2
      nginx/alltube.conf

20
init.sh

@ -1,28 +1,38 @@
#!/usr/bin/env sh #!/usr/bin/env sh
DEFAULT_PORT="80"
NGINX_CONFIG="/etc/nginx/alltube.conf"
CONFIG="/var/www/alltube/config/config.yml" CONFIG="/var/www/alltube/config/config.yml"
sed -i "s,^audioBitrate:.*,audioBitrate: 320," "${CONFIG}" sed -i "s,^audioBitrate:.*,audioBitrate: 320," "${CONFIG}"
sed -i "s,^youtubedl:.*,youtubedl: /usr/bin/yt-dlp," "${CONFIG}" sed -i "s,^youtubedl:.*,youtubedl: /usr/bin/yt-dlp," "${CONFIG}"
if [ "$REMUX" = "TRUE" ] || [ "$REMUX" = "ON" ]; then if [ -n "${PORT}" ]; then
echo "Port: ${PORT}"
sed -i "s/@PORT@/${PORT}/g" "${NGINX_CONFIG}"
else
sed -i "s/@PORT@/${DEFAULT_PORT}/g" "${NGINX_CONFIG}"
fi
if [ "${REMUX}" = "TRUE" ] || [ "${REMUX}" = "ON" ]; then
echo "Remux enabled" echo "Remux enabled"
sed -i "s,^remux:.*,remux: true," "${CONFIG}" sed -i "s,^remux:.*,remux: true," "${CONFIG}"
fi fi
if [ "$STREAM" = "TRUE" ] || [ "$STREAM" = "ON" ]; then if [ "${STREAM}" = "TRUE" ] || [ "${STREAM}" = "ON" ]; then
echo "Stream enabled" echo "Stream enabled"
sed -i "s,^stream:.*,stream: ask," "${CONFIG}" sed -i "s,^stream:.*,stream: ask," "${CONFIG}"
fi fi
if [ "$CONVERT" = "TRUE" ] || [ "$CONVERT" = "ON" ]; then if [ "${CONVERT}" = "TRUE" ] || [ "${CONVERT}" = "ON" ]; then
echo "Convert enabled" echo "Convert enabled"
sed -i "s,^convert:.*,convert: true," "${CONFIG}" sed -i "s,^convert:.*,convert: true," "${CONFIG}"
sed -i "s,^convertAdvanced:.*,convertAdvanced: true," "${CONFIG}" sed -i "s,^convertAdvanced:.*,convertAdvanced: true," "${CONFIG}"
fi fi
if [ -n "$TITLE" ]; then if [ -n "${TITLE}" ]; then
echo "Title: ${TITLE}" echo "Title: "'`'"${TITLE}"'`'
sed -i "s,^appName:.*,appName: ${TITLE}," "${CONFIG}" sed -i "s,^appName:.*,appName: ${TITLE}," "${CONFIG}"
fi fi

2
nginx/alltube.conf

@ -1,5 +1,5 @@
server { server {
listen 80; listen @PORT@;
index index.php; index index.php;
root /var/www/alltube/; root /var/www/alltube/;

Loading…
Cancel
Save