more uv mig
This commit is contained in:
parent
5965a426ff
commit
a7f4bf2843
@ -25,34 +25,33 @@ $STD apt-get install -y \
|
|||||||
ripgrep
|
ripgrep
|
||||||
msg_ok "Installed Dependencies"
|
msg_ok "Installed Dependencies"
|
||||||
|
|
||||||
msg_info "Installing Python Dependencies"
|
|
||||||
$STD apt-get install -y \
|
|
||||||
python3-pip \
|
|
||||||
python3-ldap \
|
|
||||||
python3-msgpack \
|
|
||||||
python3-regex
|
|
||||||
msg_ok "Installed Python Dependencies"
|
|
||||||
|
|
||||||
NODE_VERSION="22" install_node_and_modules
|
NODE_VERSION="22" install_node_and_modules
|
||||||
|
|
||||||
msg_info "Installing Playwright"
|
msg_info "Installing ArchiveBox Python Environment"
|
||||||
$STD pip install playwright
|
|
||||||
$STD playwright install-deps chromium
|
|
||||||
msg_ok "Installed Playwright"
|
|
||||||
|
|
||||||
msg_info "Installing Chromium and ArchiveBox"
|
|
||||||
mkdir -p /opt/archivebox/{data,.npm,.cache,.local}
|
mkdir -p /opt/archivebox/{data,.npm,.cache,.local}
|
||||||
$STD adduser --system --shell /bin/bash --gecos 'Archive Box User' --group --disabled-password --home /home/archivebox archivebox
|
adduser --system --shell /bin/bash --gecos 'Archive Box User' --group --disabled-password --home /home/archivebox archivebox
|
||||||
chown -R archivebox:archivebox /opt/archivebox/{data,.npm,.cache,.local}
|
chown -R archivebox:archivebox /opt/archivebox/{data,.npm,.cache,.local}
|
||||||
chmod -R 755 /opt/archivebox/data
|
chmod -R 755 /opt/archivebox/data
|
||||||
$STD pip install archivebox
|
|
||||||
|
cd /opt/archivebox
|
||||||
|
PYTHON_VERSION="3.12" setup_uv
|
||||||
|
|
||||||
|
msg_info "Installing ArchiveBox & Playwright (Patience)"
|
||||||
cd /opt/archivebox/data
|
cd /opt/archivebox/data
|
||||||
|
cp /opt/archivebox/uv.lock . || true
|
||||||
|
$STD /opt/archivebox/.venv/bin/uv sync
|
||||||
|
sudo -u archivebox /opt/archivebox/.venv/bin/playwright install-deps chromium
|
||||||
|
msg_ok "Installed ArchiveBox & Playwright"
|
||||||
|
|
||||||
|
msg_info "Initial ArchiveBox Setup"
|
||||||
expect <<EOF
|
expect <<EOF
|
||||||
set timeout -1
|
set timeout -1
|
||||||
log_user 0
|
log_user 0
|
||||||
|
|
||||||
spawn sudo -u archivebox playwright install chromium
|
spawn sudo -u archivebox /opt/archivebox/.venv/bin/playwright install chromium
|
||||||
spawn sudo -u archivebox archivebox setup
|
expect eof
|
||||||
|
|
||||||
|
spawn sudo -u archivebox /opt/archivebox/.venv/bin/archivebox setup
|
||||||
|
|
||||||
expect "Username"
|
expect "Username"
|
||||||
send "\r"
|
send "\r"
|
||||||
@ -68,7 +67,7 @@ send "helper-scripts.com\r"
|
|||||||
|
|
||||||
expect eof
|
expect eof
|
||||||
EOF
|
EOF
|
||||||
msg_ok "Installed ArchiveBox"
|
msg_ok "Initialized ArchiveBox"
|
||||||
|
|
||||||
msg_info "Creating Service"
|
msg_info "Creating Service"
|
||||||
cat <<EOF >/etc/systemd/system/archivebox.service
|
cat <<EOF >/etc/systemd/system/archivebox.service
|
||||||
@ -79,12 +78,13 @@ After=network.target
|
|||||||
[Service]
|
[Service]
|
||||||
User=archivebox
|
User=archivebox
|
||||||
WorkingDirectory=/opt/archivebox/data
|
WorkingDirectory=/opt/archivebox/data
|
||||||
ExecStart=/usr/local/bin/archivebox server 0.0.0.0:8000
|
ExecStart=/opt/archivebox/.venv/bin/archivebox server 0.0.0.0:8000
|
||||||
Restart=always
|
Restart=always
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
systemctl enable -q --now archivebox
|
systemctl enable -q --now archivebox
|
||||||
msg_ok "Created Service"
|
msg_ok "Created Service"
|
||||||
|
|
||||||
|
@ -42,17 +42,14 @@ $STD lighttpd-enable-mod fastcgi-php
|
|||||||
service lighttpd force-reload
|
service lighttpd force-reload
|
||||||
msg_ok "Installed PHP Dependencies"
|
msg_ok "Installed PHP Dependencies"
|
||||||
|
|
||||||
|
PYTHON_VERSION="3.12" setup_uv
|
||||||
|
|
||||||
msg_info "Installing Python Dependencies"
|
msg_info "Installing Python Dependencies"
|
||||||
$STD apt-get -y install \
|
source /opt/pialert/.venv/bin/activate
|
||||||
python3-pip \
|
$STD uv pip install mac-vendor-lookup
|
||||||
python3-requests \
|
$STD uv pip install fritzconnection
|
||||||
python3-tz \
|
$STD uv pip install cryptography
|
||||||
python3-tzlocal
|
$STD uv pip install pyunifi
|
||||||
rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED
|
|
||||||
$STD pip3 install mac-vendor-lookup
|
|
||||||
$STD pip3 install fritzconnection
|
|
||||||
$STD pip3 install cryptography
|
|
||||||
$STD pip3 install pyunifi
|
|
||||||
msg_ok "Installed Python Dependencies"
|
msg_ok "Installed Python Dependencies"
|
||||||
|
|
||||||
msg_info "Installing Pi.Alert"
|
msg_info "Installing Pi.Alert"
|
||||||
@ -75,7 +72,7 @@ done
|
|||||||
sed -i 's#PIALERT_PATH\s*=\s*'\''/home/pi/pialert'\''#PIALERT_PATH = '\''/opt/pialert'\''#' /opt/pialert/config/pialert.conf
|
sed -i 's#PIALERT_PATH\s*=\s*'\''/home/pi/pialert'\''#PIALERT_PATH = '\''/opt/pialert'\''#' /opt/pialert/config/pialert.conf
|
||||||
sed -i 's/$HOME/\/opt/g' /opt/pialert/install/pialert.cron
|
sed -i 's/$HOME/\/opt/g' /opt/pialert/install/pialert.cron
|
||||||
crontab /opt/pialert/install/pialert.cron
|
crontab /opt/pialert/install/pialert.cron
|
||||||
echo "python3 /opt/pialert/back/pialert.py 1" >/usr/bin/scan
|
echo "/opt/pialert/.venv/bin/python /opt/pialert/back/pialert.py 1" >/usr/bin/scan
|
||||||
chmod +x /usr/bin/scan
|
chmod +x /usr/bin/scan
|
||||||
echo "/opt/pialert/back/pialert-cli set_permissions --lxc" >/usr/bin/permissions
|
echo "/opt/pialert/back/pialert-cli set_permissions --lxc" >/usr/bin/permissions
|
||||||
chmod +x /usr/bin/permissions
|
chmod +x /usr/bin/permissions
|
||||||
@ -84,9 +81,9 @@ chmod +x /usr/bin/sudoers
|
|||||||
msg_ok "Installed Pi.Alert"
|
msg_ok "Installed Pi.Alert"
|
||||||
|
|
||||||
msg_info "Start Pi.Alert Scan (Patience)"
|
msg_info "Start Pi.Alert Scan (Patience)"
|
||||||
$STD python3 /opt/pialert/back/pialert.py update_vendors
|
$STD /opt/pialert/.venv/bin/python /opt/pialert/back/pialert.py update_vendors
|
||||||
$STD python3 /opt/pialert/back/pialert.py internet_IP
|
$STD /opt/pialert/.venv/bin/python /opt/pialert/back/pialert.py internet_IP
|
||||||
$STD python3 /opt/pialert/back/pialert.py 1
|
$STD /opt/pialert/.venv/bin/python /opt/pialert/back/pialert.py 1
|
||||||
msg_ok "Finished Pi.Alert Scan"
|
msg_ok "Finished Pi.Alert Scan"
|
||||||
|
|
||||||
motd_ssh
|
motd_ssh
|
||||||
|
Loading…
x
Reference in New Issue
Block a user