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