rejetto forum

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - newbie

Pages: 1 2 3
16
HFS ~ HTTP File Server / Re: Get Connections
« on: November 11, 2019, 05:55:33 PM »
Sorry. I am back. I cannot depend on netstat -a anymore.
The machine is going to be host to numerous other servers, and I want to be able to filter out the non-HFS connections.
I'm thinking of collecting the IPs when the clients make the first initialization call to HFS, and removing the IP when the client disconnects.
Unless you'all know of something better.

17
Thanks bmartino1.

But the idea is to avoid any manual step like that...the idea is to start HFS as a service, and whatever's in the tpl (including real folder, permissions etc.) should just take effect, and start on many servers.

However, I did DO something similar, TBH. I started HFS, then manually set the permissions via the Properties page, then saved to a .vfs.
Now, I use this vfs across the various machines to start HFS on them automatically.
Downside is that the path (and thats the full path) is baked into the vfs, so I have to take care that the same drive, folder exists across all the machines.
The above process is working right now, but prevents me from truly running it completely automatically .

18
Anybody else have any thought as to how I can set permissions ....
cause the following in my tpl isnt working...

{.set item|myData|add access=robert.}
{.set item|myData|add upload=robert.}
{.set item|myData|add delete=robert.}

This has turned into a blocker for me.

Thanks

19
I wish to run this on a "clean" machine, ie there is no hfs.ini file at the beginning beside hfs.exe. Right?
Also, there will not be any registry entry  (Computer\HKEY_CURRENT_USER\Software\rejetto\HFS) or a .vfs file.
This whole exercise is to deploy it on multiple machines in as automatic a way as possible.

I am running the hfs.exe in elevated (admin) mode in the cmd prompt like so:
hfs.exe -c reload-on-startup=no\nload-tpl-from=myHFS.tpl F:\Blah\myData

20
Thanks bmartino1.

Since I posted my question, I was able to make my setup a bit more streamline, but the problem remains. Here's what I did:
1. Made a copy of hfs.tpl and called it myHFS.tpl
2. Modified myHFS.tpl to:
 i. add the few scripts I wanted.
 ii. add the user-permissions
[special:import]
{.new account|robert|password=bob|can change password|enabled=1|is group=1|notes=accounts members of this group will be allowed to change their password.}
{.set item|myData|add access=robert.}
{.set item|myData|add upload=robert.}
{.set item|myData|add delete=robert.}

3. In a cmd prompt, ran:
hfs.exe -c reload-on-startup=no\nload-tpl-from=myHFS.tpl F:\Blah\myData

The permissions still remain unset.

So, in answer to your post, I have done what you did essentially...unless it matters that the tpl file is called dif.hfs.tpl.

21
@Rejetto

Any thoughts on why the permissions arent setting when I add the following to the .tpl:
{.set item|myData|add access=robert.}
{.set item|myData|add upload=robert.}
{.set item|myData|add delete=robert.}

Thanks

22
HFS ~ HTTP File Server / Re: Get Connections
« on: October 23, 2019, 08:59:27 PM »
Ok. Thanks. That should work.

23
HFS ~ HTTP File Server / Re: Move cmd via curl
« on: October 23, 2019, 06:30:33 PM »
nm. Got it.
I had the destination wrong.

This works...

curl -u user:passwd "http://hfserver:280/myData/folder1/folder2/?mode=section&id=ajax.move" --data "dst=/myData/folder1/folder3&files=file1.png:file2.png:file3.png"

24
So, I have the followingL
1. myDiffTpl.tpl
[special:import]
{.new account|robert|password=bob|can change password|enabled=1|is group=1|notes=accounts members of this group will be allowed to change their password.}
{.set item|myData|add access=robert.}
{.set item|myData|add upload=robert.}
{.set item|myData|add delete=robert.}

2. myIni.ini
load-tpl-from=myDiffTpl.tpl

and, I call:
hfs.exe -a myIni.ini F:\Blah\myData

HFS opens up with myData published. When I look at myData properties, I see that there is an account called robert with an encrypted password.
However, it appears that the permissions supplied above for access, upload, delete are not checked.
Hence, these operations dont work, until I manually click the permissions on.

Any idea what I am doing wrong.

25
HFS ~ HTTP File Server / Move cmd via curl
« on: October 23, 2019, 03:56:12 PM »
I am trying to move some files via a curl cmd.

I am trying the following:
curl -u user:passwd "http://hfserver:280/myData/folder1/folder2/?mode=section&id=ajax.move" --data "dst=folder1/folder3&files=file1.png:file2.png:file3.png:" 
I am guessing the files values are wrong, but I dont know how they should be separated. Is : the right delimiter there?


I see the following code in HFS source:
function selectedFilesAsStr() {
    var a = [];
    selectedItems().each(function(){
        a.push(getItemName(this));
    });
    return a.join(":");
}
So, its an array and there's an ending :
So, thats why I tried
files=file1.png:file2.png:?

26
HFS ~ HTTP File Server / Get Connections
« on: October 23, 2019, 02:18:01 PM »
I notice that the UI displays a table for Connections with 6 entries for one client.
Is there a way for me to get that list of IP addresses via a script?

There doesnt appear to be a GetConnections here:
https://www.rejetto.com/wiki/index.php/HFS:_scripting_commands#Connections_control

27
HFS ~ HTTP File Server / Re: Firing an event on macro completion
« on: October 23, 2019, 02:09:51 PM »
Those are excellent pointers Rejetto. Thanks for your comments. I didnt know about the MySection technique, but I knew about exec and output.
Either of those will work. I am good here.

28
Thanks for your response Rejetto. Your response came in while I was responding to Mars.  :)

So, that looks doable.

Let me get your process straight (incl. the syntax).
1. Create a tpl file myDiffTpl.tpl
2. In the [special:import] section add:
{.add folder|real|myData.}
{.set item|diff template|WHAT GOES HERE? The entire DiffTemplate script in 1 line OR a file?}
{.set item|myData|add access=robert.}
{.set item|myData|add upload=robert.}
{.set item|myData|add delete=robert.}
{.set ini| INI VALUES separated by \n}
3. Supply the above tpl via cmdline:
hfs.exe -c load-tpl-from=myDiffTpl.tpl

Sound correct to you?

29
HFS ~ HTTP File Server / Re: Firing an event on macro completion
« on: October 23, 2019, 01:16:10 PM »
Thanks for your response.

Ah. ok. I think I understand.
Actually, if myprog.exe is writing out the file, it can call the 2nd process to work on that file. :)
Sometimes, one tends to overthink things.

30
Mars. Thanks for your response.

Could you please clarify a bit more...I read and re-read your response, and I see a hint of a solution (something to do with %EXEPATH% in the VFS), but cant seem to get the solution itself.
Something to do with %EXEPATH%. Is %EXEPATH% an environment variable to be set. How is this environment variable, saved into the vfs?

If I understand your comment correctly, there is a possible solution that will allow:
<EXEPATH>\myData to be mounted to HFS with all the info: user-password, specific permissions & DiffTemplates.

however, I take a feasibility reserve as long as a potential security breach by using /../ goes back beyond hfs.exe folder
What did you mean by this. Where would ../../ be used?

Pages: 1 2 3