Skip to content

Commit 9239b70

Browse files
committed
fix: libvirt build
1 parent 2d17799 commit 9239b70

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

.github/workflows/deploy-storybook.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: Deploy Storybook to Cloudflare Workers
22
permissions:
33
contents: read
44
pull-requests: write
5+
issues: write
56
on:
67
push:
78
branches:
@@ -31,6 +32,50 @@ jobs:
3132
with:
3233
run_install: false
3334

35+
- name: Cache APT Packages
36+
uses: awalsh128/cache-apt-pkgs-action@v1.4.3
37+
with:
38+
packages: bash procps python3 libvirt-dev jq zstd git build-essential libvirt-daemon-system
39+
version: 1.0
40+
41+
- name: Setup libvirt
42+
run: |
43+
# Create required groups (if they don't already exist)
44+
sudo groupadd -f libvirt
45+
sudo groupadd -f kvm
46+
47+
# Create libvirt user if not present, and add it to the kvm group
48+
sudo useradd -m -s /bin/bash -g libvirt libvirt || true
49+
sudo usermod -aG kvm libvirt || true
50+
51+
# Set up libvirt directories and permissions
52+
sudo mkdir -p /var/run/libvirt /var/log/libvirt /etc/libvirt
53+
sudo chown root:libvirt /var/run/libvirt /var/log/libvirt
54+
sudo chmod g+w /var/run/libvirt /var/log/libvirt
55+
56+
# Configure libvirt by appending required settings
57+
sudo tee -a /etc/libvirt/libvirtd.conf > /dev/null <<EOF
58+
unix_sock_group = "libvirt"
59+
unix_sock_rw_perms = "0770"
60+
auth_unix_rw = "none"
61+
EOF
62+
63+
# Add the current user to libvirt and kvm groups (note: this change won't apply to the current session)
64+
sudo usermod -aG libvirt,kvm $USER
65+
66+
sudo mkdir -p /var/run/libvirt
67+
sudo chown root:libvirt /var/run/libvirt
68+
sudo chmod 775 /var/run/libvirt
69+
70+
# Start libvirtd in the background
71+
sudo /usr/sbin/libvirtd --daemon
72+
73+
# Wait a bit longer for libvirtd to start
74+
sleep 5
75+
76+
# Verify libvirt is running using sudo to bypass group membership delays
77+
sudo virsh list --all || true
78+
3479
- name: Install dependencies
3580
run: pnpm install --frozen-lockfile
3681

api/src/dotenv.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const env =
99
override: true,
1010
})
1111
: config({
12+
debug: false,
1213
path: '/usr/local/unraid-api/.env',
1314
encoding: 'utf-8',
1415
});

0 commit comments

Comments
 (0)