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

New profile: syncthing #6536

Merged
merged 2 commits into from
Dec 17, 2024
Merged
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
116 changes: 116 additions & 0 deletions etc/profile-m-z/syncthing.profile
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
# Firejail profile for syncthing
# Description: File synchronization using public networks
# This file is overwritten after every install/update

##quiet
kmk3 marked this conversation as resolved.
Show resolved Hide resolved
# Persistent local customizations
include syncthing.local
# Persistent global definitions
include globals.local

noblacklist ${HOME}/.local/state/syncthing
# NOTE: this assumes a ~/Sync directory to be shared by default. Maybe leave a requirement to edit local file to set dirs?
noblacklist ${HOME}/Sync

# NOTE: will cause WARNING: Failed to lower process
# priority: set I/O priority: operation not permitted
# So, we try to preemptively set it here:
nice 2

# no allow-*.inc

##blacklist PATH
# Disable Wayland
blacklist ${RUNUSER}/wayland-*
# Disable RUNUSER (cli only; supersedes Disable Wayland)
blacklist ${RUNUSER}
# Remove the next blacklist if your system has no /usr/libexec dir,
# otherwise try to add it.
blacklist /usr/libexec

# disable-*.inc includes
include disable-common.inc
include disable-devel.inc
include disable-exec.inc
include disable-interpreters.inc
include disable-proc.inc
include disable-programs.inc
include disable-shell.inc
#include disable-write-mnt.inc # we set disable-mnt
#include disable-x11.inc # this causes an error...
include disable-xdg.inc


mkdir ${HOME}/.local/state/syncthing
whitelist ${HOME}/.local/state/syncthing
Comment on lines +44 to +45
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this program intended to be executed at the user or system level?

Does the syncthing executable act as the client, server or both?

Copy link
Contributor Author

@gcb gcb Nov 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Answer is both for both questions.

Ideally it is a user service. Most commonly it is system service. But upstream likes everyone to just run the program in a terminal and then minimize it.

Then it is a peer in a network which will connect to all sorts of things (announce servers, relay servers, other peers), while also exposing servers for LAN auto-discovery and to receive other peer's connections. And on top of all that the local web server with the HTML interface.


# see note above about this dir!
mkdir ${HOME}/Sync
whitelist ${HOME}/Sync

include whitelist-common.inc


# Landlock commands
##landlock.fs.read PATH
##landlock.fs.write PATH
##landlock.fs.makeipc PATH
##landlock.fs.makedev PATH
##landlock.fs.execute PATH
#include landlock-common.inc

##allusers
#apparmor
caps.drop all
# CLI only
##ipc-namespace
# breaks audio and sometimes dbus related functions
#machine-id
netfilter
no3d
nodvd
nogroups
noinput
nonewprivs
noprinters
noroot
nosound
#notpm # this line causes error
notv
nou2f
novideo
protocol unix,inet,inet6
seccomp
##seccomp !chroot
##seccomp.drop SYSCALLS (see syscalls.txt)
#seccomp.block-secondary
##seccomp-error-action log (only for debugging seccomp issues)
#tracelog
#x11 none # desirable but too complex to add

disable-mnt
#private-bin PROGRAMS
private-cache
private-dev
#private-etc
# Networking: ca-certificates,crypto-policies,host.conf,hostname,hosts,nsswitch.conf,pki,protocols,resolv.conf,rpc,services,ssl
##private-lib LIBS
#private-tmp
##writable-etc
##writable-run-user
##writable-var
##writable-var-log

dbus-user none
dbus-system none

# Note: read-only entries should usually go in disable-common.inc (especially
# entries for configuration files that allow arbitrary command execution).
##deterministic-shutdown
##env VAR=VALUE
# NOTE: there's no env to avoid starting the browser, but it will err out just "fine".
##join-or-start NAME
#memory-deny-write-execute
##read-write ${HOME}
restrict-namespaces

1 change: 1 addition & 0 deletions src/firecfg/firecfg.config
Original file line number Diff line number Diff line change
Expand Up @@ -851,6 +851,7 @@ surf
sushi
swell-foop
sylpheed
syncthing
kmk3 marked this conversation as resolved.
Show resolved Hide resolved
synfigstudio
sysprof
sysprof-cli
Expand Down