aboutsummaryrefslogtreecommitdiffhomepage
path: root/fst/template.go
diff options
context:
space:
mode:
Diffstat (limited to 'fst/template.go')
-rw-r--r--fst/template.go130
1 files changed, 67 insertions, 63 deletions
diff --git a/fst/template.go b/fst/template.go
index 0777c9d2..0ca928a1 100644
--- a/fst/template.go
+++ b/fst/template.go
@@ -9,7 +9,8 @@ import (
// Template returns a fully populated instance of Config.
func Template() *Config {
return &Config{
- ID: "org.chromium.Chromium",
+ ID: "org.chromium.Chromium",
+
Path: "/run/current-system/sw/bin/chromium",
Args: []string{
"chromium",
@@ -18,70 +19,73 @@ func Template() *Config {
"--enable-features=UseOzonePlatform",
"--ozone-platform=wayland",
},
- Confinement: ConfinementConfig{
- AppID: 9,
- Groups: []string{"video"},
- Username: "chronos",
- Outer: "/var/lib/persist/home/org.chromium.Chromium",
- Inner: "/var/lib/fortify",
- Shell: "/run/current-system/sw/bin/zsh",
- Sandbox: &SandboxConfig{
- Hostname: "localhost",
- Devel: true,
- Userns: true,
- Net: true,
- Device: true,
- Seccomp: seccomp.FilterMultiarch,
- Tty: true,
- Multiarch: true,
- MapRealUID: true,
- DirectWayland: false,
- // example API credentials pulled from Google Chrome
- // DO NOT USE THESE IN A REAL BROWSER
- Env: map[string]string{
- "GOOGLE_API_KEY": "AIzaSyBHDrl33hwRp4rMQY0ziRbj8K9LPA6vUCY",
- "GOOGLE_DEFAULT_CLIENT_ID": "77185425430.apps.googleusercontent.com",
- "GOOGLE_DEFAULT_CLIENT_SECRET": "OTJgUOQcT7lO7GsGZq2G4IlT",
- },
- Filesystem: []*FilesystemConfig{
- {Src: "/nix/store"},
- {Src: "/run/current-system"},
- {Src: "/run/opengl-driver"},
- {Src: "/var/db/nix-channels"},
- {Src: "/var/lib/fortify/u0/org.chromium.Chromium",
- Dst: "/data/data/org.chromium.Chromium", Write: true, Must: true},
- {Src: "/dev/dri", Device: true},
- },
- Link: [][2]string{{"/run/user/65534", "/run/user/150"}},
- Etc: "/etc",
- AutoEtc: true,
- Cover: []string{"/var/run/nscd"},
- },
- ExtraPerms: []*ExtraPermConfig{
- {Path: "/var/lib/fortify/u0", Ensure: true, Execute: true},
- {Path: "/var/lib/fortify/u0/org.chromium.Chromium", Read: true, Write: true, Execute: true},
- },
- SystemBus: &dbus.Config{
- See: nil,
- Talk: []string{"org.bluez", "org.freedesktop.Avahi", "org.freedesktop.UPower"},
- Own: nil,
- Call: nil,
- Broadcast: nil,
- Log: false,
- Filter: true,
+
+ Enablements: system.EWayland | system.EDBus | system.EPulse,
+
+ SessionBus: &dbus.Config{
+ See: nil,
+ Talk: []string{"org.freedesktop.Notifications", "org.freedesktop.FileManager1", "org.freedesktop.ScreenSaver",
+ "org.freedesktop.secrets", "org.kde.kwalletd5", "org.kde.kwalletd6", "org.gnome.SessionManager"},
+ Own: []string{"org.chromium.Chromium.*", "org.mpris.MediaPlayer2.org.chromium.Chromium.*",
+ "org.mpris.MediaPlayer2.chromium.*"},
+ Call: map[string]string{"org.freedesktop.portal.*": "*"},
+ Broadcast: map[string]string{"org.freedesktop.portal.*": "@/org/freedesktop/portal/*"},
+ Log: false,
+ Filter: true,
+ },
+ SystemBus: &dbus.Config{
+ See: nil,
+ Talk: []string{"org.bluez", "org.freedesktop.Avahi", "org.freedesktop.UPower"},
+ Own: nil,
+ Call: nil,
+ Broadcast: nil,
+ Log: false,
+ Filter: true,
+ },
+ DirectWayland: false,
+
+ Username: "chronos",
+ Shell: "/run/current-system/sw/bin/zsh",
+ Data: "/var/lib/fortify/u0/org.chromium.Chromium",
+ Dir: "/data/data/org.chromium.Chromium",
+ ExtraPerms: []*ExtraPermConfig{
+ {Path: "/var/lib/fortify/u0", Ensure: true, Execute: true},
+ {Path: "/var/lib/fortify/u0/org.chromium.Chromium", Read: true, Write: true, Execute: true},
+ },
+
+ Identity: 9,
+ Groups: []string{"video", "dialout", "plugdev"},
+
+ Container: &ContainerConfig{
+ Hostname: "localhost",
+ Devel: true,
+ Userns: true,
+ Net: true,
+ Device: true,
+ Seccomp: seccomp.FilterMultiarch,
+ Tty: true,
+ Multiarch: true,
+ MapRealUID: true,
+ // example API credentials pulled from Google Chrome
+ // DO NOT USE THESE IN A REAL BROWSER
+ Env: map[string]string{
+ "GOOGLE_API_KEY": "AIzaSyBHDrl33hwRp4rMQY0ziRbj8K9LPA6vUCY",
+ "GOOGLE_DEFAULT_CLIENT_ID": "77185425430.apps.googleusercontent.com",
+ "GOOGLE_DEFAULT_CLIENT_SECRET": "OTJgUOQcT7lO7GsGZq2G4IlT",
},
- SessionBus: &dbus.Config{
- See: nil,
- Talk: []string{"org.freedesktop.Notifications", "org.freedesktop.FileManager1", "org.freedesktop.ScreenSaver",
- "org.freedesktop.secrets", "org.kde.kwalletd5", "org.kde.kwalletd6", "org.gnome.SessionManager"},
- Own: []string{"org.chromium.Chromium.*", "org.mpris.MediaPlayer2.org.chromium.Chromium.*",
- "org.mpris.MediaPlayer2.chromium.*"},
- Call: map[string]string{"org.freedesktop.portal.*": "*"},
- Broadcast: map[string]string{"org.freedesktop.portal.*": "@/org/freedesktop/portal/*"},
- Log: false,
- Filter: true,
+ Filesystem: []*FilesystemConfig{
+ {Src: "/nix/store"},
+ {Src: "/run/current-system"},
+ {Src: "/run/opengl-driver"},
+ {Src: "/var/db/nix-channels"},
+ {Src: "/var/lib/fortify/u0/org.chromium.Chromium",
+ Dst: "/data/data/org.chromium.Chromium", Write: true, Must: true},
+ {Src: "/dev/dri", Device: true},
},
- Enablements: system.EWayland | system.EDBus | system.EPulse,
+ Link: [][2]string{{"/run/user/65534", "/run/user/150"}},
+ Etc: "/etc",
+ AutoEtc: true,
+ Cover: []string{"/var/run/nscd"},
},
}
}