# Copyright (c) 2001 Josha Foust (tivoweb@lightn.org) Tivo Web - TCL v1.9.3 This is a new branch of the Tivo Web Project - TCL. It is written entirely in TCL, runs directly on the TiVo and provide a lot of the functionality of the external version. It also (only) works on 2.0+ software, has the ability to browse the entire channel guide and schedule and delete recordings! Setup is very simple, you don't need anything beyond a TCP/IP connection to your TiVo (you DON'T need TiVoNet, PPP over serial is fine). INSTALLATION Gunzip, untar and transfer the files to the tivo. The neccesary ones are *tcl, *.css, *.js, *.cfg and modules/*. If you use winzip, turn off 'Smart CR/LF Conversion'. Make sure the module files are in a module subdirectory (as it comes in the tar file). Also make sure the program is executable with 'chmod u+x httpd-tt.tcl'. Then run "./httpd-tt.tcl &". There will be a few messages, and it will need to load some data. After it prints "Accepting Connections" it is ready to go. Just point your browser at the tivo. The tivoweb stuff is under "User Interface." Other areas of the web server have also been significantly enhanced. OPERATION For regular operation put "/var/hack/tivoweb-tcl/httpd-tt.tcl >> /dev/null &" (with the correct directory) in the startup script (/etc/rc.d/rc.sysinit). By default, the images are pulled straight out of mfs. If you don't like the look of them or want to crop the borders (which I suggest), save the images from your browser and modify them in a graphics program. Then put them in an 'images' directory where you run httpd-tt.tcl from. It will first check there for images, if it doesn't find them, it will go to mfs (you don't even need to restart the program for this to take effect). If you are waiting a while on the browser to display a web page from tivoweb-tcl, chances are you are waiting on a 'Lock Conflict' or 'Background Holdoff'. If you have the console open where you launched httpd-tt.tcl from, you will be able to see the messages about this. There isn't anything you can do but wait for the tivo. If you get an 'Internal Server Error' on a web page with 'error writing "file1": I/O error', this is caused by the program trying to write to the controlling terminal that started it being disconnected. If you plan to run tivoweb-tcl without keeping the telnet session open, direct the output to /dev/null (>> /dev/null) so you don't get those errors. But if you get other errors you might want to see the console output for debugging purposes. Accessing the web pages shouldn't affect video playback or recording. During startup of httpd-tt.tcl there are sometimes pauses in playback, but shouldn't affect the recording. While effort has been made to make the themes look good in a variety of browsers, the advanced usage of CSS2 really requires Mozilla (Netscape 6). The technophobe theme will look good in IE 5, but daynight won't. With the technophobe theme, some links are hard to distinguish from normal text or headers. Specifically the big program name at the top of showing screens and the 'upcoming listings' in the channel screen are both useful links. Another somewhat hidden feature exists that allows sending of multiple keys in a row via webremote. By going to http://tivo/sendkey/key1/key2/key3/... webremote will send those keys in order. You can enter any valid sendkey keys plus 'wait' which will pause 3/4 of a second before going to the next key. This is primarily useful for bookmarking backdoor sequences or interfacing with other programs. SECURITY It is a very bad idea to make a tivo IP accessable on the internet. Telnet has no authentication and a DOS attack can easily crash a tivo. Even IP-based access control can be bypassed by simple packet forging. TivoWeb-TCL now provides basic authentication services by setting a username and password in tivoweb.cfg. If you use this option you should make sure to only allow port 80 through to the tivo from known IPs at the router/firewall level. That is probably sufficient protection for tivoweb. However a much better option is to use apache (or IIS) as an authenticating proxy to your tivo. Below are instructions on how to set that up. And an SSL authenticating proxy is even better but can be difficult to setup depending on the OS/distribution used. PROXY CONFIGURATION Here is a sample configuration to make your apache server an authenticating proxy to the tivo. You will need some understanding of configuring an apache web server to be able to use this. This will let you access tivoweb from a browser by going to http://www.domain.tld:8080/. Use 'htpasswd /etc/apache/passwd ' to add/edit user's logins. ServerName www.domain.tld ... NameVirtualHost * Listen 80 Listen 8080 ServerName www.domain.tld DocumentRoot /var/www ServerAdmin webmaster@domain.tld ProxyPass / http://tivo/ ProxyPassReverse / http://tivo/ AllowOverride None AuthType Basic AuthName tivo AuthUserFile /etc/apache/passwd require valid-user BUGS Scheduling recordings and manipulating season passes is rather complicated and isn't particularly well tested. There have not been any problems reported with scheduling, but there might be situations where problems arise. The way scripting is done, most errors will cause the page to stop loading. As most pages have tables, it may not display any of the data. Some of the pages are designed to print the error messages in the web page, the rest go to the console. Of course there shouldn't be any errors, so send me a bug report about what you were doing at the time and what error message printed. I will probably need to have a look at all the objects that the script was referencing at the time, so sending a dumpobj of those along with the page source of the web page will help a lot. With 2.5.1 there is sometimes a problem with loading the ui module that will crash/reboot your tivo on tivoweb startup. The cause of the problem has not been determined, but a work around is to rename ui.itcl to 0ui.itcl which will cause it to load first and somehow not trigger the crash. Please search http://www.tivocommunity.com/ in the underground section for questions about how to use or fix a problem you are experiencing with tivoweb-tcl. It is the most trafficed site that discusses tivo hacking, including everything you need to get tivoweb-tcl running. CREDITS Stephen Rothwell (sfr@canb.auug.au) Original httpd.tcl Jon Squire (jsquire@justice.loyola.edu) SendKeys Tivo Remote Mod Namespace separation Info screen Josha Foust (tivoweb@lightn.org) Primary author TiVo User Interface Recording/SeasonPass scheduling and deletion Index, image, javascript, form, last-modified, and post data support Integration of multiple patches Mike Baker (mbm@linux.com) CSS Stylesheets and theme functionality Graphical sendkeys remote HTML, HTTP, image, and post data enhancements Testing and debugging Mike Byrne (Turbo) Resource Editor module John Paglierani (John@Paglierani.net) Program title/description editing routine Jeff Keegan (jkeegan@keegan.org) Mail module Dan Stagner (sorphin) Resource definition updates for 2.5 Benjamin Tompkins (Juppers) Integration of onlive.tcl and added memory info into info module Luan Dang (luan_dang@yahoo.com) Key Trap patch Mike Langley (mlangley@transedge.com) Original multi-sendkey modification to webremote Philip Edelbrock Original patch for basic authentication