rejetto forum
Software => HFS ~ HTTP File Server => Beta => Topic started by: rejetto on December 28, 2008, 04:58:51 PM
-
i'll work on other bugs soon ;)
this build also changes the way requests are multi-tasked. let's see if it's better.
download @ www.dovedove.it/hfs/hfs218.exe
what's new
+ new template macro: current downloads of file
- "manage user accounts" proper moving resizing dialog
- "speed limit for single address" didn't apply sometimes
- {.add header.} didn't work properly www.rejetto.com/forum/?topic=6481
-
{.if|{.?xml.}| {.$xmlpage.} | {.$stdpage.} /if.}
[xmlpage]
{.add header|Content-Type: application/xml.}
XML!
[stdpage]
{.add header|Content-Type: text/html.}
HTML!
http://localhost/?xml =
XML!
Content-Type: text/html
http://localhost/ =
HTML!
Content-Type: text/html
Bug or im doing something wrong? :)
EDIT:
Im doing it wrong...
it seems like HFS don't care where the macros are?
It execute them all... in the case it execute the: "{.add header|Content-Type: application/xml.}" even if i dont call for [xmlpage]
a solution to this is:
{.if|{.?xml.}| {:{.add header|Content-Type: application/xml.}{.$xmlpage.}:} | {.$stdpage.} /if.}
bug or not?
-
use {.mime|application/xml.}
this is the expected command for your purpose.
anyway, from next build, your code should work correctly.
-
I am having template problem
with uploads
I am using default template.
HFS says "Template error at 4,1" after upload, and some variables are shown as '%' items instead of the value
see screen shots below:
(http://img519.imageshack.us/img519/972/sshot4fc3.png)
(http://img178.imageshack.us/img178/6478/sshot3nl6.png)
(http://img136.imageshack.us/img136/1949/sshot1ws7.png)
(http://img99.imageshack.us/img99/8743/sshot2tr0.png)
-
JellyFrog, i fear my suggestion won't work because of a bug.
so you'll have to wait for next build. :(
-
JellyFrog, i fear my suggestion won't work because of a bug.
so you'll have to wait for next build. :(
Nopp, your suggestion didn't work, but my solution works fine :)
{.if|{.?xml.}| {:{.add header|Content-Type: application/xml.}{.$xmlpage.}:} | {.$stdpage.} /if.}
Ugly but works ;)
-
Insert Quote
JellyFrog, i fear my suggestion won't work because of a bug.
so you'll have to wait for next build.
NOT A BUG , BUT ERROR IN TEMPLATE
Delete simply what I put in blocked red
[upload-success]
<li><a href='%item-url%'>%item-name%</a>: <b>{.!OK.}</b> --- %item-size% ({.!Speed.} %speed% KB/s)
{.if| %user% |{: {.append| %folder-resource%\hfs.comments.txt |{.filename|%item-resource%.}=uploaded by %user%
/append.} :}/if.}
{.append|
[upload-failed]
.....
-
perfect! ;D
thank you
hope rejetto can notice this one and fix in his next version
-
In the Property... dialog of the root, setting an icon does not work.
a) If it's meant to be that way, you should also lock the 'Add new...' button which is still working, but without result.
b) If not, it's a bug and should be swatted. ;)
How can I get rid of the Home/ thing? I'd prefer it to be just /, but fear it is hard coded.
If you use the Debug menu to reset the settings temporarily to default, it puts you in Easy mode, effectively hiding the 'Restore options' setting. Maybe you could set the Restore setting into the top bar (like the one when the server is switched OFF) to avoid confusion.
-
{.add header|Content-type: application/xml.}
Adds both text/html and application/xml:
HTTP/1.1 200 OK
Content-Type: text/html
Content- Length: 322
Accept-Ranges: bytes
Server: HFS 2.3 beta
Cache-Control: no-cache, no-store, must-revalidate, max-age=-1
Content-type: application/xml
A solution for this should be that HFS shouldn't report any content-type so you need to set it yourself (an "expert-mode" setting of course, quite annoying else :))
-
{.add header|Content-type: application/xml.}
Adds both text/html and application/xml:
that's what i meant in my last post ;)
already fixed for next build
-
Sorrry...but.. no news about the memory bug? I remember you that after some test, the first version that work fine on my vps is the 187 (with RAWR template 0.1.1 without delete).
The bug can be easily reproducible, simply leave the program run for some days, then download a file (in my case from 300 to 4000 M) with a dl accelerator (i use downthemall in firefox) and/or more then one file.
The memory size of HFS, mesured with Task Manager, grow to full the memory (> 500M, then the system hangs....).
I hope this is usefull, for more info e/o test.... i'm here!
-
> b) If not, it's a bug and should be swatted. Wink
done
> How can I get rid of the Home/ thing? I'd prefer it to be just /, but fear it is hard coded.
it's in the template, not hard-coded. And i forgot to make it "localizable".
if you use the default template, from next build you'll be able to change it just by redefining [special:strings] in the diff tpl.
your mileage/template may vary. ;)
> If you use the Debug menu to reset the settings...
i like this idea. next build.
-
it's in the template, not hard-coded. And i forgot to make it "localizable".
if you use the default template, from next build you'll be able to change it just by redefining [special:strings] in the diff tpl.
your mileage/template may vary. ;)
Using RAWR template, found it in the language files. Thanks.
-
May be you have avoid my post ...
Sorry...but.. no news about the memory bug? I remember you that after some test, the first version that work fine on my vps is the 187 (with RAWR template 0.1.1 without delete).
The bug can be easily reproducible, simply leave the program run for some days, then download a file (in my case from 300 to 4000 M) with a dl accelerator (i use downthemall in firefox) and/or more then one file.
The memory size of HFS, mesured with Task Manager, grow to full the memory (> 500M, then the system hangs....).
I hope this is usefull, for more info e/o test.... i'm here!
In my opinion this is a serious bug; certainly a lot of people have this problem (see the thread about 216). No workaround about? The 187 work fine but a lot of features (e.g. group management) are missing...
-
Well, i have a server thats shares over 3Tb to 180 people. I've also experienced the memory bug and had the program always crashing over full memory usage, even being the server new and all. So finally i decided to backup to 214 and since then (2 months with only 2 or 3 reboots) no more problem. I also enforced some control over download accelerator but other than that 214 seems to work fine.
-
Following the rejetto instructions, after test over the 216 and 217 i have done a regression at step of 10 (217->207->197->187). I have also tested the 192. All except the 187 are crashed after few days, also with d/l limitation and no more then 2-3 user active. Also the 187 have an huge memory occupation (50-100M) but no over this limits. With 2.2 version the memory occupation in the same condition is never more then 2-3M. The question is: what i can do to investigate about this catastrophic bug? May be is connected with the template ? (RAWR 0.11)
-
BIG BUG utilib.pas
function removeArray(var src:TstringDynArray; toRemove:array of string):integer;
var
i, l, ofs: integer;
b: boolean;
begin
l:=length(src);
i:=0; //mars bug with i:=1
ofs:=0;
while i+ofs < l do //mars bug with i+ofs <= l
//limits of src are [0..l-1] but not [1..l]
begin
b:=stringExists(src[i+ofs], toRemove);
if b then inc(ofs);
if i+ofs > l then break;
if ofs > 0 then src:=src[i+ofs];
if not b then inc(i);
end;
setLength(src, l-ofs);
result:=ofs;
end; // removeArray
-
bug or not bug, it is necessary in main.pas to modif setitem() as
procedure setItem();
var
f: Tfile;
cmd: string;
act: TfileAction;
a:TStringDynArray; //add by mars
function get(prefix:string):TStringDynArray;
begin result:=onlyExistentAccounts(split(';', parEx(prefix+FILEACTION2STR[act]))) end;
begin
result:='';
f:=mainfrm.findFileByURL(p);
if assigned(f) and f.isTemp() then freeAndNIL(f); // makes no sense to work in it
if f = NIL then exit;
cmd:=par(1);
if cmd = 'hide' then
include(f.flags, FA_HIDDEN);
if cmd = 'hide tree' then
include(f.flags, FA_HIDDENTREE);
if cmd = 'no log' then
include(f.flags, FA_DONT_LOG);
if cmd = 'not as download' then
if f.isFile() then include(f.flags, FA_DONT_COUNT_AS_DL)
else f.dontCountAsDownloadMask:=or_(par(2), '*');
for act:=low(act) to high(act) do //mod by mars
begin
try
a:=get('');
if join(';',a) >'' then f.accounts[act]:=a;
except end;
try
a:=get('add ');
if join(';',a) >'' then adduniqueArray(f.accounts[act], a);
except end;
try
a:=get('remove ');
if join(';',a) >'' then removeArray(f.accounts[act], a);
except end;
try
uniqueStrings(f.accounts[act]);
except end;
end;
VFSmodified:=TRUE;
mainfrm.filesBox.repaint();
end; // setItem
a good syntax to the set item macro is
{.set item|folder
|action=accounts list;
|add action=accounts list;
|remove action=accounts list;
.}
Not to forget to add a semicolon at the end of list otherwise the last account is not treated in the action
-
BUG!!!!!! AHOY!!!!!!!!!!!!!!! seems the block spiders option is NOT working.. googlebots.com has been querying my port 443 all day and has been getting results!
this isnt supposed to happen! and yes I have the site passworded etc... using tog 3.0 with login page... is it possible to modify that option to auto-generate a robots.txt file?
[hmmm nope.. just noticed.. build 218 isnt always saving the options.. half the time it does.. half the time it doesnt. the template page keeps reverting back to the default.]
*****
hmmmmmmmmm???
how about an option to not only save options to a file but to load them as welll.. just live the vfs file.. that way if we ahve a system crash we dont ahve to reload all the settings manually... otherwise just save al teh options to the vfs as well.
-
Huh? Do you mean the settings? I never need to load the settings manually, they always autoload for me, everytime.
Are you using Vista (UAC)?
-
Huh? Do you mean the settings? I never need to load the settings manually, they always autoload for me, everytime.
Are you using Vista (UAC)?
"after" a system crash. the settings seem to reset themselves to default... I have always had that problem .. but its more noticeable with build 218. It seems as tho its saving the settings to registry instead of to a file even tho I told it to save to file.
what would be really useful is being able to store those settings to a "user chosen" location.... right now they get stored to a default location which is the HFS directory... its better to be able to save a backup copy in a specific location or to make it save settings as part of the VFS file rather than a separate INI file.
that way when I restore I only have to load "one" file. ... that file would remember the template etc...
-
chthonic
From your comments it seems as if you have frequent system crashes. If this is the case I think you may have other problems with your system.
A simple way to ensure your settings and critical files are backed up is to simply create a folder, in a location of your choice, and copy into it your current vfs, tpl, and hfs.ini. Update these files as needed. They are now available when needed.
As MarkV, I don't have to manually re-load settings either. Maybe you are using a buggy template that is causing you some problems or maybe your HFS isn't configured to save your settings at logoff and reload the settings and template your were using at logoff when you logon again.
As for the robots.txt file, I just created one (years ago) and added it to the root of my vfs. No problems whatsoever. Spiders can come knocking, and it's logged when they do, but they don't get in. There is also a stop spiders option in the HFS menu.
-
BIG BUG utilib.pas
ok, thank you mars!
-
bug or not bug, it is necessary in main.pas to modif setitem() as
a:=get('');
if join(';',a) >'' then f.accounts[act]:=a;
if you make such change, people won't be able to set NO permission.
what's the reason why you suggest it?
instead, for the add/remove, adding and removing an empty set is just a null action. no reason to prevent it.
{.set item|folder
|action=accounts list;
|add action=accounts list;
|remove action=accounts list;
.}
Not to forget to add a semicolon at the end of list otherwise the last account is not treated in the action
ah, this is a bug.
fixed in next build.
final semicolon no more needed.
-
BUG!!!!!! AHOY!!!!!!!!!!!!!!! seems the block spiders option is NOT working.. googlebots.com has been querying my port 443 all day and has been getting results!
so, as far as i got, this bug report is canceled, because your settings were lost, and so was the "stop spiders" option. right?
"after" a system crash. the settings seem to reset themselves to default...
with a crash, HFS should not save latest option changes, but keep the previous one.
So, if you started from a default position, made all the changes, and you got a crash, that's normal.
What you can do to avoid this situation is to manually save the options by the menu.
if instead you started HFS already configured, and then the crash reset your configuration, this is not normal.
It would be useful to know if the crash is only related to HFS or is system-wide.
I have always had that problem .. but its more noticeable with build 218.
consider most people don't have this problem, so we must try to find what makes your HFS working bad.
It seems as tho its saving the settings to registry instead of to a file even tho I told it to save to file.
HFS saves to registry by default, so if you lost your whole configuration and are back to the default, that's normal, just a consequence of the other problem.
what would be really useful is being able to store those settings to a "user chosen" location.... right now they get stored to a default location which is the HFS directory... its better to be able to save a backup copy in a specific location or to make it save settings as part of the VFS file rather than a separate INI file.
oh, event scripts are very nice feature :)
put this in your events file
[quit]
{.copy|hfs.ini|hfs.ini.bak.}
nice, but untested. let us know :)
-
The bug can be easily reproducible, simply leave the program run for some days, then download a file (in my case from 300 to 4000 M) with a dl accelerator (i use downthemall in firefox) and/or more then one file.
The memory size of HFS, mesured with Task Manager, grow to full the memory (> 500M, then the system hangs....).
can someone confirm this is enough to reproduce the bug?
or, can someone report the opposite, that you are in the same situation but don't get the bug?
-
Quote from: mars on 09 January 2009, 01:05:34
bug or not bug, it is necessary in main.pas to modif setitem() as
a:=get('');
if join(';',a) >'' then f.accounts[act]:=a;
if you make such change, people won't be able to set NO permission.
what's the reason why you suggest it?
instead, for the add/remove, adding and removing an empty set is just a null action. no reason to prevent it.
You are completely right, not need of modification as long as the alone action (no add or del) is not specified.
I had to make an error during the first tests by putting the action to be made in more without the accounts (|access =|Add access = 1;2;3;4;5|del acess =2;3;5) what falsified my judgment.
Since, I use the best formula which combines all the possible actions:
<form method=post action="/~accesschange">
<form name='usersform' method='post' action='/~passchanger'>
<select name="action">
<option value="">action?</option>
<option value="access">access</option>
<option value="upload">upload</option>
<option value="delete">delete</option>
</select>
<table>
<tr><td align=left><b><font size="4">Folder</font></b><td><b><font size="4">: </font></b><span style="background-color: #000000"><input name=folder style="font-size:10pt; font-weight:bold; border:1px solid #88f" size="20" ></span>
<tr><td align=left><b><font size="4">Authorization only for Accounts in list</font></b><td><b><font size="4">: </font></b><span style="background-color: #000000"><input name=replaceaccounts style="font-size:10pt; font-weight:bold; border:1px solid #88f" size="20" ></span>
<tr><td align=left><b><font size="4">Add Authorization for Accounts in list</font></b><td><b><font size="4">: </font></b><span style="background-color: #000000"><input name=addaccounts style="font-size:10pt; font-weight:bold; border:1px solid #88f" size="20" ></span>
<tr><td align=left><b><font size="4">Remove Authorization for Accounts in list</font></b><td><b><font size="4">: </font></b><span style="background-color: #000000"><input name=deleteaccounts style="font-size:10pt; font-weight:bold; border:1px solid #88f" size="20" ></span>
<tr><td><font size="4">Click <a href="/~adminpanel">here</a> to return to Admin Panel.</font><td align=center><input type=submit value="Change">
</tr></table>
</form>
A form to be sent to combination with a page of action to be realized
Action={.switch|{.postvar|action.}|,|access,add,delete|{.postvar|action.}|You selected NO ACTION.}<p>
{.set item|{.postvar|folder.}
|{.if|{.postvar|replaceaccounts.}|{.postvar|action.}={.postvar|replaceaccounts.};/if.}
|{.if|{.postvar|addaccounts.} |add {.postvar|action.}={.postvar|addaccounts.};/if.}
|{.if|{.postvar|deleteaccounts.} |remove {.postvar|action.}={.postvar|deleteaccounts.};/if.}
.}
It is even possible to use an external file to define specific rights for an account and a precise directory, to authorize or not the access to the modifications by the form.
The method is simple, it is enough to use a file of this type:
;List of the accounts having the rights of administration for directories
[access]
folder/subfolder1=rejetto;mars;silentpliz
folder2=@anonymous
[delete]
folder/subfolder2=rejetto;mars;
folder/upload=rejetto;silentpliz
[upload]
folder/upload=rejetto;silentpliz