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

add wolf configs #1

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions files/justfiles/apps/wolf/wolf.just
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
wolf-api-schema:
sudo curl --unix-socket /var/run/wolf/wolf.sock http://localhost/api/v1/openapi-schema | jq

wolf-debug-steam:
sudo podman run --rm -it \
--device=/dev/dri/renderD128 \
--device=/dev/dri/card1 \
-ipc=host \
-privileged \
-cap-add=ALL \
-security-opt seccomp=unconfined \
-e XDG_RUNTIME_DIR=/tmp \
-v ${XDG_RUNTIME_DIR}/${WAYLAND_DISPLAY}:/tmp/${WAYLAND_DISPLAY}:rw \
-e XDG_SESSION_TYPE=wayland \
-e WAYLAND_DISPLAY=${WAYLAND_DISPLAY} \
-e RUN_SWAY=true \
-v /tmp/SteamGOWData:/home/retro/ \
ghcr.io/games-on-whales/steam:fix-steam-mesa

wolf-debug:
sudo podman stop WolfPulseAudio || true
sudo podman rm WolfPulseAudio || true
sudo podman run --rm \
--name wolf \
--privileged \
--network=host \
--ipc=host \
--cap-add=ALL \
--device-cgroup-rule "c 13:* rmw" \
--device /dev/dri \
--device /dev/uinput \
--device /dev/uhid \
-v /tmp/sockets:/tmp/sockets:rw \
-v /etc/wolf:/etc/wolf:rw \
-v /run/podman/podman.sock:/var/run/docker.sock:ro \
-v /dev/input:/dev/input:ro \
-v /run/udev:/run/udev:rw \
--security-opt seccomp=unconfined \
ghcr.io/games-on-whales/wolf:stable
58 changes: 58 additions & 0 deletions files/system/wolf/etc/containers/systemd/wolf.container
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# wolf.container
# modified from: https://github.com/games-on-whales/wolf/pull/92/files
[Unit]
Description=Podman Wolf Gamestreaming

[Service]
Environment=PATH=/usr/bin
TimeoutStartSec=900

# TODO: Look into using systemd-tmpfiles here:
# https://wiki.archlinux.org/title/Systemd#systemd-tmpfiles_-_temporary_filesd
# look into config directive/setting for /var/run abstraction
ExecStartPre=-mkdir -p %T/sockets
ExecStartPre=-mkdir -p /var/run/wolf
ExecStartPre=-podman rm --force WolfPulseAudio
Restart=on-failure
RestartSec=5
StartLimitBurst=5

[Install]
WantedBy=multi-user.target

[Container]
# Avoid needing to use systemctl daemon-reload for trivial env var changes
# /etc/sysconfig is the default on Fedora based systems, /etc/default on ubuntu
# TODO: is there a better way to genericize this, or maybe just dump it into /etc/wolf?
EnvironmentFile=/etc/sysconfig/wolf

Image=ghcr.io/games-on-whales/wolf:stable
AutoUpdate=registry

HostName=%N # TODO: is this the hostname we actually want?

# Figure out what is actually really required here
#AddCapability=CAP_SYS_PTRACE
#AddCapability=CAP_NET_ADMIN
AddCapability=ALL

Network=host

# TODO: figure out tightening back down security
SecurityLabelDisable=true
# same as adding '--security-opt seccomp=unconfined' to PodmanArgs
SeccompProfile=unconfined

PodmanArgs=--ipc=host --device-cgroup-rule "c 13:* rmw"

AddDevice=/dev/dri
AddDevice=/dev/uinput
AddDevice=/dev/uhid

Volume=/dev/input:/dev/input:ro
Volume=/dev/:/dev/:ro
Volume=/run/udev:/run/udev:ro
Volume=%T/sockets:/tmp/sockets:rw
Volume=%t/podman/podman.sock:/var/run/docker.sock:ro
Volume=/etc/wolf:/etc/wolf:rw
Volume=/var/run/wolf:/var/run/wolf:rw
11 changes: 11 additions & 0 deletions files/system/wolf/etc/sysconfig/wolf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Environment variables for Podman Wolf Gamestreaming

# Temporary debugging vars
#WOLF_LOG_LEVEL=DEBUG
#WOLF_STOP_CONTAINER_ON_EXIT=true
#WOLF_RENDER_NODE=SOFTWARE

# TODO: figure out how to propagate TZ to created containers
TZ=America/New_York

WOLF_SOCKET_PATH=/var/run/wolf/wolf.sock
14 changes: 14 additions & 0 deletions files/system/wolf/etc/udev/rules.d/85-wolf.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Allows Wolf to access /dev/uinput
KERNEL=="uinput", SUBSYSTEM=="misc", MODE="0660", GROUP="input", OPTIONS+="static_node=uinput"

# Allows Wolf to access /dev/uhid
KERNEL=="uhid", TAG+="uaccess"

# Move virtual keyboard and mouse into a different seat
SUBSYSTEMS=="input", ATTRS{id/vendor}=="ab00", MODE="0660", GROUP="input", ENV{ID_SEAT}="seat9"

# Joypads
SUBSYSTEMS=="input", ATTRS{name}=="Wolf X-Box One (virtual) pad", MODE="0660", GROUP="input"
SUBSYSTEMS=="input", ATTRS{name}=="Wolf PS5 (virtual) pad", MODE="0660", GROUP="input"
SUBSYSTEMS=="input", ATTRS{name}=="Wolf gamepad (virtual) motion sensors", MODE="0660", GROUP="input"
SUBSYSTEMS=="input", ATTRS{name}=="Wolf Nintendo (virtual) pad", MODE="0660", GROUP="input"
Loading
Loading