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
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 .

17
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

18
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

19
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.

20
@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

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

22
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"

23
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.

24
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:?

25
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

26
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.

27
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?

28
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.

29
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?

30
HFS ~ HTTP File Server / Firing an event on macro completion
« on: October 22, 2019, 08:40:51 PM »
I would like to fire an event to do something (for e.g run exec) when a template script in my DiffTemplates finishes successfully.

For e.g: when exec |myprog.exe| runs and produces a file.ext, then fire an event that will then call another exec to do something with the file.
ie the appearance of the file constitutes an event, upon which some other process works on that file.

I looked at this https://rejetto.com/wiki/index.php?title=HFS:_Event_scripts#Other_events and searched in the forum, but it isnt clear to me how I can fire up my own event and watch for it.

I would really appreciate any help.

Thanks.


Pages: 1 2 3