]> git.mxchange.org Git - fba.git/log
fba.git
17 months agoContinued:
Roland Häder [Tue, 20 Jun 2023 05:27:48 +0000 (07:27 +0200)]
Continued:
- avoided local variables

17 months agoContinued:
Roland Häder [Tue, 20 Jun 2023 04:31:29 +0000 (06:31 +0200)]
Continued:
- new URL for TOP 10 lists

17 months agoContinued:
Roland Häder [Tue, 20 Jun 2023 03:06:52 +0000 (05:06 +0200)]
Continued:
- better acquire lock here

17 months agoContinued:
Roland Häder [Tue, 20 Jun 2023 02:49:56 +0000 (04:49 +0200)]
Continued:
- ignore non-updating UPDATE statements

17 months agoContinued:
Roland Häder [Tue, 20 Jun 2023 02:43:30 +0000 (04:43 +0200)]
Continued:
- new flooder everyoneattack.com added
- also ignored empty nodeinfo_url column
- WIP: commented out missing lemmy.fetch_blocks()
- also fixed some missing variables (removed from string)

17 months agoContinued:
Roland Häder [Tue, 20 Jun 2023 01:20:17 +0000 (03:20 +0200)]
Continued:
- added command fetch_observer() to fetch instances from fediverse.observer
- WIP: added blocks for lemmy

17 months agoContinued:
Roland Häder [Mon, 19 Jun 2023 19:41:46 +0000 (21:41 +0200)]
Continued:
- wrapped into single quotes

17 months agoContinued:
Roland Häder [Mon, 19 Jun 2023 12:22:21 +0000 (14:22 +0200)]
Continued:
- further exception added

17 months agoContinued:
Roland Häder [Sun, 18 Jun 2023 18:43:27 +0000 (20:43 +0200)]
Continued:
- bookwym and takahe are not supported, let's remove them
- don't cut off path when checking if instances is registered or not
- added commented out debug line

17 months agoContinued:
Roland Häder [Sun, 18 Jun 2023 16:54:39 +0000 (18:54 +0200)]
Continued:
- skip fake domains (.tld)
- don't invoke instances.add() with fake domains (.tld)

17 months agoContinued:
Roland Häder [Sun, 18 Jun 2023 16:39:45 +0000 (18:39 +0200)]
Continued:
- returned JSON can sometimes be no list

17 months agoContinued:
Roland Häder [Sun, 18 Jun 2023 12:10:40 +0000 (14:10 +0200)]
Continued:
- sorted network type (aka. "software") members

17 months agoContinued:
Roland Häder [Sun, 18 Jun 2023 09:55:42 +0000 (11:55 +0200)]
Continued:
- some link[href] results from nodeinfo may not have complete URLs
- strange, but true. they need to be prepended with https://{domain}

17 months agoContinue:
Roland Häder [Sun, 18 Jun 2023 01:35:46 +0000 (03:35 +0200)]
Continue:
- continue checking on software type after it was discovered by
  generator/site_name
- maybe it needs aliasing?
- also add 'slipfox calckey' as an alias for 'misskey'
- don't tidy-up None values

17 months agoContinued:
Roland Häder [Sun, 18 Jun 2023 01:01:08 +0000 (03:01 +0200)]
Continued:
- don't invoke update_data() which caused a non-existing instance being updated

17 months agoWIP:
Roland Häder [Sun, 18 Jun 2023 00:53:52 +0000 (02:53 +0200)]
WIP:
- removed geneic-try/except blocks around SQL statements, let them fail and not
  sys.exit() uncleanly
- raise an exception if no row has been updated, e.g. when record isn't found

17 months agoContinued:
Roland Häder [Sat, 17 Jun 2023 09:58:41 +0000 (11:58 +0200)]
Continued:
- ignore "accept" block level as that is whitelisting instances, not blocking them

17 months agoContinued:
Roland Häder [Sat, 17 Jun 2023 09:47:19 +0000 (11:47 +0200)]
Continued:
- in the end, a missing "t" caused a lot of 'sofware' to be None (NULL) now

17 months agoContinued:
Roland Häder [Sat, 17 Jun 2023 08:45:45 +0000 (10:45 +0200)]
Continued:
- need to handle requests.exceptions.InvalidSchema as well
- if variable link is not dict or does not contain 'rel' attribute for what
  reason, then skip this

17 months agoContinued:
Roland Häder [Fri, 16 Jun 2023 13:24:59 +0000 (15:24 +0200)]
Continued:
- let's always update last error details/status code

17 months agoContinued:
Roland Häder [Thu, 15 Jun 2023 23:45:16 +0000 (01:45 +0200)]
Continued:
- rewrote block for fetching nodeinfo, fetch is provided path is None or matches
  with request or http[s]://domain/path
- if a protocol is given in 'path' parameter, then it needs to be removed

17 months agoContinued:
Roland Häder [Thu, 15 Jun 2023 22:29:01 +0000 (00:29 +0200)]
Continued:
- if software is (still) None, then it needs to be determined, not otherwise
  (logic error)
- commented out some DEBUG lines

17 months agoContinued:
Roland Häder [Tue, 13 Jun 2023 23:43:23 +0000 (01:43 +0200)]
Continued:
- added config key "rss_limit" (default: 50)

17 months agoContinued:
Roland Häder [Tue, 13 Jun 2023 22:43:29 +0000 (00:43 +0200)]
Continued:
- reformatted ({}) block
- commented out debug line
- converted print("", foo, bar) to masked (f) version
- fixed logic bug when not all needed steps were executed

17 months agoContinued:
Roland Häder [Tue, 13 Jun 2023 21:05:52 +0000 (23:05 +0200)]
Continued:
- always add non-existing instances, also when their software type is not
  detectable, e.g. not existing
- also skip recently checked instances

17 months agoContinued:
Roland Häder [Tue, 13 Jun 2023 20:16:46 +0000 (22:16 +0200)]
Continued:
- re-introduced wrapper function around each column of the "model" `instances`
- marked set_data() as private (now named _set_data())
- these wrappers do NOT invoke instances.update_data(), you have to do this
  from your code

17 months agoContinued:
Roland Häder [Tue, 13 Jun 2023 17:58:52 +0000 (19:58 +0200)]
Continued:
- first load main packages, then sub

17 months agoFixed:
Roland Häder [Tue, 13 Jun 2023 17:20:22 +0000 (19:20 +0200)]
Fixed:
- also the other way around

17 months agoContinued:
Roland Häder [Tue, 13 Jun 2023 16:26:43 +0000 (18:26 +0200)]
Continued:
- 'data' is optional, e.g. empty POST bodies are okay
- fixed handling of JSON replies from peertube instances:
- the request /api/v1/server/followers is correct, then always the JSON has
  "follow" and "following" as elements

17 months agoFixed:
Roland Häder [Tue, 13 Jun 2023 10:08:11 +0000 (12:08 +0200)]
Fixed:
- some instances have broken API at /api/v1/instance/domain_blocks which returns
  nodeinfo (see masto1.iana.de)

17 months agoContinued:
Roland Häder [Tue, 13 Jun 2023 09:32:02 +0000 (11:32 +0200)]
Continued:
- domain/path might be a valid installation path, but some bug in Friendica
  caused my instance to be reported as 'f.haeder.net/featured' which sucks
- still we need to let domain/path pass here as some installations might
  be happening to be installed in such a way
- sure, best option is always a sub-domain ...

17 months agoContinued:
Roland Häder [Tue, 13 Jun 2023 09:19:23 +0000 (11:19 +0200)]
Continued:
- added 'software' as optional parameter to instances.add()
- also prevent bad invocations when a link to a user profile has provided

17 months agoContinued:
Roland Häder [Tue, 13 Jun 2023 02:18:29 +0000 (04:18 +0200)]
Continued:
- removed some wrapper functions
- update instance data even when the connection didn't work or some error
  status code (>= 400) came

17 months agoFixed:
Roland Häder [Mon, 12 Jun 2023 23:43:11 +0000 (01:43 +0200)]
Fixed:
- ops, wrong way!

17 months agoContinued:
Roland Häder [Mon, 12 Jun 2023 23:25:57 +0000 (01:25 +0200)]
Continued:
- moved fba.locking to fba.helpers

17 months agoContinued:
Roland Häder [Mon, 12 Jun 2023 22:01:25 +0000 (00:01 +0200)]
Continued:
- moved blocks, instances to new package fba.models as these modules are only
  around a database table with the same name
- movved+renamed fba.log_error() to fba.models.error_log.add()
- pleroma has a /instance/about/index.html "API" which can be parsed for
  block lists if the JSON has returned no 'mrf_simple' and
  'quarantined_instances'

17 months agoContinued:
Roland Häder [Mon, 12 Jun 2023 19:14:44 +0000 (21:14 +0200)]
Continued:
- prevent .arpa domains being added by instances.add()

17 months agoContinued:
Roland Häder [Mon, 12 Jun 2023 18:09:38 +0000 (20:09 +0200)]
Continued:
- better query `last_error_details` as this column is always set to NULL on
  success

17 months agoContinued:
Roland Häder [Mon, 12 Jun 2023 17:59:22 +0000 (19:59 +0200)]
Continued:
- ops, don't double-fetch a single row, causing 2nd invocation of fetchone()
  to return None as the first one already fetched it

17 months agoFixed:
Roland Häder [Mon, 12 Jun 2023 17:11:10 +0000 (19:11 +0200)]
Fixed:
- one lesser return statement, currently I have no idea on how to rewrite this?

17 months agoContinued:
Roland Häder [Mon, 12 Jun 2023 16:44:33 +0000 (18:44 +0200)]
Continued:
- no more 'unknown' blocking reasons, just keep them empty

17 months agoContinued:
Roland Häder [Mon, 12 Jun 2023 16:09:07 +0000 (18:09 +0200)]
Continued:
- duplicated some code for when no "mrf_simple" is returned but only
  "quarantined_instances"

17 months agoContinued:
Roland Häder [Mon, 12 Jun 2023 15:11:13 +0000 (17:11 +0200)]
Continued:
- ValueException is wrong, it is ValueError

17 months agoContinued:
Roland Häder [Mon, 12 Jun 2023 14:59:56 +0000 (16:59 +0200)]
Continued:
- better checking with .endswith() instead of .split()[-1]
- don't crawl '.tld' domains

17 months agoContinued:
Roland Häder [Mon, 12 Jun 2023 14:52:20 +0000 (16:52 +0200)]
Continued:
- fixed finding "powered by " (start of string)

17 months agoContinued:
Roland Häder [Mon, 12 Jun 2023 14:42:49 +0000 (16:42 +0200)]
Continued:
- alias 'nextcloud social' to 'nextcloud'

17 months agoContinued:
Roland Häder [Mon, 12 Jun 2023 12:16:02 +0000 (14:16 +0200)]
Continued:
- log also domain,origin,blocker

17 months agoContinued:
Roland Häder [Mon, 12 Jun 2023 12:06:04 +0000 (14:06 +0200)]
Continued:
- empty string changed to None

17 months agoFixed:
Roland Häder [Mon, 12 Jun 2023 11:47:21 +0000 (13:47 +0200)]
Fixed:
- 'redefined-outer-name' lint fixed
- 'bad-indentation ' lint fixed

17 months agoContinued:
Roland Häder [Mon, 12 Jun 2023 11:29:47 +0000 (13:29 +0200)]
Continued:
- tidyup + validate domains/reasons

17 months agoContinued:
Roland Häder [Mon, 12 Jun 2023 11:14:34 +0000 (13:14 +0200)]
Continued:
- introduced fba.process_domain() for generic domain processing, please provide
  origin and command

17 months agoContinued:
Roland Häder [Mon, 12 Jun 2023 10:38:53 +0000 (12:38 +0200)]
Continued:
- tpzo fixed in function name
- also re-check with domain if hash wasn't found
- 'runtube.re' aliased to 'peertube'

17 months agoContinued:
Roland Häder [Mon, 12 Jun 2023 10:25:17 +0000 (12:25 +0200)]
Continued:
- renamed hash -> blocked_hash to avoid redefining builtin references
- also combined 2 isinstance() into one

17 months agoContinued:
Roland Häder [Mon, 12 Jun 2023 09:22:57 +0000 (11:22 +0200)]
Continued:
- introduced instances.deobsure() for simple deobscuring attempts, e.g. when
  they use * or ? when they don't want to show the domain, you can still
  deobsfucate it with the hash (some provide it) or obscured domain itself

17 months agoContinued:
Roland Häder [Mon, 12 Jun 2023 04:25:42 +0000 (06:25 +0200)]
Continued:
- also update last_instance_fetch when software type isn't determined yet
- include command name in log messages

17 months agoContinued:
Roland Häder [Mon, 12 Jun 2023 03:51:41 +0000 (05:51 +0200)]
Continued:
- moved fba.cache to fba.helpers
- introduced instances.is_recent() so importing long blocklists won't take so
  long

17 months agoContinued:
Roland Häder [Mon, 12 Jun 2023 03:07:54 +0000 (05:07 +0200)]
Continued:
- added optional --domain parameter to fetch only from one oliphant blocklist
  files

17 months agoWIP:
Roland Häder [Mon, 12 Jun 2023 02:48:04 +0000 (04:48 +0200)]
WIP:
- rewrote from out-dated federater blocklist to multiple up-to-date oliphant
  blocklists
- also prepared for local file support (documentation prepared)

17 months agoContinued:
Roland Häder [Mon, 12 Jun 2023 01:51:23 +0000 (03:51 +0200)]
Continued:
- moved version-related stuff to own helpers module

17 months agoContinued:
Roland Häder [Sun, 11 Jun 2023 22:39:10 +0000 (00:39 +0200)]
Continued:
- let's collect them all and handle them together, no "generic-catch-all" as
  this would hide actual bugs

17 months agoContinued:
Roland Häder [Sun, 11 Jun 2023 22:02:46 +0000 (00:02 +0200)]
Continued:
- avoid local variables

17 months agoContinued:
Roland Häder [Sun, 11 Jun 2023 19:24:48 +0000 (21:24 +0200)]
Continued:
- some Mastodon API responses have no comment in it

17 months agoContinued:
Roland Häder [Sun, 11 Jun 2023 19:05:52 +0000 (21:05 +0200)]
Continued:
- DEBUG level is enough here, avoids double-logging

17 months agoContinued:
Roland Häder [Sun, 11 Jun 2023 17:59:08 +0000 (19:59 +0200)]
Continued:
- also cut off trailing double-dot (some people cannot format their data in
  tables properly)
- a wildcat might be at the start of the string, so start checking there for it

17 months agoContinued:
Roland Häder [Sun, 11 Jun 2023 17:56:16 +0000 (19:56 +0200)]
Continued:
- whole input tag, no matter for what purpose is styled now
- sorted CSS members

17 months agoContinued:
Roland Häder [Sun, 11 Jun 2023 17:52:36 +0000 (19:52 +0200)]
Continued:
- logic fixed
- debug messages added

17 months agoContinued:
Roland Häder [Sun, 11 Jun 2023 17:25:49 +0000 (19:25 +0200)]
Continued:
- need to catch exceptions here so more instances can be added with
  software=None

17 months agoContinued:
Roland Häder [Sun, 11 Jun 2023 17:09:53 +0000 (19:09 +0200)]
Continued:
- reason['reason'] had been handled to tidyup.reason() which caused an error
- it needed to be flexible "detected": str, dict are only supported types for now

17 months agoContinued:
Roland Häder [Sun, 11 Jun 2023 16:31:22 +0000 (18:31 +0200)]
Continued:
- fixed handling of 404 (no exception) case when nodeinfo wasn't found
- copied (WIP!) fetching /about page to pleroma
- also added /about to /about/more as possible pages for misskey

17 months agoContinued:
Roland Häder [Sun, 11 Jun 2023 15:57:51 +0000 (17:57 +0200)]
Continued:
- .arpa domains are reverse-ip-address domains and should not be used generally
- please choose a proper domain name, e.g. lemmy.myhomepage.tld

17 months agoContinued:
Roland Häder [Sun, 11 Jun 2023 15:42:06 +0000 (17:42 +0200)]
Continued:
- always transport causing exception
- some places may still handle it

17 months agoRewrites:
Roland Häder [Sun, 11 Jun 2023 15:03:06 +0000 (17:03 +0200)]
Rewrites:
- rewrote api.api_top() to only 2 parameters, 'mode' and 'amount'
- also remove duplicate `if amount > 500` lines and combined them into one

17 months agoContinued:
Roland Häder [Sun, 11 Jun 2023 14:39:26 +0000 (16:39 +0200)]
Continued:
- disabled 'duplicate-code' lint check as it found checking parameters as
  duplicated code while it is needed for each function

17 months agoFixes:
Roland Häder [Sun, 11 Jun 2023 13:40:58 +0000 (15:40 +0200)]
Fixes:
- some misskey installations don't return isSuspended/isBlocked fields

17 months agoContinued:
Roland Häder [Sun, 11 Jun 2023 13:20:43 +0000 (15:20 +0200)]
Continued:
- removed another broad except block
- added missing variable initialization
- there is no 'domain', aka. instance here
- fixed bare-except, you can use 'if foo in bar' instead

17 months agoContinued:
Roland Häder [Sun, 11 Jun 2023 12:49:07 +0000 (14:49 +0200)]
Continued:
- handle typical network exceptions here, too
- don't sys.exit() here anymore, exit function properly
- don't 'break' here, there was no loop, better return proper error code
- fixed a few problems, found by pylint

17 months agoContinued:
Roland Häder [Sun, 11 Jun 2023 12:21:57 +0000 (14:21 +0200)]
Continued:
- fetch[_wellknown]_nodeinfo() should return same dict with at least
  'status_code' and 'json' on success and 'error_message' on failure

17 months agoContinued:
Roland Häder [Sun, 11 Jun 2023 11:26:17 +0000 (13:26 +0200)]
Continued:
- if dict 'error' cannot be handled (their keys) then raise an exception
- put all type(foo) into single quotes
- commented out debug line

17 months agoContinued:
Roland Häder [Sun, 11 Jun 2023 02:53:42 +0000 (04:53 +0200)]
Continued:
- also need to put a try/except block around csrf.determine() invocations

17 months agoContinued:
Roland Häder [Sun, 11 Jun 2023 02:48:43 +0000 (04:48 +0200)]
Continued:
- forgot to copy-paste error_message check for "blocked"
- also needed to take fetched['json'] for fetched rows

17 months agoContinued:
Roland Häder [Sat, 10 Jun 2023 22:35:17 +0000 (00:35 +0200)]
Continued:
- some misskey (Chinese) instance returned broken UTF-8, so I had to catch
  UnicodeEncodeError, too

17 months agoContinued:
Roland Häder [Sat, 10 Jun 2023 22:22:15 +0000 (00:22 +0200)]
Continued:
- both ['error_message'] and ['json']['federated_instances'] is extremely rare

17 months agoContinued:
Roland Häder [Sat, 10 Jun 2023 18:24:22 +0000 (20:24 +0200)]
Continued:
- at least show the exception name

17 months agoContinued:
Roland Häder [Sat, 10 Jun 2023 17:56:16 +0000 (19:56 +0200)]
Continued:
- ops, don't copy whole HTML to last_error_message
- also need to initialize local variable 'peers' first

17 months agoContinued:
Roland Häder [Sat, 10 Jun 2023 17:40:37 +0000 (19:40 +0200)]
Continued:
- no parameter for 'timeout' (here: 'headers' wasn't handled over)

17 months agoWIP(?):
Roland Häder [Sat, 10 Jun 2023 17:32:52 +0000 (19:32 +0200)]
WIP(?):
- moved csrf.determine() of of central functions, it was causing to much CSRF
  checks and slowed down all

17 months agoContinued:
Roland Häder [Sat, 10 Jun 2023 17:05:40 +0000 (19:05 +0200)]
Continued:
- ops wrong fix

17 months agoContinued:
Roland Häder [Sat, 10 Jun 2023 16:59:09 +0000 (18:59 +0200)]
Continued:
- DEBUG level + commented out is enough here

17 months agoContinued:
Roland Häder [Sat, 10 Jun 2023 16:50:26 +0000 (18:50 +0200)]
Continued:
- caught more specific exception and not broad BaseException (still some are
  left)
- renamed variable blocks -> blocking to avoid confusion with imported
  fba.blocks

17 months agoContinued:
Roland Häder [Sat, 10 Jun 2023 15:57:54 +0000 (17:57 +0200)]
Continued:
- also here need to handle error_message
- fetched['json'] does now contain the rows

17 months agoContinued:
Roland Häder [Sat, 10 Jun 2023 15:51:55 +0000 (17:51 +0200)]
Continued:
- whyever, but a list is returned, not a dict

17 months agoContinued:
Roland Häder [Sat, 10 Jun 2023 15:49:35 +0000 (17:49 +0200)]
Continued:
- also catch this exception here, avoiding a lot of more requests to unreachable websites

17 months agoContinued:
Roland Häder [Sat, 10 Jun 2023 14:38:05 +0000 (16:38 +0200)]
Continued:
- data['json'] now contains the reply

17 months agoContinued:
Roland Häder [Sat, 10 Jun 2023 14:32:39 +0000 (16:32 +0200)]
Continued:
- still a requests.model.Response might be handled over

17 months agoWIP:
Roland Häder [Sat, 10 Jun 2023 14:29:43 +0000 (16:29 +0200)]
WIP:
- introduced network.fetch_api_url() which takes a whole URL (not domain/path
  separated) and returns it's reply in a json_reply dictionary as both other
  API functions are handling it

17 months agoWIP:
Roland Häder [Sat, 10 Jun 2023 14:14:54 +0000 (16:14 +0200)]
WIP:
- more refacturing away from "generic except blocks"

17 months agoContinued:
Roland Häder [Sat, 10 Jun 2023 13:27:05 +0000 (15:27 +0200)]
Continued:
- introduced get_json_api() which gives back a dictionary,
- 'status_code' in it is always set, so better test on 'error_message'

17 months agoFixed:
Roland Häder [Sat, 10 Jun 2023 12:06:45 +0000 (14:06 +0200)]
Fixed:
- had to add a 'import reqto' only here to make Python happy
- looks like something in Python internal mapping or so is broken?

17 months agoContinued: broken/missing-import-reqto
Roland Häder [Sat, 10 Jun 2023 11:42:20 +0000 (13:42 +0200)]
Continued:
- first 'rows' was re-assigned with new values, which is typical for Python
- yet still this hasn't fixed the recursion error

17 months agoContinued:
Roland Häder [Sat, 10 Jun 2023 00:10:02 +0000 (02:10 +0200)]
Continued:
- removed redundant initialization of 'blockdict'
- removed local variable 'csrf'