Roland Häder [Mon, 29 May 2023 19:05:16 +0000 (21:05 +0200)]
Continued:
- added .json to all JSON responses
- added response class JSONResponse (I hope it is not overstated this way?
- cleaned up imports a bit (only used once can be referenced directly)
Roland Häder [Mon, 29 May 2023 17:13:00 +0000 (19:13 +0200)]
Continued:
- introduced config key 'host', so you can let this run on an other IP address
- recommended is 127.0.0.1, of course and then setup a reverse-proxy (in
Apache's terminology)
- cleaned up imports
Roland Häder [Mon, 29 May 2023 16:31:34 +0000 (18:31 +0200)]
Continued:
- removed superflous 'get_peers_url' from database, it was only logged and
get_peers() cannot make use of it as it depends on detected software
Roland Häder [Mon, 29 May 2023 06:29:10 +0000 (08:29 +0200)]
Continued:
- is_instance_registered() caused tons of SQL queries, let's introduce some
cache here
- 1 hour for recheck is good for development (even shorter) but a bad idea in
the wild
Roland Häder [Sun, 28 May 2023 13:19:41 +0000 (15:19 +0200)]
Continued:
- 100 rows should work! (the fail-safe check "fetched versus expected" will
kick in here)
- also read origin and pass over 'origin' during fetching instances
Roland Häder [Sun, 28 May 2023 12:06:53 +0000 (14:06 +0200)]
Continued:
- encapsulted into function add_peers()
- need to add "Content-Type: application/json" for API requests, thanks to Kromonos
- introduced 'api_headers' for JSON API requests
Roland Häder [Sun, 28 May 2023 09:36:18 +0000 (11:36 +0200)]
Continued:
- also ngrok-free.app is a testing/development ground, no productive/live
instances will be found there
- please don't abuse their kind services for hosting a live instance!
- didn't log variable "instance", ops
Roland Häder [Sun, 28 May 2023 09:19:13 +0000 (11:19 +0200)]
Continued:
- don't name your variables after packages, Python seem to be not strict on
checking data types while referencing
- also scan misskey instances for new (no filter applied)
Roland Häder [Sun, 28 May 2023 07:58:12 +0000 (09:58 +0200)]
Continued:
- these aren't supposed to be real URLs, they COULD be reached actually
- these URLs are references, not crawlable URLs
- so some people overdoze the SSL here a little, as http:// is just enough
for referencing to a specification
Roland Häder [Fri, 26 May 2023 15:10:52 +0000 (17:10 +0200)]
Continued:
- one character more to remove which cuts of the separator, e.g. '/'
- also don't raise exceptions here, a returned unmodified software name is just fine
Roland Häder [Fri, 26 May 2023 04:41:53 +0000 (06:41 +0200)]
Continued:
- also strip out " by " and " see " (self-advertisement)
- same with " version"
- some version numbers had uncommon long patch levels, e.g. 8.0.0000
Roland Häder [Thu, 25 May 2023 23:24:01 +0000 (01:24 +0200)]
Continued:
- old Friendica installations (I found one with 2019.03) may have version
number in software's name info and in format YYYY.MM (and maybe later others)
Roland Häder [Thu, 25 May 2023 23:09:27 +0000 (01:09 +0200)]
Continued:
- an INFO message is okay, let the user know that the <meta name='generator'>
was found and taken as the software behind the instance/website
Roland Häder [Thu, 25 May 2023 20:07:18 +0000 (22:07 +0200)]
Continued:
- try to strip off version numbers from software name
- remove_version() will output a warning and return 'software' unmodified if it
fails to match version number against regex
Roland Häder [Wed, 24 May 2023 16:23:05 +0000 (18:23 +0200)]
Continued:
- "guessing" it didn't really work, let's take <meta name='generator'> as the
software type, some people even change that and have no /.well-known/ path
enabled. Then they cannot federate anymore, at least not by auto-discovery
Roland Häder [Wed, 24 May 2023 05:23:50 +0000 (07:23 +0200)]
Continued:
- if fetching nodeinfo was successful, then clear any status codes and error
messages for this instance
- also tidyup() found instance, some are invalid :-(
Roland Häder [Tue, 23 May 2023 07:10:42 +0000 (09:10 +0200)]
Continued:
- added get_peers_url column
- flush any pending data after get_peers() was invoked
- blacklisted already added instances should be removed (WIP)