2022-11-30 23:09:26 +01:00
|
|
|
#include <tunables/global>
|
|
|
|
|
|
|
|
profile gotosocial flags=(attach_disconnected, mediate_deleted) {
|
2024-02-24 09:44:53 +01:00
|
|
|
include <abstractions/base>
|
|
|
|
include <abstractions/dbus-session-strict>
|
|
|
|
include <abstractions/gio-open>
|
|
|
|
include <abstractions/nameservice>
|
|
|
|
include <abstractions/user-tmp>
|
2022-11-30 23:09:26 +01:00
|
|
|
|
2024-09-28 16:58:39 +02:00
|
|
|
# Allow common binary install paths.
|
|
|
|
#
|
|
|
|
# You can change or remove these depending on
|
|
|
|
# where you've installed your GoToSocial binary.
|
2022-11-30 23:09:26 +01:00
|
|
|
/gotosocial/gotosocial mrix,
|
|
|
|
/usr/local/bin/gotosocial mrix,
|
2024-02-24 09:44:53 +01:00
|
|
|
/usr/bin/gotosocial mrix,
|
|
|
|
/usr/sbin/gotosocial mrix,
|
2022-11-30 23:09:26 +01:00
|
|
|
|
2024-09-28 16:58:39 +02:00
|
|
|
# Allow access to GoToSocial's storage and database paths.
|
|
|
|
# Change these depending on your db + storage locations.
|
2022-11-30 23:09:26 +01:00
|
|
|
owner /gotosocial/{,**} r,
|
2023-06-04 18:55:57 +02:00
|
|
|
owner /gotosocial/db/* wk,
|
2022-11-30 23:09:26 +01:00
|
|
|
owner /gotosocial/storage/** wk,
|
|
|
|
|
2024-09-28 16:58:39 +02:00
|
|
|
# Embedded ffmpeg needs read
|
|
|
|
# permission on /dev/urandom.
|
2024-10-16 14:34:08 +02:00
|
|
|
/dev/ r,
|
|
|
|
/dev/urandom r,
|
2024-09-28 16:58:39 +02:00
|
|
|
|
|
|
|
# Temp dir access is needed for storing
|
|
|
|
# files briefly during media processing.
|
2024-10-16 14:34:08 +02:00
|
|
|
/tmp/ r,
|
2024-09-28 16:58:39 +02:00
|
|
|
owner /tmp/* rwk,
|
|
|
|
|
|
|
|
# If running with GTS_WAZERO_COMPILATION_CACHE set,
|
|
|
|
# change + uncomment the below lines as appropriate:
|
|
|
|
# owner /your/wazero/cache/directory/ r,
|
|
|
|
# owner /your/wazero/cache/directory/** rwk,
|
|
|
|
|
|
|
|
# If you've enabled logging to syslog, allow GoToSocial
|
|
|
|
# to write logs by uncommenting the following line:
|
2024-10-16 14:34:08 +02:00
|
|
|
# /var/log/syslog w,
|
2022-11-30 23:09:26 +01:00
|
|
|
|
2024-09-28 16:58:39 +02:00
|
|
|
# These directories are not currently used by any of
|
|
|
|
# the recommended GoToSocial installation methods, but
|
|
|
|
# may be used in the future and/or for custom installs.
|
|
|
|
# Delete them if you prefer.
|
2022-11-30 23:09:26 +01:00
|
|
|
owner /etc/gotosocial/{,**} r,
|
|
|
|
owner /usr/local/etc/gotosocial/{,**} r,
|
2024-02-24 09:44:53 +01:00
|
|
|
owner /usr/share/gotosocial/{,**} r,
|
2022-11-30 23:09:26 +01:00
|
|
|
owner /usr/local/share/gotosocial/{,**} r,
|
2024-02-24 09:44:53 +01:00
|
|
|
owner /usr/lib/gotosocial/{,**} r,
|
|
|
|
owner /usr/lib/gotosocial/db/* wk,
|
|
|
|
owner /usr/lib/gotosocial/storage/** wk,
|
|
|
|
owner /usr/local/lib/gotosocial/{,**} r,
|
|
|
|
owner /usr/local/lib/gotosocial/db/* wk,
|
|
|
|
owner /usr/local/lib/gotosocial/storage/** wk,
|
2022-11-30 23:09:26 +01:00
|
|
|
owner /var/lib/gotosocial/{,**} r,
|
2024-02-24 09:44:53 +01:00
|
|
|
owner /var/lib/gotosocial/db/* wk,
|
|
|
|
owner /var/lib/gotosocial/storage/** wk,
|
2022-11-30 23:09:26 +01:00
|
|
|
owner /opt/gotosocial/{,**} r,
|
|
|
|
owner /run/gotosocial/{,**} r,
|
|
|
|
|
2024-02-24 09:44:53 +01:00
|
|
|
/etc/mime.types r,
|
|
|
|
/etc/services r,
|
2022-11-30 23:09:26 +01:00
|
|
|
/proc/sys/net/core/somaxconn r,
|
2024-02-24 09:44:53 +01:00
|
|
|
/sys/fs/cgroup/system.slice/gotosocial.service/{,*} r,
|
2024-10-16 14:34:08 +02:00
|
|
|
/sys/kernel/mm/hugepages/ r,
|
2022-11-30 23:09:26 +01:00
|
|
|
/sys/kernel/mm/transparent_hugepage/hpage_pmd_size r,
|
2024-02-24 09:44:53 +01:00
|
|
|
owner /proc/*/cgroup r,
|
|
|
|
owner /proc/*/cpuset r,
|
|
|
|
owner /proc/*/mountinfo r,
|
2022-11-30 23:09:26 +01:00
|
|
|
|
|
|
|
# TCP / UDP network access
|
|
|
|
network inet stream,
|
|
|
|
network inet6 stream,
|
|
|
|
network inet dgram,
|
|
|
|
network inet6 dgram,
|
|
|
|
|
2024-09-28 16:58:39 +02:00
|
|
|
# Allow GoToSocial to receive signals from unconfined processes.
|
2022-11-30 23:09:26 +01:00
|
|
|
signal (receive) peer=unconfined,
|
2024-09-28 16:58:39 +02:00
|
|
|
|
|
|
|
# Allow GoToSocial to send signals to/receive signals from worker processes.
|
2022-11-30 23:09:26 +01:00
|
|
|
signal (send,receive) peer=gotosocial,
|
|
|
|
}
|
|
|
|
|
|
|
|
# vim:syntax=apparmor
|