conicalflask / fs2

A sophisticated file sharing system for LAN parties with a focus on fast accurate searching, easy browsing and fast transfers.
BSD 3-Clause "New" or "Revised" License
6 stars 1 forks source link

Ability to run FS2 in console mode? #18

Closed BenSBB closed 12 years ago

BenSBB commented 12 years ago

This might already exist but is it possible to run FS2 from a console? I wish to run it from my fileserver but it runs linux and I don't have X or a window manager installed. I've tried in the past but didnt really get anywhere.

Thanks, Ben

conicalflask commented 12 years ago

In theory it works fine headless but it hasn't been tested thoroughly so there might be bugs.

Try running it on a headless system and it should crash with some error about how it needs a gui, and if you really meant it then re-run with "-Dheadless"

So it would be something like java -Dheadless -Xmx256m -jar fs2client-X.X.X.jar

You wont get help writing the config file though without a gui, but if you run it once successfully it will emit a template config.xml into your ~/.fs2client/

TBH, I run fs2 in a vnc session on my fileserver because I want it to download directly as well, but I'm a bit lame in that respect :)

You can see the config xml format for shares and settings from a desktop version of fs2, but I've not had the time or motivation to document it yet.

Let me know how it goes!

BenSBB commented 12 years ago

Thanks,

I've had a lot more success than previously,

Luckily I don't really need any functionality, literally just the ability to connect to the indexnode and share. I can do the downloading from my PC.

FS2 started ok and connected to an indexnode running from my PC. I then shut it down and edited the config file, I noticed there was a share created for the default download folder. I edited is as follows:

    <s82650203>
        <name>Video</name>
        <path>/mnt/user/Video</path>
    </s82650203>

After a few mins it was indexed and accessible, excellent :D

However I have a query as to how to add a new share, but i'm confused as to the formatting, what is the significance of s82650203?

Thanks Ben

conicalflask commented 12 years ago

The xml tag that contains the name and path is "s{java hash of share name}".

When you create a share you can use whatever you like for that tag name but FS2 will rename it back to "sBLAHBLAH"

They have these odd names because it makes it cheaper (in coding time and runtime) to lookup the correct config entry for a given share name (which isn't important on headless clients anyway as the shares can't change at runtime).

Also share names can be totally invalid XML tag names, so this also helps :)

TL; DR: it doesn't matter what you put there, FS2 will change it anyway.


Side note: You can refresh your shares instantly (rather than waiting half an hour or restarting the client) by doing a "kill -SIGUSR1 {fs2 java process id}"

BenSBB commented 12 years ago

Thanks, I just filled it out with random numbers and its working great :D