Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux CLI-only setup #20

Closed
rcarmo opened this issue Jun 10, 2019 · 5 comments
Closed

Linux CLI-only setup #20

rcarmo opened this issue Jun 10, 2019 · 5 comments

Comments

@rcarmo
Copy link

rcarmo commented Jun 10, 2019

Hi there!

I'd like to leave an "anti-request" here, since I would like to be able to use the Linux client without a GUI (or X, or anything else) and right now authorisation is hard-coded with an #ifdef(__linux__) to pop up a browser.

Could there be an option (build or run time) not to use WebKitGTK at all?

@jstaf
Copy link
Owner

jstaf commented Jun 11, 2019

Hah, an anti-request is still a feature! It'll likely need to be a build-time option, otherwise the compiled binary will get linked against WebKitGTK and require it as a dependency. I'll see what I can do to add that in.

Just as a heads up - it may be some time before this is implemented- my current dev priority is getting onedriver to sync server-side changes to the local client. In the meantime, you can delete the contents of the#ifdef(__linux__) sections from graph/oauth2_gtk.c and it will produce a GUI-free binary.

@jstaf jstaf added this to To do in onedriver kanban Jun 11, 2019
@jstaf
Copy link
Owner

jstaf commented Sep 8, 2019

Hey @rcarmo, I've rewritten things so that you can exclude WebKitGTK from the build by disabling CGo. If you build onedriver with CGO_ENABLED=0 go build, onedriver will be built without the popup browser (all of the C dependencies like WebKitGTK and X11 won't be required at runtime either this way).

Closed by #27

@jstaf jstaf closed this as completed Sep 8, 2019
onedriver kanban automation moved this from To do to Done Sep 8, 2019
@pepa65
Copy link

pepa65 commented Nov 7, 2022

This would be great to document, as it greatly simplifies the CLI-only build:

cd cmd/onedriver
CGO_ENABLED=0 go build
sudo cp onedriver /usr/local/bin/onedriver_cli

I am not sure how to configure a drive instance though...

@jstaf
Copy link
Owner

jstaf commented Nov 7, 2022

It's no longer documented because you can just use --no-browser option to authenticate from the CLI with the normal build. See the readme on setting up new drives - you can just do onedriver /path/to/mount, or alternatively use systemd to mount things automatically for you (see the readme).

@pepa65
Copy link

pepa65 commented Nov 7, 2022

But it's nice not to have to install X and all kinds of packages that you don't need. I can't use the go binary that I built somewhere else, it will not work on a headless system if I use --no-browser... So I have to install libwebkit which pulls in all kinds of stuff I cannot use.

But I am glad to report that building without CGO still works! After issuing onedriver MNT authentication needs to happen at the URL displayed, and the URL that then appears in the URL bar of the browser needs to be pasted into the terminal, but then it all works!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

3 participants