Hi Panos,

I'm glad that people play around with my script, and adopt it to their 
needs. I was thinking about a cleanup mechanism, too. Now I can take yours. 
I like open source :-)

Regarding your implementation, I have two questions:
1) Why do you want the user not to see the backup directory? With it being 
visible, an user could simply open an archived TiddlyWiki for reference 
without leaving the browser.
2) What is the benefit of using SSL on localhost?

Regarding automatic startup: I made the script executable (chmod a+x 
twserver.py), and added it to the Startup Applications in the Mate Control 
Center (I'm using Debian with Mate Desktop). Your systemctl solution has 
the advantage of being Desktop Environment agnostic, but might be slightly 
more complicated to implement (root access).

UBi

Am Montag, 30. Dezember 2019 20:55:51 UTC+1 schrieb Panos Firbas:
>
> 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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/814b3ad3-d81a-4baa-8eaa-942af15c04b2%40googlegroups.com.

Reply via email to