|
Introduction
Caveat: If you are not already familiar with Lua language and/or if you don't run your own HTTP server on your own machine, it's highly unlikely you'll find FFTempl useful in any way. About FFTemplFFTempl allows you to have (almost) absolute freedom in mixing dynamic and static content using various templates and scripts, without need for any database. You only need Lua 5.1 installed (available as package in Ubuntu and Debian) and a sensible webserver that allows for CGI execution and URL rewriting. The core FFTempl system is (like Lua itself) extremely simple but allows you to expand its possibilities almost limitlessly. FFTempl was tested using Apache 2 on Linux, I have no idea if and how it works under different servers / OSes (it probably won't without some tweaking because it uses the command os.getenv('QUERY_STRING') to get the URL parameters from Apache). I made FFTempl to satisfy my needs which are probably different from what you need. If you find it useful, great. If you don't, please use one of many other dynamic content systems that are freely available. It's probably meaningless to ask me to "implement this or that" in FFTempl because you can implement almost everything yourself, using hooks, without changing the core system. But I am open to suggestions. What FFTempl allows you to doYour whole HTML site is stored as static files in any directory structure you deem necessary (as if you used normal static webpages). Required scripts and template files for FFTempl are all stored in a single directory called YourWebsiteRoot/fftempl/. The most important principle of FFTempl operation is as follows: FFTempl is only concerned with files that have ".htm" extension and leaves all other files alone. That means you can have .php or .html (yes, ".html" is something different than ".htm") or .gif or .swf files on your website and FFTempl does not care about them at all - how they are handled depends on your webserver configuration only and has nothing to do with FFTempl. FFTempl springs into action every time a file with ".htm" extension is requested. If someone requests file called /dir1/dir2/page.htm from your webserver, this request is redirected to FFTempl, which loads this file from disk (this is not a HTML file but "FFTempl source file", explained later), parses it and returns the result to the webbrowser which asked for it. "Parsing the file" means that template, tags and/or scripts are applied to the file. You can do almost anything, including incorporating the results of arbitrary OS commands into your pages. Thanks to templates and tags, it's very easy to make different parts of your website available in different designs and layouts, each of which only has to be defined once to immediately propagate the changes to whole site. To a casual visitor, your website looks like it consists only of static HTM pages (unless you want it to look like dynamically generated website). Once more: The directory structure is entirely up to you (except for the required /fftempl directory). The only rule is that if something has to be dynamic or use templates, it has to have the ".htm" extension. Other files are not altered by FFTempl in any way. Note that all your normal webserver configuration is still in effect for all files. What FFTempl does not allow you to doIf you are excited after reading the previous paragraphs, please curb your enthusiasm. You must understand what FFTempl is not: FFTempl does not provide any means for "live" editing of your online pages. How you create your files and how you transfer them to your webserver is entirely up to you (personally, I have the whole website structure on my home PC, edit it using texteditor and then transfer the changes online using rsync). FFTempl does not incorporate WYSIWYG in any shape or form. You have to understand HTML/CSS if your want to create your own webdesigns and you have to understand Lua if you want to create your own scripts. All the content is defined using text files. You don't have to understand Apache or change its configuration after you successfully installed FFTempl. FFTempl does not "hold you by the hand". With great power comes great responsibility. There is nothing in FFTempl that prevents you from creating megabytes of useless output or scripts that consume 100% of your CPU or erase your important files. You have been warned. Which leads us to the next point: SecurityFFTempl is not very "secure", although this needs longer explanation: I think FFTempl is very secure in the sense that person who visits your website cannot use FFTempl to gain unauthorized access to your system or to see files outside of your public HTML directory. On the other hand, it's not very difficult, under the default FFTempl configuration, for knowledgeable person to see your FFTempl source, template and tag files, your FFTempl scripts etc... FFTempl may be made more "obscured" by choosing hard-to-guess filenames for these files but this is not something I needed or wanted. Finally, it's really bad idea to use FFTempl on webservers whose "public HTML" directories are accessible by multiple people who don't entirely trust each other. FFTempl files basically empower anyone capable of uploads to his public HTML directory to do anything he could do if he had full shell access with "www-data" rights! Including, but not limited to, changing contents of other people's public HTML directories. Again, this security aspect could be improved, but this is not a scenario I care about and it would limit the possibilities of FFTempl. Note that you (as the server admin) can install FFTempl for your own web directories and you can have other ("untrustworthy") people to have their web directories on the same machine - and they cannot harm your data unless you allow them to also use FFTempl. If you are still interested, continue to Installation and Usage pages. |