flathub / org.chromium.Chromium

https://flathub.org/apps/details/org.chromium.Chromium
43 stars 25 forks source link

flatpak extensions: Can't mkdir parents: Read-only file system #388

Closed hansingt closed 4 months ago

hansingt commented 4 months ago

Hello guy,

I've been trying to configure the chromium flatpak for SPNego. According to https://github.com/flathub/org.chromium.Chromium/issues/37 and the README, this should be done using the flatpak extension points.

Thus, I've tried to create an unmanaged extension for it:

I've created a $XDG_DATA_HOME/flatpak/extension/org.chromium.Chromium.Extension/x86_64/1/policies/managed/spnego.json file with the following contents (domains replaced):

{
    "AuthServerAllowlist": "example.com",
    "AuthNegotiateDelegateAllowlist": ".example.com"
}

But when trying to start the flatpak, I get the following error:

> flatpak run org.chromium.Chromium
bwrap: Can't mkdir parents for /app/chromium/policies/managed/spnego.json: Read-only file system

In this case, the browser does not start at all.

If I create an empty extension by renaming the policies folder, the browser starts, but I get the following errors printed to the command line:

mkdir: cannot create directory '/app/chromium/extensions/native-messaging-hosts': Read-only file system
mkdir: cannot create directory '/app/chromium/extensions/policies': Read-only file system
mkdir: cannot create directory '/app/chromium/extensions/policies': Read-only file system

Any Ideas, what the Problem is and how to solve this?

Thanks in advance!

hansingt commented 4 months ago

Okay, I solved it.

The problem was, that the extension folder name must be org.chromium.Chromium.Extension.<id>. Moved the contents to org.chromium.Chromium.Extension.spnego and now it works!

alex996 commented 3 weeks ago

For anyone still struggling, I found that the path should look like this:

/var/lib/flatpak/extension/org.chromium.Chromium.Extension.<id>/<arch>/1/policies/managed/<policy>.json

For example, my full path is /var/lib/flatpak/extension/org.chromium.Chromium.Extension.system-policies/x86_64/1/policies/managed/policy.json.

vulpes2 commented 3 weeks ago

If you want to place the extension in your home directory instead, this is a complete and working example.

mkdir -p ~/.local/share/flatpak/extension/org.chromium.Chromium.Extension.system-policies/x86_64/1/policies/managed
echo '{ "ExtensionManifestV2Availability": 2 }' > ~/.local/share/flatpak/extension/org.chromium.Chromium.Extension.system-policies/x86_64/1/policies/managed/policy.json