Hi UBi,
Regarding *the cleanup mechanism*, please be advised that it *needs to be
updated* (I realized this last night before falling asleep, I'll be fixing
it now): as it is now, it will delete any backups that STARTSWITH the
string of the current file (i.e. if you're working on "empty.html" and
there's a previous "emptyXXX.html" backup, the "emptyXXX" will be deleted!!
bad design, sorry for that !).
Regarding my choices, the important difference is that I wanted to host my
tiddly on a remote machine. This way I can access it from any computer I am
on (I have at least 4 machines that I would be wanting to open my notes
from, including my phone). So ssl makes things a bit safer, and automatic
startup makes it much more hassle free.
Regarding the backups, I was considering the following: maybe we can setup
a git-based backup function? Instead of just saving a new backup file, we
can overwrite the file in a backup folder and then call a simple git add
git commit on that folder? (It's pretty simple in python). This way the
size won't balloon and it should be safe to revert to any previous state.
What do you think?
You are right about the backup folder as it is now, not exactly sure why I
didn't want to serve it.
One more thing I'll be looking into is implementing some sort of
rudimentary authentication on the server. If I understand right, anyone who
stumbles upon my server's tiddly can change it now.
Regarding Windows and python ans stuff, maybe we can package the
tiddlyserver in a pypi package so that people can just install python and
then "pip install tiddlyserver"?
That should be simple enough, Does windows python come with pip? I assume
it would
Cheers, I'll be back later with today's updates
On Tuesday, December 31, 2019 at 9:55:22 AM UTC, UBi wrote:
>
> 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/a19df6e1-8073-4125-a0f1-05f2d72b3c4a%40googlegroups.com.