Commit graph

10922 commits

Author SHA1 Message Date
rinpatch
0ffde499b8 Connection Pool: register workers using :via 2020-07-15 15:24:47 +03:00
rinpatch
ec9d0d146b Connection pool: Fix race conditions in limit enforcement
Fixes race conditions in limit enforcement by putting worker processes
in a DynamicSupervisor
2020-07-15 15:17:27 +03:00
rinpatch
d08b157699 Connection pool: check that there actually is a result
Sometimes connections died before being released to the pool, resulting
in MatchErrors
2020-07-15 15:17:27 +03:00
rinpatch
fffbcffb8c Connection Pool: don't enforce pool limits if no new connection needs to be opened 2020-07-15 15:17:27 +03:00
rinpatch
58a4f350a8 Refactor gun pooling and simplify adapter option insertion
This patch refactors gun pooling to use Elixir process registry and
simplifies adapter option insertion.

Having the pool use process registry instead of a GenServer has a number of advantages:
- Simpler code: the initial implementation adds about half the lines of code it deletes
- Concurrency: unlike a GenServer, ETS-based registry can handle multiple checkout/checkin
requests at the same time
- Precise and easy idle connection clousure: current proposal for closing idle connections in
the GenServer-based pool needs to filter through all connections once a minute and compare their
last active time with closing time. With Elixir process registry this can be done
by just using `Process.send_after`/`Process.cancel_timer` in the worker process.
- Lower memory footprint: In my tests `gun-memory-leak` branch uses about 290mb on peak load (250 connections)
and 235mb on idle (5-10 connections). Registry-based pool uses 210mb on idle and 240mb on peak load
2020-07-15 15:17:27 +03:00
lain
040524c09f Merge branch 'tests/apc2s-update_outbox' into 'develop'
AP C2S tests: Make sure you can't use another user's AP id

See merge request pleroma/pleroma!2767
2020-07-15 10:12:44 +00:00
Haelwenn (lanodan) Monnier
6d8427cca2
AP C2S tests: Make sure you can't use another user's AP id 2020-07-15 09:59:24 +02:00
Alex Gleason
0d004a9d04
Email admins when a new unapproved account is up for review 2020-07-14 20:31:20 -05:00
Alex Gleason
48983e9421
Merge remote-tracking branch 'upstream/develop' into by-approval 2020-07-14 18:56:40 -05:00
Alex Gleason
df3d1bf5e5
Add :approval_pending to User @type account_status 2020-07-14 18:56:36 -05:00
Alex Gleason
e82060c472
Update CHANGELOG.md 2020-07-14 18:47:23 -05:00
Alex Gleason
fab44f6970
Test User with confirmation_pending: true, approval_pending: true 2020-07-14 18:46:57 -05:00
Alex Gleason
20d24741af
AdminAPI: Add PATCH /api/pleroma/admin/users/approve endpoint 2020-07-14 18:02:44 -05:00
Alex Gleason
33f1b29b2c
AdminAPI: Filter users by need_approval 2020-07-14 14:29:03 -05:00
Alex Gleason
b750129da1
AdminAPI: Return approval_pending with users 2020-07-14 13:47:05 -05:00
Maksim Pechnikov
1dd767b8c7 Include port in host for signatures 2020-07-14 21:44:08 +03:00
Mark Felder
777a7edc6b Lint and fix test to match new log message 2020-07-14 13:15:37 -05:00
Mark Felder
37297a8482 Improve error messages 2020-07-14 13:12:16 -05:00
Alex Gleason
a1570ba6ad
AdminAPI: Return registration_reason with users 2020-07-14 13:08:39 -05:00
3f65f2ea79 Merge branch 'feature/1922-media-proxy-whitelist' into 'develop'
Support for hosts with scheme in MediaProxy whitelist setting

Closes #1922

See merge request pleroma/pleroma!2754
2020-07-14 18:07:44 +00:00
63798e89de Merge branch 'fix/scrubber-recompile-warnings-as-errors' into 'develop'
Fix in-db configuration in dev environment

See merge request pleroma/pleroma!2764
2020-07-14 18:05:36 +00:00
2909dc873b Merge branch '1940-admin-token-oauthless-auth' into 'develop'
[#1940] Reinstated OAuth-less `admin_token` authentication

Closes #1940

See merge request pleroma/pleroma!2760
2020-07-14 16:48:26 +00:00
Ivan Tashkinov
124b4709dc [#1940] Added admin_token param (as admin_api_params/0) to existing Admin API OpenAPI operations. 2020-07-14 19:31:05 +03:00
Mark Felder
ce314e6fe2 Clarify description and suggestion 2020-07-14 11:24:58 -05:00
246f49d685 Merge branch '1916-transmogrifier-skipping-oddities-in-address-fields' into 'develop'
Transmogrifier: filtering weirdness in address fields

Closes #1916

See merge request pleroma/pleroma!2762
2020-07-14 15:17:25 +00:00
rinpatch
2d5e96ea8b Merge branch 'fix/oban-2.0-in-db-config' into 'develop'
Migrate in-db config after updating to Oban 2.0

See merge request pleroma/pleroma!2765
2020-07-14 10:39:08 +00:00
rinpatch
e6ccc25565 Fix in-db configuration in dev environment
Previously, in-db configuration only worked when `warnings_as_errors`
was disabled because re-compiling scrubbers on application restart
created a warning about module conflicts. This patch fixes that
by enabling `ignore_module_conflict` option of the compiler at runtime,
and enables `warnings_as_errors` in prod since there is no reason
to keep it disabled anymore.
2020-07-14 13:16:54 +03:00
rinpatch
8d56fb6d22 Migrate in-db config after updating to Oban 2.0 2020-07-14 13:15:46 +03:00
Haelwenn (lanodan) Monnier
858d9fc7e8
MRF Policies: Return a {:reject, reason} instead of {:reject, nil} 2020-07-14 11:04:16 +02:00
Ivan Tashkinov
9b225db7d8 [#1940] Applied rate limit for requests with bad admin_token. Added doc warnings on admin_token setting. 2020-07-14 11:58:41 +03:00
Ivan Tashkinov
cf3f8cb72a [#1940] Reinstated OAuth-less admin_token authentication. Refactored UserIsAdminPlug (freed from checking admin scopes presence). 2020-07-19 21:35:57 +03:00
Maksim Pechnikov
3062f86613 added generated pleroma.env 2020-07-14 09:05:34 +03:00
Alex Gleason
5ddf0415c4
Accept reason in POST /api/v1/accounts and store in DB 2020-07-14 00:22:12 -05:00
=
b221b640a2 Transmogrifier: filtering weirdness in address fields 2020-07-13 22:43:21 +03:00
Mark Felder
80c21100db Merge branch 'develop' into refactor/notification_settings 2020-07-13 13:32:21 -05:00
5d215fd81f Merge branch 'config-behaviours-runtime' into 'develop'
Config/Docs: Expand behaviour suggestions modules at runtime

Closes #1941

See merge request pleroma/pleroma!2755
2020-07-13 15:45:25 +00:00
8f9ee694ed Merge branch 'features/profile-fields-emojo' into 'develop'
user: Add support for custom emojis in profile fields

See merge request pleroma/pleroma!2741
2020-07-13 15:43:46 +00:00
63fef0c0fb Merge branch 'chore/improve-database-config-docs' into 'develop'
Improve database config migration and add documentation

See merge request pleroma/pleroma!2756
2020-07-13 15:42:20 +00:00
db529d454e Merge branch 'fix/mediaproxy-cache-settings-types' into 'develop'
Update types for :headers and :options settings in Pleroma.Web.MediaProxy.Invalidation.Http

See merge request pleroma/pleroma!2735
2020-07-13 15:38:56 +00:00
Mark Felder
d1cd3f4ec0 Lint 2020-07-13 10:32:17 -05:00
Mark Felder
442fe3cd45 Show examples for both OTP and source 2020-07-13 09:56:05 -05:00
Mark Felder
e1908a5270 Pick up env for both source and OTP installs 2020-07-13 08:39:56 -05:00
Haelwenn (lanodan) Monnier
ce243b107f
Use Logger.info for {:reject, reason} 2020-07-13 15:26:31 +02:00
Haelwenn (lanodan) Monnier
2aac92e9e0
Transmogrifier.fix_in_reply_to/2: Use warn for non-fatal fail to get replied-to post 2020-07-13 15:26:30 +02:00
Haelwenn
f918b6f86d Merge branch '1937-renaming' into 'develop'
ActivityPub: Don't rename a clashing nickname with the same ap id.

Closes #1937

See merge request pleroma/pleroma!2748
2020-07-13 12:06:43 +00:00
Alex Gleason
bcfd38c8f3
Make a user unapproved when registering with account_approval_required on 2020-07-12 22:55:37 -05:00
Alex Gleason
e4e5577818
Prevent unapproved users from logging in 2020-07-12 22:55:26 -05:00
Alex Gleason
51ab8d0128
Add account_approval_required instance setting 2020-07-12 20:27:58 -05:00
Alex Gleason
a62f17da17
Add approval_pending field to User 2020-07-12 20:27:14 -05:00
Mark Felder
46b123cded Still allow passing the arg, but fallback to MIX_ENV 2020-07-12 10:59:12 -05:00