Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Make brave available through Flatpak and Flathub #11999

Closed
Jacalz opened this issue Nov 16, 2017 · 22 comments
Closed

Make brave available through Flatpak and Flathub #11999

Jacalz opened this issue Nov 16, 2017 · 22 comments

Comments

@Jacalz
Copy link
Contributor

Jacalz commented Nov 16, 2017

Description

Brave should be avaliable through flatpak because it is an alternative to snap that feels better because it is not run by a big company as cononical. Here is a great page with the advantages between the two: https://www.maketecheasier.com/snap-packages-vs-flatpacks/

@da2x
Copy link
Contributor

da2x commented Dec 26, 2017

This seems to be very straightforward to support using electron-installer-flatpak.

E.g. mattdangerw@e436fd8

@agilob
Copy link

agilob commented Feb 28, 2018

This should be some kind of a priority, Brave doesnt have enough community support to manage dozens of linux distributions. I used a few electron flatpak apps and all of them behave really well and are easy to install/upgrade in KDE and Gnome in Arch and Ubuntu. This would make it easier for you to distribute Brave and install instructions shorter and less distro-specific. Flapak is already installed by default on most Linux distributions, while snap is not being so popular and is mostly ignored by people who manage packages.

This issue should include distribution using flathub.

@Jacalz
Copy link
Contributor Author

Jacalz commented Mar 11, 2018

Yeah I do definitely agree with you @agilob especially about having it available on Flathub 👍

@Jacalz Jacalz mentioned this issue May 7, 2018
@candrapersada
Copy link

When will Brave flatpak come out?
I am user of linux mint

@bsclifton
Copy link
Member

Hi folks,

We haven't done any work on this... but I'd encourage a community member to give it a shot 😄 We're currently only supporting:

  • RPM / DEBs via yum/dnf/apt
  • Ubuntu Snaps

@bsclifton bsclifton added the help wanted The PR/issue opener needs help to complete/report the task. label May 7, 2018
@Jacalz Jacalz changed the title Make brave avaliable through flatpak Make brave avaliable through Flatpak and Flathub May 18, 2018
@x80486
Copy link

x80486 commented Jun 4, 2018

Hi, I just gave it a shot for a few hours, but it doesn't quite work well. I have to run it as non-sandboxed, etc.

I'm sure there are other (better) ways of doing this, but I'm not very familiar on building/making Flatpaks. I'll try again some time in the next few weeks, but if a wise soul wants to pull the files/templates (it's a heads start anyway!) and see if they can make it work better, that would be great — it should be all tweaking the com.brave.Brave.yaml file.

@eljuno
Copy link
Contributor

eljuno commented Jun 17, 2018

@ripper2hl
Copy link

okay i try use snap, but in theory , flatpack is the standar

@ghost
Copy link

ghost commented Jul 13, 2018

Hi @x80486
any progress on that? thanks

@manueltorrez
Copy link

I tried to install it through snap but at least in Manjaro Linux looks terrible. I had to install it from AUR (I didn't want to do it because it isn't an official source)

@x80486
Copy link

x80486 commented Jul 15, 2018

Hi @Zig-03, I tried again this weekend, but I can't make it work. There are a couple of issues:

  • I can't make it work unless I run it non-sandboxed (defeats the purpose when running a Flatpak)
  • The application restarts itself after some time using it

I'll try to see if someone from the Flatpak/FlatHub IRC channels can help.

@bsclifton bsclifton changed the title Make brave avaliable through Flatpak and Flathub Make brave available through Flatpak and Flathub Jul 26, 2018
@Garbee
Copy link

Garbee commented Jul 27, 2018

I have this running now. I'm going to try it out for a few days and see how the stability is. The current flatpak build isn't nearly "perfect" but the program is runable which is the main point.

I am able to maintain it and get it into Flathub. However, I would need permission to distribute it as "Brave" and use the logo. Just like Snapcraft does. How do I go about getting permission to do that?

On the note of the sandbox, running with --no-sandbox in this context is fine since the browser is already encapsulated. As I recall anyways the file sandbox should be getting removed down the line anyways, they just haven't done it. Or maybe they're waiting on something upstream to happen first in Linux.

brave.json
{
  "app-id": "com.brave.Brave",
  "runtime": "org.freedesktop.Platform",
  "runtime-version": "1.6",
  "branch": "stable",
  "sdk": "org.freedesktop.Sdk",
  "base": "io.atom.electron.BaseApp",
  "base-version": "stable",
  "command": "run.sh",
  "separate-locales": false,
  "finish-args": [
    "--share=network",
    "--share=ipc",
    "--device=dri",
    "--socket=pulseaudio",
    "--socket=x11",
    "--device=all",
    "--filesystem=home",
    "--talk-name=org.freedesktop.Notifications"
  ],
  "build-options" : {
        "cflags": "-O2 -g",
        "cxxflags": "-O2 -g",
        "env": {
            "NPM_CONFIG_LOGLEVEL": "info"
        }
  },
  "modules": [
        {
          "name": "brave-laptop",
          "buildsystem": "simple",
          "sources": [
            {
              "type": "archive",
              "url": "https://github.com/brave/browser-laptop/releases/download/v0.23.39dev/Brave.tar.bz2",
              "sha256": "2555da58a91e1e2b70ced26e92f18cd1c802199ac9ccd3a6119dad8b13fced8c",
              "dest": "main"
            },
            {
              "type": "file",
              "path": "./scripts/brave.sh",
              "dest-filename": "run.sh"
            }
          ],
          "build-commands": [
            "mkdir -p /app/main /app/bin",
            "cp -ra main/brave-linux-x64/* /app/main/",
            "install run.sh /app/bin/"
          ]
        }
  ]
}
scripts/brave.sh
#!/bin/sh

# Run without the sandbox since we are already isolated by flatpaks runtime.
# Also the sandbox file doesn't work in flatpak easily since it requires root.
exec /app/main/brave --no-sandbox

exit 0

@ghost
Copy link

ghost commented Jul 28, 2018

I am able to maintain it and get it into Flathub. However, I would need permission to distribute it as "Brave" and use the logo. Just like Snapcraft does. How do I go about getting permission to do that?

Me personally, I'd use it if only officially supported by Brave, sorry. External contributors? Sure. But Brave should have the last saying about each line of code.

On the note of the sandbox, running with --no-sandbox in this context is fine since the browser is already encapsulated.

What if someone doesn't trust Brave's sandboxing, but trusts Flatpak's one? Or what if someone wanna have them both? For me personally, this isn't an option.

As I recall anyways the file sandbox should be getting removed down the line anyways, they just haven't done it. Or maybe they're waiting on something upstream to happen first in Linux.

If this happens, it'll be the moment when I will stop using Flatpak altogether.

@Garbee
Copy link

Garbee commented Jul 28, 2018

Me personally, I'd use it if only officially supported by Brave, sorry. External contributors? Sure. But Brave should have the last saying about each line of code.

I'm willing to handle this however Brave wants it to be. If they want the build setup and repo hosted on their end, then I'll help get it all figured out. If they don't mind it being something handled over with Flathub's existing infrastructure, then fine.

The flathub builds are all open to view how they are made. Also my flatpak simply takes the generic x64 Linux build and puts it within a node base. Then adds a desktop file and icon so it looks right. There is no modification of execution, (except having to disable the sandbox) it's all how Brave themselves builds the binary upstream.

What if someone doesn't trust Brave's sandboxing, but trusts Flatpak's one? Or what if someone wanna have them both? For me personally, this isn't an option.

Then the flatpak route isn't for you unless you want to do the legwork to make the sandbox work in a Flatpak. Flatpak's don't have root users, so using the chrome sandbox file isn't an option since it hard requires a root owner and group be assigned to the file.

If this happens, it'll be the moment when I will stop using Flatpak altogether.

What? The sandbox file support is to be removed from Chromium as I recall. It is something but it isn't as good as what the kernel has built in now that is widely supported. Flatpaks are designed specifically to isolate things with sandboxes so it isn't going anywhere there.

@Garbee
Copy link

Garbee commented Jul 28, 2018

Also, this kind of thing doesn't need to be a Brave official push from the start. We can roll out a flathub offering of the browser first. Try to battle-test the configuration and setup woes that users have. Perhaps even figure out a way to run with a sandbox for users that want to go through the work to set that up. Then once Brave has the capacity to handle maintaining flatpak builds internally themselves, they can step in and see what has already been problematic. Then they can either take over the flathub builds themselves or host their own repository and the flathub's would be deprecated in favor of the Brave repository.

It isn't an "all-or-nothing" scenario, these things can co-exist collaboratively adding as little stress as possible on the Brave team until they're ready.

@x80486
Copy link

x80486 commented Jul 30, 2018

Hey @Garbee, are you going to PR that work into flathub/flathub? Folks there are pretty sharp, so eventually they will polish whatever you have.

Thanks for the effort!

@Garbee
Copy link

Garbee commented Jul 31, 2018

@x80486 Only once I have confirmation from the Brave team that I'm allowed to use the logo and name for redistribution through Flathub. I'm not a lawyer, but the license doesn't allow re-using the trademarks. So I'm going to verify they're fine with it before submitting the PR.

I've already discussed it with the maintainers there. They're open to having it. I just want to verify the trademark usage is OK to the Brave team.

@bsclifton bsclifton removed the help wanted The PR/issue opener needs help to complete/report the task. label Sep 1, 2018
@bsclifton
Copy link
Member

@Garbee logo usage should be just fine

@LeandroStanger officially, we won't be working on a flatpak version. But as mentioned above, @Garbee has got something working

Coming soon, we'll want to switch gears to brave-core

@Garbee
Copy link

Garbee commented Sep 5, 2018

Yup. I found a few glaring UX bugs in testing the flatpak builds I had. Turned out they were from the custom setup and should be naturally resolved when that is removed and replaced with the Chromium UX. So, I kinda held off on building a flatpak off the brave-laptop Node interface and am waiting for the moment the Chromium UX drops (or gets to where I can get pre-build artifacts to test with) to go forward with a Flatpak on Flathub. That way we aren't randomly stuck needing to quickly refactor the build so people can get updates (and any migration woes that may exist are negated.)

I have a workable solution though since it just pulls in the pre-built binary and runs it. Now that I have a green light on logo being allowed it just comes down to waiting for the Chromium UX for me.

@bsclifton
Copy link
Member

Closing in favor of brave/brave-browser#1000

@Garbee if you wanted to share any info with folks in that new issue, it would be very much appreciated 😄 This new repo corresponds to our new Developer channel build that was released today:
https://brave.com/download-dev

@bsclifton bsclifton removed this from the Triage Backlog milestone Sep 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

12 participants