more uv migrations
This commit is contained in:
parent
96511db9ef
commit
5965a426ff
@ -35,17 +35,9 @@ $STD apt-get install -y \
|
||||
libleptonica-dev
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
PYTHON_VERSION="3.12" setup_uv
|
||||
PG_VERSION="16" install_postgresql
|
||||
|
||||
msg_info "Setup Python3"
|
||||
$STD apt-get install -y \
|
||||
python3 \
|
||||
python3-pip \
|
||||
python3-dev \
|
||||
python3-setuptools \
|
||||
python3-wheel
|
||||
msg_ok "Setup Python3"
|
||||
|
||||
msg_info "Installing OCR Dependencies (Patience)"
|
||||
$STD apt-get install -y \
|
||||
unpaper \
|
||||
@ -85,8 +77,7 @@ $STD tar -xf "paperless-ngx-$Paperlessngx.tar.xz" -C /opt/
|
||||
mv paperless-ngx paperless
|
||||
rm "paperless-ngx-$Paperlessngx.tar.xz"
|
||||
cd /opt/paperless
|
||||
$STD pip install --upgrade pip
|
||||
$STD pip install -r requirements.txt
|
||||
$STD uv sync
|
||||
curl -fsSL "https://raw.githubusercontent.com/paperless-ngx/paperless-ngx/main/paperless.conf.example" -o /opt/paperless/paperless.conf
|
||||
mkdir -p {consume,data,media,static}
|
||||
sed -i -e 's|#PAPERLESS_REDIS=redis://localhost:6379|PAPERLESS_REDIS=redis://localhost:6379|' /opt/paperless/paperless.conf
|
||||
@ -98,7 +89,7 @@ echo "${Paperlessngx}" >/opt/"${APPLICATION}"_version.txt
|
||||
msg_ok "Installed Paperless-ngx"
|
||||
|
||||
msg_info "Installing Natural Language Toolkit (Patience)"
|
||||
$STD python3 -m nltk.downloader -d /usr/share/nltk_data all
|
||||
$STD /opt/paperless/.venv/bin/python -m nltk.downloader -d /usr/share/nltk_data all
|
||||
msg_ok "Installed Natural Language Toolkit"
|
||||
|
||||
msg_info "Setting up PostgreSQL database"
|
||||
@ -122,7 +113,7 @@ sed -i -e "s|#PAPERLESS_DBUSER=paperless|PAPERLESS_DBUSER=$DB_USER|" /opt/paperl
|
||||
sed -i -e "s|#PAPERLESS_DBPASS=paperless|PAPERLESS_DBPASS=$DB_PASS|" /opt/paperless/paperless.conf
|
||||
sed -i -e "s|#PAPERLESS_SECRET_KEY=change-me|PAPERLESS_SECRET_KEY=$SECRET_KEY|" /opt/paperless/paperless.conf
|
||||
cd /opt/paperless/src
|
||||
$STD python3 manage.py migrate
|
||||
$STD /opt/paperless/.venv/bin/python manage.py migrate
|
||||
msg_ok "Set up PostgreSQL database"
|
||||
|
||||
read -r -p "${TAB3}Would you like to add Adminer? <y/N> " prompt
|
||||
@ -144,7 +135,7 @@ fi
|
||||
|
||||
msg_info "Setting up admin Paperless-ngx User & Password"
|
||||
## From https://github.com/linuxserver/docker-paperless-ngx/blob/main/root/etc/cont-init.d/99-migrations
|
||||
cat <<EOF | python3 /opt/paperless/src/manage.py shell
|
||||
cat <<EOF | /opt/paperless/.venv/bin/python /opt/paperless/src/manage.py shell
|
||||
from django.contrib.auth import get_user_model
|
||||
UserModel = get_user_model()
|
||||
user = UserModel.objects.create_user('admin', password='$DB_PASS')
|
||||
@ -194,7 +185,7 @@ Requires=redis.service
|
||||
[Service]
|
||||
WorkingDirectory=/opt/paperless/src
|
||||
ExecStartPre=/bin/sleep 2
|
||||
ExecStart=python3 manage.py document_consumer
|
||||
ExecStart=/opt/paperless/.venv/bin/python manage.py document_consumer
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
@ -13,15 +13,10 @@ setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
msg_info "Setup Python3"
|
||||
$STD apt-get install -y \
|
||||
python3 \
|
||||
python3-pip
|
||||
rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED
|
||||
msg_ok "Setup Python3"
|
||||
PYTHON_VERSION="3.12" setup_uv
|
||||
|
||||
msg_info "Installing Prometheus Proxmox VE Exporter"
|
||||
python3 -m pip install --default-timeout=300 --quiet --root-user-action=ignore prometheus-pve-exporter
|
||||
$STD uv pip install prometheus-pve-exporter
|
||||
mkdir -p /opt/prometheus-pve-exporter
|
||||
cat <<EOF >/opt/prometheus-pve-exporter/pve.yml
|
||||
default:
|
||||
@ -42,7 +37,7 @@ After=syslog.target network.target
|
||||
User=root
|
||||
Restart=always
|
||||
Type=simple
|
||||
ExecStart=pve_exporter \
|
||||
ExecStart=/usr/local/bin/uv run pve_exporter \
|
||||
--config.file=/opt/prometheus-pve-exporter/pve.yml \
|
||||
--web.listen-address=0.0.0.0:9221
|
||||
ExecReload=/bin/kill -HUP \$MAINPID
|
||||
|
@ -15,17 +15,16 @@ update_os
|
||||
|
||||
msg_info "Installing Dependencies"
|
||||
$STD apt-get install -y \
|
||||
apache2-utils \
|
||||
python3-pip \
|
||||
python3.11-venv
|
||||
apache2-utils
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
PYTHON_VERSION="3.12" setup_uv
|
||||
|
||||
msg_info "Setting up Radicale"
|
||||
python3 -m venv /opt/radicale
|
||||
source /opt/radicale/bin/activate
|
||||
$STD python3 -m pip install --upgrade https://github.com/Kozea/Radicale/archive/master.tar.gz
|
||||
$STD uv venv /opt/radicale
|
||||
$STD /opt/radicale/bin/uv pip install --upgrade https://github.com/Kozea/Radicale/archive/master.tar.gz
|
||||
RNDPASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)
|
||||
$STD htpasswd -c -b -5 /opt/radicale/users admin $RNDPASS
|
||||
$STD htpasswd -c -b -5 /opt/radicale/users admin "$RNDPASS"
|
||||
{
|
||||
echo "Radicale Credentials"
|
||||
echo "Admin User: admin"
|
||||
@ -34,16 +33,15 @@ $STD htpasswd -c -b -5 /opt/radicale/users admin $RNDPASS
|
||||
msg_ok "Done setting up Radicale"
|
||||
|
||||
msg_info "Setup Service"
|
||||
|
||||
cat <<EOF >/opt/radicale/start.sh
|
||||
#!/usr/bin/env bash
|
||||
source /opt/radicale/bin/activate
|
||||
python3 -m radicale --storage-filesystem-folder=/var/lib/radicale/collections --hosts 0.0.0.0:5232 --auth-type htpasswd --auth-htpasswd-filename /opt/radicale/users --auth-htpasswd-encryption sha512
|
||||
/opt/radicale/bin/uv run -m radicale --storage-filesystem-folder=/var/lib/radicale/collections --hosts 0.0.0.0:5232 --auth-type htpasswd --auth-htpasswd-filename /opt/radicale/users --auth-htpasswd-encryption sha512
|
||||
EOF
|
||||
|
||||
chmod +x /opt/radicale/start.sh
|
||||
|
||||
cat <<EOF >/etc/systemd/system/radicale.service
|
||||
[Unit]
|
||||
Description=A simple CalDAV (calendar) and CardDAV (contact) server
|
||||
After=network.target
|
||||
Requires=network.target
|
||||
@ -51,13 +49,11 @@ Requires=network.target
|
||||
[Service]
|
||||
ExecStart=/opt/radicale/start.sh
|
||||
Restart=on-failure
|
||||
# User=radicale
|
||||
# Deny other users access to the calendar data
|
||||
# UMask=0027
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
systemctl enable -q --now radicale
|
||||
msg_ok "Created Service"
|
||||
|
||||
|
@ -22,13 +22,7 @@ $STD apt-get install -y \
|
||||
git
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
msg_info "Setup Python3"
|
||||
$STD apt-get install -y \
|
||||
python3 \
|
||||
python3-{pip,venv,yaml,dev}
|
||||
$STD pip install --upgrade pip setuptools wheel
|
||||
$STD pip install pyyaml
|
||||
msg_ok "Setup Python3"
|
||||
PYTHON_VERSION="3.12" setup_uv
|
||||
|
||||
msg_info "Setup SearXNG"
|
||||
mkdir -p /usr/local/searxng /etc/searxng
|
||||
@ -36,11 +30,10 @@ useradd -d /etc/searxng searxng
|
||||
chown searxng:searxng /usr/local/searxng /etc/searxng
|
||||
$STD git clone https://github.com/searxng/searxng.git /usr/local/searxng/searxng-src
|
||||
cd /usr/local/searxng/
|
||||
sudo -u searxng python3 -m venv /usr/local/searxng/searx-pyenv
|
||||
source /usr/local/searxng/searx-pyenv/bin/activate
|
||||
$STD pip install --upgrade pip setuptools wheel
|
||||
$STD pip install pyyaml
|
||||
$STD pip install --use-pep517 --no-build-isolation -e /usr/local/searxng/searxng-src
|
||||
$STD uv venv /usr/local/searxng/searx-pyenv
|
||||
$STD /usr/local/searxng/searx-pyenv/bin/uv pip install --upgrade pip setuptools wheel pyyaml
|
||||
$STD /usr/local/searxng/searx-pyenv/bin/uv pip install --use-pep517 --no-build-isolation -e /usr/local/searxng/searxng-src
|
||||
|
||||
SECRET_KEY=$(openssl rand -hex 32)
|
||||
cat <<EOF >/etc/searxng/settings.yml
|
||||
# SearXNG settings
|
||||
@ -94,7 +87,7 @@ Type=simple
|
||||
User=searxng
|
||||
Group=searxng
|
||||
Environment="SEARXNG_SETTINGS_PATH=/etc/searxng/settings.yml"
|
||||
ExecStart=/usr/local/searxng/searx-pyenv/bin/python -m searx.webapp
|
||||
ExecStart=/usr/local/searxng/searx-pyenv/bin/uv run -m searx.webapp
|
||||
WorkingDirectory=/usr/local/searxng/searxng-src
|
||||
Restart=always
|
||||
|
||||
|
@ -13,10 +13,7 @@ setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
msg_info "Installing Dependencies"
|
||||
$STD apt-get install -y \
|
||||
python3-pip
|
||||
msg_ok "Installed Dependencies"
|
||||
PYTHON_VERSION="3.12" setup_uv
|
||||
|
||||
msg_info "Setup ${APPLICATION}"
|
||||
tmp_file=$(mktemp)
|
||||
@ -40,13 +37,13 @@ sed -i \
|
||||
msg_ok "Setup ${APPLICATION}"
|
||||
|
||||
msg_info "Installing Soularr"
|
||||
rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED
|
||||
cd /tmp
|
||||
curl -fsSL -o main.zip https://github.com/mrusse/soularr/archive/refs/heads/main.zip
|
||||
$STD unzip main.zip
|
||||
mv soularr-main /opt/soularr
|
||||
cd /opt/soularr
|
||||
$STD pip install -r requirements.txt
|
||||
$STD uv venv /opt/soularr/venv
|
||||
$STD /opt/soularr/venv/bin/uv pip install -r requirements.txt
|
||||
sed -i \
|
||||
-e "\|[Slskd]|,\|host_url|s|yourslskdapikeygoeshere|$SLSKD_API_KEY|" \
|
||||
-e "/host_url/s/slskd/localhost/" \
|
||||
@ -54,7 +51,7 @@ sed -i \
|
||||
sed -i \
|
||||
-e "/#This\|#Default\|INTERVAL/{N;d;}" \
|
||||
-e "/while\|#Pass/d" \
|
||||
-e "\|python|s|app|opt/soularr|; s|python|python3|" \
|
||||
-e "\|python|s|app|opt/soularr|; s|python|/opt/soularr/venv/bin/python3|" \
|
||||
-e "/dt/,+2d" \
|
||||
/opt/soularr/run.sh
|
||||
sed -i -E "/(soularr.py)/s/.{5}$//; /if/,/fi/s/.{4}//" /opt/soularr/run.sh
|
||||
@ -106,6 +103,7 @@ ExecStart=/bin/bash -c /opt/soularr/run.sh
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
||||
systemctl enable -q --now ${APPLICATION}
|
||||
systemctl enable -q soularr.timer
|
||||
msg_ok "Created Services"
|
||||
@ -114,8 +112,8 @@ motd_ssh
|
||||
customize
|
||||
|
||||
msg_info "Cleaning up"
|
||||
rm -rf $tmp_file
|
||||
rm -rf /tmp/main.zip
|
||||
rm -f $tmp_file
|
||||
rm -f /tmp/main.zip
|
||||
$STD apt-get -y autoremove
|
||||
$STD apt-get -y autoclean
|
||||
msg_ok "Cleaned"
|
||||
|
@ -22,22 +22,17 @@ $STD apt-get install -y \
|
||||
ca-certificates
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
msg_info "Setup Python3"
|
||||
$STD apt-get install -y \
|
||||
python3-dev \
|
||||
python3-setuptools \
|
||||
python3-wheel \
|
||||
python3-pip
|
||||
msg_ok "Setup Python3"
|
||||
PYTHON_VERSION="3.12" setup_uv
|
||||
|
||||
msg_info "Installing Spoolman"
|
||||
RELEASE=$(curl -fsSL https://github.com/Donkie/Spoolman/releases/latest | grep "title>Release" | cut -d " " -f 4)
|
||||
cd /opt
|
||||
curl -fsSL "https://github.com/Donkie/Spoolman/releases/download/$RELEASE/spoolman.zip" -o "spoolman.zip"
|
||||
$STD unzip spoolman.zip -d spoolman
|
||||
rm -rf spoolman.zip
|
||||
rm -f spoolman.zip
|
||||
cd spoolman
|
||||
$STD pip3 install -r requirements.txt
|
||||
$STD uv venv /opt/spoolman/venv
|
||||
$STD /opt/spoolman/venv/bin/uv pip install -r requirements.txt
|
||||
curl -fsSL "https://raw.githubusercontent.com/Donkie/Spoolman/master/.env.example" -o ".env"
|
||||
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
|
||||
msg_ok "Installed Spoolman"
|
||||
@ -47,13 +42,15 @@ cat <<EOF >/etc/systemd/system/spoolman.service
|
||||
[Unit]
|
||||
Description=Spoolman
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
WorkingDirectory=/opt/spoolman
|
||||
EnvironmentFile=/opt/spoolman/.env
|
||||
ExecStart=uvicorn spoolman.main:app --host 0.0.0.0 --port 7912
|
||||
ExecStart=/opt/spoolman/venv/bin/uvicorn spoolman.main:app --host 0.0.0.0 --port 7912
|
||||
Restart=always
|
||||
User=root
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
|
Loading…
x
Reference in New Issue
Block a user