winfsp / hubfs

File system for GitHub & GitLab
https://winfsp.dev
GNU Affero General Public License v3.0
1.62k stars 60 forks source link

What is the CLI invocation for HUBFS instead of NET USE? #8

Open lonnietc opened 1 year ago

lonnietc commented 1 year ago

Hello @billziss-gh ,

As an initial test, I installed the "HUBFS 2022 Beta1" (hubfs-win-1.0.22067.msi) and was able to connect to my Github Repo as it shows.

For a second step, I have been able to compile HUBFS in my MSYS2/Mingw x64 to produce the hubfs.exe file.

Now I would like to start up the hubfs.exe in a command prompt with the proper steps to connect to my repo again instead of using the "net use H: ..." command this time to validate that the build was successful.

Can you please show me the CLI options needed to make this work?

Basically, I would like to know what the CLI options that are being used when done with "net use".

Thanks

billziss-gh commented 1 year ago

Running HUBFS from the command line will print the available options. The command line that net use is described here.

lonnietc commented 1 year ago

I looked at the command line settings from there and have been able to ascertain that the step one is to:

1.) First get the token from Github.com

test-hubfs> .\hubfs.exe -auth=force -authkey=https://github.com -authonly
First, copy your one-time code: 055D-A85C
Then press [Enter] to continue in the web browser...

When you press [Enter] then you put the token in for authorization.

NOTE: After this completes, I noticed that the drive is still not present at this stage.

I am working on step 2, now to see what I need to bring up the drive and hold it active from the CLI (i.e. hubfs.exe directly)

In General the command is:

2.) Start hubfs.exe and connect to the Github Repository.

test-hubfs> .\hubfs -auth optional -o VolumePrefix=%\/_1 -o uid=-1,rellinks,FileInfoTimeout=-1 %\/b/_1 %2

But I need to figure out the %1 and %2 variables.

I assume that one of them is the mount "H:' (in the example) and the other is the Github repo string, but not sure yet.

EXPECT: I would think that the 2nd Step above will start and mount the H: and connect to the Github Repository desired.

3.) Go to the File explorer or in another command window.

???

But making progress none the less. Thanks

lonnietc commented 1 year ago

I figured it out for Step 2.

test-hubfs> .\hubfs -auth optional -o uid=-1,rellinks,FileInfoTimeout=-1 github.com/[orginization]/[repo] H:

Where (from your example image):

[organization] --- billziss-gh
[repo] --- winfsp

Not really clear what the VolumePrefix option is used for:

VolumePrefix=%\/_1

QUESTION: Where to get a list of all of the "optional -o" possibilities?

In any case, things seemed to work so far.

lonnietc commented 1 year ago

Quick question:

Can you please explain how the union filesystem part works in HUBFS since I am greatly interested in how it unions different directories?

Can HUBFS union multiple repositories and/organizations into an unified directory space under the mounted filesystem?

Thanks in advance