Hi all, I fiddled with the script a bit today for my personal use, and since this is a hot thread, I'm back to share my little improvements with you. I'm very new to tiddly so please advise if I should share these things somewhere else. In the tiddlyserver script, I added a function to cleanup the backedup files. It keeps the last X files (Default=5) and is triggered right after a backup is made. I also added https functionality.
Please note that I also made a slight change in the folder structure, I keep things at /home/user/tiddlyserver/. In there, we have the twBackups folder, the tiddlyserver.py script, and a /served folder which contains the .html files to be served. The motivation was to not serve the script itself, or the backups. You can find the updated script here (use at your own risk, of course): https://gitlab.com/snippets/1926079 I also made a .service script to make this server a systemctl service for linux systems that use it. You'll find instructions in the script itself, I don't know much about these but it seems to be working like a charm on my vps https://gitlab.com/snippets/1926082 Hope you find it useful, -- Panos On Monday, December 30, 2019 at 5:10:22 PM UTC, Mark S. wrote: > > Added under saving. > > On Monday, December 30, 2019 at 5:01:28 AM UTC-8, Mohammad wrote: >> >> To David Gifford, >> >> Please add Python Server to Tiddlywiki toolmap! It is a single html file >> saver >> >> --Mohammad >> >> On Sunday, December 29, 2019 at 11:14:37 AM UTC+3:30, Mohammad wrote: >>> >>> Added to TW-Scripts. >>> >>> >>> https://kookma.github.io/TW-Scripts/#Easy%20local%20saving%20with%20Python >>> >>> >>> On Sunday, December 29, 2019 at 1:30:42 AM UTC+3:30, UBi wrote: >>>> >>>> I will describe my use case on Linux, Windows should work in a similar >>>> fashion. >>>> >>>> My TiddlyWiki files live in /home/ubi/TW, abbreviated ~/TW. There I >>>> placed the script as twserver.py. >>>> For a first test, I started it manually in a terminal window: >>>> >>>> /usr/bin/python3 ~/TW/twserver.py >>>>> >>>> >>>> Then I pointed my browser to http://localhost:8080/. Status messages >>>> started appearing in the terminal window. >>>> >>>> In the browser window a list of files and directories below ~/TW >>>> appeared. >>>> >>>> I opened one of my TW files, notes.html, and created a new Tiddler. The >>>> I saved the changes. >>>> This >>>> 1) backed up ~/TW/notes.html html to >>>> ~/TW/twBackups/notes.html.YYYYMMDDhhmmss, creating ~/TW/twBackups on the >>>> fly. >>>> 2) saved the changes to ~/TW/notes.html. >>>> >>>> Now I have to find out how / where I can add a call to the script to my >>>> startup or login procedures. >>>> >>>> HTH UBi >>>> >>>> >>>> -- You received this message because you are subscribed to the Google Groups "TiddlyWiki" group. To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/53b42907-9485-4d08-9b70-56c959397a2d%40googlegroups.com.