Merge remote-tracking branch 'upstream/develop' into chat-moderation
This commit is contained in:
commit
9733c9d065
168 changed files with 2652 additions and 8013 deletions
395
CC-BY-4.0
Normal file
395
CC-BY-4.0
Normal file
|
@ -0,0 +1,395 @@
|
||||||
|
Attribution 4.0 International
|
||||||
|
|
||||||
|
=======================================================================
|
||||||
|
|
||||||
|
Creative Commons Corporation ("Creative Commons") is not a law firm and
|
||||||
|
does not provide legal services or legal advice. Distribution of
|
||||||
|
Creative Commons public licenses does not create a lawyer-client or
|
||||||
|
other relationship. Creative Commons makes its licenses and related
|
||||||
|
information available on an "as-is" basis. Creative Commons gives no
|
||||||
|
warranties regarding its licenses, any material licensed under their
|
||||||
|
terms and conditions, or any related information. Creative Commons
|
||||||
|
disclaims all liability for damages resulting from their use to the
|
||||||
|
fullest extent possible.
|
||||||
|
|
||||||
|
Using Creative Commons Public Licenses
|
||||||
|
|
||||||
|
Creative Commons public licenses provide a standard set of terms and
|
||||||
|
conditions that creators and other rights holders may use to share
|
||||||
|
original works of authorship and other material subject to copyright
|
||||||
|
and certain other rights specified in the public license below. The
|
||||||
|
following considerations are for informational purposes only, are not
|
||||||
|
exhaustive, and do not form part of our licenses.
|
||||||
|
|
||||||
|
Considerations for licensors: Our public licenses are
|
||||||
|
intended for use by those authorized to give the public
|
||||||
|
permission to use material in ways otherwise restricted by
|
||||||
|
copyright and certain other rights. Our licenses are
|
||||||
|
irrevocable. Licensors should read and understand the terms
|
||||||
|
and conditions of the license they choose before applying it.
|
||||||
|
Licensors should also secure all rights necessary before
|
||||||
|
applying our licenses so that the public can reuse the
|
||||||
|
material as expected. Licensors should clearly mark any
|
||||||
|
material not subject to the license. This includes other CC-
|
||||||
|
licensed material, or material used under an exception or
|
||||||
|
limitation to copyright. More considerations for licensors:
|
||||||
|
wiki.creativecommons.org/Considerations_for_licensors
|
||||||
|
|
||||||
|
Considerations for the public: By using one of our public
|
||||||
|
licenses, a licensor grants the public permission to use the
|
||||||
|
licensed material under specified terms and conditions. If
|
||||||
|
the licensor's permission is not necessary for any reason--for
|
||||||
|
example, because of any applicable exception or limitation to
|
||||||
|
copyright--then that use is not regulated by the license. Our
|
||||||
|
licenses grant only permissions under copyright and certain
|
||||||
|
other rights that a licensor has authority to grant. Use of
|
||||||
|
the licensed material may still be restricted for other
|
||||||
|
reasons, including because others have copyright or other
|
||||||
|
rights in the material. A licensor may make special requests,
|
||||||
|
such as asking that all changes be marked or described.
|
||||||
|
Although not required by our licenses, you are encouraged to
|
||||||
|
respect those requests where reasonable. More considerations
|
||||||
|
for the public:
|
||||||
|
wiki.creativecommons.org/Considerations_for_licensees
|
||||||
|
|
||||||
|
=======================================================================
|
||||||
|
|
||||||
|
Creative Commons Attribution 4.0 International Public License
|
||||||
|
|
||||||
|
By exercising the Licensed Rights (defined below), You accept and agree
|
||||||
|
to be bound by the terms and conditions of this Creative Commons
|
||||||
|
Attribution 4.0 International Public License ("Public License"). To the
|
||||||
|
extent this Public License may be interpreted as a contract, You are
|
||||||
|
granted the Licensed Rights in consideration of Your acceptance of
|
||||||
|
these terms and conditions, and the Licensor grants You such rights in
|
||||||
|
consideration of benefits the Licensor receives from making the
|
||||||
|
Licensed Material available under these terms and conditions.
|
||||||
|
|
||||||
|
|
||||||
|
Section 1 -- Definitions.
|
||||||
|
|
||||||
|
a. Adapted Material means material subject to Copyright and Similar
|
||||||
|
Rights that is derived from or based upon the Licensed Material
|
||||||
|
and in which the Licensed Material is translated, altered,
|
||||||
|
arranged, transformed, or otherwise modified in a manner requiring
|
||||||
|
permission under the Copyright and Similar Rights held by the
|
||||||
|
Licensor. For purposes of this Public License, where the Licensed
|
||||||
|
Material is a musical work, performance, or sound recording,
|
||||||
|
Adapted Material is always produced where the Licensed Material is
|
||||||
|
synched in timed relation with a moving image.
|
||||||
|
|
||||||
|
b. Adapter's License means the license You apply to Your Copyright
|
||||||
|
and Similar Rights in Your contributions to Adapted Material in
|
||||||
|
accordance with the terms and conditions of this Public License.
|
||||||
|
|
||||||
|
c. Copyright and Similar Rights means copyright and/or similar rights
|
||||||
|
closely related to copyright including, without limitation,
|
||||||
|
performance, broadcast, sound recording, and Sui Generis Database
|
||||||
|
Rights, without regard to how the rights are labeled or
|
||||||
|
categorized. For purposes of this Public License, the rights
|
||||||
|
specified in Section 2(b)(1)-(2) are not Copyright and Similar
|
||||||
|
Rights.
|
||||||
|
|
||||||
|
d. Effective Technological Measures means those measures that, in the
|
||||||
|
absence of proper authority, may not be circumvented under laws
|
||||||
|
fulfilling obligations under Article 11 of the WIPO Copyright
|
||||||
|
Treaty adopted on December 20, 1996, and/or similar international
|
||||||
|
agreements.
|
||||||
|
|
||||||
|
e. Exceptions and Limitations means fair use, fair dealing, and/or
|
||||||
|
any other exception or limitation to Copyright and Similar Rights
|
||||||
|
that applies to Your use of the Licensed Material.
|
||||||
|
|
||||||
|
f. Licensed Material means the artistic or literary work, database,
|
||||||
|
or other material to which the Licensor applied this Public
|
||||||
|
License.
|
||||||
|
|
||||||
|
g. Licensed Rights means the rights granted to You subject to the
|
||||||
|
terms and conditions of this Public License, which are limited to
|
||||||
|
all Copyright and Similar Rights that apply to Your use of the
|
||||||
|
Licensed Material and that the Licensor has authority to license.
|
||||||
|
|
||||||
|
h. Licensor means the individual(s) or entity(ies) granting rights
|
||||||
|
under this Public License.
|
||||||
|
|
||||||
|
i. Share means to provide material to the public by any means or
|
||||||
|
process that requires permission under the Licensed Rights, such
|
||||||
|
as reproduction, public display, public performance, distribution,
|
||||||
|
dissemination, communication, or importation, and to make material
|
||||||
|
available to the public including in ways that members of the
|
||||||
|
public may access the material from a place and at a time
|
||||||
|
individually chosen by them.
|
||||||
|
|
||||||
|
j. Sui Generis Database Rights means rights other than copyright
|
||||||
|
resulting from Directive 96/9/EC of the European Parliament and of
|
||||||
|
the Council of 11 March 1996 on the legal protection of databases,
|
||||||
|
as amended and/or succeeded, as well as other essentially
|
||||||
|
equivalent rights anywhere in the world.
|
||||||
|
|
||||||
|
k. You means the individual or entity exercising the Licensed Rights
|
||||||
|
under this Public License. Your has a corresponding meaning.
|
||||||
|
|
||||||
|
|
||||||
|
Section 2 -- Scope.
|
||||||
|
|
||||||
|
a. License grant.
|
||||||
|
|
||||||
|
1. Subject to the terms and conditions of this Public License,
|
||||||
|
the Licensor hereby grants You a worldwide, royalty-free,
|
||||||
|
non-sublicensable, non-exclusive, irrevocable license to
|
||||||
|
exercise the Licensed Rights in the Licensed Material to:
|
||||||
|
|
||||||
|
a. reproduce and Share the Licensed Material, in whole or
|
||||||
|
in part; and
|
||||||
|
|
||||||
|
b. produce, reproduce, and Share Adapted Material.
|
||||||
|
|
||||||
|
2. Exceptions and Limitations. For the avoidance of doubt, where
|
||||||
|
Exceptions and Limitations apply to Your use, this Public
|
||||||
|
License does not apply, and You do not need to comply with
|
||||||
|
its terms and conditions.
|
||||||
|
|
||||||
|
3. Term. The term of this Public License is specified in Section
|
||||||
|
6(a).
|
||||||
|
|
||||||
|
4. Media and formats; technical modifications allowed. The
|
||||||
|
Licensor authorizes You to exercise the Licensed Rights in
|
||||||
|
all media and formats whether now known or hereafter created,
|
||||||
|
and to make technical modifications necessary to do so. The
|
||||||
|
Licensor waives and/or agrees not to assert any right or
|
||||||
|
authority to forbid You from making technical modifications
|
||||||
|
necessary to exercise the Licensed Rights, including
|
||||||
|
technical modifications necessary to circumvent Effective
|
||||||
|
Technological Measures. For purposes of this Public License,
|
||||||
|
simply making modifications authorized by this Section 2(a)
|
||||||
|
(4) never produces Adapted Material.
|
||||||
|
|
||||||
|
5. Downstream recipients.
|
||||||
|
|
||||||
|
a. Offer from the Licensor -- Licensed Material. Every
|
||||||
|
recipient of the Licensed Material automatically
|
||||||
|
receives an offer from the Licensor to exercise the
|
||||||
|
Licensed Rights under the terms and conditions of this
|
||||||
|
Public License.
|
||||||
|
|
||||||
|
b. No downstream restrictions. You may not offer or impose
|
||||||
|
any additional or different terms or conditions on, or
|
||||||
|
apply any Effective Technological Measures to, the
|
||||||
|
Licensed Material if doing so restricts exercise of the
|
||||||
|
Licensed Rights by any recipient of the Licensed
|
||||||
|
Material.
|
||||||
|
|
||||||
|
6. No endorsement. Nothing in this Public License constitutes or
|
||||||
|
may be construed as permission to assert or imply that You
|
||||||
|
are, or that Your use of the Licensed Material is, connected
|
||||||
|
with, or sponsored, endorsed, or granted official status by,
|
||||||
|
the Licensor or others designated to receive attribution as
|
||||||
|
provided in Section 3(a)(1)(A)(i).
|
||||||
|
|
||||||
|
b. Other rights.
|
||||||
|
|
||||||
|
1. Moral rights, such as the right of integrity, are not
|
||||||
|
licensed under this Public License, nor are publicity,
|
||||||
|
privacy, and/or other similar personality rights; however, to
|
||||||
|
the extent possible, the Licensor waives and/or agrees not to
|
||||||
|
assert any such rights held by the Licensor to the limited
|
||||||
|
extent necessary to allow You to exercise the Licensed
|
||||||
|
Rights, but not otherwise.
|
||||||
|
|
||||||
|
2. Patent and trademark rights are not licensed under this
|
||||||
|
Public License.
|
||||||
|
|
||||||
|
3. To the extent possible, the Licensor waives any right to
|
||||||
|
collect royalties from You for the exercise of the Licensed
|
||||||
|
Rights, whether directly or through a collecting society
|
||||||
|
under any voluntary or waivable statutory or compulsory
|
||||||
|
licensing scheme. In all other cases the Licensor expressly
|
||||||
|
reserves any right to collect such royalties.
|
||||||
|
|
||||||
|
|
||||||
|
Section 3 -- License Conditions.
|
||||||
|
|
||||||
|
Your exercise of the Licensed Rights is expressly made subject to the
|
||||||
|
following conditions.
|
||||||
|
|
||||||
|
a. Attribution.
|
||||||
|
|
||||||
|
1. If You Share the Licensed Material (including in modified
|
||||||
|
form), You must:
|
||||||
|
|
||||||
|
a. retain the following if it is supplied by the Licensor
|
||||||
|
with the Licensed Material:
|
||||||
|
|
||||||
|
i. identification of the creator(s) of the Licensed
|
||||||
|
Material and any others designated to receive
|
||||||
|
attribution, in any reasonable manner requested by
|
||||||
|
the Licensor (including by pseudonym if
|
||||||
|
designated);
|
||||||
|
|
||||||
|
ii. a copyright notice;
|
||||||
|
|
||||||
|
iii. a notice that refers to this Public License;
|
||||||
|
|
||||||
|
iv. a notice that refers to the disclaimer of
|
||||||
|
warranties;
|
||||||
|
|
||||||
|
v. a URI or hyperlink to the Licensed Material to the
|
||||||
|
extent reasonably practicable;
|
||||||
|
|
||||||
|
b. indicate if You modified the Licensed Material and
|
||||||
|
retain an indication of any previous modifications; and
|
||||||
|
|
||||||
|
c. indicate the Licensed Material is licensed under this
|
||||||
|
Public License, and include the text of, or the URI or
|
||||||
|
hyperlink to, this Public License.
|
||||||
|
|
||||||
|
2. You may satisfy the conditions in Section 3(a)(1) in any
|
||||||
|
reasonable manner based on the medium, means, and context in
|
||||||
|
which You Share the Licensed Material. For example, it may be
|
||||||
|
reasonable to satisfy the conditions by providing a URI or
|
||||||
|
hyperlink to a resource that includes the required
|
||||||
|
information.
|
||||||
|
|
||||||
|
3. If requested by the Licensor, You must remove any of the
|
||||||
|
information required by Section 3(a)(1)(A) to the extent
|
||||||
|
reasonably practicable.
|
||||||
|
|
||||||
|
4. If You Share Adapted Material You produce, the Adapter's
|
||||||
|
License You apply must not prevent recipients of the Adapted
|
||||||
|
Material from complying with this Public License.
|
||||||
|
|
||||||
|
|
||||||
|
Section 4 -- Sui Generis Database Rights.
|
||||||
|
|
||||||
|
Where the Licensed Rights include Sui Generis Database Rights that
|
||||||
|
apply to Your use of the Licensed Material:
|
||||||
|
|
||||||
|
a. for the avoidance of doubt, Section 2(a)(1) grants You the right
|
||||||
|
to extract, reuse, reproduce, and Share all or a substantial
|
||||||
|
portion of the contents of the database;
|
||||||
|
|
||||||
|
b. if You include all or a substantial portion of the database
|
||||||
|
contents in a database in which You have Sui Generis Database
|
||||||
|
Rights, then the database in which You have Sui Generis Database
|
||||||
|
Rights (but not its individual contents) is Adapted Material; and
|
||||||
|
|
||||||
|
c. You must comply with the conditions in Section 3(a) if You Share
|
||||||
|
all or a substantial portion of the contents of the database.
|
||||||
|
|
||||||
|
For the avoidance of doubt, this Section 4 supplements and does not
|
||||||
|
replace Your obligations under this Public License where the Licensed
|
||||||
|
Rights include other Copyright and Similar Rights.
|
||||||
|
|
||||||
|
|
||||||
|
Section 5 -- Disclaimer of Warranties and Limitation of Liability.
|
||||||
|
|
||||||
|
a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
|
||||||
|
EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
|
||||||
|
AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
|
||||||
|
ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
|
||||||
|
IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
|
||||||
|
WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||||
|
PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
|
||||||
|
ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
|
||||||
|
KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
|
||||||
|
ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
|
||||||
|
|
||||||
|
b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
|
||||||
|
TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
|
||||||
|
NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
|
||||||
|
INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
|
||||||
|
COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
|
||||||
|
USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
|
||||||
|
ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
|
||||||
|
DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
|
||||||
|
IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
|
||||||
|
|
||||||
|
c. The disclaimer of warranties and limitation of liability provided
|
||||||
|
above shall be interpreted in a manner that, to the extent
|
||||||
|
possible, most closely approximates an absolute disclaimer and
|
||||||
|
waiver of all liability.
|
||||||
|
|
||||||
|
|
||||||
|
Section 6 -- Term and Termination.
|
||||||
|
|
||||||
|
a. This Public License applies for the term of the Copyright and
|
||||||
|
Similar Rights licensed here. However, if You fail to comply with
|
||||||
|
this Public License, then Your rights under this Public License
|
||||||
|
terminate automatically.
|
||||||
|
|
||||||
|
b. Where Your right to use the Licensed Material has terminated under
|
||||||
|
Section 6(a), it reinstates:
|
||||||
|
|
||||||
|
1. automatically as of the date the violation is cured, provided
|
||||||
|
it is cured within 30 days of Your discovery of the
|
||||||
|
violation; or
|
||||||
|
|
||||||
|
2. upon express reinstatement by the Licensor.
|
||||||
|
|
||||||
|
For the avoidance of doubt, this Section 6(b) does not affect any
|
||||||
|
right the Licensor may have to seek remedies for Your violations
|
||||||
|
of this Public License.
|
||||||
|
|
||||||
|
c. For the avoidance of doubt, the Licensor may also offer the
|
||||||
|
Licensed Material under separate terms or conditions or stop
|
||||||
|
distributing the Licensed Material at any time; however, doing so
|
||||||
|
will not terminate this Public License.
|
||||||
|
|
||||||
|
d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
|
||||||
|
License.
|
||||||
|
|
||||||
|
|
||||||
|
Section 7 -- Other Terms and Conditions.
|
||||||
|
|
||||||
|
a. The Licensor shall not be bound by any additional or different
|
||||||
|
terms or conditions communicated by You unless expressly agreed.
|
||||||
|
|
||||||
|
b. Any arrangements, understandings, or agreements regarding the
|
||||||
|
Licensed Material not stated herein are separate from and
|
||||||
|
independent of the terms and conditions of this Public License.
|
||||||
|
|
||||||
|
|
||||||
|
Section 8 -- Interpretation.
|
||||||
|
|
||||||
|
a. For the avoidance of doubt, this Public License does not, and
|
||||||
|
shall not be interpreted to, reduce, limit, restrict, or impose
|
||||||
|
conditions on any use of the Licensed Material that could lawfully
|
||||||
|
be made without permission under this Public License.
|
||||||
|
|
||||||
|
b. To the extent possible, if any provision of this Public License is
|
||||||
|
deemed unenforceable, it shall be automatically reformed to the
|
||||||
|
minimum extent necessary to make it enforceable. If the provision
|
||||||
|
cannot be reformed, it shall be severed from this Public License
|
||||||
|
without affecting the enforceability of the remaining terms and
|
||||||
|
conditions.
|
||||||
|
|
||||||
|
c. No term or condition of this Public License will be waived and no
|
||||||
|
failure to comply consented to unless expressly agreed to by the
|
||||||
|
Licensor.
|
||||||
|
|
||||||
|
d. Nothing in this Public License constitutes or may be interpreted
|
||||||
|
as a limitation upon, or waiver of, any privileges and immunities
|
||||||
|
that apply to the Licensor or You, including from the legal
|
||||||
|
processes of any jurisdiction or authority.
|
||||||
|
|
||||||
|
|
||||||
|
=======================================================================
|
||||||
|
|
||||||
|
Creative Commons is not a party to its public
|
||||||
|
licenses. Notwithstanding, Creative Commons may elect to apply one of
|
||||||
|
its public licenses to material it publishes and in those instances
|
||||||
|
will be considered the “Licensor.” The text of the Creative Commons
|
||||||
|
public licenses is dedicated to the public domain under the CC0 Public
|
||||||
|
Domain Dedication. Except for the limited purpose of indicating that
|
||||||
|
material is shared under a Creative Commons public license or as
|
||||||
|
otherwise permitted by the Creative Commons policies published at
|
||||||
|
creativecommons.org/policies, Creative Commons does not authorize the
|
||||||
|
use of the trademark "Creative Commons" or any other trademark or logo
|
||||||
|
of Creative Commons without its prior written consent including,
|
||||||
|
without limitation, in connection with any unauthorized modifications
|
||||||
|
to any of its public licenses or any other arrangements,
|
||||||
|
understandings, or agreements concerning use of licensed material. For
|
||||||
|
the avoidance of doubt, this paragraph does not form part of the
|
||||||
|
public licenses.
|
||||||
|
|
||||||
|
Creative Commons may be contacted at creativecommons.org.
|
16
CHANGELOG.md
16
CHANGELOG.md
|
@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||||
|
|
||||||
|
## Unreleased
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Renamed `:await_up_timeout` in `:connections_pool` namespace to `:connect_timeout`, old name is deprecated.
|
||||||
|
- Renamed `:timeout` in `pools` namespace to `:recv_timeout`, old name is deprecated.
|
||||||
|
|
||||||
|
### Removed
|
||||||
|
|
||||||
|
- **Breaking:** `Pleroma.Workers.Cron.StatsWorker` setting from Oban `:crontab` (moved to a simpler implementation).
|
||||||
|
- **Breaking:** `Pleroma.Workers.Cron.ClearOauthTokenWorker` setting from Oban `:crontab` (moved to scheduled jobs).
|
||||||
|
- **Breaking:** `Pleroma.Workers.Cron.PurgeExpiredActivitiesWorker` setting from Oban `:crontab` (moved to scheduled jobs).
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Minimum lifetime for ephmeral activities changed to 10 minutes and made configurable (`:min_lifetime` option).
|
||||||
|
|
||||||
## [2.1.1] - 2020-09-08
|
## [2.1.1] - 2020-09-08
|
||||||
|
|
||||||
### Security
|
### Security
|
||||||
|
|
|
@ -31,7 +31,7 @@ LABEL maintainer="ops@pleroma.social" \
|
||||||
ARG HOME=/opt/pleroma
|
ARG HOME=/opt/pleroma
|
||||||
ARG DATA=/var/lib/pleroma
|
ARG DATA=/var/lib/pleroma
|
||||||
|
|
||||||
RUN echo "http://nl.alpinelinux.org/alpine/latest-stable/community" >> /etc/apk/repositories &&\
|
RUN echo "https://nl.alpinelinux.org/alpine/latest-stable/community" >> /etc/apk/repositories &&\
|
||||||
apk update &&\
|
apk update &&\
|
||||||
apk add exiftool imagemagick ncurses postgresql-client &&\
|
apk add exiftool imagemagick ncurses postgresql-client &&\
|
||||||
adduser --system --shell /bin/false --home ${HOME} pleroma &&\
|
adduser --system --shell /bin/false --home ${HOME} pleroma &&\
|
||||||
|
|
|
@ -6,7 +6,7 @@ Currently, Pleroma offers bugfixes and security patches only for the latest mino
|
||||||
|
|
||||||
| Version | Support
|
| Version | Support
|
||||||
|---------| --------
|
|---------| --------
|
||||||
| 2.0 | Bugfixes and security patches
|
| 2.1 | Bugfixes and security patches
|
||||||
|
|
||||||
## Reporting a vulnerability
|
## Reporting a vulnerability
|
||||||
|
|
||||||
|
|
|
@ -530,6 +530,7 @@ config :pleroma, Oban,
|
||||||
log: false,
|
log: false,
|
||||||
queues: [
|
queues: [
|
||||||
activity_expiration: 10,
|
activity_expiration: 10,
|
||||||
|
token_expiration: 5,
|
||||||
federator_incoming: 50,
|
federator_incoming: 50,
|
||||||
federator_outgoing: 50,
|
federator_outgoing: 50,
|
||||||
web_push: 50,
|
web_push: 50,
|
||||||
|
@ -543,9 +544,6 @@ config :pleroma, Oban,
|
||||||
],
|
],
|
||||||
plugins: [Oban.Plugins.Pruner],
|
plugins: [Oban.Plugins.Pruner],
|
||||||
crontab: [
|
crontab: [
|
||||||
{"0 0 * * *", Pleroma.Workers.Cron.ClearOauthTokenWorker},
|
|
||||||
{"0 * * * *", Pleroma.Workers.Cron.StatsWorker},
|
|
||||||
{"* * * * *", Pleroma.Workers.Cron.PurgeExpiredActivitiesWorker},
|
|
||||||
{"0 0 * * 0", Pleroma.Workers.Cron.DigestEmailsWorker},
|
{"0 0 * * 0", Pleroma.Workers.Cron.DigestEmailsWorker},
|
||||||
{"0 0 * * *", Pleroma.Workers.Cron.NewUsersDigestWorker}
|
{"0 0 * * *", Pleroma.Workers.Cron.NewUsersDigestWorker}
|
||||||
]
|
]
|
||||||
|
@ -656,7 +654,7 @@ config :pleroma, :rate_limit,
|
||||||
account_confirmation_resend: {8_640_000, 5},
|
account_confirmation_resend: {8_640_000, 5},
|
||||||
ap_routes: {60_000, 15}
|
ap_routes: {60_000, 15}
|
||||||
|
|
||||||
config :pleroma, Pleroma.ActivityExpiration, enabled: true
|
config :pleroma, Pleroma.Workers.PurgeExpiredActivity, enabled: true, min_lifetime: 600
|
||||||
|
|
||||||
config :pleroma, Pleroma.Plugs.RemoteIp, enabled: true
|
config :pleroma, Pleroma.Plugs.RemoteIp, enabled: true
|
||||||
|
|
||||||
|
@ -734,28 +732,28 @@ config :pleroma, :connections_pool,
|
||||||
max_connections: 250,
|
max_connections: 250,
|
||||||
max_idle_time: 30_000,
|
max_idle_time: 30_000,
|
||||||
retry: 0,
|
retry: 0,
|
||||||
await_up_timeout: 5_000
|
connect_timeout: 5_000
|
||||||
|
|
||||||
config :pleroma, :pools,
|
config :pleroma, :pools,
|
||||||
federation: [
|
federation: [
|
||||||
size: 50,
|
size: 50,
|
||||||
max_waiting: 10,
|
max_waiting: 10,
|
||||||
timeout: 10_000
|
recv_timeout: 10_000
|
||||||
],
|
],
|
||||||
media: [
|
media: [
|
||||||
size: 50,
|
size: 50,
|
||||||
max_waiting: 10,
|
max_waiting: 10,
|
||||||
timeout: 10_000
|
recv_timeout: 10_000
|
||||||
],
|
],
|
||||||
upload: [
|
upload: [
|
||||||
size: 25,
|
size: 25,
|
||||||
max_waiting: 5,
|
max_waiting: 5,
|
||||||
timeout: 15_000
|
recv_timeout: 15_000
|
||||||
],
|
],
|
||||||
default: [
|
default: [
|
||||||
size: 10,
|
size: 10,
|
||||||
max_waiting: 2,
|
max_waiting: 2,
|
||||||
timeout: 5_000
|
recv_timeout: 5_000
|
||||||
]
|
]
|
||||||
|
|
||||||
config :pleroma, :hackney_pools,
|
config :pleroma, :hackney_pools,
|
||||||
|
|
|
@ -2290,9 +2290,6 @@ config :pleroma, :config_description, [
|
||||||
type: {:list, :tuple},
|
type: {:list, :tuple},
|
||||||
description: "Settings for cron background jobs",
|
description: "Settings for cron background jobs",
|
||||||
suggestions: [
|
suggestions: [
|
||||||
{"0 0 * * *", Pleroma.Workers.Cron.ClearOauthTokenWorker},
|
|
||||||
{"0 * * * *", Pleroma.Workers.Cron.StatsWorker},
|
|
||||||
{"* * * * *", Pleroma.Workers.Cron.PurgeExpiredActivitiesWorker},
|
|
||||||
{"0 0 * * 0", Pleroma.Workers.Cron.DigestEmailsWorker},
|
{"0 0 * * 0", Pleroma.Workers.Cron.DigestEmailsWorker},
|
||||||
{"0 0 * * *", Pleroma.Workers.Cron.NewUsersDigestWorker}
|
{"0 0 * * *", Pleroma.Workers.Cron.NewUsersDigestWorker}
|
||||||
]
|
]
|
||||||
|
@ -2475,14 +2472,20 @@ config :pleroma, :config_description, [
|
||||||
},
|
},
|
||||||
%{
|
%{
|
||||||
group: :pleroma,
|
group: :pleroma,
|
||||||
key: Pleroma.ActivityExpiration,
|
key: Pleroma.Workers.PurgeExpiredActivity,
|
||||||
type: :group,
|
type: :group,
|
||||||
description: "Expired activity settings",
|
description: "Expired activities settings",
|
||||||
children: [
|
children: [
|
||||||
%{
|
%{
|
||||||
key: :enabled,
|
key: :enabled,
|
||||||
type: :boolean,
|
type: :boolean,
|
||||||
description: "Whether expired activities will be sent to the job queue to be deleted"
|
description: "Enables expired activities addition & deletion"
|
||||||
|
},
|
||||||
|
%{
|
||||||
|
key: :min_lifetime,
|
||||||
|
type: :integer,
|
||||||
|
description: "Minimum lifetime for ephemeral activity (in seconds)",
|
||||||
|
suggestions: [600]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -3378,7 +3381,7 @@ config :pleroma, :config_description, [
|
||||||
suggestions: [250]
|
suggestions: [250]
|
||||||
},
|
},
|
||||||
%{
|
%{
|
||||||
key: :await_up_timeout,
|
key: :connect_timeout,
|
||||||
type: :integer,
|
type: :integer,
|
||||||
description: "Timeout while `gun` will wait until connection is up. Default: 5000ms.",
|
description: "Timeout while `gun` will wait until connection is up. Default: 5000ms.",
|
||||||
suggestions: [5000]
|
suggestions: [5000]
|
||||||
|
@ -3416,6 +3419,12 @@ config :pleroma, :config_description, [
|
||||||
description:
|
description:
|
||||||
"Maximum number of requests waiting for other requests to finish. After this number is reached, the pool will start returning errrors when a new request is made",
|
"Maximum number of requests waiting for other requests to finish. After this number is reached, the pool will start returning errrors when a new request is made",
|
||||||
suggestions: [10]
|
suggestions: [10]
|
||||||
|
},
|
||||||
|
%{
|
||||||
|
key: :recv_timeout,
|
||||||
|
type: :integer,
|
||||||
|
description: "Timeout for the pool while gun will wait for response",
|
||||||
|
suggestions: [10_000]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -114,8 +114,6 @@ config :pleroma, Pleroma.Plugs.RemoteIp, enabled: false
|
||||||
|
|
||||||
config :pleroma, Pleroma.Web.ApiSpec.CastAndValidate, strict: true
|
config :pleroma, Pleroma.Web.ApiSpec.CastAndValidate, strict: true
|
||||||
|
|
||||||
config :pleroma, :instances_favicons, enabled: false
|
|
||||||
|
|
||||||
config :pleroma, Pleroma.Uploaders.S3,
|
config :pleroma, Pleroma.Uploaders.S3,
|
||||||
bucket: nil,
|
bucket: nil,
|
||||||
streaming_enabled: true,
|
streaming_enabled: true,
|
||||||
|
|
|
@ -18,9 +18,10 @@ su pleroma -s $SHELL -lc "./bin/pleroma_ctl migrate"
|
||||||
|
|
||||||
1. Go to the working directory of Pleroma (default is `/opt/pleroma`)
|
1. Go to the working directory of Pleroma (default is `/opt/pleroma`)
|
||||||
2. Run `git pull`. This pulls the latest changes from upstream.
|
2. Run `git pull`. This pulls the latest changes from upstream.
|
||||||
3. Run `mix deps.get`. This pulls in any new dependencies.
|
3. Run `mix deps.get` [^1]. This pulls in any new dependencies.
|
||||||
4. Stop the Pleroma service.
|
4. Stop the Pleroma service.
|
||||||
5. Run `mix ecto.migrate`[^1]. This task performs database migrations, if there were any.
|
5. Run `mix ecto.migrate` [^1] [^2]. This task performs database migrations, if there were any.
|
||||||
6. Start the Pleroma service.
|
6. Start the Pleroma service.
|
||||||
|
|
||||||
[^1]: Prefix with `MIX_ENV=prod` to run it using the production config file.
|
[^1]: Depending on which install guide you followed (for example on Debian/Ubuntu), you want to run `mix` tasks as `pleroma` user by adding `sudo -Hu pleroma` before the command.
|
||||||
|
[^2]: Prefix with `MIX_ENV=prod` to run it using the production config file.
|
||||||
|
|
|
@ -115,6 +115,7 @@ To add configuration to your config file, you can copy it from the base config.
|
||||||
* `Pleroma.Web.ActivityPub.MRF.VocabularyPolicy`: Restricts activities to a configured set of vocabulary. (See [`:mrf_vocabulary`](#mrf_vocabulary)).
|
* `Pleroma.Web.ActivityPub.MRF.VocabularyPolicy`: Restricts activities to a configured set of vocabulary. (See [`:mrf_vocabulary`](#mrf_vocabulary)).
|
||||||
* `Pleroma.Web.ActivityPub.MRF.ObjectAgePolicy`: Rejects or delists posts based on their age when received. (See [`:mrf_object_age`](#mrf_object_age)).
|
* `Pleroma.Web.ActivityPub.MRF.ObjectAgePolicy`: Rejects or delists posts based on their age when received. (See [`:mrf_object_age`](#mrf_object_age)).
|
||||||
* `Pleroma.Web.ActivityPub.MRF.ActivityExpirationPolicy`: Sets a default expiration on all posts made by users of the local instance. Requires `Pleroma.ActivityExpiration` to be enabled for processing the scheduled delections.
|
* `Pleroma.Web.ActivityPub.MRF.ActivityExpirationPolicy`: Sets a default expiration on all posts made by users of the local instance. Requires `Pleroma.ActivityExpiration` to be enabled for processing the scheduled delections.
|
||||||
|
* `Pleroma.Web.ActivityPub.MRF.ForceBotUnlistedPolicy`: Makes all bot posts to disappear from public timelines.
|
||||||
* `transparency`: Make the content of your Message Rewrite Facility settings public (via nodeinfo).
|
* `transparency`: Make the content of your Message Rewrite Facility settings public (via nodeinfo).
|
||||||
* `transparency_exclusions`: Exclude specific instance names from MRF transparency. The use of the exclusions feature will be disclosed in nodeinfo as a boolean value.
|
* `transparency_exclusions`: Exclude specific instance names from MRF transparency. The use of the exclusions feature will be disclosed in nodeinfo as a boolean value.
|
||||||
|
|
||||||
|
@ -496,7 +497,7 @@ Settings for HTTP connection pool.
|
||||||
* `:connection_acquisition_wait` - Timeout to acquire a connection from pool.The total max time is this value multiplied by the number of retries.
|
* `:connection_acquisition_wait` - Timeout to acquire a connection from pool.The total max time is this value multiplied by the number of retries.
|
||||||
* `connection_acquisition_retries` - Number of attempts to acquire the connection from the pool if it is overloaded. Each attempt is timed `:connection_acquisition_wait` apart.
|
* `connection_acquisition_retries` - Number of attempts to acquire the connection from the pool if it is overloaded. Each attempt is timed `:connection_acquisition_wait` apart.
|
||||||
* `:max_connections` - Maximum number of connections in the pool.
|
* `:max_connections` - Maximum number of connections in the pool.
|
||||||
* `:await_up_timeout` - Timeout to connect to the host.
|
* `:connect_timeout` - Timeout to connect to the host.
|
||||||
* `:reclaim_multiplier` - Multiplied by `:max_connections` this will be the maximum number of idle connections that will be reclaimed in case the pool is overloaded.
|
* `:reclaim_multiplier` - Multiplied by `:max_connections` this will be the maximum number of idle connections that will be reclaimed in case the pool is overloaded.
|
||||||
|
|
||||||
### :pools
|
### :pools
|
||||||
|
@ -515,7 +516,7 @@ There are four pools used:
|
||||||
For each pool, the options are:
|
For each pool, the options are:
|
||||||
|
|
||||||
* `:size` - limit to how much requests can be concurrently executed.
|
* `:size` - limit to how much requests can be concurrently executed.
|
||||||
* `:timeout` - timeout while `gun` will wait for response
|
* `:recv_timeout` - timeout while `gun` will wait for response
|
||||||
* `:max_waiting` - limit to how much requests can be waiting for others to finish, after this is reached, subsequent requests will be dropped.
|
* `:max_waiting` - limit to how much requests can be waiting for others to finish, after this is reached, subsequent requests will be dropped.
|
||||||
|
|
||||||
## Captcha
|
## Captcha
|
||||||
|
@ -690,9 +691,8 @@ Pleroma has the following queues:
|
||||||
|
|
||||||
Pleroma has these periodic job workers:
|
Pleroma has these periodic job workers:
|
||||||
|
|
||||||
`Pleroma.Workers.Cron.ClearOauthTokenWorker` - a job worker to cleanup expired oauth tokens.
|
* `Pleroma.Workers.Cron.DigestEmailsWorker` - digest emails for users with new mentions and follows
|
||||||
|
* `Pleroma.Workers.Cron.NewUsersDigestWorker` - digest emails for admins with new registrations
|
||||||
Example:
|
|
||||||
|
|
||||||
```elixir
|
```elixir
|
||||||
config :pleroma, Oban,
|
config :pleroma, Oban,
|
||||||
|
@ -704,7 +704,8 @@ config :pleroma, Oban,
|
||||||
federator_outgoing: 50
|
federator_outgoing: 50
|
||||||
],
|
],
|
||||||
crontab: [
|
crontab: [
|
||||||
{"0 0 * * *", Pleroma.Workers.Cron.ClearOauthTokenWorker}
|
{"0 0 * * 0", Pleroma.Workers.Cron.DigestEmailsWorker},
|
||||||
|
{"0 0 * * *", Pleroma.Workers.Cron.NewUsersDigestWorker}
|
||||||
]
|
]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -971,7 +972,7 @@ Configure OAuth 2 provider capabilities:
|
||||||
|
|
||||||
* `token_expires_in` - The lifetime in seconds of the access token.
|
* `token_expires_in` - The lifetime in seconds of the access token.
|
||||||
* `issue_new_refresh_token` - Keeps old refresh token or generate new refresh token when to obtain an access token.
|
* `issue_new_refresh_token` - Keeps old refresh token or generate new refresh token when to obtain an access token.
|
||||||
* `clean_expired_tokens` - Enable a background job to clean expired oauth tokens. Defaults to `false`. Interval settings sets in configuration periodic jobs [`Oban.Cron`](#obancron)
|
* `clean_expired_tokens` - Enable a background job to clean expired oauth tokens. Defaults to `false`.
|
||||||
|
|
||||||
## Link parsing
|
## Link parsing
|
||||||
|
|
||||||
|
@ -1090,3 +1091,10 @@ config :pleroma, :frontends,
|
||||||
```
|
```
|
||||||
|
|
||||||
This would serve the frontend from the the folder at `$instance_static/frontends/pleroma/stable`. You have to copy the frontend into this folder yourself. You can choose the name and ref any way you like, but they will be used by mix tasks to automate installation in the future, the name referring to the project and the ref referring to a commit.
|
This would serve the frontend from the the folder at `$instance_static/frontends/pleroma/stable`. You have to copy the frontend into this folder yourself. You can choose the name and ref any way you like, but they will be used by mix tasks to automate installation in the future, the name referring to the project and the ref referring to a commit.
|
||||||
|
|
||||||
|
## Ephemeral activities (Pleroma.Workers.PurgeExpiredActivity)
|
||||||
|
|
||||||
|
Settings to enable and configure expiration for ephemeral activities
|
||||||
|
|
||||||
|
* `:enabled` - enables ephemeral activities creation
|
||||||
|
* `:min_lifetime` - minimum lifetime for ephemeral activities (in seconds). Default: 10 minutes.
|
||||||
|
|
|
@ -18,6 +18,7 @@ defmodule Mix.Pleroma do
|
||||||
@doc "Common functions to be reused in mix tasks"
|
@doc "Common functions to be reused in mix tasks"
|
||||||
def start_pleroma do
|
def start_pleroma do
|
||||||
Pleroma.Config.Holder.save_default()
|
Pleroma.Config.Holder.save_default()
|
||||||
|
Pleroma.Config.Oban.warn()
|
||||||
Application.put_env(:phoenix, :serve_endpoints, false, persistent: true)
|
Application.put_env(:phoenix, :serve_endpoints, false, persistent: true)
|
||||||
|
|
||||||
if Pleroma.Config.get(:env) != :test do
|
if Pleroma.Config.get(:env) != :test do
|
||||||
|
|
|
@ -91,20 +91,17 @@ defmodule Mix.Tasks.Pleroma.Benchmark do
|
||||||
"Without conn and without pool" => fn ->
|
"Without conn and without pool" => fn ->
|
||||||
{:ok, %Tesla.Env{}} =
|
{:ok, %Tesla.Env{}} =
|
||||||
Pleroma.HTTP.get("https://httpbin.org/stream-bytes/1500", [],
|
Pleroma.HTTP.get("https://httpbin.org/stream-bytes/1500", [],
|
||||||
adapter: [pool: :no_pool, receive_conn: false]
|
pool: :no_pool,
|
||||||
|
receive_conn: false
|
||||||
)
|
)
|
||||||
end,
|
end,
|
||||||
"Without conn and with pool" => fn ->
|
"Without conn and with pool" => fn ->
|
||||||
{:ok, %Tesla.Env{}} =
|
{:ok, %Tesla.Env{}} =
|
||||||
Pleroma.HTTP.get("https://httpbin.org/stream-bytes/1500", [],
|
Pleroma.HTTP.get("https://httpbin.org/stream-bytes/1500", [], receive_conn: false)
|
||||||
adapter: [receive_conn: false]
|
|
||||||
)
|
|
||||||
end,
|
end,
|
||||||
"With reused conn and without pool" => fn ->
|
"With reused conn and without pool" => fn ->
|
||||||
{:ok, %Tesla.Env{}} =
|
{:ok, %Tesla.Env{}} =
|
||||||
Pleroma.HTTP.get("https://httpbin.org/stream-bytes/1500", [],
|
Pleroma.HTTP.get("https://httpbin.org/stream-bytes/1500", [], pool: :no_pool)
|
||||||
adapter: [pool: :no_pool]
|
|
||||||
)
|
|
||||||
end,
|
end,
|
||||||
"With reused conn and with pool" => fn ->
|
"With reused conn and with pool" => fn ->
|
||||||
{:ok, %Tesla.Env{}} = Pleroma.HTTP.get("https://httpbin.org/stream-bytes/1500")
|
{:ok, %Tesla.Env{}} = Pleroma.HTTP.get("https://httpbin.org/stream-bytes/1500")
|
||||||
|
|
|
@ -133,8 +133,7 @@ defmodule Mix.Tasks.Pleroma.Database do
|
||||||
days = Pleroma.Config.get([:mrf_activity_expiration, :days], 365)
|
days = Pleroma.Config.get([:mrf_activity_expiration, :days], 365)
|
||||||
|
|
||||||
Pleroma.Activity
|
Pleroma.Activity
|
||||||
|> join(:left, [a], u in assoc(a, :expiration))
|
|> join(:inner, [a], o in Object,
|
||||||
|> join(:inner, [a, _u], o in Object,
|
|
||||||
on:
|
on:
|
||||||
fragment(
|
fragment(
|
||||||
"(?->>'id') = COALESCE((?)->'object'->> 'id', (?)->>'object')",
|
"(?->>'id') = COALESCE((?)->'object'->> 'id', (?)->>'object')",
|
||||||
|
@ -144,14 +143,20 @@ defmodule Mix.Tasks.Pleroma.Database do
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|> where(local: true)
|
|> where(local: true)
|
||||||
|> where([a, u], is_nil(u))
|
|
||||||
|> where([a], fragment("(? ->> 'type'::text) = 'Create'", a.data))
|
|> where([a], fragment("(? ->> 'type'::text) = 'Create'", a.data))
|
||||||
|> where([_a, _u, o], fragment("?->>'type' = 'Note'", o.data))
|
|> where([_a, o], fragment("?->>'type' = 'Note'", o.data))
|
||||||
|> Pleroma.RepoStreamer.chunk_stream(100)
|
|> Pleroma.RepoStreamer.chunk_stream(100)
|
||||||
|> Stream.each(fn activities ->
|
|> Stream.each(fn activities ->
|
||||||
Enum.each(activities, fn activity ->
|
Enum.each(activities, fn activity ->
|
||||||
expires_at = Timex.shift(activity.inserted_at, days: days)
|
expires_at =
|
||||||
Pleroma.ActivityExpiration.create(activity, expires_at, false)
|
activity.inserted_at
|
||||||
|
|> DateTime.from_naive!("Etc/UTC")
|
||||||
|
|> Timex.shift(days: days)
|
||||||
|
|
||||||
|
Pleroma.Workers.PurgeExpiredActivity.enqueue(%{
|
||||||
|
activity_id: activity.id,
|
||||||
|
expires_at: expires_at
|
||||||
|
})
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|> Stream.run()
|
|> Stream.run()
|
||||||
|
|
|
@ -183,7 +183,7 @@ defmodule Mix.Tasks.Pleroma.Emoji do
|
||||||
|
|
||||||
IO.puts("Downloading the pack and generating SHA256")
|
IO.puts("Downloading the pack and generating SHA256")
|
||||||
|
|
||||||
binary_archive = Tesla.get!(client(), src).body
|
{:ok, %{body: binary_archive}} = Pleroma.HTTP.get(src)
|
||||||
archive_sha = :crypto.hash(:sha256, binary_archive) |> Base.encode16()
|
archive_sha = :crypto.hash(:sha256, binary_archive) |> Base.encode16()
|
||||||
|
|
||||||
IO.puts("SHA256 is #{archive_sha}")
|
IO.puts("SHA256 is #{archive_sha}")
|
||||||
|
@ -252,7 +252,7 @@ defmodule Mix.Tasks.Pleroma.Emoji do
|
||||||
end
|
end
|
||||||
|
|
||||||
defp fetch("http" <> _ = from) do
|
defp fetch("http" <> _ = from) do
|
||||||
with {:ok, %{body: body}} <- Tesla.get(client(), from) do
|
with {:ok, %{body: body}} <- Pleroma.HTTP.get(from) do
|
||||||
{:ok, body}
|
{:ok, body}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -271,13 +271,5 @@ defmodule Mix.Tasks.Pleroma.Emoji do
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
defp client do
|
|
||||||
middleware = [
|
|
||||||
{Tesla.Middleware.FollowRedirects, [max_redirects: 3]}
|
|
||||||
]
|
|
||||||
|
|
||||||
Tesla.client(middleware)
|
|
||||||
end
|
|
||||||
|
|
||||||
defp default_manifest, do: Pleroma.Config.get!([:emoji, :default_manifest])
|
defp default_manifest, do: Pleroma.Config.get!([:emoji, :default_manifest])
|
||||||
end
|
end
|
||||||
|
|
|
@ -69,7 +69,7 @@ defmodule Mix.Tasks.Pleroma.Frontend do
|
||||||
|
|
||||||
fe_label = "#{frontend} (#{ref})"
|
fe_label = "#{frontend} (#{ref})"
|
||||||
|
|
||||||
tmp_dir = Path.join(dest, "tmp")
|
tmp_dir = Path.join([instance_static_dir, "frontends", "tmp"])
|
||||||
|
|
||||||
with {_, :ok} <-
|
with {_, :ok} <-
|
||||||
{:download_or_unzip, download_or_unzip(frontend_info, tmp_dir, options[:file])},
|
{:download_or_unzip, download_or_unzip(frontend_info, tmp_dir, options[:file])},
|
||||||
|
@ -124,9 +124,7 @@ defmodule Mix.Tasks.Pleroma.Frontend do
|
||||||
url = String.replace(frontend_info["build_url"], "${ref}", frontend_info["ref"])
|
url = String.replace(frontend_info["build_url"], "${ref}", frontend_info["ref"])
|
||||||
|
|
||||||
with {:ok, %{status: 200, body: zip_body}} <-
|
with {:ok, %{status: 200, body: zip_body}} <-
|
||||||
Pleroma.HTTP.get(url, [],
|
Pleroma.HTTP.get(url, [], pool: :media, recv_timeout: 120_000) do
|
||||||
adapter: [pool: :media, timeout: 120_000, recv_timeout: 120_000]
|
|
||||||
) do
|
|
||||||
unzip(zip_body, dest)
|
unzip(zip_body, dest)
|
||||||
else
|
else
|
||||||
e -> {:error, e}
|
e -> {:error, e}
|
||||||
|
@ -135,6 +133,7 @@ defmodule Mix.Tasks.Pleroma.Frontend do
|
||||||
|
|
||||||
defp install_frontend(frontend_info, source, dest) do
|
defp install_frontend(frontend_info, source, dest) do
|
||||||
from = frontend_info["build_dir"] || "dist"
|
from = frontend_info["build_dir"] || "dist"
|
||||||
|
File.rm_rf!(dest)
|
||||||
File.mkdir_p!(dest)
|
File.mkdir_p!(dest)
|
||||||
File.cp_r!(Path.join([source, from]), dest)
|
File.cp_r!(Path.join([source, from]), dest)
|
||||||
:ok
|
:ok
|
||||||
|
|
|
@ -7,7 +7,6 @@ defmodule Pleroma.Activity do
|
||||||
|
|
||||||
alias Pleroma.Activity
|
alias Pleroma.Activity
|
||||||
alias Pleroma.Activity.Queries
|
alias Pleroma.Activity.Queries
|
||||||
alias Pleroma.ActivityExpiration
|
|
||||||
alias Pleroma.Bookmark
|
alias Pleroma.Bookmark
|
||||||
alias Pleroma.Notification
|
alias Pleroma.Notification
|
||||||
alias Pleroma.Object
|
alias Pleroma.Object
|
||||||
|
@ -60,8 +59,6 @@ defmodule Pleroma.Activity do
|
||||||
# typical case.
|
# typical case.
|
||||||
has_one(:object, Object, on_delete: :nothing, foreign_key: :id)
|
has_one(:object, Object, on_delete: :nothing, foreign_key: :id)
|
||||||
|
|
||||||
has_one(:expiration, ActivityExpiration, on_delete: :delete_all)
|
|
||||||
|
|
||||||
timestamps()
|
timestamps()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -304,14 +301,14 @@ defmodule Pleroma.Activity do
|
||||||
|> Repo.all()
|
|> Repo.all()
|
||||||
end
|
end
|
||||||
|
|
||||||
def follow_requests_for_actor(%Pleroma.User{ap_id: ap_id}) do
|
def follow_requests_for_actor(%User{ap_id: ap_id}) do
|
||||||
ap_id
|
ap_id
|
||||||
|> Queries.by_object_id()
|
|> Queries.by_object_id()
|
||||||
|> Queries.by_type("Follow")
|
|> Queries.by_type("Follow")
|
||||||
|> where([a], fragment("? ->> 'state' = 'pending'", a.data))
|
|> where([a], fragment("? ->> 'state' = 'pending'", a.data))
|
||||||
end
|
end
|
||||||
|
|
||||||
def following_requests_for_actor(%Pleroma.User{ap_id: ap_id}) do
|
def following_requests_for_actor(%User{ap_id: ap_id}) do
|
||||||
Queries.by_type("Follow")
|
Queries.by_type("Follow")
|
||||||
|> where([a], fragment("?->>'state' = 'pending'", a.data))
|
|> where([a], fragment("?->>'state' = 'pending'", a.data))
|
||||||
|> where([a], a.actor == ^ap_id)
|
|> where([a], a.actor == ^ap_id)
|
||||||
|
|
|
@ -1,74 +0,0 @@
|
||||||
# Pleroma: A lightweight social networking server
|
|
||||||
# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
|
|
||||||
# SPDX-License-Identifier: AGPL-3.0-only
|
|
||||||
|
|
||||||
defmodule Pleroma.ActivityExpiration do
|
|
||||||
use Ecto.Schema
|
|
||||||
|
|
||||||
alias Pleroma.Activity
|
|
||||||
alias Pleroma.ActivityExpiration
|
|
||||||
alias Pleroma.Repo
|
|
||||||
|
|
||||||
import Ecto.Changeset
|
|
||||||
import Ecto.Query
|
|
||||||
|
|
||||||
@type t :: %__MODULE__{}
|
|
||||||
@min_activity_lifetime :timer.hours(1)
|
|
||||||
|
|
||||||
schema "activity_expirations" do
|
|
||||||
belongs_to(:activity, Activity, type: FlakeId.Ecto.CompatType)
|
|
||||||
field(:scheduled_at, :naive_datetime)
|
|
||||||
end
|
|
||||||
|
|
||||||
def changeset(%ActivityExpiration{} = expiration, attrs, validate_scheduled_at) do
|
|
||||||
expiration
|
|
||||||
|> cast(attrs, [:scheduled_at])
|
|
||||||
|> validate_required([:scheduled_at])
|
|
||||||
|> validate_scheduled_at(validate_scheduled_at)
|
|
||||||
end
|
|
||||||
|
|
||||||
def get_by_activity_id(activity_id) do
|
|
||||||
ActivityExpiration
|
|
||||||
|> where([exp], exp.activity_id == ^activity_id)
|
|
||||||
|> Repo.one()
|
|
||||||
end
|
|
||||||
|
|
||||||
def create(%Activity{} = activity, scheduled_at, validate_scheduled_at \\ true) do
|
|
||||||
%ActivityExpiration{activity_id: activity.id}
|
|
||||||
|> changeset(%{scheduled_at: scheduled_at}, validate_scheduled_at)
|
|
||||||
|> Repo.insert()
|
|
||||||
end
|
|
||||||
|
|
||||||
def due_expirations(offset \\ 0) do
|
|
||||||
naive_datetime =
|
|
||||||
NaiveDateTime.utc_now()
|
|
||||||
|> NaiveDateTime.add(offset, :millisecond)
|
|
||||||
|
|
||||||
ActivityExpiration
|
|
||||||
|> where([exp], exp.scheduled_at < ^naive_datetime)
|
|
||||||
|> limit(50)
|
|
||||||
|> preload(:activity)
|
|
||||||
|> Repo.all()
|
|
||||||
|> Enum.reject(fn %{activity: activity} ->
|
|
||||||
Activity.pinned_by_actor?(activity)
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
|
|
||||||
def validate_scheduled_at(changeset, false), do: changeset
|
|
||||||
|
|
||||||
def validate_scheduled_at(changeset, true) do
|
|
||||||
validate_change(changeset, :scheduled_at, fn _, scheduled_at ->
|
|
||||||
if not expires_late_enough?(scheduled_at) do
|
|
||||||
[scheduled_at: "an ephemeral activity must live for at least one hour"]
|
|
||||||
else
|
|
||||||
[]
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
|
|
||||||
def expires_late_enough?(scheduled_at) do
|
|
||||||
now = NaiveDateTime.utc_now()
|
|
||||||
diff = NaiveDateTime.diff(scheduled_at, now, :millisecond)
|
|
||||||
diff > @min_activity_lifetime
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -22,13 +22,18 @@ defmodule Pleroma.Application do
|
||||||
def repository, do: @repository
|
def repository, do: @repository
|
||||||
|
|
||||||
def user_agent do
|
def user_agent do
|
||||||
case Config.get([:http, :user_agent], :default) do
|
if Process.whereis(Pleroma.Web.Endpoint) do
|
||||||
:default ->
|
case Config.get([:http, :user_agent], :default) do
|
||||||
info = "#{Pleroma.Web.base_url()} <#{Config.get([:instance, :email], "")}>"
|
:default ->
|
||||||
named_version() <> "; " <> info
|
info = "#{Pleroma.Web.base_url()} <#{Config.get([:instance, :email], "")}>"
|
||||||
|
named_version() <> "; " <> info
|
||||||
|
|
||||||
custom ->
|
custom ->
|
||||||
custom
|
custom
|
||||||
|
end
|
||||||
|
else
|
||||||
|
# fallback, if endpoint is not started yet
|
||||||
|
"Pleroma Data Loader"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -39,9 +44,13 @@ defmodule Pleroma.Application do
|
||||||
# every time the application is restarted, so we disable module
|
# every time the application is restarted, so we disable module
|
||||||
# conflicts at runtime
|
# conflicts at runtime
|
||||||
Code.compiler_options(ignore_module_conflict: true)
|
Code.compiler_options(ignore_module_conflict: true)
|
||||||
|
# Disable warnings_as_errors at runtime, it breaks Phoenix live reload
|
||||||
|
# due to protocol consolidation warnings
|
||||||
|
Code.compiler_options(warnings_as_errors: false)
|
||||||
Pleroma.Telemetry.Logger.attach()
|
Pleroma.Telemetry.Logger.attach()
|
||||||
Config.Holder.save_default()
|
Config.Holder.save_default()
|
||||||
Pleroma.HTML.compile_scrubbers()
|
Pleroma.HTML.compile_scrubbers()
|
||||||
|
Pleroma.Config.Oban.warn()
|
||||||
Config.DeprecationWarnings.warn()
|
Config.DeprecationWarnings.warn()
|
||||||
Pleroma.Plugs.HTTPSecurityPlug.warn_if_disabled()
|
Pleroma.Plugs.HTTPSecurityPlug.warn_if_disabled()
|
||||||
Pleroma.ApplicationRequirements.verify!()
|
Pleroma.ApplicationRequirements.verify!()
|
||||||
|
|
|
@ -76,9 +76,7 @@ defmodule Pleroma.Chat do
|
||||||
def for_user_query(user_id) do
|
def for_user_query(user_id) do
|
||||||
from(c in Chat,
|
from(c in Chat,
|
||||||
where: c.user_id == ^user_id,
|
where: c.user_id == ^user_id,
|
||||||
order_by: [desc: c.updated_at],
|
order_by: [desc: c.updated_at]
|
||||||
inner_join: u in User,
|
|
||||||
on: u.ap_id == c.recipient
|
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -8,7 +8,7 @@ defmodule Pleroma.Config.DeprecationWarnings do
|
||||||
require Logger
|
require Logger
|
||||||
alias Pleroma.Config
|
alias Pleroma.Config
|
||||||
|
|
||||||
@type config_namespace() :: [atom()]
|
@type config_namespace() :: atom() | [atom()]
|
||||||
@type config_map() :: {config_namespace(), config_namespace(), String.t()}
|
@type config_map() :: {config_namespace(), config_namespace(), String.t()}
|
||||||
|
|
||||||
@mrf_config_map [
|
@mrf_config_map [
|
||||||
|
@ -56,6 +56,8 @@ defmodule Pleroma.Config.DeprecationWarnings do
|
||||||
check_old_mrf_config()
|
check_old_mrf_config()
|
||||||
check_media_proxy_whitelist_config()
|
check_media_proxy_whitelist_config()
|
||||||
check_welcome_message_config()
|
check_welcome_message_config()
|
||||||
|
check_gun_pool_options()
|
||||||
|
check_activity_expiration_config()
|
||||||
end
|
end
|
||||||
|
|
||||||
def check_welcome_message_config do
|
def check_welcome_message_config do
|
||||||
|
@ -115,4 +117,62 @@ defmodule Pleroma.Config.DeprecationWarnings do
|
||||||
""")
|
""")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def check_gun_pool_options do
|
||||||
|
pool_config = Config.get(:connections_pool)
|
||||||
|
|
||||||
|
if timeout = pool_config[:await_up_timeout] do
|
||||||
|
Logger.warn("""
|
||||||
|
!!!DEPRECATION WARNING!!!
|
||||||
|
Your config is using old setting name `await_up_timeout` instead of `connect_timeout`. Setting should work for now, but you are advised to change format to scheme with port to prevent possible issues later.
|
||||||
|
""")
|
||||||
|
|
||||||
|
Config.put(:connections_pool, Keyword.put_new(pool_config, :connect_timeout, timeout))
|
||||||
|
end
|
||||||
|
|
||||||
|
pools_configs = Config.get(:pools)
|
||||||
|
|
||||||
|
warning_preface = """
|
||||||
|
!!!DEPRECATION WARNING!!!
|
||||||
|
Your config is using old setting name `timeout` instead of `recv_timeout` in pool settings. Setting should work for now, but you are advised to change format to scheme with port to prevent possible issues later.
|
||||||
|
"""
|
||||||
|
|
||||||
|
updated_config =
|
||||||
|
Enum.reduce(pools_configs, [], fn {pool_name, config}, acc ->
|
||||||
|
if timeout = config[:timeout] do
|
||||||
|
Keyword.put(acc, pool_name, Keyword.put_new(config, :recv_timeout, timeout))
|
||||||
|
else
|
||||||
|
acc
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
if updated_config != [] do
|
||||||
|
pool_warnings =
|
||||||
|
updated_config
|
||||||
|
|> Keyword.keys()
|
||||||
|
|> Enum.map(fn pool_name ->
|
||||||
|
"\n* `:timeout` options in #{pool_name} pool is now `:recv_timeout`"
|
||||||
|
end)
|
||||||
|
|
||||||
|
Logger.warn(Enum.join([warning_preface | pool_warnings]))
|
||||||
|
|
||||||
|
Config.put(:pools, updated_config)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
@spec check_activity_expiration_config() :: :ok | nil
|
||||||
|
def check_activity_expiration_config do
|
||||||
|
warning_preface = """
|
||||||
|
!!!DEPRECATION WARNING!!!
|
||||||
|
Your config is using old namespace for activity expiration configuration. Setting should work for now, but you are advised to change to new namespace to prevent possible issues later:
|
||||||
|
"""
|
||||||
|
|
||||||
|
move_namespace_and_warn(
|
||||||
|
[
|
||||||
|
{Pleroma.ActivityExpiration, Pleroma.Workers.PurgeExpiredActivity,
|
||||||
|
"\n* `config :pleroma, Pleroma.ActivityExpiration` is now `config :pleroma, Pleroma.Workers.PurgeExpiredActivity`"}
|
||||||
|
],
|
||||||
|
warning_preface
|
||||||
|
)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
34
lib/pleroma/config/oban.ex
Normal file
34
lib/pleroma/config/oban.ex
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
defmodule Pleroma.Config.Oban do
|
||||||
|
require Logger
|
||||||
|
|
||||||
|
def warn do
|
||||||
|
oban_config = Pleroma.Config.get(Oban)
|
||||||
|
|
||||||
|
crontab =
|
||||||
|
[
|
||||||
|
Pleroma.Workers.Cron.StatsWorker,
|
||||||
|
Pleroma.Workers.Cron.PurgeExpiredActivitiesWorker,
|
||||||
|
Pleroma.Workers.Cron.ClearOauthTokenWorker
|
||||||
|
]
|
||||||
|
|> Enum.reduce(oban_config[:crontab], fn removed_worker, acc ->
|
||||||
|
with acc when is_list(acc) <- acc,
|
||||||
|
setting when is_tuple(setting) <-
|
||||||
|
Enum.find(acc, fn {_, worker} -> worker == removed_worker end) do
|
||||||
|
"""
|
||||||
|
!!!OBAN CONFIG WARNING!!!
|
||||||
|
You are using old workers in Oban crontab settings, which were removed.
|
||||||
|
Please, remove setting from crontab in your config file (prod.secret.exs): #{
|
||||||
|
inspect(setting)
|
||||||
|
}
|
||||||
|
"""
|
||||||
|
|> Logger.warn()
|
||||||
|
|
||||||
|
List.delete(acc, setting)
|
||||||
|
else
|
||||||
|
_ -> acc
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
Pleroma.Config.put(Oban, Keyword.put(oban_config, :crontab, crontab))
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,34 @@
|
||||||
|
# Pleroma: A lightweight social networking server
|
||||||
|
# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
|
||||||
|
# SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
|
defmodule Pleroma.EctoType.ActivityPub.ObjectValidators.Emoji do
|
||||||
|
use Ecto.Type
|
||||||
|
|
||||||
|
def type, do: :map
|
||||||
|
|
||||||
|
def cast(data) when is_map(data) do
|
||||||
|
has_invalid_emoji? =
|
||||||
|
Enum.find(data, fn
|
||||||
|
{name, uri} when is_binary(name) and is_binary(uri) ->
|
||||||
|
# based on ObjectValidators.Uri.cast()
|
||||||
|
case URI.parse(uri) do
|
||||||
|
%URI{host: nil} -> true
|
||||||
|
%URI{host: ""} -> true
|
||||||
|
%URI{scheme: scheme} when scheme in ["https", "http"] -> false
|
||||||
|
_ -> true
|
||||||
|
end
|
||||||
|
|
||||||
|
{_name, _uri} ->
|
||||||
|
true
|
||||||
|
end)
|
||||||
|
|
||||||
|
if has_invalid_emoji?, do: :error, else: {:ok, data}
|
||||||
|
end
|
||||||
|
|
||||||
|
def cast(_data), do: :error
|
||||||
|
|
||||||
|
def dump(data), do: {:ok, data}
|
||||||
|
|
||||||
|
def load(data), do: {:ok, data}
|
||||||
|
end
|
|
@ -13,7 +13,7 @@ defmodule Pleroma.Gun.Conn do
|
||||||
opts =
|
opts =
|
||||||
opts
|
opts
|
||||||
|> Enum.into(%{})
|
|> Enum.into(%{})
|
||||||
|> Map.put_new(:await_up_timeout, pool_opts[:await_up_timeout] || 5_000)
|
|> Map.put_new(:connect_timeout, pool_opts[:connect_timeout] || 5_000)
|
||||||
|> Map.put_new(:supervise, false)
|
|> Map.put_new(:supervise, false)
|
||||||
|> maybe_add_tls_opts(uri)
|
|> maybe_add_tls_opts(uri)
|
||||||
|
|
||||||
|
@ -50,10 +50,10 @@ defmodule Pleroma.Gun.Conn do
|
||||||
|
|
||||||
with open_opts <- Map.delete(opts, :tls_opts),
|
with open_opts <- Map.delete(opts, :tls_opts),
|
||||||
{:ok, conn} <- Gun.open(proxy_host, proxy_port, open_opts),
|
{:ok, conn} <- Gun.open(proxy_host, proxy_port, open_opts),
|
||||||
{:ok, _} <- Gun.await_up(conn, opts[:await_up_timeout]),
|
{:ok, protocol} <- Gun.await_up(conn, opts[:connect_timeout]),
|
||||||
stream <- Gun.connect(conn, connect_opts),
|
stream <- Gun.connect(conn, connect_opts),
|
||||||
{:response, :fin, 200, _} <- Gun.await(conn, stream) do
|
{:response, :fin, 200, _} <- Gun.await(conn, stream) do
|
||||||
{:ok, conn}
|
{:ok, conn, protocol}
|
||||||
else
|
else
|
||||||
error ->
|
error ->
|
||||||
Logger.warn(
|
Logger.warn(
|
||||||
|
@ -88,8 +88,8 @@ defmodule Pleroma.Gun.Conn do
|
||||||
|> Map.put(:socks_opts, socks_opts)
|
|> Map.put(:socks_opts, socks_opts)
|
||||||
|
|
||||||
with {:ok, conn} <- Gun.open(proxy_host, proxy_port, opts),
|
with {:ok, conn} <- Gun.open(proxy_host, proxy_port, opts),
|
||||||
{:ok, _} <- Gun.await_up(conn, opts[:await_up_timeout]) do
|
{:ok, protocol} <- Gun.await_up(conn, opts[:connect_timeout]) do
|
||||||
{:ok, conn}
|
{:ok, conn, protocol}
|
||||||
else
|
else
|
||||||
error ->
|
error ->
|
||||||
Logger.warn(
|
Logger.warn(
|
||||||
|
@ -106,8 +106,8 @@ defmodule Pleroma.Gun.Conn do
|
||||||
host = Pleroma.HTTP.AdapterHelper.parse_host(host)
|
host = Pleroma.HTTP.AdapterHelper.parse_host(host)
|
||||||
|
|
||||||
with {:ok, conn} <- Gun.open(host, port, opts),
|
with {:ok, conn} <- Gun.open(host, port, opts),
|
||||||
{:ok, _} <- Gun.await_up(conn, opts[:await_up_timeout]) do
|
{:ok, protocol} <- Gun.await_up(conn, opts[:connect_timeout]) do
|
||||||
{:ok, conn}
|
{:ok, conn, protocol}
|
||||||
else
|
else
|
||||||
error ->
|
error ->
|
||||||
Logger.warn(
|
Logger.warn(
|
||||||
|
|
|
@ -15,7 +15,7 @@ defmodule Pleroma.Gun.ConnectionPool.Worker do
|
||||||
|
|
||||||
@impl true
|
@impl true
|
||||||
def handle_continue({:connect, [key, uri, opts, client_pid]}, _) do
|
def handle_continue({:connect, [key, uri, opts, client_pid]}, _) do
|
||||||
with {:ok, conn_pid} <- Gun.Conn.open(uri, opts),
|
with {:ok, conn_pid, protocol} <- Gun.Conn.open(uri, opts),
|
||||||
Process.link(conn_pid) do
|
Process.link(conn_pid) do
|
||||||
time = :erlang.monotonic_time(:millisecond)
|
time = :erlang.monotonic_time(:millisecond)
|
||||||
|
|
||||||
|
@ -27,8 +27,12 @@ defmodule Pleroma.Gun.ConnectionPool.Worker do
|
||||||
send(client_pid, {:conn_pid, conn_pid})
|
send(client_pid, {:conn_pid, conn_pid})
|
||||||
|
|
||||||
{:noreply,
|
{:noreply,
|
||||||
%{key: key, timer: nil, client_monitors: %{client_pid => Process.monitor(client_pid)}},
|
%{
|
||||||
:hibernate}
|
key: key,
|
||||||
|
timer: nil,
|
||||||
|
client_monitors: %{client_pid => Process.monitor(client_pid)},
|
||||||
|
protocol: protocol
|
||||||
|
}, :hibernate}
|
||||||
else
|
else
|
||||||
err ->
|
err ->
|
||||||
{:stop, {:shutdown, err}, nil}
|
{:stop, {:shutdown, err}, nil}
|
||||||
|
@ -53,14 +57,20 @@ defmodule Pleroma.Gun.ConnectionPool.Worker do
|
||||||
end
|
end
|
||||||
|
|
||||||
@impl true
|
@impl true
|
||||||
def handle_call(:add_client, {client_pid, _}, %{key: key} = state) do
|
def handle_call(:add_client, {client_pid, _}, %{key: key, protocol: protocol} = state) do
|
||||||
time = :erlang.monotonic_time(:millisecond)
|
time = :erlang.monotonic_time(:millisecond)
|
||||||
|
|
||||||
{{conn_pid, _, _, _}, _} =
|
{{conn_pid, used_by, _, _}, _} =
|
||||||
Registry.update_value(@registry, key, fn {conn_pid, used_by, crf, last_reference} ->
|
Registry.update_value(@registry, key, fn {conn_pid, used_by, crf, last_reference} ->
|
||||||
{conn_pid, [client_pid | used_by], crf(time - last_reference, crf), time}
|
{conn_pid, [client_pid | used_by], crf(time - last_reference, crf), time}
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
:telemetry.execute(
|
||||||
|
[:pleroma, :connection_pool, :client, :add],
|
||||||
|
%{client_pid: client_pid, clients: used_by},
|
||||||
|
%{key: state.key, protocol: protocol}
|
||||||
|
)
|
||||||
|
|
||||||
state =
|
state =
|
||||||
if state.timer != nil do
|
if state.timer != nil do
|
||||||
Process.cancel_timer(state[:timer])
|
Process.cancel_timer(state[:timer])
|
||||||
|
@ -131,7 +141,7 @@ defmodule Pleroma.Gun.ConnectionPool.Worker do
|
||||||
@impl true
|
@impl true
|
||||||
def handle_info({:DOWN, _ref, :process, pid, reason}, state) do
|
def handle_info({:DOWN, _ref, :process, pid, reason}, state) do
|
||||||
:telemetry.execute(
|
:telemetry.execute(
|
||||||
[:pleroma, :connection_pool, :client_death],
|
[:pleroma, :connection_pool, :client, :dead],
|
||||||
%{client_pid: pid, reason: reason},
|
%{client_pid: pid, reason: reason},
|
||||||
%{key: state.key}
|
%{key: state.key}
|
||||||
)
|
)
|
||||||
|
|
|
@ -6,7 +6,7 @@ defmodule Pleroma.HTTP.AdapterHelper do
|
||||||
@moduledoc """
|
@moduledoc """
|
||||||
Configure Tesla.Client with default and customized adapter options.
|
Configure Tesla.Client with default and customized adapter options.
|
||||||
"""
|
"""
|
||||||
@defaults [pool: :federation]
|
@defaults [pool: :federation, connect_timeout: 5_000, recv_timeout: 5_000]
|
||||||
|
|
||||||
@type proxy_type() :: :socks4 | :socks5
|
@type proxy_type() :: :socks4 | :socks5
|
||||||
@type host() :: charlist() | :inet.ip_address()
|
@type host() :: charlist() | :inet.ip_address()
|
||||||
|
@ -19,7 +19,6 @@ defmodule Pleroma.HTTP.AdapterHelper do
|
||||||
| {Connection.proxy_type(), Connection.host(), pos_integer()}
|
| {Connection.proxy_type(), Connection.host(), pos_integer()}
|
||||||
|
|
||||||
@callback options(keyword(), URI.t()) :: keyword()
|
@callback options(keyword(), URI.t()) :: keyword()
|
||||||
@callback get_conn(URI.t(), keyword()) :: {:ok, term()} | {:error, term()}
|
|
||||||
|
|
||||||
@spec format_proxy(String.t() | tuple() | nil) :: proxy() | nil
|
@spec format_proxy(String.t() | tuple() | nil) :: proxy() | nil
|
||||||
def format_proxy(nil), do: nil
|
def format_proxy(nil), do: nil
|
||||||
|
@ -47,9 +46,6 @@ defmodule Pleroma.HTTP.AdapterHelper do
|
||||||
|> adapter_helper().options(uri)
|
|> adapter_helper().options(uri)
|
||||||
end
|
end
|
||||||
|
|
||||||
@spec get_conn(URI.t(), keyword()) :: {:ok, keyword()} | {:error, atom()}
|
|
||||||
def get_conn(uri, opts), do: adapter_helper().get_conn(uri, opts)
|
|
||||||
|
|
||||||
defp adapter, do: Application.get_env(:tesla, :adapter)
|
defp adapter, do: Application.get_env(:tesla, :adapter)
|
||||||
|
|
||||||
defp adapter_helper do
|
defp adapter_helper do
|
||||||
|
|
|
@ -6,18 +6,13 @@ defmodule Pleroma.HTTP.AdapterHelper.Gun do
|
||||||
@behaviour Pleroma.HTTP.AdapterHelper
|
@behaviour Pleroma.HTTP.AdapterHelper
|
||||||
|
|
||||||
alias Pleroma.Config
|
alias Pleroma.Config
|
||||||
alias Pleroma.Gun.ConnectionPool
|
|
||||||
alias Pleroma.HTTP.AdapterHelper
|
alias Pleroma.HTTP.AdapterHelper
|
||||||
|
|
||||||
require Logger
|
require Logger
|
||||||
|
|
||||||
@defaults [
|
@defaults [
|
||||||
connect_timeout: 5_000,
|
|
||||||
domain_lookup_timeout: 5_000,
|
|
||||||
tls_handshake_timeout: 5_000,
|
|
||||||
retry: 1,
|
retry: 1,
|
||||||
retry_timeout: 1000,
|
retry_timeout: 1_000
|
||||||
await_up_timeout: 5_000
|
|
||||||
]
|
]
|
||||||
|
|
||||||
@type pool() :: :federation | :upload | :media | :default
|
@type pool() :: :federation | :upload | :media | :default
|
||||||
|
@ -46,23 +41,17 @@ defmodule Pleroma.HTTP.AdapterHelper.Gun do
|
||||||
end
|
end
|
||||||
|
|
||||||
defp put_timeout(opts) do
|
defp put_timeout(opts) do
|
||||||
|
{recv_timeout, opts} = Keyword.pop(opts, :recv_timeout, pool_timeout(opts[:pool]))
|
||||||
# this is the timeout to receive a message from Gun
|
# this is the timeout to receive a message from Gun
|
||||||
Keyword.put_new(opts, :timeout, pool_timeout(opts[:pool]))
|
# `:timeout` key is used in Tesla
|
||||||
|
Keyword.put(opts, :timeout, recv_timeout)
|
||||||
end
|
end
|
||||||
|
|
||||||
@spec pool_timeout(pool()) :: non_neg_integer()
|
@spec pool_timeout(pool()) :: non_neg_integer()
|
||||||
def pool_timeout(pool) do
|
def pool_timeout(pool) do
|
||||||
default = Config.get([:pools, :default, :timeout], 5_000)
|
default = Config.get([:pools, :default, :recv_timeout], 5_000)
|
||||||
|
|
||||||
Config.get([:pools, pool, :timeout], default)
|
Config.get([:pools, pool, :recv_timeout], default)
|
||||||
end
|
|
||||||
|
|
||||||
@spec get_conn(URI.t(), keyword()) :: {:ok, keyword()} | {:error, atom()}
|
|
||||||
def get_conn(uri, opts) do
|
|
||||||
case ConnectionPool.get_conn(uri, opts) do
|
|
||||||
{:ok, conn_pid} -> {:ok, Keyword.merge(opts, conn: conn_pid, close_conn: false)}
|
|
||||||
err -> err
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@prefix Pleroma.Gun.ConnectionPool
|
@prefix Pleroma.Gun.ConnectionPool
|
||||||
|
|
|
@ -2,11 +2,8 @@ defmodule Pleroma.HTTP.AdapterHelper.Hackney do
|
||||||
@behaviour Pleroma.HTTP.AdapterHelper
|
@behaviour Pleroma.HTTP.AdapterHelper
|
||||||
|
|
||||||
@defaults [
|
@defaults [
|
||||||
connect_timeout: 10_000,
|
|
||||||
recv_timeout: 20_000,
|
|
||||||
follow_redirect: true,
|
follow_redirect: true,
|
||||||
force_redirect: true,
|
force_redirect: true
|
||||||
pool: :federation
|
|
||||||
]
|
]
|
||||||
|
|
||||||
@spec options(keyword(), URI.t()) :: keyword()
|
@spec options(keyword(), URI.t()) :: keyword()
|
||||||
|
@ -19,6 +16,7 @@ defmodule Pleroma.HTTP.AdapterHelper.Hackney do
|
||||||
|> Keyword.merge(config_opts)
|
|> Keyword.merge(config_opts)
|
||||||
|> Keyword.merge(connection_opts)
|
|> Keyword.merge(connection_opts)
|
||||||
|> add_scheme_opts(uri)
|
|> add_scheme_opts(uri)
|
||||||
|
|> maybe_add_with_body()
|
||||||
|> Pleroma.HTTP.AdapterHelper.maybe_add_proxy(proxy)
|
|> Pleroma.HTTP.AdapterHelper.maybe_add_proxy(proxy)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -28,6 +26,11 @@ defmodule Pleroma.HTTP.AdapterHelper.Hackney do
|
||||||
|
|
||||||
defp add_scheme_opts(opts, _), do: opts
|
defp add_scheme_opts(opts, _), do: opts
|
||||||
|
|
||||||
@spec get_conn(URI.t(), keyword()) :: {:ok, keyword()}
|
defp maybe_add_with_body(opts) do
|
||||||
def get_conn(_uri, opts), do: {:ok, opts}
|
if opts[:max_body] do
|
||||||
|
Keyword.put(opts, :with_body, true)
|
||||||
|
else
|
||||||
|
opts
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -11,7 +11,7 @@ defmodule Pleroma.HTTP.ExAws do
|
||||||
|
|
||||||
@impl true
|
@impl true
|
||||||
def request(method, url, body \\ "", headers \\ [], http_opts \\ []) do
|
def request(method, url, body \\ "", headers \\ [], http_opts \\ []) do
|
||||||
http_opts = Keyword.put_new(http_opts, :adapter, pool: :upload)
|
http_opts = Keyword.put_new(http_opts, :pool, :upload)
|
||||||
|
|
||||||
case HTTP.request(method, url, body, headers, http_opts) do
|
case HTTP.request(method, url, body, headers, http_opts) do
|
||||||
{:ok, env} ->
|
{:ok, env} ->
|
||||||
|
|
|
@ -60,30 +60,23 @@ defmodule Pleroma.HTTP do
|
||||||
{:ok, Env.t()} | {:error, any()}
|
{:ok, Env.t()} | {:error, any()}
|
||||||
def request(method, url, body, headers, options) when is_binary(url) do
|
def request(method, url, body, headers, options) when is_binary(url) do
|
||||||
uri = URI.parse(url)
|
uri = URI.parse(url)
|
||||||
adapter_opts = AdapterHelper.options(uri, options[:adapter] || [])
|
adapter_opts = AdapterHelper.options(uri, options || [])
|
||||||
|
|
||||||
case AdapterHelper.get_conn(uri, adapter_opts) do
|
options = put_in(options[:adapter], adapter_opts)
|
||||||
{:ok, adapter_opts} ->
|
params = options[:params] || []
|
||||||
options = put_in(options[:adapter], adapter_opts)
|
request = build_request(method, headers, options, url, body, params)
|
||||||
params = options[:params] || []
|
|
||||||
request = build_request(method, headers, options, url, body, params)
|
|
||||||
|
|
||||||
adapter = Application.get_env(:tesla, :adapter)
|
adapter = Application.get_env(:tesla, :adapter)
|
||||||
|
|
||||||
client = Tesla.client(adapter_middlewares(adapter), adapter)
|
client = Tesla.client(adapter_middlewares(adapter), adapter)
|
||||||
|
|
||||||
maybe_limit(
|
maybe_limit(
|
||||||
fn ->
|
fn ->
|
||||||
request(client, request)
|
request(client, request)
|
||||||
end,
|
end,
|
||||||
adapter,
|
adapter,
|
||||||
adapter_opts
|
adapter_opts
|
||||||
)
|
)
|
||||||
|
|
||||||
# Connection release is handled in a custom FollowRedirects middleware
|
|
||||||
err ->
|
|
||||||
err
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@spec request(Client.t(), keyword()) :: {:ok, Env.t()} | {:error, any()}
|
@spec request(Client.t(), keyword()) :: {:ok, Env.t()} | {:error, any()}
|
||||||
|
@ -110,7 +103,7 @@ defmodule Pleroma.HTTP do
|
||||||
end
|
end
|
||||||
|
|
||||||
defp adapter_middlewares(Tesla.Adapter.Gun) do
|
defp adapter_middlewares(Tesla.Adapter.Gun) do
|
||||||
[Pleroma.HTTP.Middleware.FollowRedirects]
|
[Tesla.Middleware.FollowRedirects, Pleroma.Tesla.Middleware.ConnectionPool]
|
||||||
end
|
end
|
||||||
|
|
||||||
defp adapter_middlewares(_), do: []
|
defp adapter_middlewares(_), do: []
|
||||||
|
|
|
@ -11,7 +11,7 @@ defmodule Pleroma.HTTP.Tzdata do
|
||||||
|
|
||||||
@impl true
|
@impl true
|
||||||
def get(url, headers, options) do
|
def get(url, headers, options) do
|
||||||
options = Keyword.put_new(options, :adapter, pool: :default)
|
options = Keyword.put_new(options, :pool, :default)
|
||||||
|
|
||||||
with {:ok, %Tesla.Env{} = env} <- HTTP.get(url, headers, options) do
|
with {:ok, %Tesla.Env{} = env} <- HTTP.get(url, headers, options) do
|
||||||
{:ok, {env.status, env.headers, env.body}}
|
{:ok, {env.status, env.headers, env.body}}
|
||||||
|
@ -20,7 +20,7 @@ defmodule Pleroma.HTTP.Tzdata do
|
||||||
|
|
||||||
@impl true
|
@impl true
|
||||||
def head(url, headers, options) do
|
def head(url, headers, options) do
|
||||||
options = Keyword.put_new(options, :adapter, pool: :default)
|
options = Keyword.put_new(options, :pool, :default)
|
||||||
|
|
||||||
with {:ok, %Tesla.Env{} = env} <- HTTP.head(url, headers, options) do
|
with {:ok, %Tesla.Env{} = env} <- HTTP.head(url, headers, options) do
|
||||||
{:ok, {env.status, env.headers}}
|
{:ok, {env.status, env.headers}}
|
||||||
|
|
|
@ -159,13 +159,11 @@ defmodule Pleroma.Instances.Instance do
|
||||||
Pleroma.HTTP.get(to_string(instance_uri), [{"accept", "text/html"}],
|
Pleroma.HTTP.get(to_string(instance_uri), [{"accept", "text/html"}],
|
||||||
adapter: [pool: :media]
|
adapter: [pool: :media]
|
||||||
),
|
),
|
||||||
favicon_rel <-
|
{_, [favicon_rel | _]} when is_binary(favicon_rel) <-
|
||||||
html
|
{:parse,
|
||||||
|> Floki.parse_document!()
|
html |> Floki.parse_document!() |> Floki.attribute("link[rel=icon]", "href")},
|
||||||
|> Floki.attribute("link[rel=icon]", "href")
|
{_, favicon} when is_binary(favicon) <-
|
||||||
|> List.first(),
|
{:merge, URI.merge(instance_uri, favicon_rel) |> to_string()} do
|
||||||
favicon <- URI.merge(instance_uri, favicon_rel) |> to_string(),
|
|
||||||
true <- is_binary(favicon) do
|
|
||||||
favicon
|
favicon
|
||||||
else
|
else
|
||||||
_ -> nil
|
_ -> nil
|
||||||
|
|
|
@ -10,10 +10,11 @@ defmodule Pleroma.MFA.Token do
|
||||||
alias Pleroma.Repo
|
alias Pleroma.Repo
|
||||||
alias Pleroma.User
|
alias Pleroma.User
|
||||||
alias Pleroma.Web.OAuth.Authorization
|
alias Pleroma.Web.OAuth.Authorization
|
||||||
alias Pleroma.Web.OAuth.Token, as: OAuthToken
|
|
||||||
|
|
||||||
@expires 300
|
@expires 300
|
||||||
|
|
||||||
|
@type t() :: %__MODULE__{}
|
||||||
|
|
||||||
schema "mfa_tokens" do
|
schema "mfa_tokens" do
|
||||||
field(:token, :string)
|
field(:token, :string)
|
||||||
field(:valid_until, :naive_datetime_usec)
|
field(:valid_until, :naive_datetime_usec)
|
||||||
|
@ -24,6 +25,7 @@ defmodule Pleroma.MFA.Token do
|
||||||
timestamps()
|
timestamps()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@spec get_by_token(String.t()) :: {:ok, t()} | {:error, :not_found}
|
||||||
def get_by_token(token) do
|
def get_by_token(token) do
|
||||||
from(
|
from(
|
||||||
t in __MODULE__,
|
t in __MODULE__,
|
||||||
|
@ -33,33 +35,40 @@ defmodule Pleroma.MFA.Token do
|
||||||
|> Repo.find_resource()
|
|> Repo.find_resource()
|
||||||
end
|
end
|
||||||
|
|
||||||
def validate(token) do
|
@spec validate(String.t()) :: {:ok, t()} | {:error, :not_found} | {:error, :expired_token}
|
||||||
with {:fetch_token, {:ok, token}} <- {:fetch_token, get_by_token(token)},
|
def validate(token_str) do
|
||||||
{:expired, false} <- {:expired, is_expired?(token)} do
|
with {:ok, token} <- get_by_token(token_str),
|
||||||
|
false <- expired?(token) do
|
||||||
{:ok, token}
|
{:ok, token}
|
||||||
else
|
|
||||||
{:expired, _} -> {:error, :expired_token}
|
|
||||||
{:fetch_token, _} -> {:error, :not_found}
|
|
||||||
error -> {:error, error}
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def create_token(%User{} = user) do
|
defp expired?(%__MODULE__{valid_until: valid_until}) do
|
||||||
%__MODULE__{}
|
with true <- NaiveDateTime.diff(NaiveDateTime.utc_now(), valid_until) > 0 do
|
||||||
|> change
|
{:error, :expired_token}
|
||||||
|> assign_user(user)
|
end
|
||||||
|> put_token
|
|
||||||
|> put_valid_until
|
|
||||||
|> Repo.insert()
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def create_token(user, authorization) do
|
@spec create(User.t(), Authorization.t() | nil) :: {:ok, t()} | {:error, Ecto.Changeset.t()}
|
||||||
|
def create(user, authorization \\ nil) do
|
||||||
|
with {:ok, token} <- do_create(user, authorization) do
|
||||||
|
Pleroma.Workers.PurgeExpiredToken.enqueue(%{
|
||||||
|
token_id: token.id,
|
||||||
|
valid_until: DateTime.from_naive!(token.valid_until, "Etc/UTC"),
|
||||||
|
mod: __MODULE__
|
||||||
|
})
|
||||||
|
|
||||||
|
{:ok, token}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
defp do_create(user, authorization) do
|
||||||
%__MODULE__{}
|
%__MODULE__{}
|
||||||
|> change
|
|> change()
|
||||||
|> assign_user(user)
|
|> assign_user(user)
|
||||||
|> assign_authorization(authorization)
|
|> maybe_assign_authorization(authorization)
|
||||||
|> put_token
|
|> put_token()
|
||||||
|> put_valid_until
|
|> put_valid_until()
|
||||||
|> Repo.insert()
|
|> Repo.insert()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -69,15 +78,19 @@ defmodule Pleroma.MFA.Token do
|
||||||
|> validate_required([:user])
|
|> validate_required([:user])
|
||||||
end
|
end
|
||||||
|
|
||||||
defp assign_authorization(changeset, authorization) do
|
defp maybe_assign_authorization(changeset, %Authorization{} = authorization) do
|
||||||
changeset
|
changeset
|
||||||
|> put_assoc(:authorization, authorization)
|
|> put_assoc(:authorization, authorization)
|
||||||
|> validate_required([:authorization])
|
|> validate_required([:authorization])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
defp maybe_assign_authorization(changeset, _), do: changeset
|
||||||
|
|
||||||
defp put_token(changeset) do
|
defp put_token(changeset) do
|
||||||
|
token = Pleroma.Web.OAuth.Token.Utils.generate_token()
|
||||||
|
|
||||||
changeset
|
changeset
|
||||||
|> change(%{token: OAuthToken.Utils.generate_token()})
|
|> change(%{token: token})
|
||||||
|> validate_required([:token])
|
|> validate_required([:token])
|
||||||
|> unique_constraint(:token)
|
|> unique_constraint(:token)
|
||||||
end
|
end
|
||||||
|
@ -89,18 +102,4 @@ defmodule Pleroma.MFA.Token do
|
||||||
|> change(%{valid_until: expires_in})
|
|> change(%{valid_until: expires_in})
|
||||||
|> validate_required([:valid_until])
|
|> validate_required([:valid_until])
|
||||||
end
|
end
|
||||||
|
|
||||||
def is_expired?(%__MODULE__{valid_until: valid_until}) do
|
|
||||||
NaiveDateTime.diff(NaiveDateTime.utc_now(), valid_until) > 0
|
|
||||||
end
|
|
||||||
|
|
||||||
def is_expired?(_), do: false
|
|
||||||
|
|
||||||
def delete_expired_tokens do
|
|
||||||
from(
|
|
||||||
q in __MODULE__,
|
|
||||||
where: fragment("?", q.valid_until) < ^Timex.now()
|
|
||||||
)
|
|
||||||
|> Repo.delete_all()
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -648,4 +648,16 @@ defmodule Pleroma.Notification do
|
||||||
)
|
)
|
||||||
|> Repo.one()
|
|> Repo.one()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@spec mark_context_as_read(User.t(), String.t()) :: {integer(), nil | [term()]}
|
||||||
|
def mark_context_as_read(%User{id: id}, context) do
|
||||||
|
from(
|
||||||
|
n in Notification,
|
||||||
|
join: a in assoc(n, :activity),
|
||||||
|
where: n.user_id == ^id,
|
||||||
|
where: n.seen == false,
|
||||||
|
where: fragment("?->>'context'", a.data) == ^context
|
||||||
|
)
|
||||||
|
|> Repo.update_all(set: [seen: true])
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -44,13 +44,6 @@ defmodule Pleroma.Object.Containment do
|
||||||
nil
|
nil
|
||||||
end
|
end
|
||||||
|
|
||||||
# TODO: We explicitly allow 'tag' URIs through, due to references to legacy OStatus
|
|
||||||
# objects being present in the test suite environment. Once these objects are
|
|
||||||
# removed, please also remove this.
|
|
||||||
if Mix.env() == :test do
|
|
||||||
defp compare_uris(_, %URI{scheme: "tag"}), do: :ok
|
|
||||||
end
|
|
||||||
|
|
||||||
defp compare_uris(%URI{host: host} = _id_uri, %URI{host: host} = _other_uri), do: :ok
|
defp compare_uris(%URI{host: host} = _id_uri, %URI{host: host} = _other_uri), do: :ok
|
||||||
defp compare_uris(_id_uri, _other_uri), do: :error
|
defp compare_uris(_id_uri, _other_uri), do: :error
|
||||||
|
|
||||||
|
|
|
@ -36,8 +36,7 @@ defmodule Pleroma.Object.Fetcher do
|
||||||
defp reinject_object(%Object{data: %{"type" => "Question"}} = object, new_data) do
|
defp reinject_object(%Object{data: %{"type" => "Question"}} = object, new_data) do
|
||||||
Logger.debug("Reinjecting object #{new_data["id"]}")
|
Logger.debug("Reinjecting object #{new_data["id"]}")
|
||||||
|
|
||||||
with new_data <- Transmogrifier.fix_object(new_data),
|
with data <- maybe_reinject_internal_fields(object, new_data),
|
||||||
data <- maybe_reinject_internal_fields(object, new_data),
|
|
||||||
{:ok, data, _} <- ObjectValidator.validate(data, %{}),
|
{:ok, data, _} <- ObjectValidator.validate(data, %{}),
|
||||||
changeset <- Object.change(object, %{data: data}),
|
changeset <- Object.change(object, %{data: data}),
|
||||||
changeset <- touch_changeset(changeset),
|
changeset <- touch_changeset(changeset),
|
||||||
|
|
|
@ -28,7 +28,7 @@ defmodule Pleroma.ReverseProxy.Client.Tesla do
|
||||||
url,
|
url,
|
||||||
body,
|
body,
|
||||||
headers,
|
headers,
|
||||||
Keyword.put(opts, :adapter, opts)
|
opts
|
||||||
) do
|
) do
|
||||||
if is_map(response.body) and method != :head do
|
if is_map(response.body) and method != :head do
|
||||||
{:ok, response.status, response.headers, response.body}
|
{:ok, response.status, response.headers, response.body}
|
||||||
|
|
|
@ -3,12 +3,15 @@
|
||||||
# SPDX-License-Identifier: AGPL-3.0-only
|
# SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
defmodule Pleroma.Stats do
|
defmodule Pleroma.Stats do
|
||||||
|
use GenServer
|
||||||
|
|
||||||
import Ecto.Query
|
import Ecto.Query
|
||||||
|
|
||||||
alias Pleroma.CounterCache
|
alias Pleroma.CounterCache
|
||||||
alias Pleroma.Repo
|
alias Pleroma.Repo
|
||||||
alias Pleroma.User
|
alias Pleroma.User
|
||||||
|
|
||||||
use GenServer
|
@interval :timer.seconds(60)
|
||||||
|
|
||||||
def start_link(_) do
|
def start_link(_) do
|
||||||
GenServer.start_link(
|
GenServer.start_link(
|
||||||
|
@ -18,6 +21,12 @@ defmodule Pleroma.Stats do
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@impl true
|
||||||
|
def init(_args) do
|
||||||
|
if Pleroma.Config.get(:env) == :test, do: :ok = Ecto.Adapters.SQL.Sandbox.checkout(Repo)
|
||||||
|
{:ok, nil, {:continue, :calculate_stats}}
|
||||||
|
end
|
||||||
|
|
||||||
@doc "Performs update stats"
|
@doc "Performs update stats"
|
||||||
def force_update do
|
def force_update do
|
||||||
GenServer.call(__MODULE__, :force_update)
|
GenServer.call(__MODULE__, :force_update)
|
||||||
|
@ -29,7 +38,11 @@ defmodule Pleroma.Stats do
|
||||||
end
|
end
|
||||||
|
|
||||||
@doc "Returns stats data"
|
@doc "Returns stats data"
|
||||||
@spec get_stats() :: %{domain_count: integer(), status_count: integer(), user_count: integer()}
|
@spec get_stats() :: %{
|
||||||
|
domain_count: non_neg_integer(),
|
||||||
|
status_count: non_neg_integer(),
|
||||||
|
user_count: non_neg_integer()
|
||||||
|
}
|
||||||
def get_stats do
|
def get_stats do
|
||||||
%{stats: stats} = GenServer.call(__MODULE__, :get_state)
|
%{stats: stats} = GenServer.call(__MODULE__, :get_state)
|
||||||
|
|
||||||
|
@ -44,25 +57,14 @@ defmodule Pleroma.Stats do
|
||||||
peers
|
peers
|
||||||
end
|
end
|
||||||
|
|
||||||
def init(_args) do
|
@spec calculate_stat_data() :: %{
|
||||||
{:ok, calculate_stat_data()}
|
peers: list(),
|
||||||
end
|
stats: %{
|
||||||
|
domain_count: non_neg_integer(),
|
||||||
def handle_call(:force_update, _from, _state) do
|
status_count: non_neg_integer(),
|
||||||
new_stats = calculate_stat_data()
|
user_count: non_neg_integer()
|
||||||
{:reply, new_stats, new_stats}
|
}
|
||||||
end
|
}
|
||||||
|
|
||||||
def handle_call(:get_state, _from, state) do
|
|
||||||
{:reply, state, state}
|
|
||||||
end
|
|
||||||
|
|
||||||
def handle_cast(:run_update, _state) do
|
|
||||||
new_stats = calculate_stat_data()
|
|
||||||
|
|
||||||
{:noreply, new_stats}
|
|
||||||
end
|
|
||||||
|
|
||||||
def calculate_stat_data do
|
def calculate_stat_data do
|
||||||
peers =
|
peers =
|
||||||
from(
|
from(
|
||||||
|
@ -97,6 +99,7 @@ defmodule Pleroma.Stats do
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@spec get_status_visibility_count(String.t() | nil) :: map()
|
||||||
def get_status_visibility_count(instance \\ nil) do
|
def get_status_visibility_count(instance \\ nil) do
|
||||||
if is_nil(instance) do
|
if is_nil(instance) do
|
||||||
CounterCache.get_sum()
|
CounterCache.get_sum()
|
||||||
|
@ -104,4 +107,36 @@ defmodule Pleroma.Stats do
|
||||||
CounterCache.get_by_instance(instance)
|
CounterCache.get_by_instance(instance)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@impl true
|
||||||
|
def handle_continue(:calculate_stats, _) do
|
||||||
|
stats = calculate_stat_data()
|
||||||
|
Process.send_after(self(), :run_update, @interval)
|
||||||
|
{:noreply, stats}
|
||||||
|
end
|
||||||
|
|
||||||
|
@impl true
|
||||||
|
def handle_call(:force_update, _from, _state) do
|
||||||
|
new_stats = calculate_stat_data()
|
||||||
|
{:reply, new_stats, new_stats}
|
||||||
|
end
|
||||||
|
|
||||||
|
@impl true
|
||||||
|
def handle_call(:get_state, _from, state) do
|
||||||
|
{:reply, state, state}
|
||||||
|
end
|
||||||
|
|
||||||
|
@impl true
|
||||||
|
def handle_cast(:run_update, _state) do
|
||||||
|
new_stats = calculate_stat_data()
|
||||||
|
|
||||||
|
{:noreply, new_stats}
|
||||||
|
end
|
||||||
|
|
||||||
|
@impl true
|
||||||
|
def handle_info(:run_update, _) do
|
||||||
|
new_stats = calculate_stat_data()
|
||||||
|
Process.send_after(self(), :run_update, @interval)
|
||||||
|
{:noreply, new_stats}
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -7,7 +7,8 @@ defmodule Pleroma.Telemetry.Logger do
|
||||||
[:pleroma, :connection_pool, :reclaim, :start],
|
[:pleroma, :connection_pool, :reclaim, :start],
|
||||||
[:pleroma, :connection_pool, :reclaim, :stop],
|
[:pleroma, :connection_pool, :reclaim, :stop],
|
||||||
[:pleroma, :connection_pool, :provision_failure],
|
[:pleroma, :connection_pool, :provision_failure],
|
||||||
[:pleroma, :connection_pool, :client_death]
|
[:pleroma, :connection_pool, :client, :dead],
|
||||||
|
[:pleroma, :connection_pool, :client, :add]
|
||||||
]
|
]
|
||||||
def attach do
|
def attach do
|
||||||
:telemetry.attach_many("pleroma-logger", @events, &handle_event/4, [])
|
:telemetry.attach_many("pleroma-logger", @events, &handle_event/4, [])
|
||||||
|
@ -62,7 +63,7 @@ defmodule Pleroma.Telemetry.Logger do
|
||||||
end
|
end
|
||||||
|
|
||||||
def handle_event(
|
def handle_event(
|
||||||
[:pleroma, :connection_pool, :client_death],
|
[:pleroma, :connection_pool, :client, :dead],
|
||||||
%{client_pid: client_pid, reason: reason},
|
%{client_pid: client_pid, reason: reason},
|
||||||
%{key: key},
|
%{key: key},
|
||||||
_
|
_
|
||||||
|
@ -73,4 +74,17 @@ defmodule Pleroma.Telemetry.Logger do
|
||||||
}"
|
}"
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def handle_event(
|
||||||
|
[:pleroma, :connection_pool, :client, :add],
|
||||||
|
%{clients: [_, _ | _] = clients},
|
||||||
|
%{key: key, protocol: :http},
|
||||||
|
_
|
||||||
|
) do
|
||||||
|
Logger.info(fn ->
|
||||||
|
"Pool worker for #{key}: #{length(clients)} clients are using an HTTP1 connection at the same time, head-of-line blocking might occur."
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
def handle_event([:pleroma, :connection_pool, :client, :add], _, _, _), do: :ok
|
||||||
end
|
end
|
||||||
|
|
50
lib/pleroma/tesla/middleware/connection_pool.ex
Normal file
50
lib/pleroma/tesla/middleware/connection_pool.ex
Normal file
|
@ -0,0 +1,50 @@
|
||||||
|
# Pleroma: A lightweight social networking server
|
||||||
|
# Copyright © 2020 Pleroma Authors <https://pleroma.social/>
|
||||||
|
# SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
|
defmodule Pleroma.Tesla.Middleware.ConnectionPool do
|
||||||
|
@moduledoc """
|
||||||
|
Middleware to get/release connections from `Pleroma.Gun.ConnectionPool`
|
||||||
|
"""
|
||||||
|
|
||||||
|
@behaviour Tesla.Middleware
|
||||||
|
|
||||||
|
alias Pleroma.Gun.ConnectionPool
|
||||||
|
|
||||||
|
@impl Tesla.Middleware
|
||||||
|
def call(%Tesla.Env{url: url, opts: opts} = env, next, _) do
|
||||||
|
uri = URI.parse(url)
|
||||||
|
|
||||||
|
# Avoid leaking connections when the middleware is called twice
|
||||||
|
# with body_as: :chunks. We assume only the middleware can set
|
||||||
|
# opts[:adapter][:conn]
|
||||||
|
if opts[:adapter][:conn] do
|
||||||
|
ConnectionPool.release_conn(opts[:adapter][:conn])
|
||||||
|
end
|
||||||
|
|
||||||
|
case ConnectionPool.get_conn(uri, opts[:adapter]) do
|
||||||
|
{:ok, conn_pid} ->
|
||||||
|
adapter_opts = Keyword.merge(opts[:adapter], conn: conn_pid, close_conn: false)
|
||||||
|
opts = Keyword.put(opts, :adapter, adapter_opts)
|
||||||
|
env = %{env | opts: opts}
|
||||||
|
|
||||||
|
case Tesla.run(env, next) do
|
||||||
|
{:ok, env} ->
|
||||||
|
unless opts[:adapter][:body_as] == :chunks do
|
||||||
|
ConnectionPool.release_conn(conn_pid)
|
||||||
|
{_, res} = pop_in(env.opts[:adapter][:conn])
|
||||||
|
{:ok, res}
|
||||||
|
else
|
||||||
|
{:ok, env}
|
||||||
|
end
|
||||||
|
|
||||||
|
err ->
|
||||||
|
ConnectionPool.release_conn(conn_pid)
|
||||||
|
err
|
||||||
|
end
|
||||||
|
|
||||||
|
err ->
|
||||||
|
err
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -1,110 +0,0 @@
|
||||||
# Pleroma: A lightweight social networking server
|
|
||||||
# Copyright © 2015-2020 Tymon Tobolski <https://github.com/teamon/tesla/blob/master/lib/tesla/middleware/follow_redirects.ex>
|
|
||||||
# Copyright © 2020 Pleroma Authors <https://pleroma.social/>
|
|
||||||
# SPDX-License-Identifier: AGPL-3.0-only
|
|
||||||
|
|
||||||
defmodule Pleroma.HTTP.Middleware.FollowRedirects do
|
|
||||||
@moduledoc """
|
|
||||||
Pool-aware version of https://github.com/teamon/tesla/blob/master/lib/tesla/middleware/follow_redirects.ex
|
|
||||||
|
|
||||||
Follow 3xx redirects
|
|
||||||
## Options
|
|
||||||
- `:max_redirects` - limit number of redirects (default: `5`)
|
|
||||||
"""
|
|
||||||
|
|
||||||
alias Pleroma.Gun.ConnectionPool
|
|
||||||
|
|
||||||
@behaviour Tesla.Middleware
|
|
||||||
|
|
||||||
@max_redirects 5
|
|
||||||
@redirect_statuses [301, 302, 303, 307, 308]
|
|
||||||
|
|
||||||
@impl Tesla.Middleware
|
|
||||||
def call(env, next, opts \\ []) do
|
|
||||||
max = Keyword.get(opts, :max_redirects, @max_redirects)
|
|
||||||
|
|
||||||
redirect(env, next, max)
|
|
||||||
end
|
|
||||||
|
|
||||||
defp redirect(env, next, left) do
|
|
||||||
opts = env.opts[:adapter]
|
|
||||||
|
|
||||||
case Tesla.run(env, next) do
|
|
||||||
{:ok, %{status: status} = res} when status in @redirect_statuses and left > 0 ->
|
|
||||||
release_conn(opts)
|
|
||||||
|
|
||||||
case Tesla.get_header(res, "location") do
|
|
||||||
nil ->
|
|
||||||
{:ok, res}
|
|
||||||
|
|
||||||
location ->
|
|
||||||
location = parse_location(location, res)
|
|
||||||
|
|
||||||
case get_conn(location, opts) do
|
|
||||||
{:ok, opts} ->
|
|
||||||
%{env | opts: Keyword.put(env.opts, :adapter, opts)}
|
|
||||||
|> new_request(res.status, location)
|
|
||||||
|> redirect(next, left - 1)
|
|
||||||
|
|
||||||
e ->
|
|
||||||
e
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
{:ok, %{status: status}} when status in @redirect_statuses ->
|
|
||||||
release_conn(opts)
|
|
||||||
{:error, {__MODULE__, :too_many_redirects}}
|
|
||||||
|
|
||||||
{:error, _} = e ->
|
|
||||||
release_conn(opts)
|
|
||||||
e
|
|
||||||
|
|
||||||
other ->
|
|
||||||
unless opts[:body_as] == :chunks do
|
|
||||||
release_conn(opts)
|
|
||||||
end
|
|
||||||
|
|
||||||
other
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
defp get_conn(location, opts) do
|
|
||||||
uri = URI.parse(location)
|
|
||||||
|
|
||||||
case ConnectionPool.get_conn(uri, opts) do
|
|
||||||
{:ok, conn} ->
|
|
||||||
{:ok, Keyword.merge(opts, conn: conn)}
|
|
||||||
|
|
||||||
e ->
|
|
||||||
e
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
defp release_conn(opts) do
|
|
||||||
ConnectionPool.release_conn(opts[:conn])
|
|
||||||
end
|
|
||||||
|
|
||||||
# The 303 (See Other) redirect was added in HTTP/1.1 to indicate that the originally
|
|
||||||
# requested resource is not available, however a related resource (or another redirect)
|
|
||||||
# available via GET is available at the specified location.
|
|
||||||
# https://tools.ietf.org/html/rfc7231#section-6.4.4
|
|
||||||
defp new_request(env, 303, location), do: %{env | url: location, method: :get, query: []}
|
|
||||||
|
|
||||||
# The 307 (Temporary Redirect) status code indicates that the target
|
|
||||||
# resource resides temporarily under a different URI and the user agent
|
|
||||||
# MUST NOT change the request method (...)
|
|
||||||
# https://tools.ietf.org/html/rfc7231#section-6.4.7
|
|
||||||
defp new_request(env, 307, location), do: %{env | url: location}
|
|
||||||
|
|
||||||
defp new_request(env, _, location), do: %{env | url: location, query: []}
|
|
||||||
|
|
||||||
defp parse_location("https://" <> _rest = location, _env), do: location
|
|
||||||
defp parse_location("http://" <> _rest = location, _env), do: location
|
|
||||||
|
|
||||||
defp parse_location(location, env) do
|
|
||||||
env.url
|
|
||||||
|> URI.parse()
|
|
||||||
|> URI.merge(location)
|
|
||||||
|> URI.to_string()
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -83,7 +83,7 @@ defmodule Pleroma.User do
|
||||||
]
|
]
|
||||||
|
|
||||||
schema "users" do
|
schema "users" do
|
||||||
field(:bio, :string)
|
field(:bio, :string, default: "")
|
||||||
field(:raw_bio, :string)
|
field(:raw_bio, :string)
|
||||||
field(:email, :string)
|
field(:email, :string)
|
||||||
field(:name, :string)
|
field(:name, :string)
|
||||||
|
@ -1587,7 +1587,7 @@ defmodule Pleroma.User do
|
||||||
# "Right to be forgotten"
|
# "Right to be forgotten"
|
||||||
# https://gdpr.eu/right-to-be-forgotten/
|
# https://gdpr.eu/right-to-be-forgotten/
|
||||||
change(user, %{
|
change(user, %{
|
||||||
bio: nil,
|
bio: "",
|
||||||
raw_bio: nil,
|
raw_bio: nil,
|
||||||
email: nil,
|
email: nil,
|
||||||
name: nil,
|
name: nil,
|
||||||
|
@ -2315,6 +2315,11 @@ defmodule Pleroma.User do
|
||||||
max_pinned_statuses = Config.get([:instance, :max_pinned_statuses], 0)
|
max_pinned_statuses = Config.get([:instance, :max_pinned_statuses], 0)
|
||||||
params = %{pinned_activities: user.pinned_activities ++ [id]}
|
params = %{pinned_activities: user.pinned_activities ++ [id]}
|
||||||
|
|
||||||
|
# if pinned activity was scheduled for deletion, we remove job
|
||||||
|
if expiration = Pleroma.Workers.PurgeExpiredActivity.get_expiration(id) do
|
||||||
|
Oban.cancel_job(expiration.id)
|
||||||
|
end
|
||||||
|
|
||||||
user
|
user
|
||||||
|> cast(params, [:pinned_activities])
|
|> cast(params, [:pinned_activities])
|
||||||
|> validate_length(:pinned_activities,
|
|> validate_length(:pinned_activities,
|
||||||
|
@ -2327,9 +2332,19 @@ defmodule Pleroma.User do
|
||||||
|> update_and_set_cache()
|
|> update_and_set_cache()
|
||||||
end
|
end
|
||||||
|
|
||||||
def remove_pinnned_activity(user, %Pleroma.Activity{id: id}) do
|
def remove_pinnned_activity(user, %Pleroma.Activity{id: id, data: data}) do
|
||||||
params = %{pinned_activities: List.delete(user.pinned_activities, id)}
|
params = %{pinned_activities: List.delete(user.pinned_activities, id)}
|
||||||
|
|
||||||
|
# if pinned activity was scheduled for deletion, we reschedule it for deletion
|
||||||
|
if data["expires_at"] do
|
||||||
|
{:ok, expires_at, _} = DateTime.from_iso8601(data["expires_at"])
|
||||||
|
|
||||||
|
Pleroma.Workers.PurgeExpiredActivity.enqueue(%{
|
||||||
|
activity_id: id,
|
||||||
|
expires_at: expires_at
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
user
|
user
|
||||||
|> cast(params, [:pinned_activities])
|
|> cast(params, [:pinned_activities])
|
||||||
|> update_and_set_cache()
|
|> update_and_set_cache()
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
defmodule Pleroma.Web.ActivityPub.ActivityPub do
|
defmodule Pleroma.Web.ActivityPub.ActivityPub do
|
||||||
alias Pleroma.Activity
|
alias Pleroma.Activity
|
||||||
alias Pleroma.Activity.Ir.Topics
|
alias Pleroma.Activity.Ir.Topics
|
||||||
alias Pleroma.ActivityExpiration
|
|
||||||
alias Pleroma.Config
|
alias Pleroma.Config
|
||||||
alias Pleroma.Constants
|
alias Pleroma.Constants
|
||||||
alias Pleroma.Conversation
|
alias Pleroma.Conversation
|
||||||
|
@ -102,7 +101,9 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
|
||||||
local: local,
|
local: local,
|
||||||
recipients: recipients,
|
recipients: recipients,
|
||||||
actor: object["actor"]
|
actor: object["actor"]
|
||||||
}) do
|
}),
|
||||||
|
# TODO: add tests for expired activities, when Note type will be supported in new pipeline
|
||||||
|
{:ok, _} <- maybe_create_activity_expiration(activity) do
|
||||||
{:ok, activity, meta}
|
{:ok, activity, meta}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -111,23 +112,14 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
|
||||||
def insert(map, local \\ true, fake \\ false, bypass_actor_check \\ false) when is_map(map) do
|
def insert(map, local \\ true, fake \\ false, bypass_actor_check \\ false) when is_map(map) do
|
||||||
with nil <- Activity.normalize(map),
|
with nil <- Activity.normalize(map),
|
||||||
map <- lazy_put_activity_defaults(map, fake),
|
map <- lazy_put_activity_defaults(map, fake),
|
||||||
true <- bypass_actor_check || check_actor_is_active(map["actor"]),
|
{_, true} <- {:actor_check, bypass_actor_check || check_actor_is_active(map["actor"])},
|
||||||
{_, true} <- {:remote_limit_error, check_remote_limit(map)},
|
{_, true} <- {:remote_limit_pass, check_remote_limit(map)},
|
||||||
{:ok, map} <- MRF.filter(map),
|
{:ok, map} <- MRF.filter(map),
|
||||||
{recipients, _, _} = get_recipients(map),
|
{recipients, _, _} = get_recipients(map),
|
||||||
{:fake, false, map, recipients} <- {:fake, fake, map, recipients},
|
{:fake, false, map, recipients} <- {:fake, fake, map, recipients},
|
||||||
{:containment, :ok} <- {:containment, Containment.contain_child(map)},
|
{:containment, :ok} <- {:containment, Containment.contain_child(map)},
|
||||||
{:ok, map, object} <- insert_full_object(map) do
|
{:ok, map, object} <- insert_full_object(map),
|
||||||
{:ok, activity} =
|
{:ok, activity} <- insert_activity_with_expiration(map, local, recipients) do
|
||||||
%Activity{
|
|
||||||
data: map,
|
|
||||||
local: local,
|
|
||||||
actor: map["actor"],
|
|
||||||
recipients: recipients
|
|
||||||
}
|
|
||||||
|> Repo.insert()
|
|
||||||
|> maybe_create_activity_expiration()
|
|
||||||
|
|
||||||
# Splice in the child object if we have one.
|
# Splice in the child object if we have one.
|
||||||
activity = Maps.put_if_present(activity, :object, object)
|
activity = Maps.put_if_present(activity, :object, object)
|
||||||
|
|
||||||
|
@ -138,6 +130,15 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
|
||||||
%Activity{} = activity ->
|
%Activity{} = activity ->
|
||||||
{:ok, activity}
|
{:ok, activity}
|
||||||
|
|
||||||
|
{:actor_check, _} ->
|
||||||
|
{:error, false}
|
||||||
|
|
||||||
|
{:containment, _} = error ->
|
||||||
|
error
|
||||||
|
|
||||||
|
{:error, _} = error ->
|
||||||
|
error
|
||||||
|
|
||||||
{:fake, true, map, recipients} ->
|
{:fake, true, map, recipients} ->
|
||||||
activity = %Activity{
|
activity = %Activity{
|
||||||
data: map,
|
data: map,
|
||||||
|
@ -150,8 +151,24 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
|
||||||
Pleroma.Web.RichMedia.Helpers.fetch_data_for_activity(activity)
|
Pleroma.Web.RichMedia.Helpers.fetch_data_for_activity(activity)
|
||||||
{:ok, activity}
|
{:ok, activity}
|
||||||
|
|
||||||
error ->
|
{:remote_limit_pass, _} ->
|
||||||
{:error, error}
|
{:error, :remote_limit}
|
||||||
|
|
||||||
|
{:reject, reason} ->
|
||||||
|
{:error, reason}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
defp insert_activity_with_expiration(data, local, recipients) do
|
||||||
|
struct = %Activity{
|
||||||
|
data: data,
|
||||||
|
local: local,
|
||||||
|
actor: data["actor"],
|
||||||
|
recipients: recipients
|
||||||
|
}
|
||||||
|
|
||||||
|
with {:ok, activity} <- Repo.insert(struct) do
|
||||||
|
maybe_create_activity_expiration(activity)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -164,13 +181,19 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
|
||||||
stream_out_participations(participations)
|
stream_out_participations(participations)
|
||||||
end
|
end
|
||||||
|
|
||||||
defp maybe_create_activity_expiration({:ok, %{data: %{"expires_at" => expires_at}} = activity}) do
|
defp maybe_create_activity_expiration(
|
||||||
with {:ok, _} <- ActivityExpiration.create(activity, expires_at) do
|
%{data: %{"expires_at" => %DateTime{} = expires_at}} = activity
|
||||||
|
) do
|
||||||
|
with {:ok, _job} <-
|
||||||
|
Pleroma.Workers.PurgeExpiredActivity.enqueue(%{
|
||||||
|
activity_id: activity.id,
|
||||||
|
expires_at: expires_at
|
||||||
|
}) do
|
||||||
{:ok, activity}
|
{:ok, activity}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
defp maybe_create_activity_expiration(result), do: result
|
defp maybe_create_activity_expiration(activity), do: {:ok, activity}
|
||||||
|
|
||||||
defp create_or_bump_conversation(activity, actor) do
|
defp create_or_bump_conversation(activity, actor) do
|
||||||
with {:ok, conversation} <- Conversation.create_or_bump_for(activity),
|
with {:ok, conversation} <- Conversation.create_or_bump_for(activity),
|
||||||
|
@ -1224,7 +1247,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
|
||||||
name: data["name"],
|
name: data["name"],
|
||||||
follower_address: data["followers"],
|
follower_address: data["followers"],
|
||||||
following_address: data["following"],
|
following_address: data["following"],
|
||||||
bio: data["summary"],
|
bio: data["summary"] || "",
|
||||||
actor_type: actor_type,
|
actor_type: actor_type,
|
||||||
also_known_as: Map.get(data, "alsoKnownAs", []),
|
also_known_as: Map.get(data, "alsoKnownAs", []),
|
||||||
public_key: public_key,
|
public_key: public_key,
|
||||||
|
|
|
@ -31,10 +31,10 @@ defmodule Pleroma.Web.ActivityPub.MRF.ActivityExpirationPolicy do
|
||||||
|
|
||||||
defp maybe_add_expiration(activity) do
|
defp maybe_add_expiration(activity) do
|
||||||
days = Pleroma.Config.get([:mrf_activity_expiration, :days], 365)
|
days = Pleroma.Config.get([:mrf_activity_expiration, :days], 365)
|
||||||
expires_at = NaiveDateTime.utc_now() |> Timex.shift(days: days)
|
expires_at = DateTime.utc_now() |> Timex.shift(days: days)
|
||||||
|
|
||||||
with %{"expires_at" => existing_expires_at} <- activity,
|
with %{"expires_at" => existing_expires_at} <- activity,
|
||||||
:lt <- NaiveDateTime.compare(existing_expires_at, expires_at) do
|
:lt <- DateTime.compare(existing_expires_at, expires_at) do
|
||||||
activity
|
activity
|
||||||
else
|
else
|
||||||
_ -> Map.put(activity, "expires_at", expires_at)
|
_ -> Map.put(activity, "expires_at", expires_at)
|
||||||
|
|
|
@ -0,0 +1,56 @@
|
||||||
|
# Pleroma: A lightweight social networking server
|
||||||
|
# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
|
||||||
|
# SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
|
defmodule Pleroma.Web.ActivityPub.MRF.ForceBotUnlistedPolicy do
|
||||||
|
alias Pleroma.User
|
||||||
|
@behaviour Pleroma.Web.ActivityPub.MRF
|
||||||
|
@moduledoc "Remove bot posts from federated timeline"
|
||||||
|
|
||||||
|
require Pleroma.Constants
|
||||||
|
|
||||||
|
defp check_by_actor_type(user), do: user.actor_type in ["Application", "Service"]
|
||||||
|
defp check_by_nickname(user), do: Regex.match?(~r/bot@|ebooks@/i, user.nickname)
|
||||||
|
|
||||||
|
defp check_if_bot(user), do: check_by_actor_type(user) or check_by_nickname(user)
|
||||||
|
|
||||||
|
@impl true
|
||||||
|
def filter(
|
||||||
|
%{
|
||||||
|
"type" => "Create",
|
||||||
|
"to" => to,
|
||||||
|
"cc" => cc,
|
||||||
|
"actor" => actor,
|
||||||
|
"object" => object
|
||||||
|
} = message
|
||||||
|
) do
|
||||||
|
user = User.get_cached_by_ap_id(actor)
|
||||||
|
isbot = check_if_bot(user)
|
||||||
|
|
||||||
|
if isbot and Enum.member?(to, Pleroma.Constants.as_public()) do
|
||||||
|
to = List.delete(to, Pleroma.Constants.as_public()) ++ [user.follower_address]
|
||||||
|
cc = List.delete(cc, user.follower_address) ++ [Pleroma.Constants.as_public()]
|
||||||
|
|
||||||
|
object =
|
||||||
|
object
|
||||||
|
|> Map.put("to", to)
|
||||||
|
|> Map.put("cc", cc)
|
||||||
|
|
||||||
|
message =
|
||||||
|
message
|
||||||
|
|> Map.put("to", to)
|
||||||
|
|> Map.put("cc", cc)
|
||||||
|
|> Map.put("object", object)
|
||||||
|
|
||||||
|
{:ok, message}
|
||||||
|
else
|
||||||
|
{:ok, message}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
@impl true
|
||||||
|
def filter(message), do: {:ok, message}
|
||||||
|
|
||||||
|
@impl true
|
||||||
|
def describe, do: {:ok, %{}}
|
||||||
|
end
|
|
@ -13,22 +13,16 @@ defmodule Pleroma.Web.ActivityPub.MRF.MediaProxyWarmingPolicy do
|
||||||
require Logger
|
require Logger
|
||||||
|
|
||||||
@options [
|
@options [
|
||||||
pool: :media
|
pool: :media,
|
||||||
|
recv_timeout: 10_000
|
||||||
]
|
]
|
||||||
|
|
||||||
def perform(:prefetch, url) do
|
def perform(:prefetch, url) do
|
||||||
Logger.debug("Prefetching #{inspect(url)}")
|
Logger.debug("Prefetching #{inspect(url)}")
|
||||||
|
|
||||||
opts =
|
|
||||||
if Application.get_env(:tesla, :adapter) == Tesla.Adapter.Hackney do
|
|
||||||
Keyword.put(@options, :recv_timeout, 10_000)
|
|
||||||
else
|
|
||||||
@options
|
|
||||||
end
|
|
||||||
|
|
||||||
url
|
url
|
||||||
|> MediaProxy.url()
|
|> MediaProxy.url()
|
||||||
|> HTTP.get([], adapter: opts)
|
|> HTTP.get([], @options)
|
||||||
end
|
end
|
||||||
|
|
||||||
def perform(:preload, %{"object" => %{"attachment" => attachments}} = _message) do
|
def perform(:preload, %{"object" => %{"attachment" => attachments}} = _message) do
|
||||||
|
|
|
@ -9,6 +9,7 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.AudioValidator do
|
||||||
alias Pleroma.Web.ActivityPub.ObjectValidators.AttachmentValidator
|
alias Pleroma.Web.ActivityPub.ObjectValidators.AttachmentValidator
|
||||||
alias Pleroma.Web.ActivityPub.ObjectValidators.CommonFixes
|
alias Pleroma.Web.ActivityPub.ObjectValidators.CommonFixes
|
||||||
alias Pleroma.Web.ActivityPub.ObjectValidators.CommonValidations
|
alias Pleroma.Web.ActivityPub.ObjectValidators.CommonValidations
|
||||||
|
alias Pleroma.Web.ActivityPub.Transmogrifier
|
||||||
|
|
||||||
import Ecto.Changeset
|
import Ecto.Changeset
|
||||||
|
|
||||||
|
@ -33,8 +34,7 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.AudioValidator do
|
||||||
field(:attributedTo, ObjectValidators.ObjectID)
|
field(:attributedTo, ObjectValidators.ObjectID)
|
||||||
field(:summary, :string)
|
field(:summary, :string)
|
||||||
field(:published, ObjectValidators.DateTime)
|
field(:published, ObjectValidators.DateTime)
|
||||||
# TODO: Write type
|
field(:emoji, ObjectValidators.Emoji, default: %{})
|
||||||
field(:emoji, :map, default: %{})
|
|
||||||
field(:sensitive, :boolean, default: false)
|
field(:sensitive, :boolean, default: false)
|
||||||
embeds_many(:attachment, AttachmentValidator)
|
embeds_many(:attachment, AttachmentValidator)
|
||||||
field(:replies_count, :integer, default: 0)
|
field(:replies_count, :integer, default: 0)
|
||||||
|
@ -83,6 +83,7 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.AudioValidator do
|
||||||
data
|
data
|
||||||
|> CommonFixes.fix_defaults()
|
|> CommonFixes.fix_defaults()
|
||||||
|> CommonFixes.fix_attribution()
|
|> CommonFixes.fix_attribution()
|
||||||
|
|> Transmogrifier.fix_emoji()
|
||||||
|> fix_url()
|
|> fix_url()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.ChatMessageValidator do
|
||||||
field(:content, ObjectValidators.SafeText)
|
field(:content, ObjectValidators.SafeText)
|
||||||
field(:actor, ObjectValidators.ObjectID)
|
field(:actor, ObjectValidators.ObjectID)
|
||||||
field(:published, ObjectValidators.DateTime)
|
field(:published, ObjectValidators.DateTime)
|
||||||
field(:emoji, :map, default: %{})
|
field(:emoji, ObjectValidators.Emoji, default: %{})
|
||||||
|
|
||||||
embeds_one(:attachment, AttachmentValidator)
|
embeds_one(:attachment, AttachmentValidator)
|
||||||
end
|
end
|
||||||
|
|
|
@ -11,8 +11,8 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.CommonFixes do
|
||||||
Utils.create_context(data["context"] || data["conversation"])
|
Utils.create_context(data["context"] || data["conversation"])
|
||||||
|
|
||||||
data
|
data
|
||||||
|> Map.put_new("context", context)
|
|> Map.put("context", context)
|
||||||
|> Map.put_new("context_id", context_id)
|
|> Map.put("context_id", context_id)
|
||||||
end
|
end
|
||||||
|
|
||||||
def fix_attribution(data) do
|
def fix_attribution(data) do
|
||||||
|
|
|
@ -9,6 +9,7 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.EventValidator do
|
||||||
alias Pleroma.Web.ActivityPub.ObjectValidators.AttachmentValidator
|
alias Pleroma.Web.ActivityPub.ObjectValidators.AttachmentValidator
|
||||||
alias Pleroma.Web.ActivityPub.ObjectValidators.CommonFixes
|
alias Pleroma.Web.ActivityPub.ObjectValidators.CommonFixes
|
||||||
alias Pleroma.Web.ActivityPub.ObjectValidators.CommonValidations
|
alias Pleroma.Web.ActivityPub.ObjectValidators.CommonValidations
|
||||||
|
alias Pleroma.Web.ActivityPub.Transmogrifier
|
||||||
|
|
||||||
import Ecto.Changeset
|
import Ecto.Changeset
|
||||||
|
|
||||||
|
@ -39,8 +40,7 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.EventValidator do
|
||||||
|
|
||||||
field(:attributedTo, ObjectValidators.ObjectID)
|
field(:attributedTo, ObjectValidators.ObjectID)
|
||||||
field(:published, ObjectValidators.DateTime)
|
field(:published, ObjectValidators.DateTime)
|
||||||
# TODO: Write type
|
field(:emoji, ObjectValidators.Emoji, default: %{})
|
||||||
field(:emoji, :map, default: %{})
|
|
||||||
field(:sensitive, :boolean, default: false)
|
field(:sensitive, :boolean, default: false)
|
||||||
embeds_many(:attachment, AttachmentValidator)
|
embeds_many(:attachment, AttachmentValidator)
|
||||||
field(:replies_count, :integer, default: 0)
|
field(:replies_count, :integer, default: 0)
|
||||||
|
@ -74,6 +74,7 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.EventValidator do
|
||||||
data
|
data
|
||||||
|> CommonFixes.fix_defaults()
|
|> CommonFixes.fix_defaults()
|
||||||
|> CommonFixes.fix_attribution()
|
|> CommonFixes.fix_attribution()
|
||||||
|
|> Transmogrifier.fix_emoji()
|
||||||
end
|
end
|
||||||
|
|
||||||
def changeset(struct, data) do
|
def changeset(struct, data) do
|
||||||
|
|
|
@ -6,6 +6,7 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.NoteValidator do
|
||||||
use Ecto.Schema
|
use Ecto.Schema
|
||||||
|
|
||||||
alias Pleroma.EctoType.ActivityPub.ObjectValidators
|
alias Pleroma.EctoType.ActivityPub.ObjectValidators
|
||||||
|
alias Pleroma.Web.ActivityPub.Transmogrifier
|
||||||
|
|
||||||
import Ecto.Changeset
|
import Ecto.Changeset
|
||||||
|
|
||||||
|
@ -32,8 +33,7 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.NoteValidator do
|
||||||
field(:actor, ObjectValidators.ObjectID)
|
field(:actor, ObjectValidators.ObjectID)
|
||||||
field(:attributedTo, ObjectValidators.ObjectID)
|
field(:attributedTo, ObjectValidators.ObjectID)
|
||||||
field(:published, ObjectValidators.DateTime)
|
field(:published, ObjectValidators.DateTime)
|
||||||
# TODO: Write type
|
field(:emoji, ObjectValidators.Emoji, default: %{})
|
||||||
field(:emoji, :map, default: %{})
|
|
||||||
field(:sensitive, :boolean, default: false)
|
field(:sensitive, :boolean, default: false)
|
||||||
# TODO: Write type
|
# TODO: Write type
|
||||||
field(:attachment, {:array, :map}, default: [])
|
field(:attachment, {:array, :map}, default: [])
|
||||||
|
@ -53,7 +53,14 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.NoteValidator do
|
||||||
|> validate_data()
|
|> validate_data()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
defp fix(data) do
|
||||||
|
data
|
||||||
|
|> Transmogrifier.fix_emoji()
|
||||||
|
end
|
||||||
|
|
||||||
def cast_data(data) do
|
def cast_data(data) do
|
||||||
|
data = fix(data)
|
||||||
|
|
||||||
%__MODULE__{}
|
%__MODULE__{}
|
||||||
|> cast(data, __schema__(:fields))
|
|> cast(data, __schema__(:fields))
|
||||||
end
|
end
|
||||||
|
|
|
@ -10,6 +10,7 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.QuestionValidator do
|
||||||
alias Pleroma.Web.ActivityPub.ObjectValidators.CommonFixes
|
alias Pleroma.Web.ActivityPub.ObjectValidators.CommonFixes
|
||||||
alias Pleroma.Web.ActivityPub.ObjectValidators.CommonValidations
|
alias Pleroma.Web.ActivityPub.ObjectValidators.CommonValidations
|
||||||
alias Pleroma.Web.ActivityPub.ObjectValidators.QuestionOptionsValidator
|
alias Pleroma.Web.ActivityPub.ObjectValidators.QuestionOptionsValidator
|
||||||
|
alias Pleroma.Web.ActivityPub.Transmogrifier
|
||||||
|
|
||||||
import Ecto.Changeset
|
import Ecto.Changeset
|
||||||
|
|
||||||
|
@ -35,8 +36,7 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.QuestionValidator do
|
||||||
field(:attributedTo, ObjectValidators.ObjectID)
|
field(:attributedTo, ObjectValidators.ObjectID)
|
||||||
field(:summary, :string)
|
field(:summary, :string)
|
||||||
field(:published, ObjectValidators.DateTime)
|
field(:published, ObjectValidators.DateTime)
|
||||||
# TODO: Write type
|
field(:emoji, ObjectValidators.Emoji, default: %{})
|
||||||
field(:emoji, :map, default: %{})
|
|
||||||
field(:sensitive, :boolean, default: false)
|
field(:sensitive, :boolean, default: false)
|
||||||
embeds_many(:attachment, AttachmentValidator)
|
embeds_many(:attachment, AttachmentValidator)
|
||||||
field(:replies_count, :integer, default: 0)
|
field(:replies_count, :integer, default: 0)
|
||||||
|
@ -85,6 +85,7 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.QuestionValidator do
|
||||||
data
|
data
|
||||||
|> CommonFixes.fix_defaults()
|
|> CommonFixes.fix_defaults()
|
||||||
|> CommonFixes.fix_attribution()
|
|> CommonFixes.fix_attribution()
|
||||||
|
|> Transmogrifier.fix_emoji()
|
||||||
|> fix_closed()
|
|> fix_closed()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,6 @@ defmodule Pleroma.Web.ActivityPub.SideEffects do
|
||||||
"""
|
"""
|
||||||
alias Pleroma.Activity
|
alias Pleroma.Activity
|
||||||
alias Pleroma.Activity.Ir.Topics
|
alias Pleroma.Activity.Ir.Topics
|
||||||
alias Pleroma.ActivityExpiration
|
|
||||||
alias Pleroma.Chat
|
alias Pleroma.Chat
|
||||||
alias Pleroma.Chat.MessageReference
|
alias Pleroma.Chat.MessageReference
|
||||||
alias Pleroma.FollowingRelationship
|
alias Pleroma.FollowingRelationship
|
||||||
|
@ -188,10 +187,6 @@ defmodule Pleroma.Web.ActivityPub.SideEffects do
|
||||||
Object.increase_replies_count(in_reply_to)
|
Object.increase_replies_count(in_reply_to)
|
||||||
end
|
end
|
||||||
|
|
||||||
if expires_at = activity.data["expires_at"] do
|
|
||||||
ActivityExpiration.create(activity, expires_at)
|
|
||||||
end
|
|
||||||
|
|
||||||
BackgroundWorker.enqueue("fetch_data_for_activity", %{"activity_id" => activity.id})
|
BackgroundWorker.enqueue("fetch_data_for_activity", %{"activity_id" => activity.id})
|
||||||
|
|
||||||
meta =
|
meta =
|
||||||
|
|
|
@ -168,7 +168,6 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do
|
||||||
def fix_in_reply_to(%{"inReplyTo" => in_reply_to} = object, options)
|
def fix_in_reply_to(%{"inReplyTo" => in_reply_to} = object, options)
|
||||||
when not is_nil(in_reply_to) do
|
when not is_nil(in_reply_to) do
|
||||||
in_reply_to_id = prepare_in_reply_to(in_reply_to)
|
in_reply_to_id = prepare_in_reply_to(in_reply_to)
|
||||||
object = Map.put(object, "inReplyToAtomUri", in_reply_to_id)
|
|
||||||
depth = (options[:depth] || 0) + 1
|
depth = (options[:depth] || 0) + 1
|
||||||
|
|
||||||
if Federator.allowed_thread_distance?(depth) do
|
if Federator.allowed_thread_distance?(depth) do
|
||||||
|
@ -176,9 +175,8 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do
|
||||||
%Activity{} <- Activity.get_create_by_object_ap_id(replied_object.data["id"]) do
|
%Activity{} <- Activity.get_create_by_object_ap_id(replied_object.data["id"]) do
|
||||||
object
|
object
|
||||||
|> Map.put("inReplyTo", replied_object.data["id"])
|
|> Map.put("inReplyTo", replied_object.data["id"])
|
||||||
|> Map.put("inReplyToAtomUri", object["inReplyToAtomUri"] || in_reply_to_id)
|
|
||||||
|> Map.put("context", replied_object.data["context"] || object["conversation"])
|
|> Map.put("context", replied_object.data["context"] || object["conversation"])
|
||||||
|> Map.drop(["conversation"])
|
|> Map.drop(["conversation", "inReplyToAtomUri"])
|
||||||
else
|
else
|
||||||
e ->
|
e ->
|
||||||
Logger.warn("Couldn't fetch #{inspect(in_reply_to_id)}, error: #{inspect(e)}")
|
Logger.warn("Couldn't fetch #{inspect(in_reply_to_id)}, error: #{inspect(e)}")
|
||||||
|
@ -318,9 +316,6 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do
|
||||||
Map.put(mapping, name, data["icon"]["url"])
|
Map.put(mapping, name, data["icon"]["url"])
|
||||||
end)
|
end)
|
||||||
|
|
||||||
# we merge mastodon and pleroma emoji into a single mapping, to allow for both wire formats
|
|
||||||
emoji = Map.merge(object["emoji"] || %{}, emoji)
|
|
||||||
|
|
||||||
Map.put(object, "emoji", emoji)
|
Map.put(object, "emoji", emoji)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -114,7 +114,7 @@ defmodule Pleroma.Web.ApiSpec.ListOperation do
|
||||||
description: "Add accounts to the given list.",
|
description: "Add accounts to the given list.",
|
||||||
operationId: "ListController.add_to_list",
|
operationId: "ListController.add_to_list",
|
||||||
parameters: [id_param()],
|
parameters: [id_param()],
|
||||||
requestBody: add_remove_accounts_request(),
|
requestBody: add_remove_accounts_request(true),
|
||||||
security: [%{"oAuth" => ["write:lists"]}],
|
security: [%{"oAuth" => ["write:lists"]}],
|
||||||
responses: %{
|
responses: %{
|
||||||
200 => Operation.response("Empty object", "application/json", %Schema{type: :object})
|
200 => Operation.response("Empty object", "application/json", %Schema{type: :object})
|
||||||
|
@ -127,8 +127,16 @@ defmodule Pleroma.Web.ApiSpec.ListOperation do
|
||||||
tags: ["Lists"],
|
tags: ["Lists"],
|
||||||
summary: "Remove accounts from list",
|
summary: "Remove accounts from list",
|
||||||
operationId: "ListController.remove_from_list",
|
operationId: "ListController.remove_from_list",
|
||||||
parameters: [id_param()],
|
parameters: [
|
||||||
requestBody: add_remove_accounts_request(),
|
id_param(),
|
||||||
|
Operation.parameter(
|
||||||
|
:account_ids,
|
||||||
|
:query,
|
||||||
|
%Schema{type: :array, items: %Schema{type: :string}},
|
||||||
|
"Array of account IDs"
|
||||||
|
)
|
||||||
|
],
|
||||||
|
requestBody: add_remove_accounts_request(false),
|
||||||
security: [%{"oAuth" => ["write:lists"]}],
|
security: [%{"oAuth" => ["write:lists"]}],
|
||||||
responses: %{
|
responses: %{
|
||||||
200 => Operation.response("Empty object", "application/json", %Schema{type: :object})
|
200 => Operation.response("Empty object", "application/json", %Schema{type: :object})
|
||||||
|
@ -171,7 +179,7 @@ defmodule Pleroma.Web.ApiSpec.ListOperation do
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
defp add_remove_accounts_request do
|
defp add_remove_accounts_request(required) when is_boolean(required) do
|
||||||
request_body(
|
request_body(
|
||||||
"Parameters",
|
"Parameters",
|
||||||
%Schema{
|
%Schema{
|
||||||
|
@ -180,9 +188,9 @@ defmodule Pleroma.Web.ApiSpec.ListOperation do
|
||||||
properties: %{
|
properties: %{
|
||||||
account_ids: %Schema{type: :array, description: "Array of account IDs", items: FlakeID}
|
account_ids: %Schema{type: :array, description: "Array of account IDs", items: FlakeID}
|
||||||
},
|
},
|
||||||
required: [:account_ids]
|
required: required && [:account_ids]
|
||||||
},
|
},
|
||||||
required: true
|
required: required
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -68,7 +68,7 @@ defmodule Pleroma.Web.Auth.PleromaAuthenticator do
|
||||||
nickname = value([registration_attrs["nickname"], Registration.nickname(registration)])
|
nickname = value([registration_attrs["nickname"], Registration.nickname(registration)])
|
||||||
email = value([registration_attrs["email"], Registration.email(registration)])
|
email = value([registration_attrs["email"], Registration.email(registration)])
|
||||||
name = value([registration_attrs["name"], Registration.name(registration)]) || nickname
|
name = value([registration_attrs["name"], Registration.name(registration)]) || nickname
|
||||||
bio = value([registration_attrs["bio"], Registration.description(registration)])
|
bio = value([registration_attrs["bio"], Registration.description(registration)]) || ""
|
||||||
|
|
||||||
random_password = :crypto.strong_rand_bytes(64) |> Base.encode64()
|
random_password = :crypto.strong_rand_bytes(64) |> Base.encode64()
|
||||||
|
|
||||||
|
|
|
@ -202,7 +202,7 @@ defmodule Pleroma.Web.CommonAPI.ActivityDraft do
|
||||||
|
|
||||||
additional =
|
additional =
|
||||||
case draft.expires_at do
|
case draft.expires_at do
|
||||||
%NaiveDateTime{} = expires_at -> Map.put(additional, "expires_at", expires_at)
|
%DateTime{} = expires_at -> Map.put(additional, "expires_at", expires_at)
|
||||||
_ -> additional
|
_ -> additional
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
|
|
||||||
defmodule Pleroma.Web.CommonAPI do
|
defmodule Pleroma.Web.CommonAPI do
|
||||||
alias Pleroma.Activity
|
alias Pleroma.Activity
|
||||||
alias Pleroma.ActivityExpiration
|
|
||||||
alias Pleroma.Conversation.Participation
|
alias Pleroma.Conversation.Participation
|
||||||
alias Pleroma.Formatter
|
alias Pleroma.Formatter
|
||||||
alias Pleroma.Object
|
alias Pleroma.Object
|
||||||
|
@ -381,9 +380,9 @@ defmodule Pleroma.Web.CommonAPI do
|
||||||
def check_expiry_date({:ok, nil} = res), do: res
|
def check_expiry_date({:ok, nil} = res), do: res
|
||||||
|
|
||||||
def check_expiry_date({:ok, in_seconds}) do
|
def check_expiry_date({:ok, in_seconds}) do
|
||||||
expiry = NaiveDateTime.utc_now() |> NaiveDateTime.add(in_seconds)
|
expiry = DateTime.add(DateTime.utc_now(), in_seconds)
|
||||||
|
|
||||||
if ActivityExpiration.expires_late_enough?(expiry) do
|
if Pleroma.Workers.PurgeExpiredActivity.expires_late_enough?(expiry) do
|
||||||
{:ok, expiry}
|
{:ok, expiry}
|
||||||
else
|
else
|
||||||
{:error, "Expiry date is too soon"}
|
{:error, "Expiry date is too soon"}
|
||||||
|
@ -452,7 +451,8 @@ defmodule Pleroma.Web.CommonAPI do
|
||||||
end
|
end
|
||||||
|
|
||||||
def add_mute(user, activity) do
|
def add_mute(user, activity) do
|
||||||
with {:ok, _} <- ThreadMute.add_mute(user.id, activity.data["context"]) do
|
with {:ok, _} <- ThreadMute.add_mute(user.id, activity.data["context"]),
|
||||||
|
_ <- Pleroma.Notification.mark_context_as_read(user, activity.data["context"]) do
|
||||||
{:ok, activity}
|
{:ok, activity}
|
||||||
else
|
else
|
||||||
{:error, _} -> {:error, dgettext("errors", "conversation is already muted")}
|
{:error, _} -> {:error, dgettext("errors", "conversation is already muted")}
|
||||||
|
|
|
@ -74,7 +74,7 @@ defmodule Pleroma.Web.MastodonAPI.ListController do
|
||||||
|
|
||||||
# DELETE /api/v1/lists/:id/accounts
|
# DELETE /api/v1/lists/:id/accounts
|
||||||
def remove_from_list(
|
def remove_from_list(
|
||||||
%{assigns: %{list: list}, body_params: %{account_ids: account_ids}} = conn,
|
%{assigns: %{list: list}, params: %{account_ids: account_ids}} = conn,
|
||||||
_
|
_
|
||||||
) do
|
) do
|
||||||
Enum.each(account_ids, fn account_id ->
|
Enum.each(account_ids, fn account_id ->
|
||||||
|
@ -86,6 +86,10 @@ defmodule Pleroma.Web.MastodonAPI.ListController do
|
||||||
json(conn, %{})
|
json(conn, %{})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def remove_from_list(%{body_params: params} = conn, _) do
|
||||||
|
remove_from_list(%{conn | params: params}, %{})
|
||||||
|
end
|
||||||
|
|
||||||
defp list_by_id_and_user(%{assigns: %{user: user}, params: %{id: id}} = conn, _) do
|
defp list_by_id_and_user(%{assigns: %{user: user}, params: %{id: id}} = conn, _) do
|
||||||
case Pleroma.List.get(id, user) do
|
case Pleroma.List.get(id, user) do
|
||||||
%Pleroma.List{} = list -> assign(conn, :list, list)
|
%Pleroma.List{} = list -> assign(conn, :list, list)
|
||||||
|
|
|
@ -245,7 +245,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountView do
|
||||||
followers_count: followers_count,
|
followers_count: followers_count,
|
||||||
following_count: following_count,
|
following_count: following_count,
|
||||||
statuses_count: user.note_count,
|
statuses_count: user.note_count,
|
||||||
note: user.bio || "",
|
note: user.bio,
|
||||||
url: user.uri || user.ap_id,
|
url: user.uri || user.ap_id,
|
||||||
avatar: image,
|
avatar: image,
|
||||||
avatar_static: image,
|
avatar_static: image,
|
||||||
|
|
|
@ -8,7 +8,6 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
|
||||||
require Pleroma.Constants
|
require Pleroma.Constants
|
||||||
|
|
||||||
alias Pleroma.Activity
|
alias Pleroma.Activity
|
||||||
alias Pleroma.ActivityExpiration
|
|
||||||
alias Pleroma.HTML
|
alias Pleroma.HTML
|
||||||
alias Pleroma.Object
|
alias Pleroma.Object
|
||||||
alias Pleroma.Repo
|
alias Pleroma.Repo
|
||||||
|
@ -228,8 +227,8 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
|
||||||
|
|
||||||
expires_at =
|
expires_at =
|
||||||
with true <- client_posted_this_activity,
|
with true <- client_posted_this_activity,
|
||||||
%ActivityExpiration{scheduled_at: scheduled_at} <-
|
%Oban.Job{scheduled_at: scheduled_at} <-
|
||||||
ActivityExpiration.get_by_activity_id(activity.id) do
|
Pleroma.Workers.PurgeExpiredActivity.get_expiration(activity.id) do
|
||||||
scheduled_at
|
scheduled_at
|
||||||
else
|
else
|
||||||
_ -> nil
|
_ -> nil
|
||||||
|
|
|
@ -37,12 +37,12 @@ defmodule Pleroma.Web.MastodonAPI.WebsocketHandler do
|
||||||
else
|
else
|
||||||
{:error, :bad_topic} ->
|
{:error, :bad_topic} ->
|
||||||
Logger.debug("#{__MODULE__} bad topic #{inspect(req)}")
|
Logger.debug("#{__MODULE__} bad topic #{inspect(req)}")
|
||||||
{:ok, req} = :cowboy_req.reply(404, req)
|
req = :cowboy_req.reply(404, req)
|
||||||
{:ok, req, state}
|
{:ok, req, state}
|
||||||
|
|
||||||
{:error, :unauthorized} ->
|
{:error, :unauthorized} ->
|
||||||
Logger.debug("#{__MODULE__} authentication error: #{inspect(req)}")
|
Logger.debug("#{__MODULE__} authentication error: #{inspect(req)}")
|
||||||
{:ok, req} = :cowboy_req.reply(401, req)
|
req = :cowboy_req.reply(401, req)
|
||||||
{:ok, req, state}
|
{:ok, req, state}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -64,7 +64,9 @@ defmodule Pleroma.Web.MastodonAPI.WebsocketHandler do
|
||||||
{:ok, %{state | timer: timer()}}
|
{:ok, %{state | timer: timer()}}
|
||||||
end
|
end
|
||||||
|
|
||||||
# We never receive messages.
|
# We only receive pings for now
|
||||||
|
def websocket_handle(:ping, state), do: {:ok, state}
|
||||||
|
|
||||||
def websocket_handle(frame, state) do
|
def websocket_handle(frame, state) do
|
||||||
Logger.error("#{__MODULE__} received frame: #{inspect(frame)}")
|
Logger.error("#{__MODULE__} received frame: #{inspect(frame)}")
|
||||||
{:ok, state}
|
{:ok, state}
|
||||||
|
@ -98,6 +100,10 @@ defmodule Pleroma.Web.MastodonAPI.WebsocketHandler do
|
||||||
{:reply, :ping, %{state | timer: nil, count: 0}, :hibernate}
|
{:reply, :ping, %{state | timer: nil, count: 0}, :hibernate}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# State can be `[]` only in case we terminate before switching to websocket,
|
||||||
|
# we already log errors for these cases in `init/1`, so just do nothing here
|
||||||
|
def terminate(_reason, _req, []), do: :ok
|
||||||
|
|
||||||
def terminate(reason, _req, state) do
|
def terminate(reason, _req, state) do
|
||||||
Logger.debug(
|
Logger.debug(
|
||||||
"#{__MODULE__} terminating websocket connection for user #{
|
"#{__MODULE__} terminating websocket connection for user #{
|
||||||
|
|
|
@ -61,7 +61,7 @@ defmodule Pleroma.Web.Metadata.Providers.OpenGraph do
|
||||||
|
|
||||||
@impl Provider
|
@impl Provider
|
||||||
def build_tags(%{user: user}) do
|
def build_tags(%{user: user}) do
|
||||||
with truncated_bio = Utils.scrub_html_and_truncate(user.bio || "") do
|
with truncated_bio = Utils.scrub_html_and_truncate(user.bio) do
|
||||||
[
|
[
|
||||||
{:meta,
|
{:meta,
|
||||||
[
|
[
|
||||||
|
|
|
@ -40,7 +40,7 @@ defmodule Pleroma.Web.Metadata.Providers.TwitterCard do
|
||||||
|
|
||||||
@impl Provider
|
@impl Provider
|
||||||
def build_tags(%{user: user}) do
|
def build_tags(%{user: user}) do
|
||||||
with truncated_bio = Utils.scrub_html_and_truncate(user.bio || "") do
|
with truncated_bio = Utils.scrub_html_and_truncate(user.bio) do
|
||||||
[
|
[
|
||||||
title_tag(user),
|
title_tag(user),
|
||||||
{:meta, [property: "twitter:description", content: truncated_bio], []},
|
{:meta, [property: "twitter:description", content: truncated_bio], []},
|
||||||
|
|
|
@ -145,7 +145,10 @@ defmodule Pleroma.Web.OAuth.OAuthController do
|
||||||
def after_create_authorization(%Plug.Conn{} = conn, %Authorization{} = auth, %{
|
def after_create_authorization(%Plug.Conn{} = conn, %Authorization{} = auth, %{
|
||||||
"authorization" => %{"redirect_uri" => @oob_token_redirect_uri}
|
"authorization" => %{"redirect_uri" => @oob_token_redirect_uri}
|
||||||
}) do
|
}) do
|
||||||
render(conn, "oob_authorization_created.html", %{auth: auth})
|
# Enforcing the view to reuse the template when calling from other controllers
|
||||||
|
conn
|
||||||
|
|> put_view(OAuthView)
|
||||||
|
|> render("oob_authorization_created.html", %{auth: auth})
|
||||||
end
|
end
|
||||||
|
|
||||||
def after_create_authorization(%Plug.Conn{} = conn, %Authorization{} = auth, %{
|
def after_create_authorization(%Plug.Conn{} = conn, %Authorization{} = auth, %{
|
||||||
|
@ -197,7 +200,7 @@ defmodule Pleroma.Web.OAuth.OAuthController do
|
||||||
{:mfa_required, user, auth, _},
|
{:mfa_required, user, auth, _},
|
||||||
params
|
params
|
||||||
) do
|
) do
|
||||||
{:ok, token} = MFA.Token.create_token(user, auth)
|
{:ok, token} = MFA.Token.create(user, auth)
|
||||||
|
|
||||||
data = %{
|
data = %{
|
||||||
"mfa_token" => token.token,
|
"mfa_token" => token.token,
|
||||||
|
@ -579,7 +582,7 @@ defmodule Pleroma.Web.OAuth.OAuthController do
|
||||||
do: put_session(conn, :registration_id, registration_id)
|
do: put_session(conn, :registration_id, registration_id)
|
||||||
|
|
||||||
defp build_and_response_mfa_token(user, auth) do
|
defp build_and_response_mfa_token(user, auth) do
|
||||||
with {:ok, token} <- MFA.Token.create_token(user, auth) do
|
with {:ok, token} <- MFA.Token.create(user, auth) do
|
||||||
MFAView.render("mfa_response.json", %{token: token, user: user})
|
MFAView.render("mfa_response.json", %{token: token, user: user})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -50,7 +50,7 @@ defmodule Pleroma.Web.OAuth.Token do
|
||||||
true <- auth.app_id == app.id do
|
true <- auth.app_id == app.id do
|
||||||
user = if auth.user_id, do: User.get_cached_by_id(auth.user_id), else: %User{}
|
user = if auth.user_id, do: User.get_cached_by_id(auth.user_id), else: %User{}
|
||||||
|
|
||||||
create_token(
|
create(
|
||||||
app,
|
app,
|
||||||
user,
|
user,
|
||||||
%{scopes: auth.scopes}
|
%{scopes: auth.scopes}
|
||||||
|
@ -83,8 +83,22 @@ defmodule Pleroma.Web.OAuth.Token do
|
||||||
|> validate_required([:valid_until])
|
|> validate_required([:valid_until])
|
||||||
end
|
end
|
||||||
|
|
||||||
@spec create_token(App.t(), User.t(), map()) :: {:ok, Token} | {:error, Changeset.t()}
|
@spec create(App.t(), User.t(), map()) :: {:ok, Token} | {:error, Changeset.t()}
|
||||||
def create_token(%App{} = app, %User{} = user, attrs \\ %{}) do
|
def create(%App{} = app, %User{} = user, attrs \\ %{}) do
|
||||||
|
with {:ok, token} <- do_create(app, user, attrs) do
|
||||||
|
if Pleroma.Config.get([:oauth2, :clean_expired_tokens]) do
|
||||||
|
Pleroma.Workers.PurgeExpiredToken.enqueue(%{
|
||||||
|
token_id: token.id,
|
||||||
|
valid_until: DateTime.from_naive!(token.valid_until, "Etc/UTC"),
|
||||||
|
mod: __MODULE__
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
{:ok, token}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
defp do_create(app, user, attrs) do
|
||||||
%__MODULE__{user_id: user.id, app_id: app.id}
|
%__MODULE__{user_id: user.id, app_id: app.id}
|
||||||
|> cast(%{scopes: attrs[:scopes] || app.scopes}, [:scopes])
|
|> cast(%{scopes: attrs[:scopes] || app.scopes}, [:scopes])
|
||||||
|> validate_required([:scopes, :app_id])
|
|> validate_required([:scopes, :app_id])
|
||||||
|
@ -105,11 +119,6 @@ defmodule Pleroma.Web.OAuth.Token do
|
||||||
|> Repo.delete_all()
|
|> Repo.delete_all()
|
||||||
end
|
end
|
||||||
|
|
||||||
def delete_expired_tokens do
|
|
||||||
Query.get_expired_tokens()
|
|
||||||
|> Repo.delete_all()
|
|
||||||
end
|
|
||||||
|
|
||||||
def get_user_tokens(%User{id: user_id}) do
|
def get_user_tokens(%User{id: user_id}) do
|
||||||
Query.get_by_user(user_id)
|
Query.get_by_user(user_id)
|
||||||
|> Query.preload([:app])
|
|> Query.preload([:app])
|
||||||
|
|
|
@ -1,38 +0,0 @@
|
||||||
# Pleroma: A lightweight social networking server
|
|
||||||
# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
|
|
||||||
# SPDX-License-Identifier: AGPL-3.0-only
|
|
||||||
|
|
||||||
defmodule Pleroma.Web.OAuth.Token.CleanWorker do
|
|
||||||
@moduledoc """
|
|
||||||
The module represents functions to clean an expired OAuth and MFA tokens.
|
|
||||||
"""
|
|
||||||
use GenServer
|
|
||||||
|
|
||||||
@ten_seconds 10_000
|
|
||||||
@one_day 86_400_000
|
|
||||||
|
|
||||||
alias Pleroma.MFA
|
|
||||||
alias Pleroma.Web.OAuth
|
|
||||||
alias Pleroma.Workers.BackgroundWorker
|
|
||||||
|
|
||||||
def start_link(_), do: GenServer.start_link(__MODULE__, %{})
|
|
||||||
|
|
||||||
def init(_) do
|
|
||||||
Process.send_after(self(), :perform, @ten_seconds)
|
|
||||||
{:ok, nil}
|
|
||||||
end
|
|
||||||
|
|
||||||
@doc false
|
|
||||||
def handle_info(:perform, state) do
|
|
||||||
BackgroundWorker.enqueue("clean_expired_tokens", %{})
|
|
||||||
interval = Pleroma.Config.get([:oauth2, :clean_expired_tokens_interval], @one_day)
|
|
||||||
|
|
||||||
Process.send_after(self(), :perform, interval)
|
|
||||||
{:noreply, state}
|
|
||||||
end
|
|
||||||
|
|
||||||
def perform(:clean) do
|
|
||||||
OAuth.Token.delete_expired_tokens()
|
|
||||||
MFA.Token.delete_expired_tokens()
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -33,12 +33,6 @@ defmodule Pleroma.Web.OAuth.Token.Query do
|
||||||
from(q in query, where: q.id == ^id)
|
from(q in query, where: q.id == ^id)
|
||||||
end
|
end
|
||||||
|
|
||||||
@spec get_expired_tokens(query, DateTime.t() | nil) :: query
|
|
||||||
def get_expired_tokens(query \\ Token, date \\ nil) do
|
|
||||||
expired_date = date || Timex.now()
|
|
||||||
from(q in query, where: fragment("?", q.valid_until) < ^expired_date)
|
|
||||||
end
|
|
||||||
|
|
||||||
@spec get_by_user(query, String.t()) :: query
|
@spec get_by_user(query, String.t()) :: query
|
||||||
def get_by_user(query \\ Token, user_id) do
|
def get_by_user(query \\ Token, user_id) do
|
||||||
from(q in query, where: q.user_id == ^user_id)
|
from(q in query, where: q.user_id == ^user_id)
|
||||||
|
|
|
@ -46,7 +46,7 @@ defmodule Pleroma.Web.OAuth.Token.Strategy.RefreshToken do
|
||||||
defp create_access_token({:error, error}, _), do: {:error, error}
|
defp create_access_token({:error, error}, _), do: {:error, error}
|
||||||
|
|
||||||
defp create_access_token({:ok, token}, %{app: app, user: user} = token_params) do
|
defp create_access_token({:ok, token}, %{app: app, user: user} = token_params) do
|
||||||
Token.create_token(app, user, add_refresh_token(token_params, token.refresh_token))
|
Token.create(app, user, add_refresh_token(token_params, token.refresh_token))
|
||||||
end
|
end
|
||||||
|
|
||||||
defp add_refresh_token(params, token) do
|
defp add_refresh_token(params, token) do
|
||||||
|
|
|
@ -5,7 +5,8 @@
|
||||||
defmodule Pleroma.Web.RelMe do
|
defmodule Pleroma.Web.RelMe do
|
||||||
@options [
|
@options [
|
||||||
pool: :media,
|
pool: :media,
|
||||||
max_body: 2_000_000
|
max_body: 2_000_000,
|
||||||
|
recv_timeout: 2_000
|
||||||
]
|
]
|
||||||
|
|
||||||
if Pleroma.Config.get(:env) == :test do
|
if Pleroma.Config.get(:env) == :test do
|
||||||
|
@ -23,18 +24,8 @@ defmodule Pleroma.Web.RelMe do
|
||||||
def parse(_), do: {:error, "No URL provided"}
|
def parse(_), do: {:error, "No URL provided"}
|
||||||
|
|
||||||
defp parse_url(url) do
|
defp parse_url(url) do
|
||||||
opts =
|
|
||||||
if Application.get_env(:tesla, :adapter) == Tesla.Adapter.Hackney do
|
|
||||||
Keyword.merge(@options,
|
|
||||||
recv_timeout: 2_000,
|
|
||||||
with_body: true
|
|
||||||
)
|
|
||||||
else
|
|
||||||
@options
|
|
||||||
end
|
|
||||||
|
|
||||||
with {:ok, %Tesla.Env{body: html, status: status}} when status in 200..299 <-
|
with {:ok, %Tesla.Env{body: html, status: status}} when status in 200..299 <-
|
||||||
Pleroma.HTTP.get(url, [], adapter: opts),
|
Pleroma.HTTP.get(url, [], @options),
|
||||||
{:ok, html_tree} <- Floki.parse_document(html),
|
{:ok, html_tree} <- Floki.parse_document(html),
|
||||||
data <-
|
data <-
|
||||||
Floki.attribute(html_tree, "link[rel~=me]", "href") ++
|
Floki.attribute(html_tree, "link[rel~=me]", "href") ++
|
||||||
|
|
|
@ -9,14 +9,15 @@ defmodule Pleroma.Web.RichMedia.Helpers do
|
||||||
alias Pleroma.Object
|
alias Pleroma.Object
|
||||||
alias Pleroma.Web.RichMedia.Parser
|
alias Pleroma.Web.RichMedia.Parser
|
||||||
|
|
||||||
@rich_media_options [
|
@options [
|
||||||
pool: :media,
|
pool: :media,
|
||||||
max_body: 2_000_000
|
max_body: 2_000_000,
|
||||||
|
recv_timeout: 2_000
|
||||||
]
|
]
|
||||||
|
|
||||||
@spec validate_page_url(URI.t() | binary()) :: :ok | :error
|
@spec validate_page_url(URI.t() | binary()) :: :ok | :error
|
||||||
defp validate_page_url(page_url) when is_binary(page_url) do
|
defp validate_page_url(page_url) when is_binary(page_url) do
|
||||||
validate_tld = Pleroma.Config.get([Pleroma.Formatter, :validate_tld])
|
validate_tld = Config.get([Pleroma.Formatter, :validate_tld])
|
||||||
|
|
||||||
page_url
|
page_url
|
||||||
|> Linkify.Parser.url?(validate_tld: validate_tld)
|
|> Linkify.Parser.url?(validate_tld: validate_tld)
|
||||||
|
@ -86,16 +87,6 @@ defmodule Pleroma.Web.RichMedia.Helpers do
|
||||||
def rich_media_get(url) do
|
def rich_media_get(url) do
|
||||||
headers = [{"user-agent", Pleroma.Application.user_agent() <> "; Bot"}]
|
headers = [{"user-agent", Pleroma.Application.user_agent() <> "; Bot"}]
|
||||||
|
|
||||||
options =
|
Pleroma.HTTP.get(url, headers, @options)
|
||||||
if Application.get_env(:tesla, :adapter) == Tesla.Adapter.Hackney do
|
|
||||||
Keyword.merge(@rich_media_options,
|
|
||||||
recv_timeout: 2_000,
|
|
||||||
with_body: true
|
|
||||||
)
|
|
||||||
else
|
|
||||||
@rich_media_options
|
|
||||||
end
|
|
||||||
|
|
||||||
Pleroma.HTTP.get(url, headers, adapter: options)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -21,8 +21,13 @@ defmodule Pleroma.Web.RichMedia.Parser do
|
||||||
{:ok, _} <- set_ttl_based_on_image(data, url) do
|
{:ok, _} <- set_ttl_based_on_image(data, url) do
|
||||||
{:ok, data}
|
{:ok, data}
|
||||||
else
|
else
|
||||||
|
{:error, {:invalid_metadata, data}} = e ->
|
||||||
|
Logger.debug(fn -> "Incomplete or invalid metadata for #{url}: #{inspect(data)}" end)
|
||||||
|
e
|
||||||
|
|
||||||
error ->
|
error ->
|
||||||
Logger.error(fn -> "Rich media error: #{inspect(error)}" end)
|
Logger.error(fn -> "Rich media error for #{url}: #{inspect(error)}" end)
|
||||||
|
error
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -90,7 +95,7 @@ defmodule Pleroma.Web.RichMedia.Parser do
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
defp parse_url(url) do
|
def parse_url(url) do
|
||||||
with {:ok, %Tesla.Env{body: html}} <- Pleroma.Web.RichMedia.Helpers.rich_media_get(url),
|
with {:ok, %Tesla.Env{body: html}} <- Pleroma.Web.RichMedia.Helpers.rich_media_get(url),
|
||||||
{:ok, html} <- Floki.parse_document(html) do
|
{:ok, html} <- Floki.parse_document(html) do
|
||||||
html
|
html
|
||||||
|
@ -116,7 +121,7 @@ defmodule Pleroma.Web.RichMedia.Parser do
|
||||||
end
|
end
|
||||||
|
|
||||||
defp check_parsed_data(data) do
|
defp check_parsed_data(data) do
|
||||||
{:error, "Found metadata was invalid or incomplete: #{inspect(data)}"}
|
{:error, {:invalid_metadata, data}}
|
||||||
end
|
end
|
||||||
|
|
||||||
defp clean_parsed_data(data) do
|
defp clean_parsed_data(data) do
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
<h1>Successfully authorized</h1>
|
<h1>Successfully authorized</h1>
|
||||||
<h2>Token code is <%= @auth.token %></h2>
|
<h2>Token code is <br><%= @auth.token %></h2>
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
<h1>Authorization exists</h1>
|
<h1>Authorization exists</h1>
|
||||||
<h2>Access token is <%= @token.token %></h2>
|
<h2>Access token is <br><%= @token.token %></h2>
|
||||||
|
|
|
@ -135,7 +135,7 @@ defmodule Pleroma.Web.TwitterAPI.RemoteFollowController do
|
||||||
end
|
end
|
||||||
|
|
||||||
defp handle_follow_error(conn, {:mfa_required, followee, user, _} = _) do
|
defp handle_follow_error(conn, {:mfa_required, followee, user, _} = _) do
|
||||||
{:ok, %{token: token}} = MFA.Token.create_token(user)
|
{:ok, %{token: token}} = MFA.Token.create(user)
|
||||||
render(conn, "follow_mfa.html", %{followee: followee, mfa_token: token, error: false})
|
render(conn, "follow_mfa.html", %{followee: followee, mfa_token: token, error: false})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,23 +0,0 @@
|
||||||
# Pleroma: A lightweight social networking server
|
|
||||||
# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
|
|
||||||
# SPDX-License-Identifier: AGPL-3.0-only
|
|
||||||
|
|
||||||
defmodule Pleroma.Workers.Cron.ClearOauthTokenWorker do
|
|
||||||
@moduledoc """
|
|
||||||
The worker to cleanup expired oAuth tokens.
|
|
||||||
"""
|
|
||||||
|
|
||||||
use Oban.Worker, queue: "background"
|
|
||||||
|
|
||||||
alias Pleroma.Config
|
|
||||||
alias Pleroma.Web.OAuth.Token
|
|
||||||
|
|
||||||
@impl Oban.Worker
|
|
||||||
def perform(_job) do
|
|
||||||
if Config.get([:oauth2, :clean_expired_tokens], false) do
|
|
||||||
Token.delete_expired_tokens()
|
|
||||||
end
|
|
||||||
|
|
||||||
:ok
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -1,48 +0,0 @@
|
||||||
# Pleroma: A lightweight social networking server
|
|
||||||
# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
|
|
||||||
# SPDX-License-Identifier: AGPL-3.0-only
|
|
||||||
|
|
||||||
defmodule Pleroma.Workers.Cron.PurgeExpiredActivitiesWorker do
|
|
||||||
@moduledoc """
|
|
||||||
The worker to purge expired activities.
|
|
||||||
"""
|
|
||||||
|
|
||||||
use Oban.Worker, queue: "activity_expiration"
|
|
||||||
|
|
||||||
alias Pleroma.Activity
|
|
||||||
alias Pleroma.ActivityExpiration
|
|
||||||
alias Pleroma.Config
|
|
||||||
alias Pleroma.User
|
|
||||||
alias Pleroma.Web.CommonAPI
|
|
||||||
|
|
||||||
require Logger
|
|
||||||
|
|
||||||
@interval :timer.minutes(1)
|
|
||||||
|
|
||||||
@impl Oban.Worker
|
|
||||||
def perform(_job) do
|
|
||||||
if Config.get([ActivityExpiration, :enabled]) do
|
|
||||||
Enum.each(ActivityExpiration.due_expirations(@interval), &delete_activity/1)
|
|
||||||
end
|
|
||||||
after
|
|
||||||
:ok
|
|
||||||
end
|
|
||||||
|
|
||||||
def delete_activity(%ActivityExpiration{activity_id: activity_id}) do
|
|
||||||
with {:activity, %Activity{} = activity} <-
|
|
||||||
{:activity, Activity.get_by_id_with_object(activity_id)},
|
|
||||||
{:user, %User{} = user} <- {:user, User.get_by_ap_id(activity.object.data["actor"])} do
|
|
||||||
CommonAPI.delete(activity.id, user)
|
|
||||||
else
|
|
||||||
{:activity, _} ->
|
|
||||||
Logger.error(
|
|
||||||
"#{__MODULE__} Couldn't delete expired activity: not found activity ##{activity_id}"
|
|
||||||
)
|
|
||||||
|
|
||||||
{:user, _} ->
|
|
||||||
Logger.error(
|
|
||||||
"#{__MODULE__} Couldn't delete expired activity: not found actor of ##{activity_id}"
|
|
||||||
)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -1,17 +0,0 @@
|
||||||
# Pleroma: A lightweight social networking server
|
|
||||||
# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
|
|
||||||
# SPDX-License-Identifier: AGPL-3.0-only
|
|
||||||
|
|
||||||
defmodule Pleroma.Workers.Cron.StatsWorker do
|
|
||||||
@moduledoc """
|
|
||||||
The worker to update peers statistics.
|
|
||||||
"""
|
|
||||||
|
|
||||||
use Oban.Worker, queue: "background"
|
|
||||||
|
|
||||||
@impl Oban.Worker
|
|
||||||
def perform(_job) do
|
|
||||||
Pleroma.Stats.do_collect()
|
|
||||||
:ok
|
|
||||||
end
|
|
||||||
end
|
|
72
lib/pleroma/workers/purge_expired_activity.ex
Normal file
72
lib/pleroma/workers/purge_expired_activity.ex
Normal file
|
@ -0,0 +1,72 @@
|
||||||
|
# Pleroma: A lightweight social networking server
|
||||||
|
# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
|
||||||
|
# SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
|
defmodule Pleroma.Workers.PurgeExpiredActivity do
|
||||||
|
@moduledoc """
|
||||||
|
Worker which purges expired activity.
|
||||||
|
"""
|
||||||
|
|
||||||
|
use Oban.Worker, queue: :activity_expiration, max_attempts: 1
|
||||||
|
|
||||||
|
import Ecto.Query
|
||||||
|
|
||||||
|
alias Pleroma.Activity
|
||||||
|
|
||||||
|
@spec enqueue(map()) ::
|
||||||
|
{:ok, Oban.Job.t()}
|
||||||
|
| {:error, :expired_activities_disabled}
|
||||||
|
| {:error, :expiration_too_close}
|
||||||
|
def enqueue(args) do
|
||||||
|
with true <- enabled?() do
|
||||||
|
{scheduled_at, args} = Map.pop(args, :expires_at)
|
||||||
|
|
||||||
|
args
|
||||||
|
|> new(scheduled_at: scheduled_at)
|
||||||
|
|> Oban.insert()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
@impl true
|
||||||
|
def perform(%Oban.Job{args: %{"activity_id" => id}}) do
|
||||||
|
with %Activity{} = activity <- find_activity(id),
|
||||||
|
%Pleroma.User{} = user <- find_user(activity.object.data["actor"]) do
|
||||||
|
Pleroma.Web.CommonAPI.delete(activity.id, user)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
defp enabled? do
|
||||||
|
with false <- Pleroma.Config.get([__MODULE__, :enabled], false) do
|
||||||
|
{:error, :expired_activities_disabled}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
defp find_activity(id) do
|
||||||
|
with nil <- Activity.get_by_id_with_object(id) do
|
||||||
|
{:error, :activity_not_found}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
defp find_user(ap_id) do
|
||||||
|
with nil <- Pleroma.User.get_by_ap_id(ap_id) do
|
||||||
|
{:error, :user_not_found}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def get_expiration(id) do
|
||||||
|
from(j in Oban.Job,
|
||||||
|
where: j.state == "scheduled",
|
||||||
|
where: j.queue == "activity_expiration",
|
||||||
|
where: fragment("?->>'activity_id' = ?", j.args, ^id)
|
||||||
|
)
|
||||||
|
|> Pleroma.Repo.one()
|
||||||
|
end
|
||||||
|
|
||||||
|
@spec expires_late_enough?(DateTime.t()) :: boolean()
|
||||||
|
def expires_late_enough?(scheduled_at) do
|
||||||
|
now = DateTime.utc_now()
|
||||||
|
diff = DateTime.diff(scheduled_at, now, :millisecond)
|
||||||
|
min_lifetime = Pleroma.Config.get([__MODULE__, :min_lifetime], 600)
|
||||||
|
diff > :timer.seconds(min_lifetime)
|
||||||
|
end
|
||||||
|
end
|
29
lib/pleroma/workers/purge_expired_token.ex
Normal file
29
lib/pleroma/workers/purge_expired_token.ex
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
# Pleroma: A lightweight social networking server
|
||||||
|
# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
|
||||||
|
# SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
|
defmodule Pleroma.Workers.PurgeExpiredToken do
|
||||||
|
@moduledoc """
|
||||||
|
Worker which purges expired OAuth tokens
|
||||||
|
"""
|
||||||
|
|
||||||
|
use Oban.Worker, queue: :token_expiration, max_attempts: 1
|
||||||
|
|
||||||
|
@spec enqueue(%{token_id: integer(), valid_until: DateTime.t(), mod: module()}) ::
|
||||||
|
{:ok, Oban.Job.t()} | {:error, Ecto.Changeset.t()}
|
||||||
|
def enqueue(args) do
|
||||||
|
{scheduled_at, args} = Map.pop(args, :valid_until)
|
||||||
|
|
||||||
|
args
|
||||||
|
|> __MODULE__.new(scheduled_at: scheduled_at)
|
||||||
|
|> Oban.insert()
|
||||||
|
end
|
||||||
|
|
||||||
|
@impl true
|
||||||
|
def perform(%Oban.Job{args: %{"token_id" => id, "mod" => module}}) do
|
||||||
|
module
|
||||||
|
|> String.to_existing_atom()
|
||||||
|
|> Pleroma.Repo.get(id)
|
||||||
|
|> Pleroma.Repo.delete()
|
||||||
|
end
|
||||||
|
end
|
8
mix.exs
8
mix.exs
|
@ -4,7 +4,7 @@ defmodule Pleroma.Mixfile do
|
||||||
def project do
|
def project do
|
||||||
[
|
[
|
||||||
app: :pleroma,
|
app: :pleroma,
|
||||||
version: version("2.1.1"),
|
version: version("2.1.50"),
|
||||||
elixir: "~> 1.9",
|
elixir: "~> 1.9",
|
||||||
elixirc_paths: elixirc_paths(Mix.env()),
|
elixirc_paths: elixirc_paths(Mix.env()),
|
||||||
compilers: [:phoenix, :gettext] ++ Mix.compilers(),
|
compilers: [:phoenix, :gettext] ++ Mix.compilers(),
|
||||||
|
@ -134,7 +134,9 @@ defmodule Pleroma.Mixfile do
|
||||||
{:cachex, "~> 3.2"},
|
{:cachex, "~> 3.2"},
|
||||||
{:poison, "~> 3.0", override: true},
|
{:poison, "~> 3.0", override: true},
|
||||||
{:tesla,
|
{:tesla,
|
||||||
github: "teamon/tesla", ref: "af3707078b10793f6a534938e56b963aff82fe3c", override: true},
|
git: "https://github.com/teamon/tesla/",
|
||||||
|
ref: "9f7261ca49f9f901ceb73b60219ad6f8a9f6aa30",
|
||||||
|
override: true},
|
||||||
{:castore, "~> 0.1"},
|
{:castore, "~> 0.1"},
|
||||||
{:cowlib, "~> 2.9", override: true},
|
{:cowlib, "~> 2.9", override: true},
|
||||||
{:gun,
|
{:gun,
|
||||||
|
@ -178,7 +180,7 @@ defmodule Pleroma.Mixfile do
|
||||||
{:flake_id, "~> 0.1.0"},
|
{:flake_id, "~> 0.1.0"},
|
||||||
{:concurrent_limiter,
|
{:concurrent_limiter,
|
||||||
git: "https://git.pleroma.social/pleroma/elixir-libraries/concurrent_limiter.git",
|
git: "https://git.pleroma.social/pleroma/elixir-libraries/concurrent_limiter.git",
|
||||||
ref: "55e92f84b4ed531bd487952a71040a9c69dc2807"},
|
ref: "d81be41024569330f296fc472e24198d7499ba78"},
|
||||||
{:remote_ip,
|
{:remote_ip,
|
||||||
git: "https://git.pleroma.social/pleroma/remote_ip.git",
|
git: "https://git.pleroma.social/pleroma/remote_ip.git",
|
||||||
ref: "b647d0deecaa3acb140854fe4bda5b7e1dc6d1c8"},
|
ref: "b647d0deecaa3acb140854fe4bda5b7e1dc6d1c8"},
|
||||||
|
|
4
mix.lock
4
mix.lock
|
@ -14,7 +14,7 @@
|
||||||
"certifi": {:hex, :certifi, "2.5.1", "867ce347f7c7d78563450a18a6a28a8090331e77fa02380b4a21962a65d36ee5", [:rebar3], [{:parse_trans, "~>3.3", [hex: :parse_trans, repo: "hexpm", optional: false]}], "hexpm", "805abd97539caf89ec6d4732c91e62ba9da0cda51ac462380bbd28ee697a8c42"},
|
"certifi": {:hex, :certifi, "2.5.1", "867ce347f7c7d78563450a18a6a28a8090331e77fa02380b4a21962a65d36ee5", [:rebar3], [{:parse_trans, "~>3.3", [hex: :parse_trans, repo: "hexpm", optional: false]}], "hexpm", "805abd97539caf89ec6d4732c91e62ba9da0cda51ac462380bbd28ee697a8c42"},
|
||||||
"combine": {:hex, :combine, "0.10.0", "eff8224eeb56498a2af13011d142c5e7997a80c8f5b97c499f84c841032e429f", [:mix], [], "hexpm", "1b1dbc1790073076580d0d1d64e42eae2366583e7aecd455d1215b0d16f2451b"},
|
"combine": {:hex, :combine, "0.10.0", "eff8224eeb56498a2af13011d142c5e7997a80c8f5b97c499f84c841032e429f", [:mix], [], "hexpm", "1b1dbc1790073076580d0d1d64e42eae2366583e7aecd455d1215b0d16f2451b"},
|
||||||
"comeonin": {:hex, :comeonin, "5.3.1", "7fe612b739c78c9c1a75186ef2d322ce4d25032d119823269d0aa1e2f1e20025", [:mix], [], "hexpm", "d6222483060c17f0977fad1b7401ef0c5863c985a64352755f366aee3799c245"},
|
"comeonin": {:hex, :comeonin, "5.3.1", "7fe612b739c78c9c1a75186ef2d322ce4d25032d119823269d0aa1e2f1e20025", [:mix], [], "hexpm", "d6222483060c17f0977fad1b7401ef0c5863c985a64352755f366aee3799c245"},
|
||||||
"concurrent_limiter": {:git, "https://git.pleroma.social/pleroma/elixir-libraries/concurrent_limiter.git", "55e92f84b4ed531bd487952a71040a9c69dc2807", [ref: "55e92f84b4ed531bd487952a71040a9c69dc2807"]},
|
"concurrent_limiter": {:git, "https://git.pleroma.social/pleroma/elixir-libraries/concurrent_limiter.git", "d81be41024569330f296fc472e24198d7499ba78", [ref: "d81be41024569330f296fc472e24198d7499ba78"]},
|
||||||
"connection": {:hex, :connection, "1.0.4", "a1cae72211f0eef17705aaededacac3eb30e6625b04a6117c1b2db6ace7d5976", [:mix], [], "hexpm", "4a0850c9be22a43af9920a71ab17c051f5f7d45c209e40269a1938832510e4d9"},
|
"connection": {:hex, :connection, "1.0.4", "a1cae72211f0eef17705aaededacac3eb30e6625b04a6117c1b2db6ace7d5976", [:mix], [], "hexpm", "4a0850c9be22a43af9920a71ab17c051f5f7d45c209e40269a1938832510e4d9"},
|
||||||
"cors_plug": {:hex, :cors_plug, "2.0.2", "2b46083af45e4bc79632bd951550509395935d3e7973275b2b743bd63cc942ce", [:mix], [{:plug, "~> 1.8", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "f0d0e13f71c51fd4ef8b2c7e051388e4dfb267522a83a22392c856de7e46465f"},
|
"cors_plug": {:hex, :cors_plug, "2.0.2", "2b46083af45e4bc79632bd951550509395935d3e7973275b2b743bd63cc942ce", [:mix], [{:plug, "~> 1.8", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "f0d0e13f71c51fd4ef8b2c7e051388e4dfb267522a83a22392c856de7e46465f"},
|
||||||
"cowboy": {:hex, :cowboy, "2.8.0", "f3dc62e35797ecd9ac1b50db74611193c29815401e53bac9a5c0577bd7bc667d", [:rebar3], [{:cowlib, "~> 2.9.1", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "~> 1.7.1", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "4643e4fba74ac96d4d152c75803de6fad0b3fa5df354c71afdd6cbeeb15fac8a"},
|
"cowboy": {:hex, :cowboy, "2.8.0", "f3dc62e35797ecd9ac1b50db74611193c29815401e53bac9a5c0577bd7bc667d", [:rebar3], [{:cowlib, "~> 2.9.1", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "~> 1.7.1", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "4643e4fba74ac96d4d152c75803de6fad0b3fa5df354c71afdd6cbeeb15fac8a"},
|
||||||
|
@ -110,7 +110,7 @@
|
||||||
"swoosh": {:hex, :swoosh, "1.0.0", "c547cfc83f30e12d5d1fdcb623d7de2c2e29a5becfc68bf8f42ba4d23d2c2756", [:mix], [{:cowboy, "~> 1.0.1 or ~> 1.1 or ~> 2.4", [hex: :cowboy, repo: "hexpm", optional: true]}, {:gen_smtp, "~> 0.13", [hex: :gen_smtp, repo: "hexpm", optional: true]}, {:hackney, "~> 1.9", [hex: :hackney, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:mail, "~> 0.2", [hex: :mail, repo: "hexpm", optional: true]}, {:mime, "~> 1.1", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_cowboy, ">= 1.0.0", [hex: :plug_cowboy, repo: "hexpm", optional: true]}], "hexpm", "b3b08e463f876cb6167f7168e9ad99a069a724e124bcee61847e0e1ed13f4a0d"},
|
"swoosh": {:hex, :swoosh, "1.0.0", "c547cfc83f30e12d5d1fdcb623d7de2c2e29a5becfc68bf8f42ba4d23d2c2756", [:mix], [{:cowboy, "~> 1.0.1 or ~> 1.1 or ~> 2.4", [hex: :cowboy, repo: "hexpm", optional: true]}, {:gen_smtp, "~> 0.13", [hex: :gen_smtp, repo: "hexpm", optional: true]}, {:hackney, "~> 1.9", [hex: :hackney, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:mail, "~> 0.2", [hex: :mail, repo: "hexpm", optional: true]}, {:mime, "~> 1.1", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_cowboy, ">= 1.0.0", [hex: :plug_cowboy, repo: "hexpm", optional: true]}], "hexpm", "b3b08e463f876cb6167f7168e9ad99a069a724e124bcee61847e0e1ed13f4a0d"},
|
||||||
"syslog": {:hex, :syslog, "1.1.0", "6419a232bea84f07b56dc575225007ffe34d9fdc91abe6f1b2f254fd71d8efc2", [:rebar3], [], "hexpm", "4c6a41373c7e20587be33ef841d3de6f3beba08519809329ecc4d27b15b659e1"},
|
"syslog": {:hex, :syslog, "1.1.0", "6419a232bea84f07b56dc575225007ffe34d9fdc91abe6f1b2f254fd71d8efc2", [:rebar3], [], "hexpm", "4c6a41373c7e20587be33ef841d3de6f3beba08519809329ecc4d27b15b659e1"},
|
||||||
"telemetry": {:hex, :telemetry, "0.4.2", "2808c992455e08d6177322f14d3bdb6b625fbcfd233a73505870d8738a2f4599", [:rebar3], [], "hexpm", "2d1419bd9dda6a206d7b5852179511722e2b18812310d304620c7bd92a13fcef"},
|
"telemetry": {:hex, :telemetry, "0.4.2", "2808c992455e08d6177322f14d3bdb6b625fbcfd233a73505870d8738a2f4599", [:rebar3], [], "hexpm", "2d1419bd9dda6a206d7b5852179511722e2b18812310d304620c7bd92a13fcef"},
|
||||||
"tesla": {:git, "https://github.com/teamon/tesla.git", "af3707078b10793f6a534938e56b963aff82fe3c", [ref: "af3707078b10793f6a534938e56b963aff82fe3c"]},
|
"tesla": {:git, "https://github.com/teamon/tesla/", "9f7261ca49f9f901ceb73b60219ad6f8a9f6aa30", [ref: "9f7261ca49f9f901ceb73b60219ad6f8a9f6aa30"]},
|
||||||
"timex": {:hex, :timex, "3.6.2", "845cdeb6119e2fef10751c0b247b6c59d86d78554c83f78db612e3290f819bc2", [:mix], [{:combine, "~> 0.10", [hex: :combine, repo: "hexpm", optional: false]}, {:gettext, "~> 0.10", [hex: :gettext, repo: "hexpm", optional: false]}, {:tzdata, "~> 0.1.8 or ~> 0.5 or ~> 1.0.0", [hex: :tzdata, repo: "hexpm", optional: false]}], "hexpm", "26030b46199d02a590be61c2394b37ea25a3664c02fafbeca0b24c972025d47a"},
|
"timex": {:hex, :timex, "3.6.2", "845cdeb6119e2fef10751c0b247b6c59d86d78554c83f78db612e3290f819bc2", [:mix], [{:combine, "~> 0.10", [hex: :combine, repo: "hexpm", optional: false]}, {:gettext, "~> 0.10", [hex: :gettext, repo: "hexpm", optional: false]}, {:tzdata, "~> 0.1.8 or ~> 0.5 or ~> 1.0.0", [hex: :tzdata, repo: "hexpm", optional: false]}], "hexpm", "26030b46199d02a590be61c2394b37ea25a3664c02fafbeca0b24c972025d47a"},
|
||||||
"trailing_format_plug": {:hex, :trailing_format_plug, "0.0.7", "64b877f912cf7273bed03379936df39894149e35137ac9509117e59866e10e45", [:mix], [{:plug, "> 0.12.0", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "bd4fde4c15f3e993a999e019d64347489b91b7a9096af68b2bdadd192afa693f"},
|
"trailing_format_plug": {:hex, :trailing_format_plug, "0.0.7", "64b877f912cf7273bed03379936df39894149e35137ac9509117e59866e10e45", [:mix], [{:plug, "> 0.12.0", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "bd4fde4c15f3e993a999e019d64347489b91b7a9096af68b2bdadd192afa693f"},
|
||||||
"tzdata": {:hex, :tzdata, "1.0.3", "73470ad29dde46e350c60a66e6b360d3b99d2d18b74c4c349dbebbc27a09a3eb", [:mix], [{:hackney, "~> 1.0", [hex: :hackney, repo: "hexpm", optional: false]}], "hexpm", "a6e1ee7003c4d04ecbd21dd3ec690d4c6662db5d3bbdd7262d53cdf5e7c746c1"},
|
"tzdata": {:hex, :tzdata, "1.0.3", "73470ad29dde46e350c60a66e6b360d3b99d2d18b74c4c349dbebbc27a09a3eb", [:mix], [{:hackney, "~> 1.0", [hex: :hackney, repo: "hexpm", optional: false]}], "hexpm", "a6e1ee7003c4d04ecbd21dd3ec690d4c6662db5d3bbdd7262d53cdf5e7c746c1"},
|
||||||
|
|
586
priv/gettext/es/LC_MESSAGES/errors.po
Normal file
586
priv/gettext/es/LC_MESSAGES/errors.po
Normal file
|
@ -0,0 +1,586 @@
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: PACKAGE VERSION\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2020-09-09 09:49+0000\n"
|
||||||
|
"PO-Revision-Date: 2020-09-09 10:52+0000\n"
|
||||||
|
"Last-Translator: tarteka <info@tarteka.net>\n"
|
||||||
|
"Language-Team: Spanish <https://translate.pleroma.social/projects/pleroma/"
|
||||||
|
"pleroma/es/>\n"
|
||||||
|
"Language: es\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
||||||
|
"X-Generator: Weblate 4.0.4\n"
|
||||||
|
|
||||||
|
## This file is a PO Template file.
|
||||||
|
##
|
||||||
|
## `msgid`s here are often extracted from source code.
|
||||||
|
## Add new translations manually only if they're dynamic
|
||||||
|
## translations that can't be statically extracted.
|
||||||
|
##
|
||||||
|
## Run `mix gettext.extract` to bring this file up to
|
||||||
|
## date. Leave `msgstr`s empty as changing them here as no
|
||||||
|
## effect: edit them in PO (`.po`) files instead.
|
||||||
|
## From Ecto.Changeset.cast/4
|
||||||
|
msgid "can't be blank"
|
||||||
|
msgstr "no puede estar en blanco"
|
||||||
|
|
||||||
|
## From Ecto.Changeset.unique_constraint/3
|
||||||
|
msgid "has already been taken"
|
||||||
|
msgstr "ya está en uso"
|
||||||
|
|
||||||
|
## From Ecto.Changeset.put_change/3
|
||||||
|
msgid "is invalid"
|
||||||
|
msgstr "es inválido"
|
||||||
|
|
||||||
|
## From Ecto.Changeset.validate_format/3
|
||||||
|
msgid "has invalid format"
|
||||||
|
msgstr "el formato no es válido"
|
||||||
|
|
||||||
|
## From Ecto.Changeset.validate_subset/3
|
||||||
|
msgid "has an invalid entry"
|
||||||
|
msgstr "tiene una entrada inválida"
|
||||||
|
|
||||||
|
## From Ecto.Changeset.validate_exclusion/3
|
||||||
|
msgid "is reserved"
|
||||||
|
msgstr "está reservado"
|
||||||
|
|
||||||
|
## From Ecto.Changeset.validate_confirmation/3
|
||||||
|
msgid "does not match confirmation"
|
||||||
|
msgstr "la confirmación no coincide"
|
||||||
|
|
||||||
|
## From Ecto.Changeset.no_assoc_constraint/3
|
||||||
|
msgid "is still associated with this entry"
|
||||||
|
msgstr "todavía está asociado con esta entrada"
|
||||||
|
|
||||||
|
msgid "are still associated with this entry"
|
||||||
|
msgstr "todavía están asociados con esta entrada"
|
||||||
|
|
||||||
|
## From Ecto.Changeset.validate_length/3
|
||||||
|
msgid "should be %{count} character(s)"
|
||||||
|
msgid_plural "should be %{count} character(s)"
|
||||||
|
msgstr[0] "debe tener %{count} carácter"
|
||||||
|
msgstr[1] "debe tener %{count} caracteres"
|
||||||
|
|
||||||
|
msgid "should have %{count} item(s)"
|
||||||
|
msgid_plural "should have %{count} item(s)"
|
||||||
|
msgstr[0] ""
|
||||||
|
msgstr[1] ""
|
||||||
|
|
||||||
|
msgid "should be at least %{count} character(s)"
|
||||||
|
msgid_plural "should be at least %{count} character(s)"
|
||||||
|
msgstr[0] ""
|
||||||
|
msgstr[1] ""
|
||||||
|
|
||||||
|
msgid "should have at least %{count} item(s)"
|
||||||
|
msgid_plural "should have at least %{count} item(s)"
|
||||||
|
msgstr[0] ""
|
||||||
|
msgstr[1] ""
|
||||||
|
|
||||||
|
msgid "should be at most %{count} character(s)"
|
||||||
|
msgid_plural "should be at most %{count} character(s)"
|
||||||
|
msgstr[0] ""
|
||||||
|
msgstr[1] ""
|
||||||
|
|
||||||
|
msgid "should have at most %{count} item(s)"
|
||||||
|
msgid_plural "should have at most %{count} item(s)"
|
||||||
|
msgstr[0] ""
|
||||||
|
msgstr[1] ""
|
||||||
|
|
||||||
|
## From Ecto.Changeset.validate_number/3
|
||||||
|
msgid "must be less than %{number}"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
msgid "must be greater than %{number}"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
msgid "must be less than or equal to %{number}"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
msgid "must be greater than or equal to %{number}"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
msgid "must be equal to %{number}"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/common_api/common_api.ex:505
|
||||||
|
#, elixir-format
|
||||||
|
msgid "Account not found"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/common_api/common_api.ex:339
|
||||||
|
#, elixir-format
|
||||||
|
msgid "Already voted"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/oauth/oauth_controller.ex:359
|
||||||
|
#, elixir-format
|
||||||
|
msgid "Bad request"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/activity_pub/activity_pub_controller.ex:426
|
||||||
|
#, elixir-format
|
||||||
|
msgid "Can't delete object"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/controller_helper.ex:105
|
||||||
|
#: lib/pleroma/web/controller_helper.ex:111
|
||||||
|
#, elixir-format
|
||||||
|
msgid "Can't display this activity"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/mastodon_api/controllers/account_controller.ex:285
|
||||||
|
#, elixir-format
|
||||||
|
msgid "Can't find user"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/pleroma_api/controllers/account_controller.ex:61
|
||||||
|
#, elixir-format
|
||||||
|
msgid "Can't get favorites"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/activity_pub/activity_pub_controller.ex:438
|
||||||
|
#, elixir-format
|
||||||
|
msgid "Can't like object"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/common_api/utils.ex:563
|
||||||
|
#, elixir-format
|
||||||
|
msgid "Cannot post an empty status without attachments"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/common_api/utils.ex:511
|
||||||
|
#, elixir-format
|
||||||
|
msgid "Comment must be up to %{max_size} characters"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/config/config_db.ex:191
|
||||||
|
#, elixir-format
|
||||||
|
msgid "Config with params %{params} not found"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/common_api/common_api.ex:181
|
||||||
|
#: lib/pleroma/web/common_api/common_api.ex:185
|
||||||
|
#, elixir-format
|
||||||
|
msgid "Could not delete"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/common_api/common_api.ex:231
|
||||||
|
#, elixir-format
|
||||||
|
msgid "Could not favorite"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/common_api/common_api.ex:453
|
||||||
|
#, elixir-format
|
||||||
|
msgid "Could not pin"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/common_api/common_api.ex:278
|
||||||
|
#, elixir-format
|
||||||
|
msgid "Could not unfavorite"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/common_api/common_api.ex:463
|
||||||
|
#, elixir-format
|
||||||
|
msgid "Could not unpin"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/common_api/common_api.ex:216
|
||||||
|
#, elixir-format
|
||||||
|
msgid "Could not unrepeat"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/common_api/common_api.ex:512
|
||||||
|
#: lib/pleroma/web/common_api/common_api.ex:521
|
||||||
|
#, elixir-format
|
||||||
|
msgid "Could not update state"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/mastodon_api/controllers/timeline_controller.ex:207
|
||||||
|
#, elixir-format
|
||||||
|
msgid "Error."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/twitter_api/twitter_api.ex:106
|
||||||
|
#, elixir-format
|
||||||
|
msgid "Invalid CAPTCHA"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/mastodon_api/controllers/account_controller.ex:116
|
||||||
|
#: lib/pleroma/web/oauth/oauth_controller.ex:568
|
||||||
|
#, elixir-format
|
||||||
|
msgid "Invalid credentials"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/plugs/ensure_authenticated_plug.ex:38
|
||||||
|
#, elixir-format
|
||||||
|
msgid "Invalid credentials."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/common_api/common_api.ex:355
|
||||||
|
#, elixir-format
|
||||||
|
msgid "Invalid indices"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/admin_api/controllers/fallback_controller.ex:29
|
||||||
|
#, elixir-format
|
||||||
|
msgid "Invalid parameters"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/common_api/utils.ex:414
|
||||||
|
#, elixir-format
|
||||||
|
msgid "Invalid password."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/mastodon_api/controllers/account_controller.ex:220
|
||||||
|
#, elixir-format
|
||||||
|
msgid "Invalid request"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/twitter_api/twitter_api.ex:109
|
||||||
|
#, elixir-format
|
||||||
|
msgid "Kocaptcha service unavailable"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/mastodon_api/controllers/account_controller.ex:112
|
||||||
|
#, elixir-format
|
||||||
|
msgid "Missing parameters"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/common_api/utils.ex:547
|
||||||
|
#, elixir-format
|
||||||
|
msgid "No such conversation"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/admin_api/controllers/admin_api_controller.ex:388
|
||||||
|
#: lib/pleroma/web/admin_api/controllers/admin_api_controller.ex:414 lib/pleroma/web/admin_api/controllers/admin_api_controller.ex:456
|
||||||
|
#, elixir-format
|
||||||
|
msgid "No such permission_group"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/plugs/uploaded_media.ex:84
|
||||||
|
#: lib/pleroma/web/activity_pub/activity_pub_controller.ex:486 lib/pleroma/web/admin_api/controllers/fallback_controller.ex:11
|
||||||
|
#: lib/pleroma/web/feed/user_controller.ex:71 lib/pleroma/web/ostatus/ostatus_controller.ex:143
|
||||||
|
#, elixir-format
|
||||||
|
msgid "Not found"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/common_api/common_api.ex:331
|
||||||
|
#, elixir-format
|
||||||
|
msgid "Poll's author can't vote"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/mastodon_api/controllers/fallback_controller.ex:20
|
||||||
|
#: lib/pleroma/web/mastodon_api/controllers/poll_controller.ex:37 lib/pleroma/web/mastodon_api/controllers/poll_controller.ex:49
|
||||||
|
#: lib/pleroma/web/mastodon_api/controllers/poll_controller.ex:50 lib/pleroma/web/mastodon_api/controllers/status_controller.ex:306
|
||||||
|
#: lib/pleroma/web/mastodon_api/controllers/subscription_controller.ex:71
|
||||||
|
#, elixir-format
|
||||||
|
msgid "Record not found"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/admin_api/controllers/fallback_controller.ex:35
|
||||||
|
#: lib/pleroma/web/feed/user_controller.ex:77 lib/pleroma/web/mastodon_api/controllers/fallback_controller.ex:36
|
||||||
|
#: lib/pleroma/web/ostatus/ostatus_controller.ex:149
|
||||||
|
#, elixir-format
|
||||||
|
msgid "Something went wrong"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/common_api/activity_draft.ex:107
|
||||||
|
#, elixir-format
|
||||||
|
msgid "The message visibility must be direct"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/common_api/utils.ex:573
|
||||||
|
#, elixir-format
|
||||||
|
msgid "The status is over the character limit"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/plugs/ensure_public_or_authenticated_plug.ex:31
|
||||||
|
#, elixir-format
|
||||||
|
msgid "This resource requires authentication."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/plugs/rate_limiter/rate_limiter.ex:206
|
||||||
|
#, elixir-format
|
||||||
|
msgid "Throttled"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/common_api/common_api.ex:356
|
||||||
|
#, elixir-format
|
||||||
|
msgid "Too many choices"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/activity_pub/activity_pub_controller.ex:443
|
||||||
|
#, elixir-format
|
||||||
|
msgid "Unhandled activity type"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/admin_api/controllers/admin_api_controller.ex:485
|
||||||
|
#, elixir-format
|
||||||
|
msgid "You can't revoke your own admin status."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/oauth/oauth_controller.ex:221
|
||||||
|
#: lib/pleroma/web/oauth/oauth_controller.ex:308
|
||||||
|
#, elixir-format
|
||||||
|
msgid "Your account is currently disabled"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/oauth/oauth_controller.ex:183
|
||||||
|
#: lib/pleroma/web/oauth/oauth_controller.ex:331
|
||||||
|
#, elixir-format
|
||||||
|
msgid "Your login is missing a confirmed e-mail address"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/activity_pub/activity_pub_controller.ex:390
|
||||||
|
#, elixir-format
|
||||||
|
msgid "can't read inbox of %{nickname} as %{as_nickname}"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/activity_pub/activity_pub_controller.ex:473
|
||||||
|
#, elixir-format
|
||||||
|
msgid "can't update outbox of %{nickname} as %{as_nickname}"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/common_api/common_api.ex:471
|
||||||
|
#, elixir-format
|
||||||
|
msgid "conversation is already muted"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/activity_pub/activity_pub_controller.ex:314
|
||||||
|
#: lib/pleroma/web/activity_pub/activity_pub_controller.ex:492
|
||||||
|
#, elixir-format
|
||||||
|
msgid "error"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/pleroma_api/controllers/mascot_controller.ex:32
|
||||||
|
#, elixir-format
|
||||||
|
msgid "mascots can only be images"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/activity_pub/activity_pub_controller.ex:62
|
||||||
|
#, elixir-format
|
||||||
|
msgid "not found"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/oauth/oauth_controller.ex:394
|
||||||
|
#, elixir-format
|
||||||
|
msgid "Bad OAuth request."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/twitter_api/twitter_api.ex:115
|
||||||
|
#, elixir-format
|
||||||
|
msgid "CAPTCHA already used"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/twitter_api/twitter_api.ex:112
|
||||||
|
#, elixir-format
|
||||||
|
msgid "CAPTCHA expired"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/plugs/uploaded_media.ex:57
|
||||||
|
#, elixir-format
|
||||||
|
msgid "Failed"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/oauth/oauth_controller.ex:410
|
||||||
|
#, elixir-format
|
||||||
|
msgid "Failed to authenticate: %{message}."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/oauth/oauth_controller.ex:441
|
||||||
|
#, elixir-format
|
||||||
|
msgid "Failed to set up user account."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/plugs/oauth_scopes_plug.ex:38
|
||||||
|
#, elixir-format
|
||||||
|
msgid "Insufficient permissions: %{permissions}."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/plugs/uploaded_media.ex:104
|
||||||
|
#, elixir-format
|
||||||
|
msgid "Internal Error"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/oauth/fallback_controller.ex:22
|
||||||
|
#: lib/pleroma/web/oauth/fallback_controller.ex:29
|
||||||
|
#, elixir-format
|
||||||
|
msgid "Invalid Username/Password"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/twitter_api/twitter_api.ex:118
|
||||||
|
#, elixir-format
|
||||||
|
msgid "Invalid answer data"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/nodeinfo/nodeinfo_controller.ex:33
|
||||||
|
#, elixir-format
|
||||||
|
msgid "Nodeinfo schema version not handled"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/oauth/oauth_controller.ex:172
|
||||||
|
#, elixir-format
|
||||||
|
msgid "This action is outside the authorized scopes"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/oauth/fallback_controller.ex:14
|
||||||
|
#, elixir-format
|
||||||
|
msgid "Unknown error, please check the details and try again."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/oauth/oauth_controller.ex:119
|
||||||
|
#: lib/pleroma/web/oauth/oauth_controller.ex:158
|
||||||
|
#, elixir-format
|
||||||
|
msgid "Unlisted redirect_uri."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/oauth/oauth_controller.ex:390
|
||||||
|
#, elixir-format
|
||||||
|
msgid "Unsupported OAuth provider: %{provider}."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/uploaders/uploader.ex:72
|
||||||
|
#, elixir-format
|
||||||
|
msgid "Uploader callback timeout"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/uploader_controller.ex:23
|
||||||
|
#, elixir-format
|
||||||
|
msgid "bad request"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/twitter_api/twitter_api.ex:103
|
||||||
|
#, elixir-format
|
||||||
|
msgid "CAPTCHA Error"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/common_api/common_api.ex:290
|
||||||
|
#, elixir-format
|
||||||
|
msgid "Could not add reaction emoji"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/common_api/common_api.ex:301
|
||||||
|
#, elixir-format
|
||||||
|
msgid "Could not remove reaction emoji"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/twitter_api/twitter_api.ex:129
|
||||||
|
#, elixir-format
|
||||||
|
msgid "Invalid CAPTCHA (Missing parameter: %{name})"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/mastodon_api/controllers/list_controller.ex:92
|
||||||
|
#, elixir-format
|
||||||
|
msgid "List not found"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/mastodon_api/controllers/account_controller.ex:123
|
||||||
|
#, elixir-format
|
||||||
|
msgid "Missing parameter: %{name}"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/oauth/oauth_controller.ex:210
|
||||||
|
#: lib/pleroma/web/oauth/oauth_controller.ex:321
|
||||||
|
#, elixir-format
|
||||||
|
msgid "Password reset is required"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/tests/auth_test_controller.ex:9
|
||||||
|
#: lib/pleroma/web/activity_pub/activity_pub_controller.ex:6 lib/pleroma/web/admin_api/controllers/admin_api_controller.ex:6
|
||||||
|
#: lib/pleroma/web/admin_api/controllers/config_controller.ex:6 lib/pleroma/web/admin_api/controllers/fallback_controller.ex:6
|
||||||
|
#: lib/pleroma/web/admin_api/controllers/invite_controller.ex:6 lib/pleroma/web/admin_api/controllers/media_proxy_cache_controller.ex:6
|
||||||
|
#: lib/pleroma/web/admin_api/controllers/oauth_app_controller.ex:6 lib/pleroma/web/admin_api/controllers/relay_controller.ex:6
|
||||||
|
#: lib/pleroma/web/admin_api/controllers/report_controller.ex:6 lib/pleroma/web/admin_api/controllers/status_controller.ex:6
|
||||||
|
#: lib/pleroma/web/controller_helper.ex:6 lib/pleroma/web/embed_controller.ex:6
|
||||||
|
#: lib/pleroma/web/fallback_redirect_controller.ex:6 lib/pleroma/web/feed/tag_controller.ex:6
|
||||||
|
#: lib/pleroma/web/feed/user_controller.ex:6 lib/pleroma/web/mailer/subscription_controller.ex:2
|
||||||
|
#: lib/pleroma/web/masto_fe_controller.ex:6 lib/pleroma/web/mastodon_api/controllers/account_controller.ex:6
|
||||||
|
#: lib/pleroma/web/mastodon_api/controllers/app_controller.ex:6 lib/pleroma/web/mastodon_api/controllers/auth_controller.ex:6
|
||||||
|
#: lib/pleroma/web/mastodon_api/controllers/conversation_controller.ex:6 lib/pleroma/web/mastodon_api/controllers/custom_emoji_controller.ex:6
|
||||||
|
#: lib/pleroma/web/mastodon_api/controllers/domain_block_controller.ex:6 lib/pleroma/web/mastodon_api/controllers/fallback_controller.ex:6
|
||||||
|
#: lib/pleroma/web/mastodon_api/controllers/filter_controller.ex:6 lib/pleroma/web/mastodon_api/controllers/follow_request_controller.ex:6
|
||||||
|
#: lib/pleroma/web/mastodon_api/controllers/instance_controller.ex:6 lib/pleroma/web/mastodon_api/controllers/list_controller.ex:6
|
||||||
|
#: lib/pleroma/web/mastodon_api/controllers/marker_controller.ex:6 lib/pleroma/web/mastodon_api/controllers/mastodon_api_controller.ex:14
|
||||||
|
#: lib/pleroma/web/mastodon_api/controllers/media_controller.ex:6 lib/pleroma/web/mastodon_api/controllers/notification_controller.ex:6
|
||||||
|
#: lib/pleroma/web/mastodon_api/controllers/poll_controller.ex:6 lib/pleroma/web/mastodon_api/controllers/report_controller.ex:8
|
||||||
|
#: lib/pleroma/web/mastodon_api/controllers/scheduled_activity_controller.ex:6 lib/pleroma/web/mastodon_api/controllers/search_controller.ex:6
|
||||||
|
#: lib/pleroma/web/mastodon_api/controllers/status_controller.ex:6 lib/pleroma/web/mastodon_api/controllers/subscription_controller.ex:7
|
||||||
|
#: lib/pleroma/web/mastodon_api/controllers/suggestion_controller.ex:6 lib/pleroma/web/mastodon_api/controllers/timeline_controller.ex:6
|
||||||
|
#: lib/pleroma/web/media_proxy/media_proxy_controller.ex:6 lib/pleroma/web/mongooseim/mongoose_im_controller.ex:6
|
||||||
|
#: lib/pleroma/web/nodeinfo/nodeinfo_controller.ex:6 lib/pleroma/web/oauth/fallback_controller.ex:6
|
||||||
|
#: lib/pleroma/web/oauth/mfa_controller.ex:10 lib/pleroma/web/oauth/oauth_controller.ex:6
|
||||||
|
#: lib/pleroma/web/ostatus/ostatus_controller.ex:6 lib/pleroma/web/pleroma_api/controllers/account_controller.ex:6
|
||||||
|
#: lib/pleroma/web/pleroma_api/controllers/chat_controller.ex:5 lib/pleroma/web/pleroma_api/controllers/conversation_controller.ex:6
|
||||||
|
#: lib/pleroma/web/pleroma_api/controllers/emoji_pack_controller.ex:2 lib/pleroma/web/pleroma_api/controllers/emoji_reaction_controller.ex:6
|
||||||
|
#: lib/pleroma/web/pleroma_api/controllers/mascot_controller.ex:6 lib/pleroma/web/pleroma_api/controllers/notification_controller.ex:6
|
||||||
|
#: lib/pleroma/web/pleroma_api/controllers/scrobble_controller.ex:6
|
||||||
|
#: lib/pleroma/web/pleroma_api/controllers/two_factor_authentication_controller.ex:7 lib/pleroma/web/static_fe/static_fe_controller.ex:6
|
||||||
|
#: lib/pleroma/web/twitter_api/controllers/password_controller.ex:10 lib/pleroma/web/twitter_api/controllers/remote_follow_controller.ex:6
|
||||||
|
#: lib/pleroma/web/twitter_api/controllers/util_controller.ex:6 lib/pleroma/web/twitter_api/twitter_api_controller.ex:6
|
||||||
|
#: lib/pleroma/web/uploader_controller.ex:6 lib/pleroma/web/web_finger/web_finger_controller.ex:6
|
||||||
|
#, elixir-format
|
||||||
|
msgid "Security violation: OAuth scopes check was neither handled nor explicitly skipped."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/plugs/ensure_authenticated_plug.ex:28
|
||||||
|
#, elixir-format
|
||||||
|
msgid "Two-factor authentication enabled, you must use a access token."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/pleroma_api/controllers/emoji_pack_controller.ex:210
|
||||||
|
#, elixir-format
|
||||||
|
msgid "Unexpected error occurred while adding file to pack."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/pleroma_api/controllers/emoji_pack_controller.ex:138
|
||||||
|
#, elixir-format
|
||||||
|
msgid "Unexpected error occurred while creating pack."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/pleroma_api/controllers/emoji_pack_controller.ex:278
|
||||||
|
#, elixir-format
|
||||||
|
msgid "Unexpected error occurred while removing file from pack."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/pleroma_api/controllers/emoji_pack_controller.ex:250
|
||||||
|
#, elixir-format
|
||||||
|
msgid "Unexpected error occurred while updating file in pack."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/pleroma_api/controllers/emoji_pack_controller.ex:179
|
||||||
|
#, elixir-format
|
||||||
|
msgid "Unexpected error occurred while updating pack metadata."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/mastodon_api/controllers/subscription_controller.ex:61
|
||||||
|
#, elixir-format
|
||||||
|
msgid "Web push subscription is disabled on this Pleroma instance"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/admin_api/controllers/admin_api_controller.ex:451
|
||||||
|
#, elixir-format
|
||||||
|
msgid "You can't revoke your own admin/moderator status."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/mastodon_api/controllers/timeline_controller.ex:126
|
||||||
|
#, elixir-format
|
||||||
|
msgid "authorization required for timeline view"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/mastodon_api/controllers/fallback_controller.ex:24
|
||||||
|
#, elixir-format
|
||||||
|
msgid "Access denied"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/web/mastodon_api/controllers/account_controller.ex:282
|
||||||
|
#, elixir-format
|
||||||
|
msgid "This API requires an authenticated user"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/pleroma/plugs/user_is_admin_plug.ex:21
|
||||||
|
#, elixir-format
|
||||||
|
msgid "User is not an admin."
|
||||||
|
msgstr ""
|
|
@ -0,0 +1,13 @@
|
||||||
|
defmodule Pleroma.Repo.Migrations.RenameActivityExpirationSetting do
|
||||||
|
use Ecto.Migration
|
||||||
|
|
||||||
|
def change do
|
||||||
|
config = Pleroma.ConfigDB.get_by_params(%{group: :pleroma, key: Pleroma.ActivityExpiration})
|
||||||
|
|
||||||
|
if config do
|
||||||
|
config
|
||||||
|
|> Ecto.Changeset.change(key: Pleroma.Workers.PurgeExpiredActivity)
|
||||||
|
|> Pleroma.Repo.update()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,26 @@
|
||||||
|
defmodule Pleroma.Repo.Migrations.MoveActivityExpirationsToOban do
|
||||||
|
use Ecto.Migration
|
||||||
|
|
||||||
|
import Ecto.Query, only: [from: 2]
|
||||||
|
|
||||||
|
def change do
|
||||||
|
Supervisor.start_link([{Oban, Pleroma.Config.get(Oban)}],
|
||||||
|
strategy: :one_for_one,
|
||||||
|
name: Pleroma.Supervisor
|
||||||
|
)
|
||||||
|
|
||||||
|
from(e in "activity_expirations",
|
||||||
|
select: %{id: e.id, activity_id: e.activity_id, scheduled_at: e.scheduled_at}
|
||||||
|
)
|
||||||
|
|> Pleroma.Repo.stream()
|
||||||
|
|> Stream.each(fn expiration ->
|
||||||
|
with {:ok, expires_at} <- DateTime.from_naive(expiration.scheduled_at, "Etc/UTC") do
|
||||||
|
Pleroma.Workers.PurgeExpiredActivity.enqueue(%{
|
||||||
|
activity_id: FlakeId.to_string(expiration.activity_id),
|
||||||
|
expires_at: expires_at
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|> Stream.run()
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,7 @@
|
||||||
|
defmodule Pleroma.Repo.Migrations.DropActivityExpirationsTable do
|
||||||
|
use Ecto.Migration
|
||||||
|
|
||||||
|
def change do
|
||||||
|
drop(table("activity_expirations"))
|
||||||
|
end
|
||||||
|
end
|
22
priv/repo/migrations/20200831142509_chat_constraints.exs
Normal file
22
priv/repo/migrations/20200831142509_chat_constraints.exs
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
defmodule Pleroma.Repo.Migrations.ChatConstraints do
|
||||||
|
use Ecto.Migration
|
||||||
|
|
||||||
|
def change do
|
||||||
|
remove_orphans = """
|
||||||
|
delete from chats where not exists(select id from users where ap_id = chats.recipient);
|
||||||
|
"""
|
||||||
|
|
||||||
|
execute(remove_orphans)
|
||||||
|
|
||||||
|
drop(constraint(:chats, "chats_user_id_fkey"))
|
||||||
|
|
||||||
|
alter table(:chats) do
|
||||||
|
modify(:user_id, references(:users, type: :uuid, on_delete: :delete_all))
|
||||||
|
|
||||||
|
modify(
|
||||||
|
:recipient,
|
||||||
|
references(:users, column: :ap_id, type: :string, on_delete: :delete_all)
|
||||||
|
)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,7 @@
|
||||||
|
defmodule Pleroma.Repo.Migrations.EnsureBioIsString do
|
||||||
|
use Ecto.Migration
|
||||||
|
|
||||||
|
def change do
|
||||||
|
execute("update users set bio = '' where bio is null", "")
|
||||||
|
end
|
||||||
|
end
|
10
priv/repo/migrations/20200901061637_bio_set_not_null.exs
Normal file
10
priv/repo/migrations/20200901061637_bio_set_not_null.exs
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
defmodule Pleroma.Repo.Migrations.BioSetNotNull do
|
||||||
|
use Ecto.Migration
|
||||||
|
|
||||||
|
def change do
|
||||||
|
execute(
|
||||||
|
"alter table users alter column bio set not null",
|
||||||
|
"alter table users alter column bio drop not null"
|
||||||
|
)
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,13 @@
|
||||||
|
defmodule Pleroma.Repo.Migrations.RenameAwaitUpTimeoutInConnectionsPool do
|
||||||
|
use Ecto.Migration
|
||||||
|
|
||||||
|
def change do
|
||||||
|
with %Pleroma.ConfigDB{} = config <-
|
||||||
|
Pleroma.ConfigDB.get_by_params(%{group: :pleroma, key: :connections_pool}),
|
||||||
|
{timeout, value} when is_integer(timeout) <- Keyword.pop(config.value, :await_up_timeout) do
|
||||||
|
config
|
||||||
|
|> Ecto.Changeset.change(value: Keyword.put(value, :connect_timeout, timeout))
|
||||||
|
|> Pleroma.Repo.update()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,19 @@
|
||||||
|
defmodule Pleroma.Repo.Migrations.RenameTimeoutInPools do
|
||||||
|
use Ecto.Migration
|
||||||
|
|
||||||
|
def change do
|
||||||
|
with %Pleroma.ConfigDB{} = config <-
|
||||||
|
Pleroma.ConfigDB.get_by_params(%{group: :pleroma, key: :pools}) do
|
||||||
|
updated_value =
|
||||||
|
Enum.map(config.value, fn {pool, pool_value} ->
|
||||||
|
with {timeout, value} when is_integer(timeout) <- Keyword.pop(pool_value, :timeout) do
|
||||||
|
{pool, Keyword.put(value, :recv_timeout, timeout)}
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
config
|
||||||
|
|> Ecto.Changeset.change(value: updated_value)
|
||||||
|
|> Pleroma.Repo.update()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,19 @@
|
||||||
|
defmodule Pleroma.Repo.Migrations.RemoveCronStatsWorkerFromObanConfig do
|
||||||
|
use Ecto.Migration
|
||||||
|
|
||||||
|
def change do
|
||||||
|
with %Pleroma.ConfigDB{} = config <-
|
||||||
|
Pleroma.ConfigDB.get_by_params(%{group: :pleroma, key: Oban}),
|
||||||
|
crontab when is_list(crontab) <- config.value[:crontab],
|
||||||
|
index when is_integer(index) <-
|
||||||
|
Enum.find_index(crontab, fn {_, worker} ->
|
||||||
|
worker == Pleroma.Workers.Cron.StatsWorker
|
||||||
|
end) do
|
||||||
|
updated_value = Keyword.put(config.value, :crontab, List.delete_at(crontab, index))
|
||||||
|
|
||||||
|
config
|
||||||
|
|> Ecto.Changeset.change(value: updated_value)
|
||||||
|
|> Pleroma.Repo.update()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,19 @@
|
||||||
|
defmodule Pleroma.Repo.Migrations.RemoveCronClearOauthTokenWorkerFromObanConfig do
|
||||||
|
use Ecto.Migration
|
||||||
|
|
||||||
|
def change do
|
||||||
|
with %Pleroma.ConfigDB{} = config <-
|
||||||
|
Pleroma.ConfigDB.get_by_params(%{group: :pleroma, key: Oban}),
|
||||||
|
crontab when is_list(crontab) <- config.value[:crontab],
|
||||||
|
index when is_integer(index) <-
|
||||||
|
Enum.find_index(crontab, fn {_, worker} ->
|
||||||
|
worker == Pleroma.Workers.Cron.ClearOauthTokenWorker
|
||||||
|
end) do
|
||||||
|
updated_value = Keyword.put(config.value, :crontab, List.delete_at(crontab, index))
|
||||||
|
|
||||||
|
config
|
||||||
|
|> Ecto.Changeset.change(value: updated_value)
|
||||||
|
|> Pleroma.Repo.update()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,36 @@
|
||||||
|
defmodule Pleroma.Repo.Migrations.MoveTokensExpirationIntoOban do
|
||||||
|
use Ecto.Migration
|
||||||
|
|
||||||
|
import Ecto.Query, only: [from: 2]
|
||||||
|
|
||||||
|
def change do
|
||||||
|
Supervisor.start_link([{Oban, Pleroma.Config.get(Oban)}],
|
||||||
|
strategy: :one_for_one,
|
||||||
|
name: Pleroma.Supervisor
|
||||||
|
)
|
||||||
|
|
||||||
|
if Pleroma.Config.get([:oauth2, :clean_expired_tokens]) do
|
||||||
|
from(t in Pleroma.Web.OAuth.Token, where: t.valid_until > ^NaiveDateTime.utc_now())
|
||||||
|
|> Pleroma.Repo.stream()
|
||||||
|
|> Stream.each(fn token ->
|
||||||
|
Pleroma.Workers.PurgeExpiredToken.enqueue(%{
|
||||||
|
token_id: token.id,
|
||||||
|
valid_until: DateTime.from_naive!(token.valid_until, "Etc/UTC"),
|
||||||
|
mod: Pleroma.Web.OAuth.Token
|
||||||
|
})
|
||||||
|
end)
|
||||||
|
|> Stream.run()
|
||||||
|
end
|
||||||
|
|
||||||
|
from(t in Pleroma.MFA.Token, where: t.valid_until > ^NaiveDateTime.utc_now())
|
||||||
|
|> Pleroma.Repo.stream()
|
||||||
|
|> Stream.each(fn token ->
|
||||||
|
Pleroma.Workers.PurgeExpiredToken.enqueue(%{
|
||||||
|
token_id: token.id,
|
||||||
|
valid_until: DateTime.from_naive!(token.valid_until, "Etc/UTC"),
|
||||||
|
mod: Pleroma.MFA.Token
|
||||||
|
})
|
||||||
|
end)
|
||||||
|
|> Stream.run()
|
||||||
|
end
|
||||||
|
end
|
20
priv/repo/migrations/20200911055909_remove_cron_jobs.exs
Normal file
20
priv/repo/migrations/20200911055909_remove_cron_jobs.exs
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
defmodule Pleroma.Repo.Migrations.RemoveCronJobs do
|
||||||
|
use Ecto.Migration
|
||||||
|
|
||||||
|
import Ecto.Query, only: [from: 2]
|
||||||
|
|
||||||
|
def up do
|
||||||
|
from(j in "oban_jobs",
|
||||||
|
where:
|
||||||
|
j.worker in ^[
|
||||||
|
"Pleroma.Workers.Cron.PurgeExpiredActivitiesWorker",
|
||||||
|
"Pleroma.Workers.Cron.StatsWorker",
|
||||||
|
"Pleroma.Workers.Cron.ClearOauthTokenWorker"
|
||||||
|
],
|
||||||
|
select: [:id]
|
||||||
|
)
|
||||||
|
|> Pleroma.Repo.delete_all()
|
||||||
|
end
|
||||||
|
|
||||||
|
def down, do: :ok
|
||||||
|
end
|
|
@ -1,55 +0,0 @@
|
||||||
# Pleroma: A lightweight social networking server
|
|
||||||
# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
|
|
||||||
# SPDX-License-Identifier: AGPL-3.0-only
|
|
||||||
|
|
||||||
defmodule Pleroma.ActivityExpirationTest do
|
|
||||||
use Pleroma.DataCase
|
|
||||||
alias Pleroma.ActivityExpiration
|
|
||||||
import Pleroma.Factory
|
|
||||||
|
|
||||||
setup do: clear_config([ActivityExpiration, :enabled])
|
|
||||||
|
|
||||||
test "finds activities due to be deleted only" do
|
|
||||||
activity = insert(:note_activity)
|
|
||||||
|
|
||||||
expiration_due =
|
|
||||||
insert(:expiration_in_the_past, %{activity_id: activity.id}) |> Repo.preload(:activity)
|
|
||||||
|
|
||||||
activity2 = insert(:note_activity)
|
|
||||||
insert(:expiration_in_the_future, %{activity_id: activity2.id})
|
|
||||||
|
|
||||||
expirations = ActivityExpiration.due_expirations()
|
|
||||||
|
|
||||||
assert length(expirations) == 1
|
|
||||||
assert hd(expirations) == expiration_due
|
|
||||||
end
|
|
||||||
|
|
||||||
test "denies expirations that don't live long enough" do
|
|
||||||
activity = insert(:note_activity)
|
|
||||||
now = NaiveDateTime.utc_now()
|
|
||||||
assert {:error, _} = ActivityExpiration.create(activity, now)
|
|
||||||
end
|
|
||||||
|
|
||||||
test "deletes an expiration activity" do
|
|
||||||
Pleroma.Config.put([ActivityExpiration, :enabled], true)
|
|
||||||
activity = insert(:note_activity)
|
|
||||||
|
|
||||||
naive_datetime =
|
|
||||||
NaiveDateTime.add(
|
|
||||||
NaiveDateTime.utc_now(),
|
|
||||||
-:timer.minutes(2),
|
|
||||||
:millisecond
|
|
||||||
)
|
|
||||||
|
|
||||||
expiration =
|
|
||||||
insert(
|
|
||||||
:expiration_in_the_past,
|
|
||||||
%{activity_id: activity.id, scheduled_at: naive_datetime}
|
|
||||||
)
|
|
||||||
|
|
||||||
Pleroma.Workers.Cron.PurgeExpiredActivitiesWorker.perform(%Oban.Job{})
|
|
||||||
|
|
||||||
refute Pleroma.Repo.get(Pleroma.Activity, activity.id)
|
|
||||||
refute Pleroma.Repo.get(Pleroma.ActivityExpiration, expiration.id)
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -185,15 +185,6 @@ defmodule Pleroma.ActivityTest do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
test "add an activity with an expiration" do
|
|
||||||
activity = insert(:note_activity)
|
|
||||||
insert(:expiration_in_the_future, %{activity_id: activity.id})
|
|
||||||
|
|
||||||
Pleroma.ActivityExpiration
|
|
||||||
|> where([a], a.activity_id == ^activity.id)
|
|
||||||
|> Repo.one!()
|
|
||||||
end
|
|
||||||
|
|
||||||
test "all_by_ids_with_object/1" do
|
test "all_by_ids_with_object/1" do
|
||||||
%{id: id1} = insert(:note_activity)
|
%{id: id1} = insert(:note_activity)
|
||||||
%{id: id2} = insert(:note_activity)
|
%{id: id2} = insert(:note_activity)
|
||||||
|
|
|
@ -26,6 +26,28 @@ defmodule Pleroma.ChatTest do
|
||||||
assert chat.id
|
assert chat.id
|
||||||
end
|
end
|
||||||
|
|
||||||
|
test "deleting the user deletes the chat" do
|
||||||
|
user = insert(:user)
|
||||||
|
other_user = insert(:user)
|
||||||
|
|
||||||
|
{:ok, chat} = Chat.bump_or_create(user.id, other_user.ap_id)
|
||||||
|
|
||||||
|
Repo.delete(user)
|
||||||
|
|
||||||
|
refute Chat.get_by_id(chat.id)
|
||||||
|
end
|
||||||
|
|
||||||
|
test "deleting the recipient deletes the chat" do
|
||||||
|
user = insert(:user)
|
||||||
|
other_user = insert(:user)
|
||||||
|
|
||||||
|
{:ok, chat} = Chat.bump_or_create(user.id, other_user.ap_id)
|
||||||
|
|
||||||
|
Repo.delete(other_user)
|
||||||
|
|
||||||
|
refute Chat.get_by_id(chat.id)
|
||||||
|
end
|
||||||
|
|
||||||
test "it returns and bumps a chat for a user and recipient if it already exists" do
|
test "it returns and bumps a chat for a user and recipient if it already exists" do
|
||||||
user = insert(:user)
|
user = insert(:user)
|
||||||
other_user = insert(:user)
|
other_user = insert(:user)
|
||||||
|
|
|
@ -4,12 +4,15 @@ defmodule Pleroma.Config.DeprecationWarningsTest do
|
||||||
|
|
||||||
import ExUnit.CaptureLog
|
import ExUnit.CaptureLog
|
||||||
|
|
||||||
|
alias Pleroma.Config
|
||||||
|
alias Pleroma.Config.DeprecationWarnings
|
||||||
|
|
||||||
test "check_old_mrf_config/0" do
|
test "check_old_mrf_config/0" do
|
||||||
clear_config([:instance, :rewrite_policy], Pleroma.Web.ActivityPub.MRF.NoOpPolicy)
|
clear_config([:instance, :rewrite_policy], Pleroma.Web.ActivityPub.MRF.NoOpPolicy)
|
||||||
clear_config([:instance, :mrf_transparency], true)
|
clear_config([:instance, :mrf_transparency], true)
|
||||||
clear_config([:instance, :mrf_transparency_exclusions], [])
|
clear_config([:instance, :mrf_transparency_exclusions], [])
|
||||||
|
|
||||||
assert capture_log(fn -> Pleroma.Config.DeprecationWarnings.check_old_mrf_config() end) =~
|
assert capture_log(fn -> DeprecationWarnings.check_old_mrf_config() end) =~
|
||||||
"""
|
"""
|
||||||
!!!DEPRECATION WARNING!!!
|
!!!DEPRECATION WARNING!!!
|
||||||
Your config is using old namespaces for MRF configuration. They should work for now, but you are advised to change to new namespaces to prevent possible issues later:
|
Your config is using old namespaces for MRF configuration. They should work for now, but you are advised to change to new namespaces to prevent possible issues later:
|
||||||
|
@ -44,22 +47,66 @@ defmodule Pleroma.Config.DeprecationWarningsTest do
|
||||||
]
|
]
|
||||||
|
|
||||||
assert capture_log(fn ->
|
assert capture_log(fn ->
|
||||||
Pleroma.Config.DeprecationWarnings.move_namespace_and_warn(
|
DeprecationWarnings.move_namespace_and_warn(
|
||||||
config_map,
|
config_map,
|
||||||
"Warning preface"
|
"Warning preface"
|
||||||
)
|
)
|
||||||
end) =~ "Warning preface\n error :key\n error :key2\n error :key3"
|
end) =~ "Warning preface\n error :key\n error :key2\n error :key3"
|
||||||
|
|
||||||
assert Pleroma.Config.get(new_group1) == 1
|
assert Config.get(new_group1) == 1
|
||||||
assert Pleroma.Config.get(new_group2) == 2
|
assert Config.get(new_group2) == 2
|
||||||
assert Pleroma.Config.get(new_group3) == 3
|
assert Config.get(new_group3) == 3
|
||||||
end
|
end
|
||||||
|
|
||||||
test "check_media_proxy_whitelist_config/0" do
|
test "check_media_proxy_whitelist_config/0" do
|
||||||
clear_config([:media_proxy, :whitelist], ["https://example.com", "example2.com"])
|
clear_config([:media_proxy, :whitelist], ["https://example.com", "example2.com"])
|
||||||
|
|
||||||
assert capture_log(fn ->
|
assert capture_log(fn ->
|
||||||
Pleroma.Config.DeprecationWarnings.check_media_proxy_whitelist_config()
|
DeprecationWarnings.check_media_proxy_whitelist_config()
|
||||||
end) =~ "Your config is using old format (only domain) for MediaProxy whitelist option"
|
end) =~ "Your config is using old format (only domain) for MediaProxy whitelist option"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe "check_gun_pool_options/0" do
|
||||||
|
test "await_up_timeout" do
|
||||||
|
config = Config.get(:connections_pool)
|
||||||
|
clear_config(:connections_pool, Keyword.put(config, :await_up_timeout, 5_000))
|
||||||
|
|
||||||
|
assert capture_log(fn ->
|
||||||
|
DeprecationWarnings.check_gun_pool_options()
|
||||||
|
end) =~
|
||||||
|
"Your config is using old setting name `await_up_timeout` instead of `connect_timeout`"
|
||||||
|
end
|
||||||
|
|
||||||
|
test "pool timeout" do
|
||||||
|
old_config = [
|
||||||
|
federation: [
|
||||||
|
size: 50,
|
||||||
|
max_waiting: 10,
|
||||||
|
timeout: 10_000
|
||||||
|
],
|
||||||
|
media: [
|
||||||
|
size: 50,
|
||||||
|
max_waiting: 10,
|
||||||
|
timeout: 10_000
|
||||||
|
],
|
||||||
|
upload: [
|
||||||
|
size: 25,
|
||||||
|
max_waiting: 5,
|
||||||
|
timeout: 15_000
|
||||||
|
],
|
||||||
|
default: [
|
||||||
|
size: 10,
|
||||||
|
max_waiting: 2,
|
||||||
|
timeout: 5_000
|
||||||
|
]
|
||||||
|
]
|
||||||
|
|
||||||
|
clear_config(:pools, old_config)
|
||||||
|
|
||||||
|
assert capture_log(fn ->
|
||||||
|
DeprecationWarnings.check_gun_pool_options()
|
||||||
|
end) =~
|
||||||
|
"Your config is using old setting name `timeout` instead of `recv_timeout` in pool settings"
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
508
test/fixtures/23211.atom
vendored
508
test/fixtures/23211.atom
vendored
|
@ -1,508 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:georss="http://www.georss.org/georss" xmlns:activity="http://activitystrea.ms/spec/1.0/" xmlns:media="http://purl.org/syndication/atommedia" xmlns:poco="http://portablecontacts.net/spec/1.0" xmlns:ostatus="http://ostatus.org/schema/1.0" xmlns:statusnet="http://status.net/schema/api/1/">
|
|
||||||
<generator uri="https://gnu.io/social" version="1.0.2-dev">GNU social</generator>
|
|
||||||
<id>https://social.heldscal.la/api/statuses/user_timeline/23211.atom</id>
|
|
||||||
<title>lambadalambda timeline</title>
|
|
||||||
<subtitle>Updates from lambadalambda on social.heldscal.la!</subtitle>
|
|
||||||
<logo>https://social.heldscal.la/avatar/23211-96-20170416114255.jpeg</logo>
|
|
||||||
<updated>2017-05-02T14:59:30+00:00</updated>
|
|
||||||
<author>
|
|
||||||
<activity:object-type>http://activitystrea.ms/schema/1.0/person</activity:object-type>
|
|
||||||
<uri>https://social.heldscal.la/user/23211</uri>
|
|
||||||
<name>lambadalambda</name>
|
|
||||||
<summary>Call me Deacon Blues.</summary>
|
|
||||||
<link rel="alternate" type="text/html" href="https://social.heldscal.la/lambadalambda"/>
|
|
||||||
<link rel="avatar" type="image/jpeg" media:width="236" media:height="236" href="https://social.heldscal.la/avatar/23211-original-20170416114255.jpeg"/>
|
|
||||||
<link rel="avatar" type="image/jpeg" media:width="96" media:height="96" href="https://social.heldscal.la/avatar/23211-96-20170416114255.jpeg"/>
|
|
||||||
<link rel="avatar" type="image/jpeg" media:width="48" media:height="48" href="https://social.heldscal.la/avatar/23211-48-20170416114255.jpeg"/>
|
|
||||||
<link rel="avatar" type="image/jpeg" media:width="24" media:height="24" href="https://social.heldscal.la/avatar/23211-24-20170416114257.jpeg"/>
|
|
||||||
<poco:preferredUsername>lambadalambda</poco:preferredUsername>
|
|
||||||
<poco:displayName>Constance Variable</poco:displayName>
|
|
||||||
<poco:note>Call me Deacon Blues.</poco:note>
|
|
||||||
<poco:address>
|
|
||||||
<poco:formatted>Berlin</poco:formatted>
|
|
||||||
</poco:address>
|
|
||||||
<poco:urls>
|
|
||||||
<poco:type>homepage</poco:type>
|
|
||||||
<poco:value>https://heldscal.la</poco:value>
|
|
||||||
<poco:primary>true</poco:primary>
|
|
||||||
</poco:urls>
|
|
||||||
<followers url="https://social.heldscal.la/lambadalambda/subscribers"></followers>
|
|
||||||
<statusnet:profile_info local_id="23211"></statusnet:profile_info>
|
|
||||||
</author>
|
|
||||||
<link href="https://social.heldscal.la/lambadalambda" rel="alternate" type="text/html"/>
|
|
||||||
<link href="https://social.heldscal.la/main/sup" rel="http://api.friendfeed.com/2008/03#sup" type="application/json"/>
|
|
||||||
<link href="https://social.heldscal.la/api/statuses/user_timeline/23211.atom?max_id=2012090" rel="next" type="application/atom+xml"/>
|
|
||||||
<link href="https://social.heldscal.la/main/push/hub" rel="hub"/>
|
|
||||||
<link href="https://social.heldscal.la/main/salmon/user/23211" rel="salmon"/>
|
|
||||||
<link href="https://social.heldscal.la/main/salmon/user/23211" rel="http://salmon-protocol.org/ns/salmon-replies"/>
|
|
||||||
<link href="https://social.heldscal.la/main/salmon/user/23211" rel="http://salmon-protocol.org/ns/salmon-mention"/>
|
|
||||||
<link href="https://social.heldscal.la/api/statuses/user_timeline/23211.atom" rel="self" type="application/atom+xml"/>
|
|
||||||
<entry>
|
|
||||||
<id>tag:social.heldscal.la,2017-05-02:fave:23211:comment:2015260:2017-05-02T14:45:47+00:00</id>
|
|
||||||
<title>Favorite</title>
|
|
||||||
<content type="html">lambadalambda favorited something by godemperorofdune: <p><span class="h-card"><a href="https://social.heldscal.la/lambadalambda" class="u-url mention">@<span>lambadalambda</span></a></span> It's because your instance decided to be trap! lol.</p></content>
|
|
||||||
<link rel="alternate" type="text/html" href="https://social.heldscal.la/notice/2015305"/>
|
|
||||||
<activity:verb>http://activitystrea.ms/schema/1.0/favorite</activity:verb>
|
|
||||||
<published>2017-05-02T14:45:47+00:00</published>
|
|
||||||
<updated>2017-05-02T14:45:47+00:00</updated>
|
|
||||||
<activity:object>
|
|
||||||
<activity:object-type>http://activitystrea.ms/schema/1.0/comment</activity:object-type>
|
|
||||||
<id>tag:pawoo.net,2017-05-02:objectId=7397439:objectType=Status</id>
|
|
||||||
<title>New comment by godemperorofdune</title>
|
|
||||||
<content type="html"><p><span class="h-card"><a href="https://social.heldscal.la/lambadalambda" class="u-url mention">@<span>lambadalambda</span></a></span> It's because your instance decided to be trap! lol.</p></content>
|
|
||||||
<link rel="alternate" type="text/html" href="https://pawoo.net/users/God_Emperor_of_Dune/updates/2090090"/>
|
|
||||||
<status_net notice_id="2015260"></status_net>
|
|
||||||
</activity:object>
|
|
||||||
<thr:in-reply-to ref="tag:pawoo.net,2017-05-02:objectId=7397439:objectType=Status" href="https://pawoo.net/users/God_Emperor_of_Dune/updates/2090090"></thr:in-reply-to>
|
|
||||||
<link rel="related" href="https://pawoo.net/users/God_Emperor_of_Dune/updates/2090090"/>
|
|
||||||
<link rel="ostatus:conversation" href="https://social.heldscal.la/conversation/1035308"/>
|
|
||||||
<ostatus:conversation href="https://social.heldscal.la/conversation/1035308" local_id="1035308" ref="tag:social.heldscal.la,2017-05-02:objectType=thread:nonce=136e244b26cdf1e9">tag:social.heldscal.la,2017-05-02:objectType=thread:nonce=136e244b26cdf1e9</ostatus:conversation>
|
|
||||||
<link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/collection" href="http://activityschema.org/collection/public"/>
|
|
||||||
<link rel="self" type="application/atom+xml" href="https://social.heldscal.la/api/statuses/show/2015305.atom"/>
|
|
||||||
<link rel="edit" type="application/atom+xml" href="https://social.heldscal.la/api/statuses/show/2015305.atom"/>
|
|
||||||
<statusnet:notice_info local_id="2015305" source="unknown"></statusnet:notice_info>
|
|
||||||
</entry>
|
|
||||||
<entry>
|
|
||||||
<activity:object-type>http://activitystrea.ms/schema/1.0/note</activity:object-type>
|
|
||||||
<id>tag:social.heldscal.la,2017-05-02:noticeId=2015221:objectType=note</id>
|
|
||||||
<title>New note by lambadalambda</title>
|
|
||||||
<content type="html">Some script thinks I'm a mastodon server.<br /> <br /> [info] GET /api/v1/timelines/public<br /> [debug] Processing with Fallback.RedirectController.redirector/2<br /> Parameters: %{&quot;limit&quot; =&gt; &quot;40&quot;, &quot;path&quot; =&gt; [&quot;api&quot;, &quot;v1&quot;, &quot;timelines&quot;, &quot;public&quot;]}<br /> Pipelines: []</content>
|
|
||||||
<link rel="alternate" type="text/html" href="https://social.heldscal.la/notice/2015221"/>
|
|
||||||
<status_net notice_id="2015221"></status_net>
|
|
||||||
<activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb>
|
|
||||||
<published>2017-05-02T14:40:50+00:00</published>
|
|
||||||
<updated>2017-05-02T14:40:50+00:00</updated>
|
|
||||||
<link rel="ostatus:conversation" href="https://social.heldscal.la/conversation/1035308"/>
|
|
||||||
<ostatus:conversation href="https://social.heldscal.la/conversation/1035308" local_id="1035308" ref="tag:social.heldscal.la,2017-05-02:objectType=thread:nonce=136e244b26cdf1e9">tag:social.heldscal.la,2017-05-02:objectType=thread:nonce=136e244b26cdf1e9</ostatus:conversation>
|
|
||||||
<link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/collection" href="http://activityschema.org/collection/public"/>
|
|
||||||
<link rel="self" type="application/atom+xml" href="https://social.heldscal.la/api/statuses/show/2015221.atom"/>
|
|
||||||
<link rel="edit" type="application/atom+xml" href="https://social.heldscal.la/api/statuses/show/2015221.atom"/>
|
|
||||||
<statusnet:notice_info local_id="2015221" source="Pleroma FE"></statusnet:notice_info>
|
|
||||||
</entry>
|
|
||||||
<entry>
|
|
||||||
<activity:object-type>http://activitystrea.ms/schema/1.0/comment</activity:object-type>
|
|
||||||
<id>tag:social.heldscal.la,2017-05-02:noticeId=2014759:objectType=comment</id>
|
|
||||||
<title>New comment by lambadalambda</title>
|
|
||||||
<content type="html">@<a href="https://mstdn.io/users/mattskala" class="h-card u-url p-nickname mention" title="Matthew Skala">mattskala</a> You and @<a href="https://mastodon.social/users/kevinmarks" class="h-card u-url p-nickname mention" title="Kevin Marks">kevinmarks</a> are not wrong, but my comment was a suggestion to users and admins: Don't use big instances, don't run big instances. Also, it's a secondary advice to devs: Don't add features that encourage big instances.</content>
|
|
||||||
<link rel="alternate" type="text/html" href="https://social.heldscal.la/notice/2014759"/>
|
|
||||||
<status_net notice_id="2014759"></status_net>
|
|
||||||
<activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb>
|
|
||||||
<published>2017-05-02T14:11:54+00:00</published>
|
|
||||||
<updated>2017-05-02T14:11:54+00:00</updated>
|
|
||||||
<thr:in-reply-to ref="tag:mstdn.io,2017-05-02:objectId=1316931:objectType=Status" href="https://mstdn.io/users/mattskala/updates/35698"></thr:in-reply-to>
|
|
||||||
<link rel="related" href="https://mstdn.io/users/mattskala/updates/35698"/>
|
|
||||||
<link rel="ostatus:conversation" href="https://social.heldscal.la/conversation/1031866"/>
|
|
||||||
<ostatus:conversation href="https://social.heldscal.la/conversation/1031866" local_id="1031866" ref="tag:social.heldscal.la,2017-05-02:objectType=thread:nonce=58e32e013ab6487d">tag:social.heldscal.la,2017-05-02:objectType=thread:nonce=58e32e013ab6487d</ostatus:conversation>
|
|
||||||
<link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/person" href="https://mastodon.social/users/kevinmarks"/>
|
|
||||||
<link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/person" href="https://mstdn.io/users/mattskala"/>
|
|
||||||
<link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/collection" href="http://activityschema.org/collection/public"/>
|
|
||||||
<link rel="self" type="application/atom+xml" href="https://social.heldscal.la/api/statuses/show/2014759.atom"/>
|
|
||||||
<link rel="edit" type="application/atom+xml" href="https://social.heldscal.la/api/statuses/show/2014759.atom"/>
|
|
||||||
<statusnet:notice_info local_id="2014759" source="Pleroma FE"></statusnet:notice_info>
|
|
||||||
</entry>
|
|
||||||
<entry>
|
|
||||||
<activity:object-type>http://activitystrea.ms/schema/1.0/comment</activity:object-type>
|
|
||||||
<id>tag:social.heldscal.la,2017-05-02:noticeId=2014684:objectType=comment</id>
|
|
||||||
<title>New comment by lambadalambda</title>
|
|
||||||
<content type="html">@<a href="https://mastodon.social/users/Ronkjeffries" class="h-card u-url p-nickname mention" title="Ron K Jeffries social">ronkjeffries</a> @<a href="https://xoxo.zone/users/KevinMarks" class="h-card u-url p-nickname mention" title="Kevin Marks ">kevinmarks</a> Usually people who run their own private instance just look at the timelines of other servers, follow a seed population and then go from there. This is of course hard on Mastodon, because it doesn't have a publicly visible timeline.</content>
|
|
||||||
<link rel="alternate" type="text/html" href="https://social.heldscal.la/notice/2014684"/>
|
|
||||||
<status_net notice_id="2014684"></status_net>
|
|
||||||
<activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb>
|
|
||||||
<published>2017-05-02T14:07:00+00:00</published>
|
|
||||||
<updated>2017-05-02T14:07:00+00:00</updated>
|
|
||||||
<thr:in-reply-to ref="tag:mastodon.social,2017-05-02:objectId=4883853:objectType=Status" href="https://mastodon.social/users/Ronkjeffries/updates/2221244"></thr:in-reply-to>
|
|
||||||
<link rel="related" href="https://mastodon.social/users/Ronkjeffries/updates/2221244"/>
|
|
||||||
<link rel="ostatus:conversation" href="https://social.heldscal.la/conversation/1031866"/>
|
|
||||||
<ostatus:conversation href="https://social.heldscal.la/conversation/1031866" local_id="1031866" ref="tag:social.heldscal.la,2017-05-02:objectType=thread:nonce=58e32e013ab6487d">tag:social.heldscal.la,2017-05-02:objectType=thread:nonce=58e32e013ab6487d</ostatus:conversation>
|
|
||||||
<link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/person" href="https://xoxo.zone/users/KevinMarks"/>
|
|
||||||
<link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/person" href="https://mastodon.social/users/Ronkjeffries"/>
|
|
||||||
<link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/collection" href="http://activityschema.org/collection/public"/>
|
|
||||||
<link rel="self" type="application/atom+xml" href="https://social.heldscal.la/api/statuses/show/2014684.atom"/>
|
|
||||||
<link rel="edit" type="application/atom+xml" href="https://social.heldscal.la/api/statuses/show/2014684.atom"/>
|
|
||||||
<statusnet:notice_info local_id="2014684" source="Pleroma FE"></statusnet:notice_info>
|
|
||||||
</entry>
|
|
||||||
<entry>
|
|
||||||
<id>tag:social.heldscal.la,2017-05-02:fave:23211:comment:2014584:2017-05-02T14:05:32+00:00</id>
|
|
||||||
<title>Favorite</title>
|
|
||||||
<content type="html">lambadalambda favorited something by mattskala: <p><span class="h-card"><a href="https://social.heldscal.la/lambadalambda" class="u-url mention">@<span>lambadalambda</span></a></span> It's reasonable to expect that instance sizes will obey a power-law distribution because that's what such things in nature nearly always do. If so, there'll necessarily be a few instances much larger than the others; even if most are small, the network both socially and technically has to be able to deal with the existence of the few large ones.</p></content>
|
|
||||||
<link rel="alternate" type="text/html" href="https://social.heldscal.la/notice/2014659"/>
|
|
||||||
<activity:verb>http://activitystrea.ms/schema/1.0/favorite</activity:verb>
|
|
||||||
<published>2017-05-02T14:05:32+00:00</published>
|
|
||||||
<updated>2017-05-02T14:05:32+00:00</updated>
|
|
||||||
<activity:object>
|
|
||||||
<activity:object-type>http://activitystrea.ms/schema/1.0/comment</activity:object-type>
|
|
||||||
<id>tag:mstdn.io,2017-05-02:objectId=1316931:objectType=Status</id>
|
|
||||||
<title>New comment by mattskala</title>
|
|
||||||
<content type="html"><p><span class="h-card"><a href="https://social.heldscal.la/lambadalambda" class="u-url mention">@<span>lambadalambda</span></a></span> It's reasonable to expect that instance sizes will obey a power-law distribution because that's what such things in nature nearly always do. If so, there'll necessarily be a few instances much larger than the others; even if most are small, the network both socially and technically has to be able to deal with the existence of the few large ones.</p></content>
|
|
||||||
<link rel="alternate" type="text/html" href="https://mstdn.io/users/mattskala/updates/35698"/>
|
|
||||||
<status_net notice_id="2014584"></status_net>
|
|
||||||
</activity:object>
|
|
||||||
<thr:in-reply-to ref="tag:mstdn.io,2017-05-02:objectId=1316931:objectType=Status" href="https://mstdn.io/users/mattskala/updates/35698"></thr:in-reply-to>
|
|
||||||
<link rel="related" href="https://mstdn.io/users/mattskala/updates/35698"/>
|
|
||||||
<link rel="ostatus:conversation" href="https://social.heldscal.la/conversation/1031866"/>
|
|
||||||
<ostatus:conversation href="https://social.heldscal.la/conversation/1031866" local_id="1031866" ref="tag:social.heldscal.la,2017-05-02:objectType=thread:nonce=58e32e013ab6487d">tag:social.heldscal.la,2017-05-02:objectType=thread:nonce=58e32e013ab6487d</ostatus:conversation>
|
|
||||||
<link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/collection" href="http://activityschema.org/collection/public"/>
|
|
||||||
<link rel="self" type="application/atom+xml" href="https://social.heldscal.la/api/statuses/show/2014659.atom"/>
|
|
||||||
<link rel="edit" type="application/atom+xml" href="https://social.heldscal.la/api/statuses/show/2014659.atom"/>
|
|
||||||
<statusnet:notice_info local_id="2014659" source="unknown"></statusnet:notice_info>
|
|
||||||
</entry>
|
|
||||||
<entry>
|
|
||||||
<id>tag:social.heldscal.la,2017-05-02:fave:23211:comment:2013568:2017-05-02T14:05:29+00:00</id>
|
|
||||||
<title>Favorite</title>
|
|
||||||
<content type="html">lambadalambda favorited something by kevinmarks: <p><span class="h-card"><a href="https://social.heldscal.la/lambadalambda" class="u-url mention">@<span>lambadalambda</span></a></span> except instance populations will be power law distributed, and the problems for the tummlers are worse at scale</p></content>
|
|
||||||
<link rel="alternate" type="text/html" href="https://social.heldscal.la/notice/2014657"/>
|
|
||||||
<activity:verb>http://activitystrea.ms/schema/1.0/favorite</activity:verb>
|
|
||||||
<published>2017-05-02T14:05:29+00:00</published>
|
|
||||||
<updated>2017-05-02T14:05:29+00:00</updated>
|
|
||||||
<activity:object>
|
|
||||||
<activity:object-type>http://activitystrea.ms/schema/1.0/comment</activity:object-type>
|
|
||||||
<id>tag:xoxo.zone,2017-05-02:objectId=89478:objectType=Status</id>
|
|
||||||
<title>New comment by kevinmarks</title>
|
|
||||||
<content type="html"><p><span class="h-card"><a href="https://social.heldscal.la/lambadalambda" class="u-url mention">@<span>lambadalambda</span></a></span> except instance populations will be power law distributed, and the problems for the tummlers are worse at scale</p></content>
|
|
||||||
<link rel="alternate" type="text/html" href="https://xoxo.zone/users/KevinMarks/updates/1749"/>
|
|
||||||
<status_net notice_id="2013568"></status_net>
|
|
||||||
</activity:object>
|
|
||||||
<thr:in-reply-to ref="tag:xoxo.zone,2017-05-02:objectId=89478:objectType=Status" href="https://xoxo.zone/users/KevinMarks/updates/1749"></thr:in-reply-to>
|
|
||||||
<link rel="related" href="https://xoxo.zone/users/KevinMarks/updates/1749"/>
|
|
||||||
<link rel="ostatus:conversation" href="https://social.heldscal.la/conversation/1031866"/>
|
|
||||||
<ostatus:conversation href="https://social.heldscal.la/conversation/1031866" local_id="1031866" ref="tag:social.heldscal.la,2017-05-02:objectType=thread:nonce=58e32e013ab6487d">tag:social.heldscal.la,2017-05-02:objectType=thread:nonce=58e32e013ab6487d</ostatus:conversation>
|
|
||||||
<link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/collection" href="http://activityschema.org/collection/public"/>
|
|
||||||
<link rel="self" type="application/atom+xml" href="https://social.heldscal.la/api/statuses/show/2014657.atom"/>
|
|
||||||
<link rel="edit" type="application/atom+xml" href="https://social.heldscal.la/api/statuses/show/2014657.atom"/>
|
|
||||||
<statusnet:notice_info local_id="2014657" source="unknown"></statusnet:notice_info>
|
|
||||||
</entry>
|
|
||||||
<entry>
|
|
||||||
<id>tag:social.heldscal.la,2017-05-02:fave:23211:comment:2014060:2017-05-02T13:34:32+00:00</id>
|
|
||||||
<title>Favorite</title>
|
|
||||||
<content type="html">lambadalambda favorited something by gcarregues: <p><span class="h-card"><a href="https://social.heldscal.la/lambadalambda" class="u-url mention">@<span>lambadalambda</span></a></span> Oh purée ! Ma vie en images !</p></content>
|
|
||||||
<link rel="alternate" type="text/html" href="https://social.heldscal.la/notice/2014147"/>
|
|
||||||
<activity:verb>http://activitystrea.ms/schema/1.0/favorite</activity:verb>
|
|
||||||
<published>2017-05-02T13:34:32+00:00</published>
|
|
||||||
<updated>2017-05-02T13:34:32+00:00</updated>
|
|
||||||
<activity:object>
|
|
||||||
<activity:object-type>http://activitystrea.ms/schema/1.0/comment</activity:object-type>
|
|
||||||
<id>tag:mastodon.etalab.gouv.fr,2017-05-02:objectId=55287:objectType=Status</id>
|
|
||||||
<title>New comment by gcarregues</title>
|
|
||||||
<content type="html"><p><span class="h-card"><a href="https://social.heldscal.la/lambadalambda" class="u-url mention">@<span>lambadalambda</span></a></span> Oh purée ! Ma vie en images !</p></content>
|
|
||||||
<link rel="alternate" type="text/html" href="https://mastodon.etalab.gouv.fr/users/gcarregues/updates/4370"/>
|
|
||||||
<status_net notice_id="2014060"></status_net>
|
|
||||||
</activity:object>
|
|
||||||
<thr:in-reply-to ref="tag:mastodon.etalab.gouv.fr,2017-05-02:objectId=55287:objectType=Status" href="https://mastodon.etalab.gouv.fr/users/gcarregues/updates/4370"></thr:in-reply-to>
|
|
||||||
<link rel="related" href="https://mastodon.etalab.gouv.fr/users/gcarregues/updates/4370"/>
|
|
||||||
<link rel="ostatus:conversation" href="https://social.heldscal.la/conversation/1034065"/>
|
|
||||||
<ostatus:conversation href="https://social.heldscal.la/conversation/1034065" local_id="1034065" ref="tag:social.heldscal.la,2017-05-02:objectType=thread:nonce=2c27c27df8ec4dcc">tag:social.heldscal.la,2017-05-02:objectType=thread:nonce=2c27c27df8ec4dcc</ostatus:conversation>
|
|
||||||
<link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/collection" href="http://activityschema.org/collection/public"/>
|
|
||||||
<link rel="self" type="application/atom+xml" href="https://social.heldscal.la/api/statuses/show/2014147.atom"/>
|
|
||||||
<link rel="edit" type="application/atom+xml" href="https://social.heldscal.la/api/statuses/show/2014147.atom"/>
|
|
||||||
<statusnet:notice_info local_id="2014147" source="unknown"></statusnet:notice_info>
|
|
||||||
</entry>
|
|
||||||
<entry>
|
|
||||||
<id>tag:social.heldscal.la,2017-05-02:fave:23211:note:2013573:2017-05-02T13:03:33+00:00</id>
|
|
||||||
<title>Favorite</title>
|
|
||||||
<content type="html">lambadalambda favorited something by phildobangnz: also @<a href="https://sealion.club/user/579" class="h-card mention" title="Sim Bot">sim</a> reminder you are awesome; don't even trip- u kewler than Tutankhamen's cucumber, fam. Okay, good night.</content>
|
|
||||||
<link rel="alternate" type="text/html" href="https://social.heldscal.la/notice/2013702"/>
|
|
||||||
<activity:verb>http://activitystrea.ms/schema/1.0/favorite</activity:verb>
|
|
||||||
<published>2017-05-02T13:03:33+00:00</published>
|
|
||||||
<updated>2017-05-02T13:03:33+00:00</updated>
|
|
||||||
<activity:object>
|
|
||||||
<activity:object-type>http://activitystrea.ms/schema/1.0/note</activity:object-type>
|
|
||||||
<id>tag:sealion.club,2017-05-02:noticeId=3060818:objectType=note</id>
|
|
||||||
<title>New note by phildobangnz</title>
|
|
||||||
<content type="html">also @<a href="https://sealion.club/user/579" class="h-card mention" title="Sim Bot">sim</a> reminder you are awesome; don't even trip- u kewler than Tutankhamen's cucumber, fam. Okay, good night.</content>
|
|
||||||
<link rel="alternate" type="text/html" href="https://sealion.club/notice/3060818"/>
|
|
||||||
<status_net notice_id="2013573"></status_net>
|
|
||||||
</activity:object>
|
|
||||||
<thr:in-reply-to ref="tag:sealion.club,2017-05-02:noticeId=3060818:objectType=note" href="https://sealion.club/notice/3060818"></thr:in-reply-to>
|
|
||||||
<link rel="related" href="https://sealion.club/notice/3060818"/>
|
|
||||||
<link rel="ostatus:conversation" href="https://social.heldscal.la/conversation/1034282"/>
|
|
||||||
<ostatus:conversation href="https://social.heldscal.la/conversation/1034282" local_id="1034282" ref="https://sealion.club/conversation/1633267">https://sealion.club/conversation/1633267</ostatus:conversation>
|
|
||||||
<link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/collection" href="http://activityschema.org/collection/public"/>
|
|
||||||
<link rel="self" type="application/atom+xml" href="https://social.heldscal.la/api/statuses/show/2013702.atom"/>
|
|
||||||
<link rel="edit" type="application/atom+xml" href="https://social.heldscal.la/api/statuses/show/2013702.atom"/>
|
|
||||||
<statusnet:notice_info local_id="2013702" source="unknown"></statusnet:notice_info>
|
|
||||||
</entry>
|
|
||||||
<entry>
|
|
||||||
<activity:object-type>http://activitystrea.ms/schema/1.0/comment</activity:object-type>
|
|
||||||
<id>tag:social.heldscal.la,2017-05-02:noticeId=2013586:objectType=comment</id>
|
|
||||||
<title>New comment by lambadalambda</title>
|
|
||||||
<content type="html">@<a href="https://xoxo.zone/users/KevinMarks" class="h-card u-url p-nickname mention" title="Kevin Marks ">kevinmarks</a> People can stay in their giant unmoderatable instances with meaningless public and federated timelines and experience constant federation drama if they want. I'll stay here with my 5 friends.</content>
|
|
||||||
<link rel="alternate" type="text/html" href="https://social.heldscal.la/notice/2013586"/>
|
|
||||||
<status_net notice_id="2013586"></status_net>
|
|
||||||
<activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb>
|
|
||||||
<published>2017-05-02T12:54:59+00:00</published>
|
|
||||||
<updated>2017-05-02T12:54:59+00:00</updated>
|
|
||||||
<thr:in-reply-to ref="tag:xoxo.zone,2017-05-02:objectId=89478:objectType=Status" href="https://xoxo.zone/users/KevinMarks/updates/1749"></thr:in-reply-to>
|
|
||||||
<link rel="related" href="https://xoxo.zone/users/KevinMarks/updates/1749"/>
|
|
||||||
<link rel="ostatus:conversation" href="https://social.heldscal.la/conversation/1031866"/>
|
|
||||||
<ostatus:conversation href="https://social.heldscal.la/conversation/1031866" local_id="1031866" ref="tag:social.heldscal.la,2017-05-02:objectType=thread:nonce=58e32e013ab6487d">tag:social.heldscal.la,2017-05-02:objectType=thread:nonce=58e32e013ab6487d</ostatus:conversation>
|
|
||||||
<link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/person" href="https://xoxo.zone/users/KevinMarks"/>
|
|
||||||
<link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/collection" href="http://activityschema.org/collection/public"/>
|
|
||||||
<link rel="self" type="application/atom+xml" href="https://social.heldscal.la/api/statuses/show/2013586.atom"/>
|
|
||||||
<link rel="edit" type="application/atom+xml" href="https://social.heldscal.la/api/statuses/show/2013586.atom"/>
|
|
||||||
<statusnet:notice_info local_id="2013586" source="Pleroma FE"></statusnet:notice_info>
|
|
||||||
</entry>
|
|
||||||
<entry>
|
|
||||||
<id>tag:social.heldscal.la,2017-05-02:fave:23211:note:2013486:2017-05-02T12:46:48+00:00</id>
|
|
||||||
<title>Favorite</title>
|
|
||||||
<content type="html">lambadalambda favorited something by fortune: There once was a dentist named Stone<br /> Who saw all his patients alone.<br /> In a fit of depravity<br /> He filled the wrong cavity,<br /> And my, how his practice has grown!</content>
|
|
||||||
<link rel="alternate" type="text/html" href="https://social.heldscal.la/notice/2013511"/>
|
|
||||||
<activity:verb>http://activitystrea.ms/schema/1.0/favorite</activity:verb>
|
|
||||||
<published>2017-05-02T12:46:48+00:00</published>
|
|
||||||
<updated>2017-05-02T12:46:48+00:00</updated>
|
|
||||||
<activity:object>
|
|
||||||
<activity:object-type>http://activitystrea.ms/schema/1.0/note</activity:object-type>
|
|
||||||
<id>tag:gs.kawa-kun.com,2017-05-02:noticeId=1655658:objectType=note</id>
|
|
||||||
<title>New note by fortune</title>
|
|
||||||
<content type="html">There once was a dentist named Stone<br /> Who saw all his patients alone.<br /> In a fit of depravity<br /> He filled the wrong cavity,<br /> And my, how his practice has grown!</content>
|
|
||||||
<link rel="alternate" type="text/html" href="https://gs.kawa-kun.com/notice/1655658"/>
|
|
||||||
<status_net notice_id="2013486"></status_net>
|
|
||||||
</activity:object>
|
|
||||||
<thr:in-reply-to ref="tag:gs.kawa-kun.com,2017-05-02:noticeId=1655658:objectType=note" href="https://gs.kawa-kun.com/notice/1655658"></thr:in-reply-to>
|
|
||||||
<link rel="related" href="https://gs.kawa-kun.com/notice/1655658"/>
|
|
||||||
<link rel="ostatus:conversation" href="https://social.heldscal.la/conversation/1034222"/>
|
|
||||||
<ostatus:conversation href="https://social.heldscal.la/conversation/1034222" local_id="1034222" ref="https://gs.kawa-kun.com/conversation/714072">https://gs.kawa-kun.com/conversation/714072</ostatus:conversation>
|
|
||||||
<link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/collection" href="http://activityschema.org/collection/public"/>
|
|
||||||
<link rel="self" type="application/atom+xml" href="https://social.heldscal.la/api/statuses/show/2013511.atom"/>
|
|
||||||
<link rel="edit" type="application/atom+xml" href="https://social.heldscal.la/api/statuses/show/2013511.atom"/>
|
|
||||||
<statusnet:notice_info local_id="2013511" source="unknown"></statusnet:notice_info>
|
|
||||||
</entry>
|
|
||||||
<entry>
|
|
||||||
<id>tag:social.heldscal.la,2017-05-02:fave:23211:note:2013365:2017-05-02T12:37:55+00:00</id>
|
|
||||||
<title>Favorite</title>
|
|
||||||
<content type="html">lambadalambda favorited something by xj9: <p>&gt; rollerblading to work</p></content>
|
|
||||||
<link rel="alternate" type="text/html" href="https://social.heldscal.la/notice/2013394"/>
|
|
||||||
<activity:verb>http://activitystrea.ms/schema/1.0/favorite</activity:verb>
|
|
||||||
<published>2017-05-02T12:37:55+00:00</published>
|
|
||||||
<updated>2017-05-02T12:37:55+00:00</updated>
|
|
||||||
<activity:object>
|
|
||||||
<activity:object-type>http://activitystrea.ms/schema/1.0/note</activity:object-type>
|
|
||||||
<id>tag:sunshinegardens.org,2017-05-02:objectId=61020:objectType=Status</id>
|
|
||||||
<title>New note by xj9</title>
|
|
||||||
<content type="html"><p>&gt; rollerblading to work</p></content>
|
|
||||||
<link rel="alternate" type="text/html" href="https://sunshinegardens.org/users/xj9/updates/748"/>
|
|
||||||
<status_net notice_id="2013365"></status_net>
|
|
||||||
</activity:object>
|
|
||||||
<thr:in-reply-to ref="tag:sunshinegardens.org,2017-05-02:objectId=61020:objectType=Status" href="https://sunshinegardens.org/users/xj9/updates/748"></thr:in-reply-to>
|
|
||||||
<link rel="related" href="https://sunshinegardens.org/users/xj9/updates/748"/>
|
|
||||||
<link rel="ostatus:conversation" href="https://social.heldscal.la/conversation/1034152"/>
|
|
||||||
<ostatus:conversation href="https://social.heldscal.la/conversation/1034152" local_id="1034152" ref="tag:social.heldscal.la,2017-05-02:objectType=thread:nonce=5a0e98612f634218">tag:social.heldscal.la,2017-05-02:objectType=thread:nonce=5a0e98612f634218</ostatus:conversation>
|
|
||||||
<link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/collection" href="http://activityschema.org/collection/public"/>
|
|
||||||
<link rel="self" type="application/atom+xml" href="https://social.heldscal.la/api/statuses/show/2013394.atom"/>
|
|
||||||
<link rel="edit" type="application/atom+xml" href="https://social.heldscal.la/api/statuses/show/2013394.atom"/>
|
|
||||||
<statusnet:notice_info local_id="2013394" source="unknown"></statusnet:notice_info>
|
|
||||||
</entry>
|
|
||||||
<entry>
|
|
||||||
<id>tag:social.heldscal.la,2017-05-02:fave:23211:comment:2013259:2017-05-02T12:29:03+00:00</id>
|
|
||||||
<title>Favorite</title>
|
|
||||||
<content type="html">lambadalambda favorited something by cereal: @<a href="https://gs.smuglo.li/user/28250" class="h-card mention" title="Bricky">thatbrickster</a> @<a href="https://social.heldscal.la/user/23211" class="h-card mention" title="Constance Variable">lambadalambda</a> But why?</content>
|
|
||||||
<link rel="alternate" type="text/html" href="https://social.heldscal.la/notice/2013267"/>
|
|
||||||
<activity:verb>http://activitystrea.ms/schema/1.0/favorite</activity:verb>
|
|
||||||
<published>2017-05-02T12:29:03+00:00</published>
|
|
||||||
<updated>2017-05-02T12:29:03+00:00</updated>
|
|
||||||
<activity:object>
|
|
||||||
<activity:object-type>http://activitystrea.ms/schema/1.0/comment</activity:object-type>
|
|
||||||
<id>tag:sealion.club,2017-05-02:noticeId=3059985:objectType=comment</id>
|
|
||||||
<title>New comment by cereal</title>
|
|
||||||
<content type="html">@<a href="https://gs.smuglo.li/user/28250" class="h-card mention" title="Bricky">thatbrickster</a> @<a href="https://social.heldscal.la/user/23211" class="h-card mention" title="Constance Variable">lambadalambda</a> But why?</content>
|
|
||||||
<link rel="alternate" type="text/html" href="https://sealion.club/notice/3059985"/>
|
|
||||||
<status_net notice_id="2013259"></status_net>
|
|
||||||
</activity:object>
|
|
||||||
<thr:in-reply-to ref="tag:sealion.club,2017-05-02:noticeId=3059985:objectType=comment" href="https://sealion.club/notice/3059985"></thr:in-reply-to>
|
|
||||||
<link rel="related" href="https://sealion.club/notice/3059985"/>
|
|
||||||
<link rel="ostatus:conversation" href="https://social.heldscal.la/conversation/1034065"/>
|
|
||||||
<ostatus:conversation href="https://social.heldscal.la/conversation/1034065" local_id="1034065" ref="tag:social.heldscal.la,2017-05-02:objectType=thread:nonce=2c27c27df8ec4dcc">tag:social.heldscal.la,2017-05-02:objectType=thread:nonce=2c27c27df8ec4dcc</ostatus:conversation>
|
|
||||||
<link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/collection" href="http://activityschema.org/collection/public"/>
|
|
||||||
<link rel="self" type="application/atom+xml" href="https://social.heldscal.la/api/statuses/show/2013267.atom"/>
|
|
||||||
<link rel="edit" type="application/atom+xml" href="https://social.heldscal.la/api/statuses/show/2013267.atom"/>
|
|
||||||
<statusnet:notice_info local_id="2013267" source="unknown"></statusnet:notice_info>
|
|
||||||
</entry>
|
|
||||||
<entry>
|
|
||||||
<id>tag:social.heldscal.la,2017-05-02:fave:23211:comment:2013227:2017-05-02T12:24:27+00:00</id>
|
|
||||||
<title>Favorite</title>
|
|
||||||
<content type="html">lambadalambda favorited something by thatbrickster: @<a href="https://social.heldscal.la/user/23211" class="h-card u-url p-nickname mention" title="Constance Variable">lambadalambda</a> install gentoo</content>
|
|
||||||
<link rel="alternate" type="text/html" href="https://social.heldscal.la/notice/2013230"/>
|
|
||||||
<activity:verb>http://activitystrea.ms/schema/1.0/favorite</activity:verb>
|
|
||||||
<published>2017-05-02T12:24:27+00:00</published>
|
|
||||||
<updated>2017-05-02T12:24:27+00:00</updated>
|
|
||||||
<activity:object>
|
|
||||||
<activity:object-type>http://activitystrea.ms/schema/1.0/comment</activity:object-type>
|
|
||||||
<id>tag:gs.smuglo.li,2017-05-02:noticeId=2144296:objectType=comment</id>
|
|
||||||
<title>New comment by thatbrickster</title>
|
|
||||||
<content type="html">@<a href="https://social.heldscal.la/user/23211" class="h-card u-url p-nickname mention" title="Constance Variable">lambadalambda</a> install gentoo</content>
|
|
||||||
<link rel="alternate" type="text/html" href="https://gs.smuglo.li/notice/2144296"/>
|
|
||||||
<status_net notice_id="2013227"></status_net>
|
|
||||||
</activity:object>
|
|
||||||
<thr:in-reply-to ref="tag:gs.smuglo.li,2017-05-02:noticeId=2144296:objectType=comment" href="https://gs.smuglo.li/notice/2144296"></thr:in-reply-to>
|
|
||||||
<link rel="related" href="https://gs.smuglo.li/notice/2144296"/>
|
|
||||||
<link rel="ostatus:conversation" href="https://social.heldscal.la/conversation/1034065"/>
|
|
||||||
<ostatus:conversation href="https://social.heldscal.la/conversation/1034065" local_id="1034065" ref="tag:social.heldscal.la,2017-05-02:objectType=thread:nonce=2c27c27df8ec4dcc">tag:social.heldscal.la,2017-05-02:objectType=thread:nonce=2c27c27df8ec4dcc</ostatus:conversation>
|
|
||||||
<link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/collection" href="http://activityschema.org/collection/public"/>
|
|
||||||
<link rel="self" type="application/atom+xml" href="https://social.heldscal.la/api/statuses/show/2013230.atom"/>
|
|
||||||
<link rel="edit" type="application/atom+xml" href="https://social.heldscal.la/api/statuses/show/2013230.atom"/>
|
|
||||||
<statusnet:notice_info local_id="2013230" source="unknown"></statusnet:notice_info>
|
|
||||||
</entry>
|
|
||||||
<entry>
|
|
||||||
<id>tag:social.heldscal.la,2017-05-02:fave:23211:comment:2013213:2017-05-02T12:22:53+00:00</id>
|
|
||||||
<title>Favorite</title>
|
|
||||||
<content type="html">lambadalambda favorited something by dwmatiz: @<a href="https://social.heldscal.la/user/23211" class="h-card mention">lambadalambda</a> *unzips dick*</content>
|
|
||||||
<link rel="alternate" type="text/html" href="https://social.heldscal.la/notice/2013218"/>
|
|
||||||
<activity:verb>http://activitystrea.ms/schema/1.0/favorite</activity:verb>
|
|
||||||
<published>2017-05-02T12:22:53+00:00</published>
|
|
||||||
<updated>2017-05-02T12:22:53+00:00</updated>
|
|
||||||
<activity:object>
|
|
||||||
<activity:object-type>http://activitystrea.ms/schema/1.0/comment</activity:object-type>
|
|
||||||
<id>tag:sealion.club,2017-05-02:noticeId=3059800:objectType=comment</id>
|
|
||||||
<title>New comment by dwmatiz</title>
|
|
||||||
<content type="html">@<a href="https://social.heldscal.la/user/23211" class="h-card mention">lambadalambda</a> *unzips dick*</content>
|
|
||||||
<link rel="alternate" type="text/html" href="https://sealion.club/notice/3059800"/>
|
|
||||||
<status_net notice_id="2013213"></status_net>
|
|
||||||
</activity:object>
|
|
||||||
<thr:in-reply-to ref="tag:sealion.club,2017-05-02:noticeId=3059800:objectType=comment" href="https://sealion.club/notice/3059800"></thr:in-reply-to>
|
|
||||||
<link rel="related" href="https://sealion.club/notice/3059800"/>
|
|
||||||
<link rel="ostatus:conversation" href="https://social.heldscal.la/conversation/1034065"/>
|
|
||||||
<ostatus:conversation href="https://social.heldscal.la/conversation/1034065" local_id="1034065" ref="tag:social.heldscal.la,2017-05-02:objectType=thread:nonce=2c27c27df8ec4dcc">tag:social.heldscal.la,2017-05-02:objectType=thread:nonce=2c27c27df8ec4dcc</ostatus:conversation>
|
|
||||||
<link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/collection" href="http://activityschema.org/collection/public"/>
|
|
||||||
<link rel="self" type="application/atom+xml" href="https://social.heldscal.la/api/statuses/show/2013218.atom"/>
|
|
||||||
<link rel="edit" type="application/atom+xml" href="https://social.heldscal.la/api/statuses/show/2013218.atom"/>
|
|
||||||
<statusnet:notice_info local_id="2013218" source="unknown"></statusnet:notice_info>
|
|
||||||
</entry>
|
|
||||||
<entry>
|
|
||||||
<id>tag:social.heldscal.la,2017-05-02:fave:23211:comment:2013199:2017-05-02T12:22:03+00:00</id>
|
|
||||||
<title>Favorite</title>
|
|
||||||
<content type="html">lambadalambda favorited something by shpuld: @<a href="https://social.heldscal.la/user/23211" class="h-card mention" title="Constance Variable">lambadalambda</a> get #<span class="tag"><a href="https://shitposter.club/tag/cofe" rel="tag">cofe</a></span></content>
|
|
||||||
<link rel="alternate" type="text/html" href="https://social.heldscal.la/notice/2013206"/>
|
|
||||||
<activity:verb>http://activitystrea.ms/schema/1.0/favorite</activity:verb>
|
|
||||||
<published>2017-05-02T12:22:03+00:00</published>
|
|
||||||
<updated>2017-05-02T12:22:03+00:00</updated>
|
|
||||||
<activity:object>
|
|
||||||
<activity:object-type>http://activitystrea.ms/schema/1.0/comment</activity:object-type>
|
|
||||||
<id>tag:shitposter.club,2017-05-02:noticeId=2783524:objectType=comment</id>
|
|
||||||
<title>New comment by shpuld</title>
|
|
||||||
<content type="html">@<a href="https://social.heldscal.la/user/23211" class="h-card mention" title="Constance Variable">lambadalambda</a> get #<span class="tag"><a href="https://shitposter.club/tag/cofe" rel="tag">cofe</a></span></content>
|
|
||||||
<link rel="alternate" type="text/html" href="https://shitposter.club/notice/2783524"/>
|
|
||||||
<status_net notice_id="2013199"></status_net>
|
|
||||||
</activity:object>
|
|
||||||
<thr:in-reply-to ref="tag:shitposter.club,2017-05-02:noticeId=2783524:objectType=comment" href="https://shitposter.club/notice/2783524"></thr:in-reply-to>
|
|
||||||
<link rel="related" href="https://shitposter.club/notice/2783524"/>
|
|
||||||
<link rel="ostatus:conversation" href="https://social.heldscal.la/conversation/1034065"/>
|
|
||||||
<ostatus:conversation href="https://social.heldscal.la/conversation/1034065" local_id="1034065" ref="tag:social.heldscal.la,2017-05-02:objectType=thread:nonce=2c27c27df8ec4dcc">tag:social.heldscal.la,2017-05-02:objectType=thread:nonce=2c27c27df8ec4dcc</ostatus:conversation>
|
|
||||||
<link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/collection" href="http://activityschema.org/collection/public"/>
|
|
||||||
<link rel="self" type="application/atom+xml" href="https://social.heldscal.la/api/statuses/show/2013206.atom"/>
|
|
||||||
<link rel="edit" type="application/atom+xml" href="https://social.heldscal.la/api/statuses/show/2013206.atom"/>
|
|
||||||
<statusnet:notice_info local_id="2013206" source="unknown"></statusnet:notice_info>
|
|
||||||
</entry>
|
|
||||||
<entry>
|
|
||||||
<activity:object-type>http://activitystrea.ms/schema/1.0/note</activity:object-type>
|
|
||||||
<id>tag:social.heldscal.la,2017-05-02:noticeId=2013185:objectType=note</id>
|
|
||||||
<title>New note by lambadalambda</title>
|
|
||||||
<content type="html">What now? <a href="https://social.heldscal.la/file/e4822d95de677757ff50d49672a4046c83218b76c04a0ad5e5f1f0a9a9eb1a74.gif" title="https://social.heldscal.la/file/e4822d95de677757ff50d49672a4046c83218b76c04a0ad5e5f1f0a9a9eb1a74.gif" rel="nofollow external noreferrer" class="attachment" id="attachment-422572">https://social.heldscal.la/attachment/422572</a></content>
|
|
||||||
<link rel="alternate" type="text/html" href="https://social.heldscal.la/notice/2013185"/>
|
|
||||||
<status_net notice_id="2013185"></status_net>
|
|
||||||
<activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb>
|
|
||||||
<published>2017-05-02T12:21:04+00:00</published>
|
|
||||||
<updated>2017-05-02T12:21:04+00:00</updated>
|
|
||||||
<link rel="ostatus:conversation" href="https://social.heldscal.la/conversation/1034065"/>
|
|
||||||
<ostatus:conversation href="https://social.heldscal.la/conversation/1034065" local_id="1034065" ref="tag:social.heldscal.la,2017-05-02:objectType=thread:nonce=2c27c27df8ec4dcc">tag:social.heldscal.la,2017-05-02:objectType=thread:nonce=2c27c27df8ec4dcc</ostatus:conversation>
|
|
||||||
<link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/collection" href="http://activityschema.org/collection/public"/>
|
|
||||||
<link rel="enclosure" href="https://social.heldscal.la/file/e4822d95de677757ff50d49672a4046c83218b76c04a0ad5e5f1f0a9a9eb1a74.gif" type="image/gif" length="132349"/>
|
|
||||||
<link rel="self" type="application/atom+xml" href="https://social.heldscal.la/api/statuses/show/2013185.atom"/>
|
|
||||||
<link rel="edit" type="application/atom+xml" href="https://social.heldscal.la/api/statuses/show/2013185.atom"/>
|
|
||||||
<statusnet:notice_info local_id="2013185" source="Pleroma FE"></statusnet:notice_info>
|
|
||||||
</entry>
|
|
||||||
<entry>
|
|
||||||
<id>tag:social.heldscal.la,2017-05-02:fave:23211:note:2012929:2017-05-02T12:01:25+00:00</id>
|
|
||||||
<title>Favorite</title>
|
|
||||||
<content type="html">lambadalambda favorited something by drkmttr: <p><span class="h-card"><a href="https://social.heldscal.la/lambadalambda" class="u-url mention">@<span>lambadalambda</span></a></span> I checked out No Agenda because I saw you mention it several time. Sadly, I wasn't impressed. I'm all about varying perspectives but Adam and John basically just sound like resentful curmudgeons. It seems like their shtick is basically playing devil's advocate to everything to arouse some discontent. Just my two cents. 😉</p></content>
|
|
||||||
<link rel="alternate" type="text/html" href="https://social.heldscal.la/notice/2012940"/>
|
|
||||||
<activity:verb>http://activitystrea.ms/schema/1.0/favorite</activity:verb>
|
|
||||||
<published>2017-05-02T12:01:25+00:00</published>
|
|
||||||
<updated>2017-05-02T12:01:25+00:00</updated>
|
|
||||||
<activity:object>
|
|
||||||
<activity:object-type>http://activitystrea.ms/schema/1.0/note</activity:object-type>
|
|
||||||
<id>tag:mstdn.io,2017-05-02:objectId=1310093:objectType=Status</id>
|
|
||||||
<title>New note by drkmttr</title>
|
|
||||||
<content type="html"><p><span class="h-card"><a href="https://social.heldscal.la/lambadalambda" class="u-url mention">@<span>lambadalambda</span></a></span> I checked out No Agenda because I saw you mention it several time. Sadly, I wasn't impressed. I'm all about varying perspectives but Adam and John basically just sound like resentful curmudgeons. It seems like their shtick is basically playing devil's advocate to everything to arouse some discontent. Just my two cents. 😉</p></content>
|
|
||||||
<link rel="alternate" type="text/html" href="https://mstdn.io/users/drkmttr/updates/35653"/>
|
|
||||||
<status_net notice_id="2012929"></status_net>
|
|
||||||
</activity:object>
|
|
||||||
<thr:in-reply-to ref="tag:mstdn.io,2017-05-02:objectId=1310093:objectType=Status" href="https://mstdn.io/users/drkmttr/updates/35653"></thr:in-reply-to>
|
|
||||||
<link rel="related" href="https://mstdn.io/users/drkmttr/updates/35653"/>
|
|
||||||
<link rel="ostatus:conversation" href="https://social.heldscal.la/conversation/1033892"/>
|
|
||||||
<ostatus:conversation href="https://social.heldscal.la/conversation/1033892" local_id="1033892" ref="tag:social.heldscal.la,2017-05-02:objectType=thread:nonce=2f329b4eb20e83e2">tag:social.heldscal.la,2017-05-02:objectType=thread:nonce=2f329b4eb20e83e2</ostatus:conversation>
|
|
||||||
<link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/collection" href="http://activityschema.org/collection/public"/>
|
|
||||||
<link rel="self" type="application/atom+xml" href="https://social.heldscal.la/api/statuses/show/2012940.atom"/>
|
|
||||||
<link rel="edit" type="application/atom+xml" href="https://social.heldscal.la/api/statuses/show/2012940.atom"/>
|
|
||||||
<statusnet:notice_info local_id="2012940" source="unknown"></statusnet:notice_info>
|
|
||||||
</entry>
|
|
||||||
<entry>
|
|
||||||
<id>tag:social.heldscal.la,2017-05-02:fave:23211:comment:2012336:2017-05-02T11:06:42+00:00</id>
|
|
||||||
<title>Favorite</title>
|
|
||||||
<content type="html">lambadalambda favorited something by clacke: @<a href="https://mastodon.org.uk/users/dick_turpin" class="h-card u-url p-nickname mention" title="dick_turpin">dickturpin</a> @<a href="http://quitter.se/user/113503" class="h-card u-url p-nickname mention" title="Luke">luke</a> Oh no, I miss being irritated by you, it helps me understand myself and others. Also it builds character. :-)<br /> <br /> So if this is not federation because you can't follow all of online mankind, what should we call it? Proto-federated? Pre-federated?<br /> <br /> The term has been used decades ago for just one Microsoft Active Directory domain cross-certifying the root of another, by mutual agreement. I don't see how it's any less relevant to opportunistic federation between open servers on an open internet.<br /> <br /> I'm not saying we should be satisfied, I'm just saying that "federate" is a useful word and to build a big system we need to start with a small one. And focus on the things we *can* change, like helping the OStatus network grow and making the tools more useful.<br /> <br /> Saying that the network's ideals have failed because other networks aren't joining is doing neither of that.</content>
|
|
||||||
<link rel="alternate" type="text/html" href="https://social.heldscal.la/notice/2012341"/>
|
|
||||||
<activity:verb>http://activitystrea.ms/schema/1.0/favorite</activity:verb>
|
|
||||||
<published>2017-05-02T11:06:42+00:00</published>
|
|
||||||
<updated>2017-05-02T11:06:42+00:00</updated>
|
|
||||||
<activity:object>
|
|
||||||
<activity:object-type>http://activitystrea.ms/schema/1.0/comment</activity:object-type>
|
|
||||||
<id>tag:social.heldscal.la,2017-05-02:noticeId=2012336:objectType=comment</id>
|
|
||||||
<title>New comment by clacke</title>
|
|
||||||
<content type="html">@<a href="https://mastodon.org.uk/users/dick_turpin" class="h-card u-url p-nickname mention" title="dick_turpin">dickturpin</a> @<a href="http://quitter.se/user/113503" class="h-card u-url p-nickname mention" title="Luke">luke</a> Oh no, I miss being irritated by you, it helps me understand myself and others. Also it builds character. :-)<br /> <br /> So if this is not federation because you can't follow all of online mankind, what should we call it? Proto-federated? Pre-federated?<br /> <br /> The term has been used decades ago for just one Microsoft Active Directory domain cross-certifying the root of another, by mutual agreement. I don't see how it's any less relevant to opportunistic federation between open servers on an open internet.<br /> <br /> I'm not saying we should be satisfied, I'm just saying that &quot;federate&quot; is a useful word and to build a big system we need to start with a small one. And focus on the things we *can* change, like helping the OStatus network grow and making the tools more useful.<br /> <br /> Saying that the network's ideals have failed because other networks aren't joining is doing neither of that.</content>
|
|
||||||
<link rel="alternate" type="text/html" href="https://social.heldscal.la/notice/2012336"/>
|
|
||||||
<status_net notice_id="2012336"></status_net>
|
|
||||||
</activity:object>
|
|
||||||
<thr:in-reply-to ref="tag:social.heldscal.la,2017-05-02:noticeId=2012336:objectType=comment" href="https://social.heldscal.la/notice/2012336"></thr:in-reply-to>
|
|
||||||
<link rel="related" href="https://social.heldscal.la/notice/2012336"/>
|
|
||||||
<link rel="ostatus:conversation" href="https://social.heldscal.la/conversation/1016421"/>
|
|
||||||
<ostatus:conversation href="https://social.heldscal.la/conversation/1016421" local_id="1016421" ref="https://s.wefamlee.be/conversation/16478">https://s.wefamlee.be/conversation/16478</ostatus:conversation>
|
|
||||||
<link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/collection" href="http://activityschema.org/collection/public"/>
|
|
||||||
<link rel="self" type="application/atom+xml" href="https://social.heldscal.la/api/statuses/show/2012341.atom"/>
|
|
||||||
<link rel="edit" type="application/atom+xml" href="https://social.heldscal.la/api/statuses/show/2012341.atom"/>
|
|
||||||
<statusnet:notice_info local_id="2012341" source="unknown"></statusnet:notice_info>
|
|
||||||
</entry>
|
|
||||||
<entry>
|
|
||||||
<id>tag:social.heldscal.la,2017-05-02:fave:23211:comment:2011332:2017-05-02T10:37:40+00:00</id>
|
|
||||||
<title>Favorite</title>
|
|
||||||
<content type="html">lambadalambda favorited something by moonman: @<a href="https://social.heldscal.la/user/23211" class="h-card mention" title="Constance Variable">lambadalambda</a> <a href="https://www.youtube.com/watch?v=mKLizztikRk" title="https://www.youtube.com/watch?v=mKLizztikRk" class="attachment" rel="nofollow">https://www.youtube.com/watch?v=mKLizztikRk</a></content>
|
|
||||||
<link rel="alternate" type="text/html" href="https://social.heldscal.la/notice/2012148"/>
|
|
||||||
<activity:verb>http://activitystrea.ms/schema/1.0/favorite</activity:verb>
|
|
||||||
<published>2017-05-02T10:37:40+00:00</published>
|
|
||||||
<updated>2017-05-02T10:37:40+00:00</updated>
|
|
||||||
<activity:object>
|
|
||||||
<activity:object-type>http://activitystrea.ms/schema/1.0/comment</activity:object-type>
|
|
||||||
<id>tag:shitposter.club,2017-05-02:noticeId=2781833:objectType=comment</id>
|
|
||||||
<title>New comment by moonman</title>
|
|
||||||
<content type="html">@<a href="https://social.heldscal.la/user/23211" class="h-card mention" title="Constance Variable">lambadalambda</a> <a href="https://www.youtube.com/watch?v=mKLizztikRk" title="https://www.youtube.com/watch?v=mKLizztikRk" class="attachment" rel="nofollow">https://www.youtube.com/watch?v=mKLizztikRk</a></content>
|
|
||||||
<link rel="alternate" type="text/html" href="https://shitposter.club/notice/2781833"/>
|
|
||||||
<status_net notice_id="2011332"></status_net>
|
|
||||||
</activity:object>
|
|
||||||
<thr:in-reply-to ref="tag:shitposter.club,2017-05-02:noticeId=2781833:objectType=comment" href="https://shitposter.club/notice/2781833"></thr:in-reply-to>
|
|
||||||
<link rel="related" href="https://shitposter.club/notice/2781833"/>
|
|
||||||
<link rel="ostatus:conversation" href="https://social.heldscal.la/conversation/1032783"/>
|
|
||||||
<ostatus:conversation href="https://social.heldscal.la/conversation/1032783" local_id="1032783" ref="tag:social.heldscal.la,2017-05-02:objectType=thread:nonce=11d8b8c27d9513ec">tag:social.heldscal.la,2017-05-02:objectType=thread:nonce=11d8b8c27d9513ec</ostatus:conversation>
|
|
||||||
<link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/collection" href="http://activityschema.org/collection/public"/>
|
|
||||||
<link rel="self" type="application/atom+xml" href="https://social.heldscal.la/api/statuses/show/2012148.atom"/>
|
|
||||||
<link rel="edit" type="application/atom+xml" href="https://social.heldscal.la/api/statuses/show/2012148.atom"/>
|
|
||||||
<statusnet:notice_info local_id="2012148" source="unknown"></statusnet:notice_info>
|
|
||||||
</entry>
|
|
||||||
<entry>
|
|
||||||
<activity:object-type>http://activitystrea.ms/schema/1.0/comment</activity:object-type>
|
|
||||||
<id>tag:social.heldscal.la,2017-05-02:noticeId=2012145:objectType=comment</id>
|
|
||||||
<title>New comment by lambadalambda</title>
|
|
||||||
<content type="html">@<a href="https://sealion.club/user/186" class="h-card u-url p-nickname mention" title="I'M CEREAL U GUISE">cereal</a> ? No, you don't even need the identity servers for federation.</content>
|
|
||||||
<link rel="alternate" type="text/html" href="https://social.heldscal.la/notice/2012145"/>
|
|
||||||
<status_net notice_id="2012145"></status_net>
|
|
||||||
<activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb>
|
|
||||||
<published>2017-05-02T10:37:33+00:00</published>
|
|
||||||
<updated>2017-05-02T10:37:33+00:00</updated>
|
|
||||||
<thr:in-reply-to ref="tag:sealion.club,2017-05-02:noticeId=3056001:objectType=comment" href="https://sealion.club/notice/3056001"></thr:in-reply-to>
|
|
||||||
<link rel="related" href="https://sealion.club/notice/3056001"/>
|
|
||||||
<link rel="ostatus:conversation" href="https://social.heldscal.la/conversation/1033277"/>
|
|
||||||
<ostatus:conversation href="https://social.heldscal.la/conversation/1033277" local_id="1033277" ref="https://sealion.club/conversation/1629037">https://sealion.club/conversation/1629037</ostatus:conversation>
|
|
||||||
<link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/person" href="https://sealion.club/user/186"/>
|
|
||||||
<link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/collection" href="http://activityschema.org/collection/public"/>
|
|
||||||
<link rel="self" type="application/atom+xml" href="https://social.heldscal.la/api/statuses/show/2012145.atom"/>
|
|
||||||
<link rel="edit" type="application/atom+xml" href="https://social.heldscal.la/api/statuses/show/2012145.atom"/>
|
|
||||||
<statusnet:notice_info local_id="2012145" source="Pleroma FE"></statusnet:notice_info>
|
|
||||||
</entry>
|
|
||||||
</feed>
|
|
68
test/fixtures/cw_retweet.xml
vendored
68
test/fixtures/cw_retweet.xml
vendored
|
@ -1,68 +0,0 @@
|
||||||
<?xml version="1.0"?>
|
|
||||||
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:activity="http://activitystrea.ms/spec/1.0/" xmlns:poco="http://portablecontacts.net/spec/1.0" xmlns:media="http://purl.org/syndication/atommedia" xmlns:ostatus="http://ostatus.org/schema/1.0" xmlns:mastodon="http://mastodon.social/schema/1.0">
|
|
||||||
<id>https://mastodon.social/users/lambadalambda.atom</id>
|
|
||||||
<title>Critical Value</title>
|
|
||||||
<subtitle></subtitle>
|
|
||||||
<updated>2017-04-16T21:47:25Z</updated>
|
|
||||||
<logo>https://files.mastodon.social/accounts/avatars/000/000/264/original/1429214160519.gif</logo>
|
|
||||||
<author>
|
|
||||||
<id>https://mastodon.social/users/lambadalambda</id>
|
|
||||||
<activity:object-type>http://activitystrea.ms/schema/1.0/person</activity:object-type>
|
|
||||||
<uri>https://mastodon.social/users/lambadalambda</uri>
|
|
||||||
<name>lambadalambda</name>
|
|
||||||
<email>lambadalambda@mastodon.social</email>
|
|
||||||
<link rel="alternate" type="text/html" href="https://mastodon.social/@lambadalambda"/>
|
|
||||||
<link rel="avatar" type="image/gif" media:width="120" media:height="120" href="https://files.mastodon.social/accounts/avatars/000/000/264/original/1429214160519.gif"/>
|
|
||||||
<link rel="header" type="" media:width="700" media:height="335" href="/headers/original/missing.png"/>
|
|
||||||
<poco:preferredUsername>lambadalambda</poco:preferredUsername>
|
|
||||||
<poco:displayName>Critical Value</poco:displayName>
|
|
||||||
<mastodon:scope>public</mastodon:scope>
|
|
||||||
</author>
|
|
||||||
<link rel="alternate" type="text/html" href="https://mastodon.social/@lambadalambda"/>
|
|
||||||
<link rel="self" type="application/atom+xml" href="https://mastodon.social/users/lambadalambda.atom"/>
|
|
||||||
<link rel="hub" href="https://mastodon.social/api/push"/>
|
|
||||||
<link rel="salmon" href="https://mastodon.social/api/salmon/264"/>
|
|
||||||
<entry>
|
|
||||||
<id>tag:mastodon.social,2017-05-11:objectId=5647963:objectType=Status</id>
|
|
||||||
<published>2017-05-11T10:23:15Z</published>
|
|
||||||
<updated>2017-05-11T10:23:15Z</updated>
|
|
||||||
<title>lambadalambda shared a status by Skruyb@mamot.fr</title>
|
|
||||||
<activity:object-type>http://activitystrea.ms/schema/1.0/activity</activity:object-type>
|
|
||||||
<activity:verb>http://activitystrea.ms/schema/1.0/share</activity:verb>
|
|
||||||
<activity:object>
|
|
||||||
<id>tag:mamot.fr,2017-05-10:objectId=1294943:objectType=Status</id>
|
|
||||||
<published>2017-05-10T17:31:44Z</published>
|
|
||||||
<updated>2017-05-10T17:31:45Z</updated>
|
|
||||||
<title>New status by Skruyb@mamot.fr</title>
|
|
||||||
<author>
|
|
||||||
<id>https://mamot.fr/users/Skruyb</id>
|
|
||||||
<activity:object-type>http://activitystrea.ms/schema/1.0/person</activity:object-type>
|
|
||||||
<uri>https://mamot.fr/users/Skruyb</uri>
|
|
||||||
<name>Skruyb</name>
|
|
||||||
<email>Skruyb@mamot.fr</email>
|
|
||||||
<summary type="html"><p>Fr and En.<br>Posts will disappear on a regular basis.</p></summary>
|
|
||||||
<link rel="alternate" type="text/html" href="https://mamot.fr/@Skruyb"/>
|
|
||||||
<link rel="avatar" type="image/jpeg" media:width="120" media:height="120" href="https://files.mastodon.social/accounts/avatars/000/106/282/original/d95dbcfc76f77f4c.jpg"/>
|
|
||||||
<link rel="header" type="image/jpeg" media:width="700" media:height="335" href="https://files.mastodon.social/accounts/headers/000/106/282/original/c1aabdf5c97eb875.jpg"/>
|
|
||||||
<poco:preferredUsername>Skruyb</poco:preferredUsername>
|
|
||||||
<poco:displayName>The 7th Son</poco:displayName>
|
|
||||||
<poco:note>Fr and En.Posts will disappear on a regular basis.</poco:note>
|
|
||||||
<mastodon:scope>public</mastodon:scope>
|
|
||||||
</author>
|
|
||||||
<activity:object-type>http://activitystrea.ms/schema/1.0/comment</activity:object-type>
|
|
||||||
<activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb>
|
|
||||||
<summary xml:lang="it">Hey.</summary>
|
|
||||||
<content type="html" xml:lang="it"><p><span class="h-card"><a href="https://mastodon.social/@lambadalambda">@<span>lambadalambda</span></a></span></p><p>Hey!!!</p></content>
|
|
||||||
<link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/person" href="https://mastodon.social/users/lambadalambda"/>
|
|
||||||
<link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/collection" href="http://activityschema.org/collection/public"/>
|
|
||||||
<mastodon:scope>public</mastodon:scope>
|
|
||||||
<link rel="alternate" type="text/html" href="https://mamot.fr/users/Skruyb/updates/176041"/>
|
|
||||||
<thr:in-reply-to ref="tag:mastodon.social,2017-05-10:objectId=5582979:objectType=Status" href="https://mastodon.social/@lambadalambda/5582979"/>
|
|
||||||
</activity:object>
|
|
||||||
<content type="html" xml:lang="en"><p><span class="h-card"><a href="https://mastodon.social/@lambadalambda">@<span>lambadalambda</span></a></span></p><p>Hey!!!</p></content>
|
|
||||||
<link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/collection" href="http://activityschema.org/collection/public"/>
|
|
||||||
<mastodon:scope>public</mastodon:scope>
|
|
||||||
<link rel="alternate" type="text/html" href="https://mastodon.social/users/lambadalambda/updates/2325225"/>
|
|
||||||
<link rel="self" type="application/atom+xml" href="https://mastodon.social/users/lambadalambda/updates/2325225.atom"/>
|
|
||||||
</entry>
|
|
||||||
</feed>
|
|
39
test/fixtures/delete.xml
vendored
39
test/fixtures/delete.xml
vendored
|
@ -1,39 +0,0 @@
|
||||||
<?xml version="1.0"?>
|
|
||||||
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:activity="http://activitystrea.ms/spec/1.0/" xmlns:poco="http://portablecontacts.net/spec/1.0" xmlns:media="http://purl.org/syndication/atommedia" xmlns:ostatus="http://ostatus.org/schema/1.0" xmlns:mastodon="http://mastodon.social/schema/1.0">
|
|
||||||
<id>https://mastodon.sdf.org/users/snowdusk.atom</id>
|
|
||||||
<title>snowdusk</title>
|
|
||||||
<subtitle>Amateur live performance DJ/radio DJ on SDF's underground Internet radio http://aNONradio.net (LIVE Sat Sun Mon Tue 23:00-24:00 UTC) - http://snowdusk.sdf.org</subtitle>
|
|
||||||
<updated>2017-06-17T04:14:34Z</updated>
|
|
||||||
<logo>https://mastodon.sdf.org/system/accounts/avatars/000/000/002/original/405a7652d5f60449.jpg?1497672873</logo>
|
|
||||||
<author>
|
|
||||||
<id>https://mastodon.sdf.org/users/snowdusk</id>
|
|
||||||
<activity:object-type>http://activitystrea.ms/schema/1.0/person</activity:object-type>
|
|
||||||
<uri>https://mastodon.sdf.org/users/snowdusk</uri>
|
|
||||||
<name>snowdusk</name>
|
|
||||||
<email>snowdusk@mastodon.sdf.org</email>
|
|
||||||
<summary type="html"><p>Amateur live performance DJ/radio DJ on SDF&apos;s underground Internet radio <a href="http://anonradio.net/" rel="nofollow noopener" target="_blank"><span class="invisible">http://</span><span class="">anonradio.net/</span><span class="invisible"></span></a> (LIVE Sat Sun Mon Tue 23:00-24:00 UTC) - <a href="http://snowdusk.sdf.org/" rel="nofollow noopener" target="_blank"><span class="invisible">http://</span><span class="">snowdusk.sdf.org/</span><span class="invisible"></span></a></p></summary>
|
|
||||||
<link rel="alternate" type="text/html" href="https://mastodon.sdf.org/@snowdusk"/>
|
|
||||||
<link rel="avatar" type="image/jpeg" media:width="120" media:height="120" href="https://mastodon.sdf.org/system/accounts/avatars/000/000/002/original/405a7652d5f60449.jpg?1497672873"/>
|
|
||||||
<link rel="header" type="image/jpeg" media:width="700" media:height="335" href="https://mastodon.sdf.org/system/accounts/headers/000/000/002/original/f1e9b0fb21b4e5a0.jpeg?1495793472"/>
|
|
||||||
<poco:preferredUsername>snowdusk</poco:preferredUsername>
|
|
||||||
<poco:displayName>snowdusk</poco:displayName>
|
|
||||||
<poco:note>Amateur live performance DJ/radio DJ on SDF's underground Internet radio http://aNONradio.net (LIVE Sat Sun Mon Tue 23:00-24:00 UTC) - http://snowdusk.sdf.org</poco:note>
|
|
||||||
<mastodon:scope>public</mastodon:scope>
|
|
||||||
</author>
|
|
||||||
<link rel="alternate" type="text/html" href="https://mastodon.sdf.org/@snowdusk"/>
|
|
||||||
<link rel="self" type="application/atom+xml" href="https://mastodon.sdf.org/users/snowdusk.atom"/>
|
|
||||||
<link rel="next" type="application/atom+xml" href="https://mastodon.sdf.org/users/snowdusk.atom?max_id=7592"/>
|
|
||||||
<link rel="hub" href="https://mastodon.sdf.org/api/push"/>
|
|
||||||
<link rel="salmon" href="https://mastodon.sdf.org/api/salmon/2"/>
|
|
||||||
<entry>
|
|
||||||
<id>tag:mastodon.sdf.org,2017-06-10:objectId=310513:objectType=Status</id>
|
|
||||||
<published>2017-06-10T22:02:31Z</published>
|
|
||||||
<updated>2017-06-10T22:02:31Z</updated>
|
|
||||||
<title>snowdusk deleted status</title>
|
|
||||||
<activity:object-type>http://activitystrea.ms/schema/1.0/activity</activity:object-type>
|
|
||||||
<activity:verb>http://activitystrea.ms/schema/1.0/delete</activity:verb>
|
|
||||||
<content>Deleted status</content>
|
|
||||||
<link rel="alternate" type="text/html" href="https://mastodon.sdf.org/users/snowdusk/updates/7782"/>
|
|
||||||
<link rel="self" type="application/atom+xml" href="https://mastodon.sdf.org/users/snowdusk/updates/7782.atom"/>
|
|
||||||
</entry>
|
|
||||||
</feed>
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue