browsh icon indicating copy to clipboard operation
browsh copied to clipboard

Building and using without sudo privileges?

Open paxperscientiam opened this issue 2 years ago • 5 comments

Hello,

On the remote servers that I have access to, I do not have sudo privileges. Is it possible to build and use browsh without it?

Thank you.

paxperscientiam avatar Jul 15 '21 17:07 paxperscientiam

In theory yes, but I think it could be hard. If you're building from scratch, then I think it's hard to install Golang without sudo. But I think you should be able to just download the prebuilt static binary at https://www.brow.sh/downloads ? You'll also need to manually install Firefox though, because I assume you don't have access to the package manager?

tombh avatar Jul 15 '21 19:07 tombh

In this case, I am using an Ubuntu server with "shared hosting" service. Actually, the apt* commands seem to work; I don't know if they can be used to install packages to an arbitrary prefix though.

Certainly, that's something I could look into if you don't already know.

I wanna write a script to do this, which I'll contribute to the repo if I succeed.

Running uname -m yields x86_64. Which binary version is appropriate?

Thanks

paxperscientiam avatar Jul 15 '21 20:07 paxperscientiam

Ok Ubuntu, so you can use dpkg then. I wonder if something like this will work:

First download the Browsh .deb at https://github.com/browsh-org/browsh/releases/download/v1.6.4/browsh_1.6.4_linux_amd64.deb

Then install it with something like dpkg -i browsh_1.6.4_linux_amd64.deb --force-not-root --root=$HOME

All you need to do then is install Firefox, I'm not sure of the best way to do that without root, but I'm sure its possible. I wonder if Firefox has X11 dependencies on a headless server?? 🤔

tombh avatar Jul 15 '21 21:07 tombh

Yes, X server appears to be installed. So, this is where I've gotten so far. Not sure your dpkg suggestion gave me permissions error, but it did. I wound up going with dpkg --vextract browsh_1.6.4_linux_amd64.deb ./

That said, I've hit a brick wall. Both ~/firefox/firefox and ~/firefox/firefox-bin --headless yield "Segmentation fault".

I'll poke around liberachat for clues.

#!/usr/bin/env bash

unset CDPATH

cd ~/build || exit

curl -L -O https://github.com/browsh-org/browsh/releases/download/v1.6.4/browsh_1.6.4_linux_amd64.deb

dpkg --vextract browsh_1.6.4_linux_amd64.deb ./

mv ./usr/local/bin/browsh ~/my-prefix/bin

mkdir -p ~/firefox

curl https://ftp.mozilla.org/pub/firefox/releases/90.0/linux-x86_64/en-US/firefox-90.0.tar.bz2 | tar xjf - -C ~/

paxperscientiam avatar Jul 17 '21 03:07 paxperscientiam

Sounds hopeful. I'd assume the Firefox segfault is a dependency issue, a mismatch with glibc or X11

tombh avatar Jul 17 '21 13:07 tombh