Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LXC Proxmox compatibility without docker required #212

Open
kendikaku opened this issue Jan 4, 2025 · 2 comments
Open

LXC Proxmox compatibility without docker required #212

kendikaku opened this issue Jan 4, 2025 · 2 comments

Comments

@kendikaku
Copy link

Hello, thank you for the great work you did on this project. Could you tell me if there is a way to create a version compatible with proxmox scripts like these? https://community-scripts.github.io/ProxmoxVE/scripts

@dmunozv04
Copy link
Owner

It might be possible to get it working but I have no experience with proxmox. However, PRs are welcome. I think it would be easier to do when running as a systemd service is working (#108)

@s0fax
Copy link

s0fax commented Jan 11, 2025

Since there is a pip package, you can simply install it in an LXC.
Here as an example with alpine as LXC OS, I typed this quickly from memory. no guarantee :)

apk update
apk upgrade
apk add python3 py3-uv
mkdir -p /opt/isponsorblocktv
mkdir -p /var/lib/isponsorblocktv
addgroup -S isponsorblocktv
adduser -S -h /var/lib/isponsorblocktv -D -g isponsorblocktv -G isponsorblocktv isponsorblocktv
chown -R isponsorblocktv:isponsorblocktv /opt/isponsorblocktv
chown -R isponsorblocktv:isponsorblocktv /var/lib/isponsorblocktv
cd /opt/isponsorblocktv
su isponsorblocktv -s /bin/sh -c "uv venv /opt/isponsorblocktv"
su isponsorblocktv -s /bin/sh -c "uv pip install iSponsorBlockTV"
su isponsorblocktv -s /bin/sh -c "/opt/isponsorblocktv/bin/iSponsorBlockTV --setup --data /var/lib/isponsorblocktv"

Initscript /etc/init.d/isponsorblocktv

#!/sbin/openrc-run

name="iSponsorBlockTV"
command="/opt/isponsorblocktv/bin/iSponsorBlockTV"
command_args="--data $DATA_DIR"
command_user="$RC_SVCNAME:$RC_SVCNAME"
command_background=true
output_log="/var/log/$RC_SVCNAME.log"
pidfile="/var/run/$RC_SVCNAME.pid"

depend() {
        need net
}

start_pre() {
        checkpath --file --owner $command_user --mode 0644 \
                "$pidfile" \
                "$output_log"
}

Initscript config /etc/conf.d/isponsorblocktv

DATA_DIR="/var/lib/isponsorblocktv"

Startup

chmod +x /etc/init.d/isponsorblocktv
rc-update add isponsorblocktv default
rc-service isponsorblocktv start

Update when new release is available

rc-service isponsorblocktv stop
cd /opt/isponsorblocktv
su isponsorblocktv -s /bin/sh -c "uv pip install iSponsorBlockTV --upgrade"
rc-service isponsorblocktv start

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants