aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/syntax/files/firejail-profile.lang
diff options
context:
space:
mode:
authorLibravatar Kelvin M. Klann <kmk3.code@protonmail.com>2023-01-23 23:03:57 -0300
committerLibravatar Kelvin M. Klann <kmk3.code@protonmail.com>2023-01-27 23:20:40 -0300
commit88ba851893362dacdbde6ff9527675b07affff27 (patch)
treee5d10d7aedd06142588e25b51a1a07f97378be75 /contrib/syntax/files/firejail-profile.lang
parentbuild: move man page targets to after seccomp filters (diff)
downloadfirejail-88ba851893362dacdbde6ff9527675b07affff27.tar.gz
firejail-88ba851893362dacdbde6ff9527675b07affff27.tar.zst
firejail-88ba851893362dacdbde6ff9527675b07affff27.zip
build: move syntax files to contrib/syntax/files
Having all of syntax files in the same directory makes it easier to reference all of them at once on a makefile (such as with `contrib/syntax/files/*.in`). Also, this makes the path to the gtksourceview language-spec shorter. Current path/new path: * contrib/gtksourceview-5/language-specs/firejail-profile.lang * contrib/syntax/files/firejail-profile.lang Currently, adding a rule to the root Makefile to generate the language-spec in the same directory as an input file would take at least 95 characters (with only a single dependency): contrib/gtksourceview-5/language-specs/%.lang: contrib/gtksourceview-5/language-specs/%.lang.in With this commit, the above shortened to 59 characters: contrib/syntax/files/%.lang: contrib/syntax/files/%.lang.in Which should make it more readable. Relates to #2679 #5502.
Diffstat (limited to 'contrib/syntax/files/firejail-profile.lang')
-rw-r--r--contrib/syntax/files/firejail-profile.lang69
1 files changed, 69 insertions, 0 deletions
diff --git a/contrib/syntax/files/firejail-profile.lang b/contrib/syntax/files/firejail-profile.lang
new file mode 100644
index 000000000..61c37f98f
--- /dev/null
+++ b/contrib/syntax/files/firejail-profile.lang
@@ -0,0 +1,69 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<!-- vim: set ts=2 sts=2 sw=2 et: -->
3<!--
4 https://gitlab.gnome.org/GNOME/gtksourceview/-/blob/master/docs/lang-tutorial.md
5 https://gitlab.gnome.org/GNOME/gtksourceview/-/blob/master/docs/lang-reference.md
6-->
7<language id="firejail-profile" name="Firejail Profile" version="2.0" _section="Other">
8 <metadata>
9 <property name="mimetypes">text/plain;text/x-firejail-profile</property>
10 <property name="globs">*.profile;*.local;*.inc</property>
11 <property name="line-comment-start">#</property>
12 </metadata>
13
14 <styles>
15 <style id="comment" name="Comment" map-to="def:comment"/>
16 <style id="condition" name="Condition" map-to="def:preprocessor"/>
17 <style id="command" name="Command" map-to="def:keyword"/>
18 <style id="invalid" name="Invalid" map-to="def:error"/>
19 </styles>
20
21 <definitions>
22 <define-regex id="commands-with-arguments" extended="true">
23 (apparmor|bind|blacklist-nolog|blacklist|caps.drop|caps.keep|cpu|dbus-system.broadcast|dbus-system.call|dbus-system.own|dbus-system.see|dbus-system.talk|dbus-system|dbus-user.broadcast|dbus-user.call|dbus-user.own|dbus-user.see|dbus-user.talk|dbus-user|defaultgw|dns|env|hostname|hosts-file|ignore|include|ip6|ip|iprange|join-or-start|keep-fd|mac|mkdir|mkfile|mtu|name|net|netfilter6|netfilter|netmask|netns|nice|noblacklist|noexec|nowhitelist|overlay-named|private-bin|private-cwd|private-etc|private-home|private-lib|private-opt|private-srv|private|protocol|read-only|read-write|restrict-namespaces|rlimit-as|rlimit-cpu|rlimit-fsize|rlimit-nofile|rlimit-nproc|rlimit-sigpending|rlimit|rmenv|seccomp-error-action|seccomp.32.drop|seccomp.32.keep|seccomp.32|seccomp.drop|seccomp.keep|seccomp|shell|timeout|tmpfs|veth-name|whitelist-ro|whitelist|x11|xephyr-screen)
24 </define-regex>
25
26 <define-regex id="commands-without-arguments" extended="true">
27 (allow-debuggers|allusers|apparmor|caps|deterministic-exit-code|deterministic-shutdown|disable-mnt|ipc-namespace|keep-config-pulse|keep-dev-shm|keep-fd|keep-var-tmp|machine-id|memory-deny-write-execute|netfilter|no3d|noautopulse|nodbus|nodvd|nogroups|noinput|nonewprivs|noprinters|noroot|nosound|notv|nou2f|novideo|overlay-tmpfs|overlay|private-cache|private-cwd|private-dev|private-lib|private-tmp|private|quiet|restrict-namespaces|seccomp.32|seccomp.block-secondary|seccomp|tab|tracelog|writable-etc|writable-run-user|writable-var-log|writable-var|x11)
28 </define-regex>
29
30 <define-regex id="conditions" extended="true">
31 (ALLOW_TRAY|BROWSER_ALLOW_DRM|BROWSER_DISABLE_U2F|HAS_APPIMAGE|HAS_NET|HAS_NODBUS|HAS_NOSOUND|HAS_X11)
32 </define-regex>
33
34 <context id="conditional-line">
35 <match>\?(?P&lt;condition&gt;\%{conditions}): </match>
36 <include>
37 <context sub-pattern="condition" style-ref="condition"/>
38 </include>
39 </context>
40
41 <context id="command-with-args">
42 <match>(?P&lt;command&gt;\%{commands-with-arguments}) (?P&lt;args&gt;.+)</match>
43 <include>
44 <context sub-pattern="command" style-ref="command"/>
45 </include>
46 </context>
47
48 <context id="command-without-args">
49 <match dupnames="true">(?P&lt;command&gt;\%{commands-without-arguments})</match>
50 <include>
51 <context sub-pattern="command" style-ref="command"/>
52 </include>
53 </context>
54
55 <context id="invalid" style-ref="invalid">
56 <match>.+</match>
57 </context>
58
59 <context id="firejail-profile" class="no-spell-check">
60 <include>
61 <context ref="def:shell-like-comment"/>
62 <context ref="conditional-line"/>
63 <context ref="command-with-args"/>
64 <context ref="command-without-args"/>
65 <context ref="invalid"/>
66 </include>
67 </context>
68 </definitions>
69</language>