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

feat: add gamescope-dbus #179

Closed
wants to merge 3 commits into from
Closed
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
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "subprojects/python-xlib"]
path = subprojects/python-xlib
url = https://github.com/python-xlib/python-xlib.git
[submodule "subprojects/gamescope-dbus"]
path = subprojects/gamescope-dbus
url = https://github.com/ShadowBlip/gamescope-dbus.git
17 changes: 16 additions & 1 deletion Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ $(OBJDIR):
.PHONY: clean
clean:
$(info :: Cleaning source directory )
@rm -rf -v $(OBJDIR) umu/umu_version.json ./$(RELEASEDIR) $(RELEASEDIR).tar.gz
@rm -rf -v $(OBJDIR) umu/umu_version.json ./$(RELEASEDIR) $(RELEASEDIR).tar.gz subprojects/gamescope-dbus/target


RELEASEDIR := $(PROJECT)-$(shell git describe --abbrev=0)
Expand Down Expand Up @@ -197,4 +197,19 @@ zipapp-install: zipapp
install -Dm755 $(ZIPAPP) $(DESTDIR)$(BINDIR)
@echo "Standalone application 'umu-run' created at '$(DESTDIR)$(PREFIX)/bin'"


$(OBJDIR)/.build-gamescope-dbus: | $(OBJDIR)
$(info :: Building gamescope-dbus )
cd subprojects/gamescope-dbus && \
cargo update && \
make build
touch $(@)

.PHONY: gamescope-dbus
gamescope-dbus: $(OBJDIR)/.build-gamescope-dbus

gamescope-dbus-install: gamescope-dbus
$(info :: Installing gamescope-dbus )
PREFIX=$(DESTDIR) make -C subprojects/gamescope-dbus install

# vim: ft=make
59 changes: 59 additions & 0 deletions systemd/units/gamescope-dbus.service.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
[Unit]
Description=Daemon for interacting with Gamescope over DBus

[Service]
Type=simple
ExecStart=gamescope-dbus
Restart=always
RestartSec=1

# Filesystem lockdown
ProtectHome=true
ProtectSystem=strict
ProtectKernelTunables=true
ProtectControlGroups=true
PrivateTmp=true
ProtectProc=invisible
ProcSubset=pid
UMask=0077

# Privilege escalation
NoNewPrivileges=true
RestrictSUIDSGID=true

# Network
PrivateNetwork=true
IPAddressDeny=any

# System call interfaces
SystemCallFilter=@system-service
SystemCallFilter=~@resources
SystemCallErrorNumber=EPERM
SystemCallArchitectures=native

# Kernel
ProtectKernelLogs=true
ProtectKernelModules=true
LockPersonality=true

# Namespaces
RestrictNamespaces=true

# Service capabilities
CapabilityBoundingSet=CAP_SYS_ADMIN CAP_CHOWN CAP_SYS_TTY_CONFIG CAP_DAC_OVERRIDE
RestrictAddressFamilies=AF_UNIX
RestrictRealtime=true
MemoryDenyWriteExecute=true
ProtectClock=true
ProtectHostname=true

# Devices
DevicePolicy=strict
DeviceAllow=char-/dev/console rw
DeviceAllow=char-drm rw
DeviceAllow=char-input rw
DeviceAllow=char-tty rw
DeviceAllow=/dev/null rw

[Install]
WantedBy=multi-user.target
Loading