fix(stats): leave our own host out of the peers
Favicon lookups for local accounts can add our own host to instances. Also skip userinfo and IPv6 literals in the backfill migration.
This commit is contained in:
parent
e8f238359f
commit
958166589e
5 changed files with 15 additions and 4 deletions
|
|
@ -13,7 +13,8 @@ defmodule Pleroma.Repo.Migrations.BackfillInstancesFromUsers do
|
|||
INSERT INTO instances (host, inserted_at, updated_at)
|
||||
SELECT DISTINCT host, now(), now()
|
||||
FROM (
|
||||
SELECT substring(ap_id from '^[A-Za-z][A-Za-z0-9+.-]*://([^/:?#]+)') AS host
|
||||
-- Skips userinfo; IPv6 literals give NULL and are left out.
|
||||
SELECT substring(ap_id from '^[A-Za-z][A-Za-z0-9+.-]*://(?:[^/?#@]*@)?([^/:?#\\[]+)') AS host
|
||||
FROM users
|
||||
WHERE local = false AND ap_id IS NOT NULL
|
||||
) AS hosts
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue