Detect IP ?

199 views
Skip to first unread message

Mat

unread,
Jul 31, 2019, 12:43:51 PM7/31/19
to TiddlyWikiDev
I want to have one appearance of my TW for me and another for visitors without the user of user names.

I'm thinking I should be able to use my IP address for this and simply make some conditional viewtemplates that use this.

Is there a way to see my IP address in TW? The infomechanism seems to lack this - or does it not belong there?

Thanks

<:-)

TonyM

unread,
Jul 31, 2019, 7:46:21 PM7/31/19
to TiddlyWikiDev
Mat,

There are possibly simpler ways to do this. 

The first is to use a link containing a tiddler https://tiddlywiki.com/#Home which takes you directly to the page for you to set the view, everyone else just get default tiddlers

Have you looked in $:/info/url/full

A url like this appears in $:/info/url/full

and $:/info/url/search

By the way in 5.1.20 the local storage plugin can simple store your settings in the browser session that no one else will see. You could capture your config settings and export them to a json file and import that to customise your view.

Actually there are so many possibilities I could spend hours on this email.

Just ask if you want more details and ideas.,

Tony

Mat

unread,
Aug 1, 2019, 5:55:01 AM8/1/19
to TiddlyWikiDev
Thanks for your reply.

Yes, there are in deed many other alternatives (here's one I made previously) but this time I want it to work automatically because it is for an information page that I will not visit very often so I do not want to have to remember "special things", like a special url or a solution that compromises the page that meets the visitor (such as some subtle or hidden toggle button somewhere or other tricks).

I think "IP" would be suitable and I'm OK with having to do a little hacking in the rare event that I physically move or change ISP.

If you have any suggestion that fulfills this "automatic" requirement I'd love to hear it.

<:-)

PMario

unread,
Aug 1, 2019, 8:36:20 AM8/1/19
to TiddlyWikiDev
Hi Mat, 

>Is there a way to see my IP address in TW?

Short answer: .... wrong approach!

-----------

You have at least 2 different IPs, that a browser sees.

Your local network hub gives your PC an IP which probably starts with 10.0.x.y or 192.168.x.y ... This one is completely useless to identify a user, since everyone else which has a LAN probably has a similar "local" IP.

The other one is the IP your InternetRouter gets from your ISP. .. This IP is __not__ static, since the ISP can change it at will. __and__ they will actually do that, to prevent you from creating public servers, without paying them for a "static IP" == "domain name"

-m

Mat

unread,
Aug 1, 2019, 8:54:41 AM8/1/19
to TiddlyWikiDev
Thanks PMario. I didn't realize the ISP changes the IP (unless the service is one that sets a temp IP for each session)... but it sounds odd because don't some settings require that you provide a (static) IP?


everyone else which has a LAN probably has a similar "local" IP.

"similar" or identical? 

And do you have any suggestion for how the wiki can automatically decide if it is "me" looking or someone else?

Thanks

<:-)

TonyM

unread,
Aug 1, 2019, 10:33:56 AM8/1/19
to TiddlyWikiDev

Mat

What kind of host are you on and what is the nature of your access and that of visitors?

Can you get https?

I ask because I know a lot of possible avenues and there are many ways to answer your question.

Do you use a password vault like last pass?

Why not just develop your own standard like url/admin is your access path? Or add ?admin to the end?

You can alter what is opened or accessible by a particular ip address on most hosts. React with a user prompt and more.

My isp gives me a reliable static ip address and there are easy ways to obtain your current ip address on line. Including dynamic dns options.

Since I use tw receiver on line, unless someone has the pass phrase they can't save and its possible to test if the pass phrase is present and its saved in your browser.

I may be in Australia but I can host something for you if you want. I have used overseas hosts myself but my own gives me a lot of choice and control.

Regards
Tony

Jeremy Ruston

unread,
Aug 1, 2019, 11:45:52 AM8/1/19
to TiddlyWikiDev
Hi Mat

Sadly, JavaScript in a web page can’t see what IP address it is running on (or more accurately, that is being used to communicate with the server).

Best wishes

Jeremy.


Thanks

<:-)

--
You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywikide...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywikidev/9d05782a-335d-4192-8676-010a148f1a51%40googlegroups.com.

Mat

unread,
Aug 1, 2019, 11:57:08 AM8/1/19
to TiddlyWikiDev
Tony, thanks for your kind reply. Let me - a tad embarrassed - start by explaining what the wiki is about:

I divorced a few years back (...2d time) and I'll use this wiki as a site to describe myself so that I can refer to it in contact ads or however dating works these days. So basically I'll just publish it and leave it. 

So this kind of excludes any ambitious hosting options including your extremely kind offer to host it. (Thank you!)

The plan is to simply put it on tiddlyspot. A downside with that is the http warnings. I didn't give the github saver a fair tryout yet but if it is as simple as I hope it is I guess I'll eventually migrate stuff to github.

What kind of host are you on and what is the nature of your access and that of visitors?


I'm not sure what you mean with "kind of host". The whole house subscribes to the ISP service and I'm in one of the apartments. Visitors can use anything but it is safe to say they are not in the same house as I am.


<:-) 

Mat

unread,
Aug 1, 2019, 11:59:18 AM8/1/19
to TiddlyWikiDev
Jeremy - ah, thanks, then I know!

I figured the various "what's my IP"-sites were using some js for this but I guess it's something else then.

<:-)

Jeremy Ruston

unread,
Aug 1, 2019, 12:01:27 PM8/1/19
to tiddly...@googlegroups.com
Hi Mat

I figured the various "what's my IP"-sites were using some js for this but I guess it's something else then.

Those sites generally work by pinging a web server with an xmlhttprequest that returns the IP address.

Best wishes

Jeremy


<:-)

--
You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywikide...@googlegroups.com.

TonyM

unread,
Aug 1, 2019, 6:24:07 PM8/1/19
to TiddlyWikiDev
Mat,

The answer to my host question is tiddlyspot, and you are thinking of GitHub. I have control panel wholesale account running on apache and Unix variant. ventraIP.com.au

I can actually host nodejs on the internet but just placing a tiddlywiki file on the internet on a website. With the option to use php and tw-receiver.

For your case it is irrelevant where its hosted, the question is how people find it, that's domain names and search engine optimisation.

Regards
Tony

Mat

unread,
Aug 2, 2019, 7:24:05 AM8/2/19
to TiddlyWikiDev
TonyM wrote:
For your case it is irrelevant where its hosted, the question is how people find it, that's domain names and search engine optimisation.

And it is actually not supposed to be found. I will only refer to it personally, with a direct link. 

...

Nobody has any ideas for how to make tw automatically differentiate between me and someone else then?

<:-)

PMario

unread,
Aug 2, 2019, 7:39:15 AM8/2/19
to TiddlyWikiDev
On Friday, August 2, 2019 at 1:24:05 PM UTC+2, Mat wrote:
....
Nobody has any ideas for how to make tw automatically differentiate between me and someone else then?

Sure. Use your user-name: $:/status/UserName  that can be adjusted in the ControlPanel.

-m

Mat

unread,
Aug 2, 2019, 9:32:14 AM8/2/19
to TiddlyWikiDev
PMario wrote:
Sure. Use your user-name: $:/status/UserName  that can be adjusted in the ControlPanel. 

Thanx but there are two problems with this.

1) the username is stored so that the visitor will also get this username... meaning that I must remember to fiddle and remove it when saving. Actually, the fact that the use name is stored doesn't seem right. I'll post an issue on this.

2) Having to manually change the username would be a big problem because this wiki should hide everything that is not supposed to be seen by the visitor. Not even the chevron to toggle the sidebar should be seen. So if I wanted to access e.g the Ctrlpanel, then I'd have to go to a bookmark/specific url - which is what I'm hoping to avoid. 

It would be neat if there was "some way" to really automatically differentiate "who is looking". 

IP detection doesn't work. Maybe unit (i.e machine) detection? Or maybe browser instance detection? @Tony mentioned the coming local storage plugin, maybe this is it? Maybe a cookie? (No idea how to "implement" this tho)

<:-)

TonyM

unread,
Aug 2, 2019, 6:09:12 PM8/2/19
to TiddlyWikiDev
Mat

I don't use tiddlyspot that much. Can you use start actions there?

If you just want to "hide" (not secure) a "backstage" from users and gain access to the backstage yourself I am thinking of a solution. Let me know if this sounds right.

The local storage plugin will do this I have tested it. It does it well.

It would help if you stated your requirements (not possible solutions) a little more clearly.

Are you the only editor?

Tony

TonyM

unread,
Aug 2, 2019, 6:26:08 PM8/2/19
to TiddlyWikiDev
Yes you are the only editor. I think I may have the requirements 

Mat

unread,
Aug 2, 2019, 6:46:47 PM8/2/19
to TiddlyWikiDev
Tony, thanx.

The requirement - or at least my wish is that I dont have to think about it. I just use tiddlyspot like normal but when the visitor looks at it, it automagically has some special settings and styles applied. And, yes, I'm the only editor.

The local storage plugin will do this I have tested it. It does it well.


I'm interested to hear how you did this.

Hiding a "backstage" is what I have right now, which means I must use a special url to access the "trigger" to switch over. Sounds great now but in a year I will swear I have never ever heard of that special url. One idea I'm considering is to use my Publish plugin which is a saver that saves to two tiddlyspots simultaneously and where one saver has a filter. Then I'd have to remember that my editing is done in one place and the public site is in another. Of course any solution, bar facial recognition, will require that I remember something. Also local storage is of course not reliable for long (I chew up a lap top every 18-24 months)... but then we're not talking about a super important project here so if I do need to hack a little once a year, then so be it.

Yes, startup actions work on Tiddlyspot. They're part of TW so why would they not?

Thank you!

<:-)

TonyM

unread,
Aug 2, 2019, 10:07:33 PM8/2/19
to TiddlyWikiDev
Mat

I can give you a design for a full solution. However ask yourself how people get the link to your site. Since you are the one to share the link in the First place would they notice you shared the link wikiname.tiddlyspot.com#home ? And you just navigate to wikiname.tiddlyspot.com

My use of local storage need only contain the tiddler containing your username and start up shows your backstage only when it has the value = of your user name. If you use another browser or loose your local storage you just have to supply your user I'd.

In fact using the password widget is possibly all you need to store your user I'd in the browser.

Does tiddlyspot not already demand a user name?

Just exclude user name from the tiddlers saved.

Rest assured we can build you a good solution to this.

Regards
Tony

Mat

unread,
Aug 3, 2019, 11:02:42 AM8/3/19
to TiddlyWikiDev
TonyM wrote:

would they notice you shared the link wikiname.tiddlyspot.com#home ? And you just navigate to wikiname.tiddlyspot.com


That's clever. Of course, I'd still have to remember that url (and have no idea how often I'll be handing it out.)
 

My use of local storage need only contain the tiddler containing your username and start up shows your backstage only when it has the value = of your user name. If you use another browser or loose your local storage you just have to supply your user I'd.

In fact using the password widget is possibly all you need to store your user I'd in the browser.


That's even more clever. I will always need the password to save to tiddlyspot anyway so if the password can be tested directly from local storage that'd be optimal, i.e

[{somehowaccessingpassword}match[mysecretpw]]

(Obviously having mysecretpw hard coded like that is totally idiotic if there was sensitive content in the wiki - but there isn't. The issue is merely aesthetic.)


Does tiddlyspot not already demand a user name?


Not really user name. To *save* to a Tiddlyspot you use the password and THISPART.tiddlyspot.com i.e the subdomain name.
 

Just exclude user name from the tiddlers saved.


Yes, this is what I'm doing currently.

<:-)

TonyM

unread,
Aug 4, 2019, 5:30:45 AM8/4/19
to TiddlyWikiDev
Mat

You say

I'd still have to remember that url

But you do not. You can put it anywhere on the wiki.

I was not suggesting you save the password in clear text but put a user id in a cookie/password then have the wiki react to that.

Regards
Tony

Mat

unread,
Aug 4, 2019, 12:27:38 PM8/4/19
to TiddlyWikiDev
TonyM wrote:
Mat

You say

I'd still have to remember that url

But you do not. You can put it anywhere on the wiki.


Not sure what you mean. I would have to keep track of both the base url and the one with the special suffix, no?
 

I was not suggesting you save the password in clear text but put a user id in a cookie/password then have the wiki react to that.


I have no idea how to access or manipulate cookies in TW.

<:-)

TonyM

unread,
Aug 4, 2019, 7:10:33 PM8/4/19
to TiddlyWikiDev
Mat,

If the default link is wikiname.tiddlyspot.com and it is your view, you can just document wikiname.tiddlyspot.com/#published on your home page. But give everyone the link to wikiname.tiddlyspot.com/#published.

Because you own the root domain name to your wiki you choose what appears there. You could even provide a link that reloads the page if clicked on for those who arrive at the root domain in error. All you have to do to recover the published link is to return to the root domain and you put it in front of your face. 

I personally use lastpass, password vault, and all my devices can access the url id and password for all my sites and third parties. So the question you ask never arises. Sooner or later you have to record something so you can find it again. The Question is where do you do this?, I do it on a solution available to me on every device.

I am working on some hacks that may eventually provide more features for this circumstance but not sure how easily they can be implemented on top of tiddlyspot.
  • These hacks are around saving the current wiki to another "curated" wiki to publish content without the backstage included. This can be done by changing some config tiddlers or the Innerwiki plugin. You can save a wiki from inside the innerwiki and you could even provide the innerwiki with different tiddlyspot credentials.
Re Cookies or equivalent

Try in a tiddler
<$password name="obscure-value">

Then use the developer storage inspector in the browser and you will find a local storage entry for tw5-password-obscure-value containing what you enter.

I do not yet know how to access this value from wikitext but someone should be able to tell us!
  • We can then build a way to respond to the value there in

Regards
Tony

Mat

unread,
Aug 11, 2019, 9:15:35 AM8/11/19
to TiddlyWikiDev
It struck me that one should be able to use the $:/UploadName as a qualifier instead of the password. The $:/UploadName is stored in the browser.

However it seems this still does not work:

tag: $:/tags/StartupAction
text:
<$list filter="[[$:/UploadName]text[xxxxx]]">


Why? Is the UploadName "applied" from the browser only after the StartupAction?

If that is the case, how could it be "applied" before?

<:-)

TonyM

unread,
Aug 11, 2019, 11:44:09 PM8/11/19
to TiddlyWikiDev
Mat,

Previously I discovered that the startup actions built in to tiddlywiki are not as flexable as Jeds. Perhaps you should try that first before giving up on this approach


Regards
Tony 

Mat

unread,
Aug 12, 2019, 12:51:47 AM8/12/19
to TiddlyWikiDev
Thanks Tony, that might be the solution. 
Should also be noted that Jeremy posted this proposal for a keyboard shortcut, which would be neat.

<:-)


Reply all
Reply to author
Forward
0 new messages