rejetto forum

Software => HFS ~ HTTP File Server => Topic started by: Killy on March 06, 2018, 05:54:10 PM

Title: I just lost my precious template
Post by: Killy on March 06, 2018, 05:54:10 PM
... and I'm really upset now.

That happened with the upgrade to 2.3k or drapid github version. (Can't exclude ssd issues too, who knows...)
hfs.tpl file got truncated somehow. I only left with JS code, that was making the most of head tag. At least something - it's the most complex part and the rest could be recreated relatively simple, although still will take some time I wasn't meant to spend on it.

Backup, always (http://rejetto.com/forum/index.php?topic=5166.0) topic is the sad one.
I will not come to the support forum unless I already got an issue.
If this piece of software is meant to fail, then make it fail safe. Make automatic backups before dangerous operations. Don't promote default template editing, instead, provide the way to store and select from multiple templates.

UPD: looks like RD version has serious unicode-related issues. It also produces broken default tpl file. Although the unicode is what made me to try it in the first place.
Title: Re: I just lost my precious template
Post by: Mars on March 06, 2018, 11:53:46 PM
to avoid a loss of a custom template, you must proceed as it

- save your template under a different name than hfs.tpl, for example "my template.tpl"

run hfs.exe and drag-drop "my template.tpl" on the root of file
you must be asked to install the template and have to answer yes

if by bad luck, an update or any other reason causes the return of hfs.tpl as a model, then just repeat the drag-drop
Title: Re: I just lost my precious template
Post by: bmartino1 on March 06, 2018, 11:54:24 PM
First, this is why we ask you to do a backup. This thousands of ways a end user can backup files. That's not the software auto doing.

Second there is advance setting and auto backup available on the jfs menu.

(If you saved your vfs then you can recover your template.)

Never use the program update method! Always download new and load vfs. (The update doesn't erase peroanl tpl file) but if you edit the default template, witch is what it sounds like) then your editing the template wrong.

The update via program will leave you with a has.old, check there.
The update will replace the default template with the package maintainer version (this is because rejeto and program foxes are most often HTML template codes.

Witch is why it says in the default template to not edit this file...
Use the change template option.

Good luck with your recovery.
Title: Re: I just lost my precious template
Post by: Killy on March 07, 2018, 02:05:10 AM
Quote
run hfs.exe and drag-drop "my template.tpl" on the root of file

That's extremely obvious (not) :/
My complaint is that the right and safe way to use the program is the least obvious one.
That's opposite of pit of success (https://english.stackexchange.com/questions/77535/what-does-falling-into-the-pit-of-success-mean) - pit of failure. And I fell into it.

To my understanding, drag-and-drop tpl file is equal to "Change file" option in menu - just write a path to tpl into config.
If I'm in Easy mode, nothing is telling me I can ever choose the template path.
If I'm in Expert mode, using the menu is actually a more clear way. But still, the program is promoting to edit the default template.

Quote
First, this is why we ask you to do a backup.

Where? Today is probably the first day I visit this forum. I have never seen such warnings in the program itself.

Quote
That's not the software auto doing.

Too bad.
The best update sequence I've seen in other apps is when updater is making an archive of all the stuff and keeps few such archives from recent updates.
Here it would be helpful not to try to overwrite existing files at least, unless asked directly. Give a warning if files are corrupted and unusable, but give a chance for user review.
Respect user data.

Quote
auto backup available on the jfs menu.

I can only see it for vfs (in two different places. what's the difference?).

Quote
(If you saved your vfs then you can recover your template.)

Even if I drag tpl into tree and save vfs, I can't see how to do this. Vfs file size is not changing after save whatever tpl I drop into it. The only thing updated after changing template path and exit is the ini file.

Quote
Never use the program update method!

Once again, how I supposed to know this before shit happens? Why the program is asking me to urgently update (due to security risks) through what turns out to be breaking mechanism and neither making nor asking to make backups?

Quote
The update via program will leave you with a has.old, check there.

To this point, it have overwriten ~temp.vfs.bak file already. Typical issue with single backup. Numbered backups would've saved from that.

Quote
Witch is why it says in the default template to not edit this file...

Can't remember if that was in the old template back when I started to customize it.
In the new ("Macro") default template, it has VERY misleading note. Essentially it says where to go to customize special flags.
Title: Re: I just lost my precious template
Post by: bmartino1 on March 07, 2018, 04:02:14 AM
Some interesting and good point on some topics.

I'd first have you visit the wiki, if that doesn't have a good how to, then it on users/rejeto(creator) to help compile a more user intensive interface that may need a revamp.

http://www.rejetto.com/wiki/index.php/HFS_Frequently_Asked_Questions_(english)


Witch is found at the download page in support:
http://rejetto.com/hfs/?f=support

And I'd have you check out the main documentation at the wiki as well(kinda the how to and help doc for it:

http://rejetto.com/wiki/index.php?title=HFS_Documentation_(English)
Title: Re: I just lost my precious template
Post by: Killy on March 07, 2018, 02:38:04 PM
What I was supposed to find in those links?
Ok. I looked through the faq and all the pages linked from the wiki main page. The only conclusion is that the wiki is well outdated.

Quote
Open the "Menu" in HFS.
Select "Other options" and open "Edit HTML template".
Copy your HTML template and paste it over the HFS "HTML template".
- I think I remember this built-in editor in the old versions of hfs...

When hfs.tpl was the one and only template file, it must've been considered as user data and never overwritten by the app unless clearly requested.
When template selection was added, it should be as simple as this:

Quote
then it on users/rejeto(creator) to help compile a more user intensive interface that may need a revamp
I hope this topic will raise his awareness of UX issues.
I can discuss it more and might contribute if the code will be on github.
Title: Re: I just lost my precious template
Post by: bmartino1 on March 07, 2018, 05:07:01 PM
The new download link(when an update is made) usual sends the source to sourceforge.

Here is the got hub link:
https://github.com/rejetto/hfs
Title: Re: I just lost my precious template
Post by: Killy on March 07, 2018, 07:02:51 PM
I've seen that github repo already. Something that was supposed to become hfs 3.0. I hope that experiment is dead now - it was a move in the wrong direction, in my opinion. To the date, there must be better tools to make a file server and not sacrifice compactness and ease of use.

Sourceforge in 2018 is still a pile of garbage. I'm not interested to interact with projects hosted there.
Title: Re: I just lost my precious template
Post by: LeoNeeson on March 08, 2018, 03:10:05 AM
@Killy: I do understand you may be upset for your template loss, but please don't be too harsh with Rejetto. His is doing all the best to improve HFS and he is doing all this in his free time. I agree GitHub is better to contribute with code, but since this is an open source project, anyone could take the code and make a fork on GitHub (you are welcome to do that if you want). Don't take me wrong, you have given several good tips to enhance the program (and I guess Rejetto would give his opinion about this soon).

This gives me a few ideas for enhancements: when updating, if a hfs.tpl file is found along with the main executable (hfs.exe), then the program should rename that hfs.tpl to MyHfs.tpl, use that template and save that configuration in the settings. Another enhancement is that HFS should search for .tpl files (located along with the main executable) before creating a new hfs.tpl file (and if more than one .tpl file is found, open a dialog to select the template you want to choose). Another last enhancement should be adding numbered backups, like you have suggested.

Cheers,
Leo.-
Title: Re: I just lost my precious template
Post by: Mars on March 08, 2018, 01:23:36 PM
there is no ready-made file named hfs.tpl for any new installation, when you also want to restore the default template, the content is extracted from an internal resource named defaultTpl,

 a particularity in the design of hfs wants that if an external file default.tpl exists, then this file is taken as a template without creating hfs.tpl

if fileExists('default.tpl') then
  defaultTpl:=loadfile('default.tpl')
else
  defaultTpl:=getRes('defaultTpl');

if i can suggest a trick, it is to create its custom template and name it default.tpl, so it will never be overwritten by an update and it always ready for any reinitialization, no hfs.tpl is created until you edit it from the hfs menu (F6 key)

if a modification has to be made to the template, edit simply default.tpl with your favorite editor ;)

Rejetto's philosophy for designing HFS is that the simpler it is, the more efficient it is.

if a path does not lead directly to where you want to go, before you build a new road, you will see if there are not a few detours you can use.
Title: Re: I just lost my precious template
Post by: Killy on March 08, 2018, 02:50:19 PM
Quote
please don't be too harsh with Rejetto
I'm not trying to be harsh to anyone. Sometimes, feedback gets perceived as an aggression and I can't help with it.
I might be missing something due to language and cultural differences. As an IT person, I'm just trying to bring things for discussion once I see them broken.

Quote
anyone could take the code and make a fork on GitHub
We have one already. And I'm not on the level of dedication where I can spin my own fork and make sure it will live. Having too many forks, barely (if ever) supported, is not a healthy situation. I'll consider contribution into a fork only when the main project is dead.
And for my purposes it might even be better to start over with a different tech and set of features.

Speaking of hfs.tpl or default.tpl: there is no need for such file at all. The less files program touches on it's own - the less space for mistakes and data loss.
The program is already using internal template without it. And customized templates must be user-selected files.
Instead of [Edit..., Change file..., Restore default], there better be [New file..., Select file..., Edit..., Use internal template].
"Edit" is disabled for internal template. "New file" shows the dialog to save a new copy of default template and that's the only way the program will write template on a disk.
No need to touch anything on update. If the config gets damaged, the worst thing could happen is the program will go back to internal template.

Currently, the program is only saying "Customized template" in the bottom panel. Make it more useful by showing template filename there instead, or "internal template". Maybe even move the whole "HTML template" menu as the context menu of that line (currently it's just a shortcut for Edit), so that the current state and manipulation controls will be in a single place.
Title: Re: I just lost my precious template
Post by: Mars on March 08, 2018, 06:55:41 PM
Instead of [Edit..., Change file..., Restore default], there better be [New file..., Select file..., Edit..., Use internal template].

No interest in making such a change, it's been years that this system is in place and corresponds to the use that is made of it. Edit, restore and default are quite explicit.

Currently, the program is only saying "Customized template" in the bottom panel. Make it more useful by showing template filename there instead, or "internal template". Maybe even move the whole "HTML template" menu as the context menu of that line (currently it's just a shortcut for Edit), so that the current state and manipulation controls will be in a single place.


The display of "Customized template" simply means that the content of the model used is different from the default model, when there is nothing it is that necessarily the model used is similar to the internal resource or is a copy of the file "default.tpl" whatever its content.


you will find below the link to a hybrid program for editing old templates
http://rejetto.com/forum/index.php?topic=3559.msg1062664#msg1062664

if you want a preview of what was the edition of the template at a certain time, visit this version
https://sourceforge.net/projects/hfs/files/HFS/2.2f/

 ;D
Title: Re: I just lost my precious template
Post by: Killy on March 08, 2018, 07:52:55 PM
I'm done here for now. I will only wait for rejetto response.