Compare commits
30 Commits
develop
...
ilja_simpl
Author | SHA1 | Date |
---|---|---|
|
d840ad460c | |
|
f255b49f3d | |
|
bb75e02b86 | |
|
7ab524b899 | |
|
95d5589df6 | |
|
fd126f2616 | |
|
6f9ee416d5 | |
|
b3f9717e29 | |
|
ca579b5a20 | |
|
487b516f8f | |
|
16f0d8ea71 | |
|
d9dfe3d451 | |
|
f4092e96d1 | |
|
0ab917ec6f | |
|
3ca8feb246 | |
|
5131038296 | |
|
9a213ee9ee | |
|
3ea3f49268 | |
|
bd1142105e | |
|
0d1c1736b4 | |
|
8e725c5acb | |
|
e8a04e4f83 | |
|
79ed38836c | |
|
cd50d9b7e0 | |
|
0411bdc748 | |
|
6446081a13 | |
|
1af6145941 | |
|
0390e0b77c | |
|
5a909e1bf0 | |
|
90a97dfc37 |
|
@ -83,7 +83,6 @@
|
|||
# lanodan: I think PreferImplicitTry should be consistency, and the behaviour seems
|
||||
# inconsistent, see: https://github.com/rrrene/credo/issues/224
|
||||
{Credo.Check.Readability.PreferImplicitTry, false},
|
||||
{Credo.Check.Readability.PipeIntoAnonymousFunctions, exit_status: 0},
|
||||
{Credo.Check.Readability.RedundantBlankLines},
|
||||
{Credo.Check.Readability.StringSigils},
|
||||
{Credo.Check.Readability.TrailingBlankLine},
|
||||
|
@ -91,7 +90,6 @@
|
|||
{Credo.Check.Readability.VariableNames},
|
||||
{Credo.Check.Readability.Semicolons},
|
||||
{Credo.Check.Readability.SpaceAfterCommas},
|
||||
{Credo.Check.Readability.WithSingleClause, exit_status: 0},
|
||||
{Credo.Check.Refactor.DoubleBooleanNegation},
|
||||
{Credo.Check.Refactor.CondStatements},
|
||||
{Credo.Check.Refactor.CyclomaticComplexity},
|
||||
|
|
|
@ -28,7 +28,6 @@ erl_crash.dump
|
|||
# variables.
|
||||
/config/*.secret.exs
|
||||
/config/generated_config.exs
|
||||
/config/runtime.exs
|
||||
/config/*.env
|
||||
|
||||
|
||||
|
@ -48,14 +47,9 @@ docs/generated_config.md
|
|||
# Code test coverage
|
||||
/cover
|
||||
/Elixir.*.coverdata
|
||||
/coverage.xml
|
||||
|
||||
.idea
|
||||
pleroma.iml
|
||||
|
||||
# asdf
|
||||
.tool-versions
|
||||
|
||||
# Editor temp files
|
||||
/*~
|
||||
/*#
|
||||
|
|
164
.gitlab-ci.yml
164
.gitlab-ci.yml
|
@ -1,17 +1,14 @@
|
|||
image: git.pleroma.social:5050/pleroma/pleroma/ci-base
|
||||
image: elixir:1.9.4
|
||||
|
||||
variables: &global_variables
|
||||
POSTGRES_DB: pleroma_test
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: postgres
|
||||
DB_HOST: postgres
|
||||
DB_PORT: 5432
|
||||
MIX_ENV: test
|
||||
|
||||
cache: &global_cache_policy
|
||||
key:
|
||||
files:
|
||||
- mix.lock
|
||||
key: ${CI_COMMIT_REF_SLUG}
|
||||
paths:
|
||||
- deps
|
||||
- _build
|
||||
|
@ -25,92 +22,50 @@ stages:
|
|||
- docker
|
||||
|
||||
before_script:
|
||||
- echo $MIX_ENV
|
||||
- rm -rf _build/*/lib/pleroma
|
||||
- mix deps.get
|
||||
|
||||
after_script:
|
||||
- rm -rf _build/*/lib/pleroma
|
||||
- apt-get update && apt-get install -y cmake
|
||||
- mix local.hex --force
|
||||
- mix local.rebar --force
|
||||
- apt-get -qq update
|
||||
- apt-get install -y libmagic-dev
|
||||
|
||||
build:
|
||||
stage: build
|
||||
only:
|
||||
changes: &build_changes_policy
|
||||
- ".gitlab-ci.yml"
|
||||
- "**/*.ex"
|
||||
- "**/*.exs"
|
||||
- "mix.lock"
|
||||
script:
|
||||
- mix deps.get
|
||||
- mix compile --force
|
||||
|
||||
spec-build:
|
||||
stage: test
|
||||
only:
|
||||
changes:
|
||||
- ".gitlab-ci.yml"
|
||||
- "lib/pleroma/web/api_spec/**/*.ex"
|
||||
- "lib/pleroma/web/api_spec.ex"
|
||||
artifacts:
|
||||
paths:
|
||||
- spec.json
|
||||
script:
|
||||
- mix pleroma.openapi_spec spec.json
|
||||
|
||||
benchmark:
|
||||
stage: benchmark
|
||||
when: manual
|
||||
variables:
|
||||
MIX_ENV: benchmark
|
||||
services:
|
||||
- name: postgres:9.6-alpine
|
||||
- name: postgres:9.6
|
||||
alias: postgres
|
||||
command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
|
||||
script:
|
||||
- mix deps.get
|
||||
- mix ecto.create
|
||||
- mix ecto.migrate
|
||||
- mix pleroma.load_testing
|
||||
|
||||
unit-testing:
|
||||
stage: test
|
||||
only:
|
||||
changes: *build_changes_policy
|
||||
cache: &testing_cache_policy
|
||||
<<: *global_cache_policy
|
||||
policy: pull
|
||||
|
||||
services:
|
||||
- name: postgres:13-alpine
|
||||
alias: postgres
|
||||
command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
|
||||
script:
|
||||
- mix ecto.create
|
||||
- mix ecto.migrate
|
||||
- mix test --cover --preload-modules
|
||||
coverage: '/^Line total: ([^ ]*%)$/'
|
||||
artifacts:
|
||||
reports:
|
||||
coverage_report:
|
||||
coverage_format: cobertura
|
||||
path: coverage.xml
|
||||
|
||||
unit-testing-erratic:
|
||||
stage: test
|
||||
retry: 2
|
||||
allow_failure: true
|
||||
only:
|
||||
changes: *build_changes_policy
|
||||
cache: &testing_cache_policy
|
||||
<<: *global_cache_policy
|
||||
policy: pull
|
||||
|
||||
services:
|
||||
- name: postgres:13-alpine
|
||||
- name: postgres:13
|
||||
alias: postgres
|
||||
command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
|
||||
script:
|
||||
- apt-get update && apt-get install -y libimage-exiftool-perl ffmpeg
|
||||
- mix deps.get
|
||||
- mix ecto.create
|
||||
- mix ecto.migrate
|
||||
- mix test --only=erratic
|
||||
- mix coveralls --preload-modules
|
||||
|
||||
# Removed to fix CI issue. In this early state it wasn't adding much value anyway.
|
||||
# TODO Fix and reinstate federated testing
|
||||
|
@ -130,8 +85,7 @@ unit-testing-erratic:
|
|||
|
||||
unit-testing-rum:
|
||||
stage: test
|
||||
only:
|
||||
changes: *build_changes_policy
|
||||
retry: 2
|
||||
cache: *testing_cache_policy
|
||||
services:
|
||||
- name: minibikini/postgres-with-rum:12
|
||||
|
@ -141,45 +95,26 @@ unit-testing-rum:
|
|||
<<: *global_variables
|
||||
RUM_ENABLED: "true"
|
||||
script:
|
||||
- apt-get update && apt-get install -y libimage-exiftool-perl ffmpeg
|
||||
- mix deps.get
|
||||
- mix ecto.create
|
||||
- mix ecto.migrate
|
||||
- "mix ecto.migrate --migrations-path priv/repo/optional_migrations/rum_indexing/"
|
||||
- mix test --preload-modules
|
||||
|
||||
lint:
|
||||
image: ¤t_elixir elixir:1.12-alpine
|
||||
stage: test
|
||||
only:
|
||||
changes: *build_changes_policy
|
||||
cache: *testing_cache_policy
|
||||
before_script: ¤t_bfr_script
|
||||
- apk update
|
||||
- apk add build-base cmake file-dev git openssl
|
||||
- mix local.hex --force
|
||||
- mix local.rebar --force
|
||||
- mix deps.get
|
||||
script:
|
||||
- mix format --check-formatted
|
||||
|
||||
analysis:
|
||||
stage: test
|
||||
only:
|
||||
changes: *build_changes_policy
|
||||
cache: *testing_cache_policy
|
||||
script:
|
||||
- mix deps.get
|
||||
- mix credo --strict --only=warnings,todo,fixme,consistency,readability
|
||||
|
||||
cycles:
|
||||
image: *current_elixir
|
||||
stage: test
|
||||
only:
|
||||
changes: *build_changes_policy
|
||||
cache: {}
|
||||
before_script: *current_bfr_script
|
||||
script:
|
||||
- mix compile
|
||||
- mix xref graph --format cycles --label compile | awk '{print $0} END{exit ($0 != "No cycles found")}'
|
||||
|
||||
docs-deploy:
|
||||
stage: deploy
|
||||
cache: *testing_cache_policy
|
||||
|
@ -220,20 +155,6 @@ review_app:
|
|||
- (ssh -t dokku@pleroma.online -- certs:add "$CI_ENVIRONMENT_SLUG" /home/dokku/server.crt /home/dokku/server.key) || true
|
||||
- git push -f dokku@pleroma.online:$CI_ENVIRONMENT_SLUG $CI_COMMIT_SHA:refs/heads/master
|
||||
|
||||
spec-deploy:
|
||||
stage: deploy
|
||||
artifacts:
|
||||
paths:
|
||||
- spec.json
|
||||
only:
|
||||
- develop@pleroma/pleroma
|
||||
image: alpine:latest
|
||||
before_script:
|
||||
- apk add curl
|
||||
script:
|
||||
- curl -X POST -F"token=$API_DOCS_PIPELINE_TRIGGER" -F'ref=master' -F"variables[BRANCH]=$CI_COMMIT_REF_NAME" -F"variables[JOB_REF]=$CI_JOB_ID" https://git.pleroma.social/api/v4/projects/1130/trigger/pipeline
|
||||
|
||||
|
||||
stop_review_app:
|
||||
image: alpine:3.9
|
||||
stage: deploy
|
||||
|
@ -254,14 +175,12 @@ stop_review_app:
|
|||
|
||||
amd64:
|
||||
stage: release
|
||||
image: elixir:1.11.4
|
||||
image: elixir:1.10.3
|
||||
only: &release-only
|
||||
- stable@pleroma/pleroma
|
||||
- develop@pleroma/pleroma
|
||||
- /^maint/.*$/@pleroma/pleroma
|
||||
- /^release/.*$/@pleroma/pleroma
|
||||
tags:
|
||||
- amd64
|
||||
artifacts: &release-artifacts
|
||||
name: "pleroma-$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA-$CI_JOB_NAME"
|
||||
paths:
|
||||
|
@ -280,7 +199,7 @@ amd64:
|
|||
MIX_ENV: prod
|
||||
before_script: &before-release
|
||||
- apt-get update && apt-get install -y cmake libmagic-dev
|
||||
- echo "import Config" > config/prod.secret.exs
|
||||
- echo "import Mix.Config" > config/prod.secret.exs
|
||||
- mix local.hex --force
|
||||
- mix local.rebar --force
|
||||
script: &release
|
||||
|
@ -294,14 +213,12 @@ amd64-musl:
|
|||
stage: release
|
||||
artifacts: *release-artifacts
|
||||
only: *release-only
|
||||
image: elixir:1.11.4-alpine
|
||||
tags:
|
||||
- amd64
|
||||
image: elixir:1.10.3-alpine
|
||||
cache: *release-cache
|
||||
variables: *release-variables
|
||||
before_script: &before-release-musl
|
||||
- apk add git build-base cmake file-dev openssl
|
||||
- echo "import Config" > config/prod.secret.exs
|
||||
- apk add git gcc g++ musl-dev make cmake file-dev
|
||||
- echo "import Mix.Config" > config/prod.secret.exs
|
||||
- mix local.hex --force
|
||||
- mix local.rebar --force
|
||||
script: *release
|
||||
|
@ -312,7 +229,7 @@ arm:
|
|||
only: *release-only
|
||||
tags:
|
||||
- arm32-specified
|
||||
image: arm32v7/elixir:1.11.4
|
||||
image: arm32v7/elixir:1.10.3
|
||||
cache: *release-cache
|
||||
variables: *release-variables
|
||||
before_script: *before-release
|
||||
|
@ -324,7 +241,7 @@ arm-musl:
|
|||
only: *release-only
|
||||
tags:
|
||||
- arm32-specified
|
||||
image: arm32v7/elixir:1.11.4-alpine
|
||||
image: arm32v7/elixir:1.10.3-alpine
|
||||
cache: *release-cache
|
||||
variables: *release-variables
|
||||
before_script: *before-release-musl
|
||||
|
@ -336,7 +253,7 @@ arm64:
|
|||
only: *release-only
|
||||
tags:
|
||||
- arm
|
||||
image: arm64v8/elixir:1.11.4
|
||||
image: arm64v8/elixir:1.10.3
|
||||
cache: *release-cache
|
||||
variables: *release-variables
|
||||
before_script: *before-release
|
||||
|
@ -348,7 +265,7 @@ arm64-musl:
|
|||
only: *release-only
|
||||
tags:
|
||||
- arm
|
||||
image: arm64v8/elixir:1.11.4-alpine
|
||||
image: arm64v8/elixir:1.10.3-alpine
|
||||
cache: *release-cache
|
||||
variables: *release-variables
|
||||
before_script: *before-release-musl
|
||||
|
@ -366,8 +283,8 @@ docker:
|
|||
IMAGE_TAG_SLUG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
|
||||
IMAGE_TAG_LATEST: $CI_REGISTRY_IMAGE:latest
|
||||
IMAGE_TAG_LATEST_STABLE: $CI_REGISTRY_IMAGE:latest-stable
|
||||
DOCKER_BUILDX_URL: https://github.com/docker/buildx/releases/download/v0.6.3/buildx-v0.6.3.linux-amd64
|
||||
DOCKER_BUILDX_HASH: 980e6b9655f971991fbbb5fd6cd19f1672386195
|
||||
DOCKER_BUILDX_URL: https://github.com/docker/buildx/releases/download/v0.4.1/buildx-v0.4.1.linux-amd64
|
||||
DOCKER_BUILDX_HASH: 71a7d01439aa8c165a25b59c44d3f016fddbd98b
|
||||
before_script: &before-docker
|
||||
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
|
||||
- docker pull $IMAGE_TAG_SLUG || true
|
||||
|
@ -432,26 +349,3 @@ docker-release:
|
|||
- dind
|
||||
only:
|
||||
- /^release/.*$/@pleroma/pleroma
|
||||
|
||||
docker-adhoc:
|
||||
stage: docker
|
||||
image: docker:latest
|
||||
cache: {}
|
||||
dependencies: []
|
||||
variables: *docker-variables
|
||||
before_script: *before-docker
|
||||
allow_failure: true
|
||||
script:
|
||||
script:
|
||||
- mkdir -p /root/.docker/cli-plugins
|
||||
- wget "${DOCKER_BUILDX_URL}" -O ~/.docker/cli-plugins/docker-buildx
|
||||
- echo "${DOCKER_BUILDX_HASH} /root/.docker/cli-plugins/docker-buildx" | sha1sum -c
|
||||
- chmod +x ~/.docker/cli-plugins/docker-buildx
|
||||
- docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
|
||||
- docker buildx create --name mbuilder --driver docker-container --use
|
||||
- docker buildx inspect --bootstrap
|
||||
- docker buildx build --platform linux/amd64,linux/arm/v7,linux/arm64/v8 --push --cache-from $IMAGE_TAG_SLUG --build-arg VCS_REF=$CI_VCS_REF --build-arg BUILD_DATE=$CI_JOB_TIMESTAMP -t $IMAGE_TAG -t $IMAGE_TAG_SLUG .
|
||||
tags:
|
||||
- dind
|
||||
only:
|
||||
- /^build-docker/.*$/@pleroma/pleroma
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
### Release checklist
|
||||
* [ ] Bump version in `mix.exs`
|
||||
* [ ] Compile a changelog
|
||||
* [ ] Create an MR with an announcement to pleroma.social
|
||||
#### post-merge
|
||||
* [ ] Tag the release on the merge commit
|
||||
* [ ] Make the tag into a Gitlab Release™
|
||||
* [ ] Bump version in `mix.exs`
|
||||
* [ ] Compile a changelog
|
||||
* [ ] Create an MR with an announcement to pleroma.social
|
||||
* [ ] Tag the release
|
||||
* [ ] Merge `stable` into `develop` (in case the fixes are already in develop, use `git merge -s ours --no-commit` and manually merge the changelogs)
|
||||
|
|
1
.mailmap
1
.mailmap
|
@ -1,3 +1,2 @@
|
|||
Ariadne Conill <ariadne@dereferenced.org> <nenolod@dereferenced.org>
|
||||
Ariadne Conill <ariadne@dereferenced.org> <nenolod@gmail.com>
|
||||
rinpatch <rin@patch.cx> <rinpatch@sdf.org>
|
||||
|
|
237
CHANGELOG.md
237
CHANGELOG.md
|
@ -8,222 +8,23 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|||
|
||||
### Changed
|
||||
|
||||
### Added
|
||||
|
||||
### Fixed
|
||||
|
||||
### Removed
|
||||
|
||||
## 2.5.0 - 2022-12-23
|
||||
|
||||
### Removed
|
||||
|
||||
- MastoFE
|
||||
- Quack, the logging backend that pushes to Slack channels
|
||||
|
||||
### Changed
|
||||
- **Breaking:** Elixir >=1.11 is now required (was >= 1.9)
|
||||
- Allow users to remove their emails if instance does not need email to register
|
||||
- Uploadfilter `Pleroma.Upload.Filter.Exiftool` has been renamed to `Pleroma.Upload.Filter.Exiftool.StripLocation`
|
||||
- **Breaking**: `/api/v1/pleroma/backups` endpoints now requires `read:backups` scope instead of `read:accounts`
|
||||
- Updated the recommended pleroma.vcl configuration for Varnish to target Varnish 7.0+
|
||||
- Set timeout values for Oban queues. The default is infinity and some operations may not time out on their own.
|
||||
- Delete activities are federated at lowest priority
|
||||
- CSP now includes wasm-unsafe-eval
|
||||
|
||||
### Added
|
||||
- `activeMonth` and `activeHalfyear` fields in NodeInfo usage.users object
|
||||
- Experimental support for Finch. Put `config :tesla, :adapter, {Tesla.Adapter.Finch, name: MyFinch}` in your secrets file to use it. Reverse Proxy will still use Hackney.
|
||||
- `ForceMentionsInPostContent` MRF policy
|
||||
- PleromaAPI: Add remote follow API endpoint at `POST /api/v1/pleroma/remote_interaction`
|
||||
- MastoAPI: Add `GET /api/v1/accounts/lookup`
|
||||
- MastoAPI: Profile Directory support
|
||||
- MastoAPI: Support v2 Suggestions (handpicked accounts only)
|
||||
- Ability to log slow Ecto queries by configuring `:pleroma, :telemetry, :slow_queries_logging`
|
||||
- Added Phoenix LiveDashboard at `/phoenix/live_dashboard`
|
||||
- Added `/manifest.json` for progressive web apps.
|
||||
- MastoAPI: Support for `birthday` and `show_birthday` field in `/api/v1/accounts/update_credentials`.
|
||||
- Configuration: Add `birthday_required` and `birthday_min_age` settings to provide a way to require users to enter their birth date.
|
||||
- PleromaAPI: Add `GET /api/v1/pleroma/birthdays` API endpoint
|
||||
- Make backend-rendered pages translatable. This includes emails. Pages returned as a HTTP response are translated using the language specified in the `userLanguage` cookie, or the `Accept-Language` header. Emails are translated using the `language` field when registering. This language can be changed by `PATCH /api/v1/accounts/update_credentials` with the `language` field.
|
||||
- Add fine grained options to provide privileges to moderators and admins (e.g. delete messages, manage reports...)
|
||||
- Uploadfilter `Pleroma.Upload.Filter.Exiftool.ReadDescription` returns description values to the FE so they can pre fill the image description field
|
||||
- Added move account API
|
||||
- Enable remote users to interact with posts
|
||||
- Possibility to discover users like `user@example.org`, while Pleroma is working on `pleroma.example.org`. Additional configuration required.
|
||||
|
||||
### Fixed
|
||||
- Subscription(Bell) Notifications: Don't create from Pipeline Ingested replies
|
||||
- Handle Reject for already-accepted Follows properly
|
||||
- Display OpenGraph data on alternative notice routes.
|
||||
- Fix replies count for remote replies
|
||||
- Fixed hashtags disappearing from the end of lines when Markdown is enabled
|
||||
- ChatAPI: Add link headers
|
||||
- Limited number of search results to 40 to prevent DoS attacks
|
||||
- ActivityPub: fixed federation of attachment dimensions
|
||||
- Fixed benchmarks
|
||||
- Elixir 1.13 support
|
||||
- Fixed crash when pinned_objects is nil
|
||||
- Fixed slow timelines when there are a lot of deactivated users
|
||||
- Fixed account deletion API
|
||||
- Fixed lowercase HTTP HEAD method in the Media Proxy Preview code
|
||||
- Removed useless notification call on Delete activities
|
||||
- Improved performance for filtering out deactivated and invisible users
|
||||
- RSS and Atom feeds for users work again
|
||||
- TwitterCard meta tags conformance
|
||||
|
||||
## 2.4.5 - 2022-11-27
|
||||
|
||||
## Fixed
|
||||
- Image `class` attributes not being scrubbed, allowing to exploit frontend special classes [!3792](https://git.pleroma.social/pleroma/pleroma/-/merge_requests/3792)
|
||||
- Delete report notifs when demoting from superuser [!3642](https://git.pleroma.social/pleroma/pleroma/-/merge_requests/3642)
|
||||
- Validate `mediaType` only by it's format rather than using a list [!3597](https://git.pleroma.social/pleroma/pleroma/-/merge_requests/3597)
|
||||
- Pagination: Make mutes and blocks lists behave the same as other lists [!3693](https://git.pleroma.social/pleroma/pleroma/-/merge_requests/3693)
|
||||
- Compatibility with Elixir 1.14 [!3740](https://git.pleroma.social/pleroma/pleroma/-/merge_requests/3740)
|
||||
- Frontend installer: FediFE build URL [!3736](https://git.pleroma.social/pleroma/pleroma/-/merge_requests/3736)
|
||||
- Streaming: Don't stream ChatMessage into the home timeline [!3738](https://git.pleroma.social/pleroma/pleroma/-/merge_requests/3738)
|
||||
- Streaming: Stream local-only posts in the local timeline [!3738](https://git.pleroma.social/pleroma/pleroma/-/merge_requests/3738)
|
||||
- Signatures: Fix `keyId` lookup for GoToSocial [!3725](https://git.pleroma.social/pleroma/pleroma/-/merge_requests/3725)
|
||||
- Validator: Fix `replies` handling for GoToSocial [!3725](https://git.pleroma.social/pleroma/pleroma/-/merge_requests/3725)
|
||||
|
||||
## 2.4.4 - 2022-08-19
|
||||
|
||||
### Security
|
||||
- Streaming API sessions will now properly disconnect if the corresponding token is revoked
|
||||
|
||||
## 2.4.3 - 2022-05-06
|
||||
|
||||
### Security
|
||||
- Private `/objects/` and `/activities/` leaking if cached by authenticated user
|
||||
- SweetXML library DTD bomb
|
||||
|
||||
## 2.4.2 - 2022-01-10
|
||||
|
||||
### Fixed
|
||||
- Federation issues caused by HTTP pool checkout timeouts
|
||||
- Compatibility with Elixir 1.13
|
||||
|
||||
### Upgrade notes
|
||||
|
||||
1. Restart Pleroma
|
||||
|
||||
## 2.4.1 - 2021-08-29
|
||||
|
||||
### Changed
|
||||
- Make `mix pleroma.database set_text_search_config` run concurrently and indefinitely
|
||||
|
||||
### Added
|
||||
- AdminAPI: Missing configuration description for StealEmojiPolicy
|
||||
|
||||
### Fixed
|
||||
- MastodonAPI: Stream out Create activities
|
||||
- MRF ObjectAgePolicy: Fix pattern matching on "published"
|
||||
- TwitterAPI: Make `change_password` and `change_email` require params on body instead of query
|
||||
- Subscription(Bell) Notifications: Don't create from Pipeline Ingested replies
|
||||
- AdminAPI: Fix rendering reports containing a `nil` object
|
||||
- Mastodon API: Activity Search fallbacks on status fetching after a DB Timeout/Error
|
||||
- Mastodon API: Fix crash in Streamer related to reblogging
|
||||
- AdminAPI: List available frontends when `static/frontends` folder is missing
|
||||
- Make activity search properly use language-aware GIN indexes
|
||||
- AdminAPI: Fix suggestions for MRF Policies
|
||||
|
||||
## 2.4.0 - 2021-08-08
|
||||
|
||||
### Changed
|
||||
|
||||
- **Breaking:** Configuration: `:chat, enabled` moved to `:shout, enabled` and `:instance, chat_limit` moved to `:shout, limit`
|
||||
- **Breaking** Entries for simple_policy, transparency_exclusions and quarantined_instances now list both the instance and a reason.
|
||||
- Support for Erlang/OTP 24
|
||||
- The `application` metadata returned with statuses is no longer hardcoded. Apps that want to display these details will now have valid data for new posts after this change.
|
||||
- HTTPSecurityPlug now sends a response header to opt out of Google's FLoC (Federated Learning of Cohorts) targeted advertising.
|
||||
- Email address is now returned if requesting user is the owner of the user account so it can be exposed in client and FE user settings UIs.
|
||||
- Improved Twittercard and OpenGraph meta tag generation including thumbnails and image dimension metadata when available.
|
||||
- AdminAPI: sort users so the newest are at the top.
|
||||
- ActivityPub Client-to-Server(C2S): Limitation on the type of Activity/Object are lifted as they are now passed through ObjectValidators
|
||||
- MRF (`AntiFollowbotPolicy`): Bot accounts are now also considered followbots. Users can still allow bots to follow them by first following the bot.
|
||||
|
||||
### Added
|
||||
|
||||
- MRF (`FollowBotPolicy`): New MRF Policy which makes a designated local Bot account attempt to follow all users in public Notes received by your instance. Users who require approving follower requests or have #nobot in their profile are excluded.
|
||||
- Return OAuth token `id` (primary key) in POST `/oauth/token`.
|
||||
- AdminAPI: return `created_at` date with users.
|
||||
- AdminAPI: add DELETE `/api/v1/pleroma/admin/instances/:instance` to delete all content from a remote instance.
|
||||
- `AnalyzeMetadata` upload filter for extracting image/video attachment dimensions and generating blurhashes for images. Blurhashes for videos are not generated at this time.
|
||||
- Attachment dimensions and blurhashes are federated when available.
|
||||
- Mastodon API: support `poll` notification.
|
||||
- Pinned posts federation
|
||||
|
||||
### Fixed
|
||||
- Don't crash so hard when email settings are invalid.
|
||||
- Checking activated Upload Filters for required commands.
|
||||
- Remote users can no longer reappear after being deleted.
|
||||
- Deactivated users may now be deleted.
|
||||
- Deleting an activity with a lot of likes/boosts no longer causes a database timeout.
|
||||
- Mix task `pleroma.database prune_objects`
|
||||
- Fixed rendering of JSON errors on ActivityPub endpoints.
|
||||
- Linkify: Parsing crash with URLs ending in unbalanced closed paren, no path separator, and no query parameters
|
||||
- Try to save exported ConfigDB settings (migrate_from_db) in the system temp directory if default location is not writable.
|
||||
- Uploading custom instance thumbnail via AdminAPI/AdminFE generated invalid URL to the image
|
||||
- Applying ConcurrentLimiter settings via AdminAPI
|
||||
- User login failures if their `notification_settings` were in a NULL state.
|
||||
- Mix task `pleroma.user delete_activities` query transaction timeout is now :infinity
|
||||
- MRF (`SimplePolicy`): Embedded objects are now checked. If any embedded object would be rejected, its parent is rejected. This fixes Announces leaking posts from blocked domains.
|
||||
- Fixed some Markdown issues, including trailing slash in links.
|
||||
|
||||
### Removed
|
||||
- **Breaking**: Remove deprecated `/api/qvitter/statuses/notifications/read` (replaced by `/api/v1/pleroma/notifications/read`)
|
||||
|
||||
## [2.3.0] - 2021-03-01
|
||||
|
||||
### Security
|
||||
|
||||
- Fixed client user agent leaking through MediaProxy
|
||||
|
||||
### Removed
|
||||
|
||||
- `:auth, :enforce_oauth_admin_scope_usage` configuration option.
|
||||
|
||||
### Changed
|
||||
|
||||
- **Breaking**: Changed `mix pleroma.user toggle_confirmed` to `mix pleroma.user confirm`
|
||||
- **Breaking**: Changed `mix pleroma.user toggle_activated` to `mix pleroma.user activate/deactivate`
|
||||
- **Breaking:** NSFW hashtag is no longer added on sensitive posts
|
||||
- Polls now always return a `voters_count`, even if they are single-choice.
|
||||
- Admin Emails: The ap id is used as the user link in emails now.
|
||||
- Improved registration workflow for email confirmation and account approval modes.
|
||||
- **Breaking:** Changed `mix pleroma.user toggle_confirmed` to `mix pleroma.user confirm`
|
||||
- Search: When using Postgres 11+, Pleroma will use the `websearch_to_tsvector` function to parse search queries.
|
||||
- Emoji: Support the full Unicode 13.1 set of Emoji for reactions, plus regional indicators.
|
||||
- Deprecated `Pleroma.Uploaders.S3, :public_endpoint`. Now `Pleroma.Upload, :base_url` is the standard configuration key for all uploaders.
|
||||
- Improved Apache webserver support: updated sample configuration, MediaProxy cache invalidation verified with the included sample script
|
||||
- Improve OAuth 2.0 provider support. A missing `fqn` field was added to the response, but does not expose the user's email address.
|
||||
- Provide redirect of external posts from `/notice/:id` to their original URL
|
||||
- Admins no longer receive notifications for reports if they are the actor making the report.
|
||||
- Improved Mailer configuration setting descriptions for AdminFE.
|
||||
- Updated default avatar to look nicer.
|
||||
|
||||
<details>
|
||||
<summary>API Changes</summary>
|
||||
|
||||
- **Breaking:** AdminAPI changed User field `confirmation_pending` to `is_confirmed`
|
||||
- **Breaking:** AdminAPI changed User field `approval_pending` to `is_approved`
|
||||
- **Breaking**: AdminAPI changed User field `deactivated` to `is_active`
|
||||
- **Breaking:** AdminAPI `GET /api/pleroma/admin/users/:nickname_or_id/statuses` changed response format and added the number of total users posts.
|
||||
- **Breaking:** AdminAPI `GET /api/pleroma/admin/instances/:instance/statuses` changed response format and added the number of total users posts.
|
||||
- **Breaking** Entries for simple_policy, transparency_exclusions and quarantined_instances now list both the instance and a reason.
|
||||
- Admin API: Reports now ordered by newest
|
||||
- Pleroma API: `GET /api/v1/pleroma/chats` is deprecated in favor of `GET /api/v2/pleroma/chats`.
|
||||
- Pleroma API: Reroute `/api/pleroma/*` to `/api/v1/pleroma/*`
|
||||
|
||||
</details>
|
||||
- Improved hashtag timeline performance (requires a background migration).
|
||||
|
||||
### Added
|
||||
|
||||
- Reports now generate notifications for admins and mods.
|
||||
- Experimental websocket-based federation between Pleroma instances.
|
||||
- Support for local-only statuses.
|
||||
- Support pagination of blocks and mutes.
|
||||
- Account backup.
|
||||
- Configuration: Add `:instance, autofollowing_nicknames` setting to provide a way to make accounts automatically follow new users that register on the local Pleroma instance.
|
||||
- `[:activitypub, :blockers_visible]` config to control visibility of blockers.
|
||||
- Ability to view remote timelines, with ex. `/api/v1/timelines/public?instance=lain.com` and streams `public:remote` and `public:remote:media`.
|
||||
- The site title is now injected as a `title` tag like preloads or metadata.
|
||||
- Password reset tokens now are not accepted after a certain age.
|
||||
|
@ -231,27 +32,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|||
- OAuth form improvements: users are remembered by their cookie, the CSS is overridable by the admin, and the style has been improved.
|
||||
- OAuth improvements and fixes: more secure session-based authentication (by token that could be revoked anytime), ability to revoke belonging OAuth token from any client etc.
|
||||
- Ability to set ActivityPub aliases for follower migration.
|
||||
- Configurable background job limits for RichMedia (link previews) and MediaProxyWarmingPolicy
|
||||
- Ability to define custom HTTP headers per each frontend
|
||||
- MRF (`NoEmptyPolicy`): New MRF Policy which will deny empty statuses or statuses of only mentions from being created by local users
|
||||
- New users will receive a simple email confirming their registration if no other emails will be dispatched. (e.g., Welcome, Confirmation, or Approval Required)
|
||||
|
||||
<details>
|
||||
<summary>API Changes</summary>
|
||||
- Admin API: (`GET /api/pleroma/admin/users`) filter users by `unconfirmed` status and `actor_type`.
|
||||
- Admin API: OpenAPI spec for the user-related operations
|
||||
- Pleroma API: `GET /api/v2/pleroma/chats` added. It is exactly like `GET /api/v1/pleroma/chats` except supports pagination.
|
||||
- Pleroma API: Add `idempotency_key` to the chat message entity that can be used for optimistic message sending.
|
||||
- Pleroma API: (`GET /api/v1/pleroma/federation_status`) Add a way to get a list of unreachable instances.
|
||||
- Mastodon API: User and conversation mutes can now auto-expire if `expires_in` parameter was given while adding the mute.
|
||||
- Admin API: An endpoint to manage frontends.
|
||||
- Streaming API: Add follow relationships updates.
|
||||
- WebPush: Introduce `pleroma:chat_mention` and `pleroma:emoji_reaction` notification types.
|
||||
- Mastodon API: Add monthly active users to `/api/v1/instance` (`pleroma.stats.mau`).
|
||||
- Mastodon API: Home, public, hashtag & list timelines accept `only_media`, `remote` & `local` parameters for filtration.
|
||||
- Mastodon API: `/api/v1/accounts/:id` & `/api/v1/mutes` endpoints accept `with_relationships` parameter and return filled `pleroma.relationship` field.
|
||||
- Mastodon API: Endpoint to remove a conversation (`DELETE /api/v1/conversations/:id`).
|
||||
- Mastodon API: `expires_in` in the scheduled post `params` field on `/api/v1/statuses` and `/api/v1/scheduled_statuses/:id` endpoints.
|
||||
</details>
|
||||
|
||||
### Fixed
|
||||
|
@ -259,32 +48,20 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|||
- Users with `is_discoverable` field set to false (default value) will appear in in-service search results but be hidden from external services (search bots etc.).
|
||||
- Streaming API: Posts and notifications are not dropped, when CLI task is executing.
|
||||
- Creating incorrect IPv4 address-style HTTP links when encountering certain numbers.
|
||||
- Reblog API Endpoint: Do not set visibility parameter to public by default and let CommonAPI to infer it from status, so a user can reblog their private status without explicitly setting reblog visibility to private.
|
||||
- Tag URLs in statuses are now absolute
|
||||
- Removed duplicate jobs to purge expired activities
|
||||
- File extensions of some attachments were incorrectly changed. This feature has been disabled for now.
|
||||
- Mix task pleroma.instance creates missing parent directories if the configuration or SQL output paths are changed.
|
||||
|
||||
<details>
|
||||
<summary>API Changes</summary>
|
||||
- Mastodon API: Current user is now included in conversation if it's the only participant.
|
||||
- Mastodon API: Fixed last_status.account being not filled with account data.
|
||||
- Mastodon API: Fix not being able to add or remove multiple users at once in lists.
|
||||
- Mastodon API: Fixed own_votes being not returned with poll data.
|
||||
- Mastodon API: Fixed creation of scheduled posts with polls.
|
||||
- Mastodon API: Support for expires_in/expires_at in the Filters.
|
||||
</details>
|
||||
|
||||
## [2.2.2] - 2021-01-18
|
||||
## Unreleased (Patch)
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix ability to update Pleroma Chat push notifications with PUT /api/v1/push/subscription and alert type pleroma:chat_mention
|
||||
- Emoji Reaction activity filtering from blocked and muted accounts.
|
||||
- StealEmojiPolicy creates dir for emojis, if it doesn't exist.
|
||||
- Updated `elixir_make` to a non-retired version
|
||||
|
||||
### Upgrade notes
|
||||
|
||||
1. Restart Pleroma
|
||||
|
||||
## [2.2.1] - 2020-12-22
|
||||
|
||||
|
@ -300,7 +77,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|||
- Rich Media Previews sometimes showed the wrong preview due to a bug following redirects.
|
||||
- Fixes for the autolinker.
|
||||
- Forwarded reports duplication from Pleroma instances.
|
||||
- Emoji Reaction activity filtering from blocked and muted accounts.
|
||||
|
||||
- <details>
|
||||
<summary>API</summary>
|
||||
|
@ -671,6 +447,7 @@ switched to a new configuration mechanism, however it was not officially removed
|
|||
- Static-FE: Fix remote posts not being sanitized
|
||||
|
||||
### Fixed
|
||||
=======
|
||||
- Rate limiter crashes when there is no explicitly specified ip in the config
|
||||
- 500 errors when no `Accept` header is present if Static-FE is enabled
|
||||
- Instance panel not being updated immediately due to wrong `Cache-Control` headers
|
||||
|
|
11
COPYING
11
COPYING
|
@ -1,17 +1,10 @@
|
|||
Unless otherwise stated this repository is copyright © 2017-2022
|
||||
Unless otherwise stated this repository is copyright © 2017-2021
|
||||
Pleroma Authors <https://pleroma.social/>, and is distributed under
|
||||
The GNU Affero General Public License Version 3, you should have received a
|
||||
copy of the license file as AGPL-3.
|
||||
|
||||
---
|
||||
|
||||
Files inside docs directory are copyright © 2022 Pleroma Authors
|
||||
<https://pleroma.social/>, and are distributed under the Creative Commons
|
||||
Attribution 4.0 International license, you should have received
|
||||
a copy of the license file as CC-BY-4.0.
|
||||
|
||||
---
|
||||
|
||||
The following files are copyright © 2019 shitposter.club, and are distributed
|
||||
under the Creative Commons Attribution-ShareAlike 4.0 International license,
|
||||
you should have received a copy of the license file as CC-BY-SA-4.0.
|
||||
|
@ -30,7 +23,7 @@ priv/static/images/pleroma-fox-tan-shy.png
|
|||
|
||||
---
|
||||
|
||||
The following files are copyright © 2017-2022 Pleroma Authors
|
||||
The following files are copyright © 2017-2020 Pleroma Authors
|
||||
<https://pleroma.social/>, and are distributed under the Creative Commons
|
||||
Attribution-ShareAlike 4.0 International license, you should have received
|
||||
a copy of the license file as CC-BY-SA-4.0.
|
||||
|
|
11
Dockerfile
11
Dockerfile
|
@ -1,18 +1,18 @@
|
|||
FROM elixir:1.11.4-alpine as build
|
||||
FROM elixir:1.9-alpine as build
|
||||
|
||||
COPY . .
|
||||
|
||||
ENV MIX_ENV=prod
|
||||
|
||||
RUN apk add git gcc g++ musl-dev make cmake file-dev &&\
|
||||
echo "import Config" > config/prod.secret.exs &&\
|
||||
echo "import Mix.Config" > config/prod.secret.exs &&\
|
||||
mix local.hex --force &&\
|
||||
mix local.rebar --force &&\
|
||||
mix deps.get --only prod &&\
|
||||
mkdir release &&\
|
||||
mix release --path release
|
||||
|
||||
FROM alpine
|
||||
FROM alpine:3.11
|
||||
|
||||
ARG BUILD_DATE
|
||||
ARG VCS_REF
|
||||
|
@ -31,8 +31,9 @@ LABEL maintainer="ops@pleroma.social" \
|
|||
ARG HOME=/opt/pleroma
|
||||
ARG DATA=/var/lib/pleroma
|
||||
|
||||
RUN apk update &&\
|
||||
apk add exiftool ffmpeg imagemagick libmagic ncurses postgresql-client &&\
|
||||
RUN echo "http://nl.alpinelinux.org/alpine/latest-stable/community" >> /etc/apk/repositories &&\
|
||||
apk update &&\
|
||||
apk add exiftool imagemagick libmagic ncurses postgresql-client &&\
|
||||
adduser --system --shell /bin/false --home ${HOME} pleroma &&\
|
||||
mkdir -p ${DATA}/uploads &&\
|
||||
mkdir -p ${DATA}/static &&\
|
||||
|
|
|
@ -30,14 +30,11 @@ If your platform is not supported, or you just want to be able to edit the sourc
|
|||
- [OpenBSD (fi)](https://docs-develop.pleroma.social/backend/installation/openbsd_fi/)
|
||||
|
||||
### OS/Distro packages
|
||||
Currently Pleroma is packaged for [YunoHost](https://yunohost.org) and [NixOS](https://nixos.org). If you want to package Pleroma for any OS/Distros, we can guide you through the process on our [community channels](#community-channels). If you want to change default options in your Pleroma package, please **discuss it with us first**.
|
||||
Currently Pleroma is not packaged by any OS/Distros, but if you want to package it for one, we can guide you through the process on our [community channels](#community-channels). If you want to change default options in your Pleroma package, please **discuss it with us first**.
|
||||
|
||||
### Docker
|
||||
While we don’t provide docker files, other people have written very good ones. Take a look at <https://github.com/angristan/docker-pleroma> or <https://glitch.sh/sn0w/pleroma-docker>.
|
||||
|
||||
### Raspberry Pi
|
||||
Community maintained Raspberry Pi image that you can flash and run Pleroma on your Raspberry Pi. Available here <https://github.com/guysoft/PleromaPi>.
|
||||
|
||||
### Compilation Troubleshooting
|
||||
If you ever encounter compilation issues during the updating of Pleroma, you can try these commands and see if they fix things:
|
||||
|
||||
|
@ -53,5 +50,5 @@ If you are not developing Pleroma, it is better to use the OTP release, which co
|
|||
- Latest Git revision: <https://docs-develop.pleroma.social>
|
||||
|
||||
## Community Channels
|
||||
* IRC: **#pleroma** and **#pleroma-dev** on libera.chat, webchat is available at <https://irc.pleroma.social>
|
||||
* Matrix: [#pleroma:libera.chat](https://matrix.to/#/#pleroma:libera.chat) and [#pleroma-dev:libera.chat](https://matrix.to/#/#pleroma-dev:libera.chat)
|
||||
* IRC: **#pleroma** and **#pleroma-dev** on freenode, webchat is available at <https://irc.pleroma.social>
|
||||
* Matrix: <https://matrix.to/#/#freenode_#pleroma:matrix.org> and <https://matrix.to/#/#freenode_#pleroma-dev:matrix.org>
|
||||
|
|
|
@ -299,7 +299,7 @@ defp insert_activity(:attachment, visibility, group, users, _opts) do
|
|||
"url" => [
|
||||
%{
|
||||
"href" =>
|
||||
"#{Pleroma.Web.Endpoint.url()}/media/b1b873552422a07bf53af01f3c231c841db4dfc42c35efde681abaf0f2a4eab7.jpg",
|
||||
"#{Pleroma.Web.base_url()}/media/b1b873552422a07bf53af01f3c231c841db4dfc42c35efde681abaf0f2a4eab7.jpg",
|
||||
"mediaType" => "image/jpeg",
|
||||
"type" => "Link"
|
||||
}
|
||||
|
@ -394,7 +394,7 @@ defp get_actor(group, users), do: Enum.random(users[group])
|
|||
|
||||
defp other_data(actor, content) do
|
||||
%{host: host} = URI.parse(actor.ap_id)
|
||||
datetime = DateTime.utc_now() |> to_string()
|
||||
datetime = DateTime.utc_now()
|
||||
context_id = "https://#{host}/contexts/#{UUID.generate()}"
|
||||
activity_id = "https://#{host}/activities/#{UUID.generate()}"
|
||||
object_id = "https://#{host}/objects/#{UUID.generate()}"
|
||||
|
|
|
@ -33,11 +33,10 @@ defp fetch_user(user) do
|
|||
end
|
||||
|
||||
defp create_filter(user) do
|
||||
Pleroma.Filter.create(%{
|
||||
Pleroma.Filter.create(%Pleroma.Filter{
|
||||
user_id: user.id,
|
||||
phrase: "must be filtered",
|
||||
hide: true,
|
||||
context: ["home"]
|
||||
hide: true
|
||||
})
|
||||
end
|
||||
|
||||
|
|
|
@ -99,16 +99,15 @@ defp hashtag_fetching(params, user, local_only) do
|
|||
|> Enum.map(&String.downcase(&1))
|
||||
|
||||
_activities =
|
||||
%{
|
||||
type: "Create",
|
||||
local_only: local_only,
|
||||
blocking_user: user,
|
||||
muting_user: user,
|
||||
user: user,
|
||||
tag: tags,
|
||||
tag_all: tag_all,
|
||||
tag_reject: tag_reject,
|
||||
}
|
||||
params
|
||||
|> Map.put(:type, "Create")
|
||||
|> Map.put(:local_only, local_only)
|
||||
|> Map.put(:blocking_user, user)
|
||||
|> Map.put(:muting_user, user)
|
||||
|> Map.put(:user, user)
|
||||
|> Map.put(:tag, tags)
|
||||
|> Map.put(:tag_all, tag_all)
|
||||
|> Map.put(:tag_reject, tag_reject)
|
||||
|> Pleroma.Web.ActivityPub.ActivityPub.fetch_public_activities()
|
||||
end
|
||||
end
|
||||
|
|
|
@ -17,14 +17,14 @@ def run(_args) do
|
|||
# Let the user make 100 posts
|
||||
|
||||
1..100
|
||||
|> Enum.each(fn i -> CommonAPI.post(user, %{status: to_string(i)}) end)
|
||||
|> Enum.each(fn i -> CommonAPI.post(user, %{"status" => to_string(i)}) end)
|
||||
|
||||
# Let 10 random users post
|
||||
posts =
|
||||
users
|
||||
|> Enum.take_random(10)
|
||||
|> Enum.map(fn {:ok, random_user} ->
|
||||
{:ok, activity} = CommonAPI.post(random_user, %{status: "."})
|
||||
{:ok, activity} = CommonAPI.post(random_user, %{"status" => "."})
|
||||
activity
|
||||
end)
|
||||
|
||||
|
@ -42,7 +42,7 @@ def run(_args) do
|
|||
|> Conn.assign(:user, reading_user)
|
||||
|> Conn.assign(:skip_link_headers, true)
|
||||
|
||||
Pleroma.Web.MastodonAPI.AccountController.statuses(conn, %{id: user.id})
|
||||
Pleroma.Web.MastodonAPI.AccountController.statuses(conn, %{"id" => user.id})
|
||||
end
|
||||
},
|
||||
inputs: %{"user" => user, "no user" => nil},
|
||||
|
@ -50,7 +50,7 @@ def run(_args) do
|
|||
)
|
||||
|
||||
users
|
||||
|> Enum.each(fn {:ok, follower} -> Pleroma.User.follow(follower, user) end)
|
||||
|> Enum.each(fn {:ok, follower, user} -> Pleroma.User.follow(follower, user) end)
|
||||
|
||||
Benchee.run(
|
||||
%{
|
||||
|
@ -60,7 +60,7 @@ def run(_args) do
|
|||
|> Conn.assign(:user, reading_user)
|
||||
|> Conn.assign(:skip_link_headers, true)
|
||||
|
||||
Pleroma.Web.MastodonAPI.AccountController.statuses(conn, %{id: user.id})
|
||||
Pleroma.Web.MastodonAPI.AccountController.statuses(conn, %{"id" => user.id})
|
||||
end
|
||||
},
|
||||
inputs: %{"user" => user, "no user" => nil},
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
FROM elixir:1.11.4
|
||||
|
||||
# Single RUN statement, otherwise intermediate images are created
|
||||
# https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#run
|
||||
RUN apt-get update &&\
|
||||
apt-get install -y libmagic-dev cmake libimage-exiftool-perl ffmpeg &&\
|
||||
mix local.hex --force &&\
|
||||
mix local.rebar --force
|
12
ci/README
12
ci/README
|
@ -1,12 +0,0 @@
|
|||
## Dependencies
|
||||
|
||||
Assuming an AMD64 Alpine system, you're going to need the following packages
|
||||
- `qemu qemu-openrc qemu-arm qemu-aarch64` for binfmt
|
||||
- `docker-cli-buildx` for building the images
|
||||
|
||||
## Setting up
|
||||
|
||||
```
|
||||
docker login git.pleroma.social:5050
|
||||
doas rc-service qemu-binfmt start
|
||||
```
|
|
@ -1 +0,0 @@
|
|||
docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t git.pleroma.social:5050/pleroma/pleroma/ci-base:latest --push .
|
|
@ -1,10 +1,11 @@
|
|||
import Config
|
||||
use Mix.Config
|
||||
|
||||
# We don't run a server during test. If one is required,
|
||||
# you can enable the server option below.
|
||||
config :pleroma, Pleroma.Web.Endpoint,
|
||||
http: [port: 4001],
|
||||
url: [port: 4001]
|
||||
url: [port: 4001],
|
||||
server: true
|
||||
|
||||
# Disable captha for tests
|
||||
config :pleroma, Pleroma.Captcha,
|
||||
|
@ -40,11 +41,10 @@
|
|||
password: "postgres",
|
||||
database: "pleroma_benchmark",
|
||||
hostname: System.get_env("DB_HOST") || "localhost",
|
||||
port: System.get_env("DB_PORT") || "5432",
|
||||
pool_size: 10
|
||||
|
||||
# Reduce hash rounds for testing
|
||||
config :pleroma, :password, iterations: 1
|
||||
config :pbkdf2_elixir, rounds: 1
|
||||
|
||||
config :tesla, adapter: Tesla.Mock
|
||||
|
||||
|
|
|
@ -37,11 +37,11 @@
|
|||
# FIGURATION! EDIT YOUR SECRET FILE (either prod.secret.exs, dev.secret.exs).
|
||||
#
|
||||
# This file is responsible for configuring your application
|
||||
# and its dependencies with the aid of the Config module.
|
||||
# and its dependencies with the aid of the Mix.Config module.
|
||||
#
|
||||
# This configuration file is loaded before any dependency and
|
||||
# is restricted to this project.
|
||||
import Config
|
||||
use Mix.Config
|
||||
|
||||
# General application configuration
|
||||
config :pleroma, ecto_repos: [Pleroma.Repo]
|
||||
|
@ -64,23 +64,14 @@
|
|||
link_name: false,
|
||||
proxy_remote: false,
|
||||
filename_display_max_length: 30,
|
||||
default_description: nil,
|
||||
base_url: nil
|
||||
default_description: nil
|
||||
|
||||
config :pleroma, Pleroma.Uploaders.Local, uploads: "uploads"
|
||||
|
||||
config :pleroma, Pleroma.Uploaders.S3,
|
||||
bucket: nil,
|
||||
bucket_namespace: nil,
|
||||
truncated_namespace: nil,
|
||||
streaming_enabled: true
|
||||
|
||||
config :ex_aws, :s3,
|
||||
# host: "s3.wasabisys.com", # required if not Amazon AWS
|
||||
access_key_id: nil,
|
||||
secret_access_key: nil,
|
||||
# region: "us-east-1", # may be required for Amazon AWS
|
||||
scheme: "https://"
|
||||
streaming_enabled: true,
|
||||
public_endpoint: "https://s3.amazonaws.com"
|
||||
|
||||
config :pleroma, :emoji,
|
||||
shortcode_globs: ["/emoji/custom/**/*.png"],
|
||||
|
@ -139,7 +130,6 @@
|
|||
],
|
||||
protocol: "https",
|
||||
secret_key_base: "aK4Abxf29xU9TTDKre9coZPUgevcVCFQJe/5xP/7Lt4BEif6idBIbjupVbOrbKxl",
|
||||
live_view: [signing_salt: "U5ELgdEwTD3n1+D5s0rY0AMg8/y1STxZ3Zvsl3bWh+oBcGrYdil0rXqPMRd3Glcq"],
|
||||
signing_salt: "CqaoopA2",
|
||||
render_errors: [view: Pleroma.Web.ErrorView, accepts: ~w(json)],
|
||||
pubsub_server: Pleroma.PubSub,
|
||||
|
@ -160,6 +150,11 @@
|
|||
format: "$metadata[$level] $message",
|
||||
metadata: [:request_id]
|
||||
|
||||
config :quack,
|
||||
level: :warn,
|
||||
meta: [:all],
|
||||
webhook_url: "https://hooks.slack.com/services/YOUR-KEY-HERE"
|
||||
|
||||
config :mime, :types, %{
|
||||
"application/xml" => ["xml"],
|
||||
"application/xrd+xml" => ["xrd+xml"],
|
||||
|
@ -182,11 +177,11 @@
|
|||
email: "example@example.com",
|
||||
notify_email: "noreply@example.com",
|
||||
description: "Pleroma: An efficient and flexible fediverse server",
|
||||
short_description: "",
|
||||
background_image: "/images/city.jpg",
|
||||
instance_thumbnail: "/instance/thumbnail.jpeg",
|
||||
limit: 5_000,
|
||||
description_limit: 5_000,
|
||||
chat_limit: 5_000,
|
||||
remote_limit: 100_000,
|
||||
upload_limit: 16_000_000,
|
||||
avatar_upload_limit: 2_000_000,
|
||||
|
@ -223,7 +218,6 @@
|
|||
max_pinned_statuses: 1,
|
||||
attachment_links: false,
|
||||
max_report_comment_size: 1000,
|
||||
report_strip_status: true,
|
||||
safe_dm_mentions: false,
|
||||
healthcheck: false,
|
||||
remote_post_retention_days: 90,
|
||||
|
@ -251,29 +245,7 @@
|
|||
]
|
||||
],
|
||||
show_reactions: true,
|
||||
password_reset_token_validity: 60 * 60 * 24,
|
||||
profile_directory: true,
|
||||
admin_privileges: [
|
||||
:users_read,
|
||||
:users_manage_invites,
|
||||
:users_manage_activation_state,
|
||||
:users_manage_tags,
|
||||
:users_manage_credentials,
|
||||
:users_delete,
|
||||
:messages_read,
|
||||
:messages_delete,
|
||||
:instances_delete,
|
||||
:reports_manage_reports,
|
||||
:moderation_log_read,
|
||||
:announcements_manage_announcements,
|
||||
:emoji_manage_emoji,
|
||||
:statistics_read
|
||||
],
|
||||
moderator_privileges: [:messages_delete, :reports_manage_reports],
|
||||
max_endorsed_users: 20,
|
||||
birthday_required: false,
|
||||
birthday_min_age: 0,
|
||||
max_media_attachments: 1_000
|
||||
password_reset_token_validity: 60 * 60 * 24
|
||||
|
||||
config :pleroma, :welcome,
|
||||
direct_message: [
|
||||
|
@ -341,6 +313,9 @@
|
|||
subjectLineBehavior: "email",
|
||||
theme: "pleroma-dark",
|
||||
webPushNotifications: false
|
||||
},
|
||||
masto_fe: %{
|
||||
showInstanceSpecificPanel: true
|
||||
}
|
||||
|
||||
config :pleroma, :assets,
|
||||
|
@ -369,7 +344,6 @@
|
|||
config :pleroma, :activitypub,
|
||||
unfollow_blocked: true,
|
||||
outgoing_blocks: true,
|
||||
blockers_visible: true,
|
||||
follow_handshake_timeout: 500,
|
||||
note_replies_output_limit: 5,
|
||||
sign_object_fetches: true,
|
||||
|
@ -408,11 +382,6 @@
|
|||
federated_timeline_removal: [],
|
||||
replace: []
|
||||
|
||||
config :pleroma, :mrf_hashtag,
|
||||
sensitive: ["nsfw"],
|
||||
reject: [],
|
||||
federated_timeline_removal: []
|
||||
|
||||
config :pleroma, :mrf_subchain, match_actor: %{}
|
||||
|
||||
config :pleroma, :mrf_activity_expiration, days: 365
|
||||
|
@ -426,8 +395,6 @@
|
|||
threshold: 604_800,
|
||||
actions: [:delist, :strip_followers]
|
||||
|
||||
config :pleroma, :mrf_follow_bot, follower_nickname: nil
|
||||
|
||||
config :pleroma, :rich_media,
|
||||
enabled: true,
|
||||
ignore_hosts: [],
|
||||
|
@ -462,9 +429,7 @@
|
|||
headers: [],
|
||||
options: []
|
||||
|
||||
config :pleroma, Pleroma.Web.MediaProxy.Invalidation.Script,
|
||||
script_path: nil,
|
||||
url_format: nil
|
||||
config :pleroma, Pleroma.Web.MediaProxy.Invalidation.Script, script_path: nil
|
||||
|
||||
# Note: media preview proxy depends on media proxy to be enabled
|
||||
config :pleroma, :media_preview_proxy,
|
||||
|
@ -474,11 +439,9 @@
|
|||
image_quality: 85,
|
||||
min_content_length: 100 * 1024
|
||||
|
||||
config :pleroma, :shout,
|
||||
enabled: true,
|
||||
limit: 5_000
|
||||
config :pleroma, :chat, enabled: true
|
||||
|
||||
config :phoenix, :format_encoders, json: Jason, "activity+json": Jason
|
||||
config :phoenix, :format_encoders, json: Jason
|
||||
|
||||
config :phoenix, :json_library, Jason
|
||||
|
||||
|
@ -569,16 +532,14 @@
|
|||
queues: [
|
||||
activity_expiration: 10,
|
||||
token_expiration: 5,
|
||||
filter_expiration: 1,
|
||||
backup: 1,
|
||||
federator_incoming: 5,
|
||||
federator_outgoing: 5,
|
||||
federator_incoming: 50,
|
||||
federator_outgoing: 50,
|
||||
ingestion_queue: 50,
|
||||
web_push: 50,
|
||||
mailer: 10,
|
||||
transmogrifier: 20,
|
||||
scheduled_activities: 10,
|
||||
poll_notifications: 10,
|
||||
background: 5,
|
||||
remote_fetcher: 2,
|
||||
attachments_cleanup: 1,
|
||||
|
@ -638,7 +599,10 @@
|
|||
base_path: "/oauth",
|
||||
providers: ueberauth_providers
|
||||
|
||||
config :pleroma, :auth, oauth_consumer_strategies: oauth_consumer_strategies
|
||||
config :pleroma,
|
||||
:auth,
|
||||
enforce_oauth_admin_scope_usage: true,
|
||||
oauth_consumer_strategies: oauth_consumer_strategies
|
||||
|
||||
config :pleroma, Pleroma.Emails.Mailer, adapter: Swoosh.Adapters.Sendmail, enabled: false
|
||||
|
||||
|
@ -681,12 +645,6 @@
|
|||
|
||||
config :pleroma, :database, rum_enabled: false
|
||||
|
||||
config :pleroma, :features, improved_hashtag_timeline: :auto
|
||||
|
||||
config :pleroma, :populate_hashtags_table, fault_rate_allowance: 0.01
|
||||
|
||||
config :pleroma, :delete_context_objects, fault_rate_allowance: 0.01
|
||||
|
||||
config :pleroma, :env, Mix.env()
|
||||
|
||||
config :http_signatures,
|
||||
|
@ -755,11 +713,8 @@
|
|||
"name" => "fedi-fe",
|
||||
"git" => "https://git.pleroma.social/pleroma/fedi-fe",
|
||||
"build_url" =>
|
||||
"https://git.pleroma.social/pleroma/fedi-fe/-/jobs/artifacts/${ref}/download?job=build_release",
|
||||
"ref" => "master",
|
||||
"custom-http-headers" => [
|
||||
{"service-worker-allowed", "/"}
|
||||
]
|
||||
"https://git.pleroma.social/pleroma/fedi-fe/-/jobs/artifacts/${ref}/download?job=build",
|
||||
"ref" => "master"
|
||||
},
|
||||
"admin-fe" => %{
|
||||
"name" => "admin-fe",
|
||||
|
@ -768,21 +723,13 @@
|
|||
"https://git.pleroma.social/pleroma/admin-fe/-/jobs/artifacts/${ref}/download?job=build",
|
||||
"ref" => "develop"
|
||||
},
|
||||
"soapbox" => %{
|
||||
"name" => "soapbox",
|
||||
"git" => "https://gitlab.com/soapbox-pub/soapbox",
|
||||
"soapbox-fe" => %{
|
||||
"name" => "soapbox-fe",
|
||||
"git" => "https://gitlab.com/soapbox-pub/soapbox-fe",
|
||||
"build_url" =>
|
||||
"https://gitlab.com/soapbox-pub/soapbox/-/jobs/artifacts/${ref}/download?job=build-production",
|
||||
"ref" => "v3.0.0-beta.1",
|
||||
"https://gitlab.com/soapbox-pub/soapbox-fe/-/jobs/artifacts/${ref}/download?job=build-production",
|
||||
"ref" => "v1.0.0",
|
||||
"build_dir" => "static"
|
||||
},
|
||||
"glitch-lily" => %{
|
||||
"name" => "glitch-lily",
|
||||
"git" => "https://lily-is.land/infra/glitch-lily",
|
||||
"build_url" =>
|
||||
"https://lily-is.land/infra/glitch-lily/-/jobs/artifacts/${ref}/download?job=build",
|
||||
"ref" => "servant",
|
||||
"build_dir" => "public"
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -876,13 +823,6 @@
|
|||
limit_days: 7,
|
||||
dir: nil
|
||||
|
||||
config :pleroma, ConcurrentLimiter, [
|
||||
{Pleroma.Web.RichMedia.Helpers, [max_running: 5, max_waiting: 5]},
|
||||
{Pleroma.Web.ActivityPub.MRF.MediaProxyWarmingPolicy, [max_running: 5, max_waiting: 5]}
|
||||
]
|
||||
|
||||
config :pleroma, Pleroma.Web.WebFinger, domain: nil, update_nickname_on_user_fetch: true
|
||||
|
||||
# Import environment specific config. This must remain at the bottom
|
||||
# of this file so it overrides the configuration defined above.
|
||||
import_config "#{Mix.env()}.exs"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import Config
|
||||
use Mix.Config
|
||||
|
||||
websocket_config = [
|
||||
path: "/websocket",
|
||||
|
@ -60,12 +60,6 @@
|
|||
label: "Build directory",
|
||||
type: :string,
|
||||
description: "The directory inside the zip file "
|
||||
},
|
||||
%{
|
||||
key: "custom-http-headers",
|
||||
label: "Custom HTTP headers",
|
||||
type: {:list, :string},
|
||||
description: "The custom HTTP headers for the frontend"
|
||||
}
|
||||
]
|
||||
|
||||
|
@ -99,8 +93,7 @@
|
|||
key: :base_url,
|
||||
label: "Base URL",
|
||||
type: :string,
|
||||
description:
|
||||
"Base URL for the uploads. Required if you use a CDN or host attachments under a different domain.",
|
||||
description: "Base URL for the uploads, needed if you use CDN",
|
||||
suggestions: [
|
||||
"https://cdn-host.com"
|
||||
]
|
||||
|
@ -156,12 +149,18 @@
|
|||
description: "S3 bucket namespace",
|
||||
suggestions: ["pleroma"]
|
||||
},
|
||||
%{
|
||||
key: :public_endpoint,
|
||||
type: :string,
|
||||
description: "S3 endpoint",
|
||||
suggestions: ["https://s3.amazonaws.com"]
|
||||
},
|
||||
%{
|
||||
key: :truncated_namespace,
|
||||
type: :string,
|
||||
description:
|
||||
"If you use S3 compatible service such as Digital Ocean Spaces or CDN, set folder name or \"\" etc." <>
|
||||
" For example, when using CDN to S3 virtual host format, set \"\". At this time, write CNAME to CDN in Upload base_url."
|
||||
" For example, when using CDN to S3 virtual host format, set \"\". At this time, write CNAME to CDN in public_endpoint."
|
||||
},
|
||||
%{
|
||||
key: :streaming_enabled,
|
||||
|
@ -215,216 +214,253 @@
|
|||
type: :group,
|
||||
description: "Mailer-related settings",
|
||||
children: [
|
||||
%{
|
||||
key: :enabled,
|
||||
label: "Mailer Enabled",
|
||||
type: :boolean
|
||||
},
|
||||
%{
|
||||
key: :adapter,
|
||||
type: :module,
|
||||
description:
|
||||
"One of the mail adapters listed in [Swoosh documentation](https://hexdocs.pm/swoosh/Swoosh.html#module-adapters)",
|
||||
"One of the mail adapters listed in [Swoosh readme](https://github.com/swoosh/swoosh#adapters)," <>
|
||||
" or Swoosh.Adapters.Local for in-memory mailbox",
|
||||
suggestions: [
|
||||
Swoosh.Adapters.AmazonSES,
|
||||
Swoosh.Adapters.Dyn,
|
||||
Swoosh.Adapters.Gmail,
|
||||
Swoosh.Adapters.Mailgun,
|
||||
Swoosh.Adapters.Mailjet,
|
||||
Swoosh.Adapters.Mandrill,
|
||||
Swoosh.Adapters.Postmark,
|
||||
Swoosh.Adapters.SMTP,
|
||||
Swoosh.Adapters.Sendgrid,
|
||||
Swoosh.Adapters.Sendmail,
|
||||
Swoosh.Adapters.Mandrill,
|
||||
Swoosh.Adapters.Mailgun,
|
||||
Swoosh.Adapters.Mailjet,
|
||||
Swoosh.Adapters.Postmark,
|
||||
Swoosh.Adapters.SparkPost,
|
||||
Swoosh.Adapters.AmazonSES,
|
||||
Swoosh.Adapters.Dyn,
|
||||
Swoosh.Adapters.SocketLabs,
|
||||
Swoosh.Adapters.SparkPost
|
||||
Swoosh.Adapters.Gmail,
|
||||
Swoosh.Adapters.Local
|
||||
]
|
||||
},
|
||||
%{
|
||||
key: :enabled,
|
||||
type: :boolean,
|
||||
description: "Allow/disallow send emails"
|
||||
},
|
||||
%{
|
||||
group: {:subgroup, Swoosh.Adapters.SMTP},
|
||||
key: :relay,
|
||||
type: :string,
|
||||
description: "Hostname or IP address",
|
||||
suggestions: ["smtp.example.com"]
|
||||
},
|
||||
%{
|
||||
group: {:subgroup, Swoosh.Adapters.SMTP},
|
||||
key: :port,
|
||||
type: :integer,
|
||||
description: "SMTP port",
|
||||
suggestions: ["1025"]
|
||||
description: "`Swoosh.Adapters.SMTP` adapter specific setting",
|
||||
suggestions: ["smtp.gmail.com"]
|
||||
},
|
||||
%{
|
||||
group: {:subgroup, Swoosh.Adapters.SMTP},
|
||||
key: :username,
|
||||
type: :string,
|
||||
description: "SMTP AUTH username",
|
||||
suggestions: ["user@example.com"]
|
||||
description: "`Swoosh.Adapters.SMTP` adapter specific setting",
|
||||
suggestions: ["pleroma"]
|
||||
},
|
||||
%{
|
||||
group: {:subgroup, Swoosh.Adapters.SMTP},
|
||||
key: :password,
|
||||
type: :string,
|
||||
description: "SMTP AUTH password",
|
||||
description: "`Swoosh.Adapters.SMTP` adapter specific setting",
|
||||
suggestions: ["password"]
|
||||
},
|
||||
%{
|
||||
group: {:subgroup, Swoosh.Adapters.SMTP},
|
||||
key: :ssl,
|
||||
label: "Use SSL",
|
||||
label: "SSL",
|
||||
type: :boolean,
|
||||
description: "Use Implicit SSL/TLS. e.g. port 465"
|
||||
description: "`Swoosh.Adapters.SMTP` adapter specific setting"
|
||||
},
|
||||
%{
|
||||
group: {:subgroup, Swoosh.Adapters.SMTP},
|
||||
key: :tls,
|
||||
label: "STARTTLS Mode",
|
||||
type: {:dropdown, :atom},
|
||||
description: "Explicit TLS (STARTTLS) enforcement mode",
|
||||
suggestions: [:if_available, :always, :never]
|
||||
label: "TLS",
|
||||
type: :atom,
|
||||
description: "`Swoosh.Adapters.SMTP` adapter specific setting",
|
||||
suggestions: [:always, :never, :if_available]
|
||||
},
|
||||
%{
|
||||
group: {:subgroup, Swoosh.Adapters.SMTP},
|
||||
key: :auth,
|
||||
label: "AUTH Mode",
|
||||
type: {:dropdown, :atom},
|
||||
description: "SMTP AUTH enforcement mode",
|
||||
suggestions: [:if_available, :always, :never]
|
||||
type: :atom,
|
||||
description: "`Swoosh.Adapters.SMTP` adapter specific setting",
|
||||
suggestions: [:always, :never, :if_available]
|
||||
},
|
||||
%{
|
||||
group: {:subgroup, Swoosh.Adapters.SMTP},
|
||||
key: :port,
|
||||
type: :integer,
|
||||
description: "`Swoosh.Adapters.SMTP` adapter specific setting",
|
||||
suggestions: [1025]
|
||||
},
|
||||
%{
|
||||
group: {:subgroup, Swoosh.Adapters.SMTP},
|
||||
key: :retries,
|
||||
type: :integer,
|
||||
description: "SMTP temporary (4xx) error retries",
|
||||
suggestions: [1]
|
||||
description: "`Swoosh.Adapters.SMTP` adapter specific setting",
|
||||
suggestions: [5]
|
||||
},
|
||||
%{
|
||||
group: {:subgroup, Swoosh.Adapters.SMTP},
|
||||
key: :no_mx_lookups,
|
||||
label: "No MX lookups",
|
||||
type: :boolean,
|
||||
description: "`Swoosh.Adapters.SMTP` adapter specific setting"
|
||||
},
|
||||
%{
|
||||
group: {:subgroup, Swoosh.Adapters.Sendgrid},
|
||||
key: :api_key,
|
||||
label: "SendGrid API Key",
|
||||
label: "API key",
|
||||
type: :string,
|
||||
suggestions: ["YOUR_API_KEY"]
|
||||
description: "`Swoosh.Adapters.Sendgrid` adapter specific setting",
|
||||
suggestions: ["my-api-key"]
|
||||
},
|
||||
%{
|
||||
group: {:subgroup, Swoosh.Adapters.Sendmail},
|
||||
key: :cmd_path,
|
||||
type: :string,
|
||||
description: "`Swoosh.Adapters.Sendmail` adapter specific setting",
|
||||
suggestions: ["/usr/bin/sendmail"]
|
||||
},
|
||||
%{
|
||||
group: {:subgroup, Swoosh.Adapters.Sendmail},
|
||||
key: :cmd_args,
|
||||
type: :string,
|
||||
description: "`Swoosh.Adapters.Sendmail` adapter specific setting",
|
||||
suggestions: ["-N delay,failure,success"]
|
||||
},
|
||||
%{
|
||||
group: {:subgroup, Swoosh.Adapters.Sendmail},
|
||||
key: :qmail,
|
||||
label: "Qmail compat mode",
|
||||
type: :boolean
|
||||
type: :boolean,
|
||||
description: "`Swoosh.Adapters.Sendmail` adapter specific setting"
|
||||
},
|
||||
%{
|
||||
group: {:subgroup, Swoosh.Adapters.Mandrill},
|
||||
key: :api_key,
|
||||
label: "Mandrill API Key",
|
||||
label: "API key",
|
||||
type: :string,
|
||||
suggestions: ["YOUR_API_KEY"]
|
||||
description: "`Swoosh.Adapters.Mandrill` adapter specific setting",
|
||||
suggestions: ["my-api-key"]
|
||||
},
|
||||
%{
|
||||
group: {:subgroup, Swoosh.Adapters.Mailgun},
|
||||
key: :api_key,
|
||||
label: "Mailgun API Key",
|
||||
label: "API key",
|
||||
type: :string,
|
||||
suggestions: ["YOUR_API_KEY"]
|
||||
description: "`Swoosh.Adapters.Mailgun` adapter specific setting",
|
||||
suggestions: ["my-api-key"]
|
||||
},
|
||||
%{
|
||||
group: {:subgroup, Swoosh.Adapters.Mailgun},
|
||||
key: :domain,
|
||||
type: :string,
|
||||
suggestions: ["YOUR_DOMAIN_NAME"]
|
||||
description: "`Swoosh.Adapters.Mailgun` adapter specific setting",
|
||||
suggestions: ["pleroma.com"]
|
||||
},
|
||||
%{
|
||||
group: {:subgroup, Swoosh.Adapters.Mailjet},
|
||||
key: :api_key,
|
||||
label: "MailJet Public API Key",
|
||||
label: "API key",
|
||||
type: :string,
|
||||
suggestions: ["MJ_APIKEY_PUBLIC"]
|
||||
description: "`Swoosh.Adapters.Mailjet` adapter specific setting",
|
||||
suggestions: ["my-api-key"]
|
||||
},
|
||||
%{
|
||||
group: {:subgroup, Swoosh.Adapters.Mailjet},
|
||||
key: :secret,
|
||||
label: "MailJet Private API Key",
|
||||
type: :string,
|
||||
suggestions: ["MJ_APIKEY_PRIVATE"]
|
||||
description: "`Swoosh.Adapters.Mailjet` adapter specific setting",
|
||||
suggestions: ["my-secret-key"]
|
||||
},
|
||||
%{
|
||||
group: {:subgroup, Swoosh.Adapters.Postmark},
|
||||
key: :api_key,
|
||||
label: "Postmark API Key",
|
||||
label: "API key",
|
||||
type: :string,
|
||||
suggestions: ["X-Postmark-Server-Token"]
|
||||
description: "`Swoosh.Adapters.Postmark` adapter specific setting",
|
||||
suggestions: ["my-api-key"]
|
||||
},
|
||||
%{
|
||||
group: {:subgroup, Swoosh.Adapters.SparkPost},
|
||||
key: :api_key,
|
||||
label: "SparkPost API key",
|
||||
label: "API key",
|
||||
type: :string,
|
||||
suggestions: ["YOUR_API_KEY"]
|
||||
description: "`Swoosh.Adapters.SparkPost` adapter specific setting",
|
||||
suggestions: ["my-api-key"]
|
||||
},
|
||||
%{
|
||||
group: {:subgroup, Swoosh.Adapters.SparkPost},
|
||||
key: :endpoint,
|
||||
type: :string,
|
||||
description: "`Swoosh.Adapters.SparkPost` adapter specific setting",
|
||||
suggestions: ["https://api.sparkpost.com/api/v1"]
|
||||
},
|
||||
%{
|
||||
group: {:subgroup, Swoosh.Adapters.AmazonSES},
|
||||
key: :access_key,
|
||||
label: "AWS Access Key",
|
||||
key: :region,
|
||||
type: :string,
|
||||
suggestions: ["AWS_ACCESS_KEY"]
|
||||
description: "`Swoosh.Adapters.AmazonSES` adapter specific setting",
|
||||
suggestions: ["us-east-1", "us-east-2"]
|
||||
},
|
||||
%{
|
||||
group: {:subgroup, Swoosh.Adapters.AmazonSES},
|
||||
key: :access_key,
|
||||
type: :string,
|
||||
description: "`Swoosh.Adapters.AmazonSES` adapter specific setting",
|
||||
suggestions: ["aws-access-key"]
|
||||
},
|
||||
%{
|
||||
group: {:subgroup, Swoosh.Adapters.AmazonSES},
|
||||
key: :secret,
|
||||
label: "AWS Secret Key",
|
||||
type: :string,
|
||||
suggestions: ["AWS_SECRET_KEY"]
|
||||
},
|
||||
%{
|
||||
group: {:subgroup, Swoosh.Adapters.AmazonSES},
|
||||
key: :region,
|
||||
label: "AWS Region",
|
||||
type: :string,
|
||||
suggestions: ["us-east-1", "us-east-2"]
|
||||
description: "`Swoosh.Adapters.AmazonSES` adapter specific setting",
|
||||
suggestions: ["aws-secret-key"]
|
||||
},
|
||||
%{
|
||||
group: {:subgroup, Swoosh.Adapters.Dyn},
|
||||
key: :api_key,
|
||||
label: "Dyn API Key",
|
||||
label: "API key",
|
||||
type: :string,
|
||||
suggestions: ["apikey"]
|
||||
},
|
||||
%{
|
||||
group: {:subgroup, Swoosh.Adapters.SocketLabs},
|
||||
key: :api_key,
|
||||
label: "SocketLabs API Key",
|
||||
type: :string,
|
||||
suggestions: ["INJECTION_API_KEY"]
|
||||
description: "`Swoosh.Adapters.Dyn` adapter specific setting",
|
||||
suggestions: ["my-api-key"]
|
||||
},
|
||||
%{
|
||||
group: {:subgroup, Swoosh.Adapters.SocketLabs},
|
||||
key: :server_id,
|
||||
label: "Server ID",
|
||||
type: :string,
|
||||
suggestions: ["SERVER_ID"]
|
||||
description: "`Swoosh.Adapters.SocketLabs` adapter specific setting"
|
||||
},
|
||||
%{
|
||||
group: {:subgroup, Swoosh.Adapters.SocketLabs},
|
||||
key: :api_key,
|
||||
label: "API key",
|
||||
type: :string,
|
||||
description: "`Swoosh.Adapters.SocketLabs` adapter specific setting"
|
||||
},
|
||||
%{
|
||||
group: {:subgroup, Swoosh.Adapters.Gmail},
|
||||
key: :access_token,
|
||||
label: "GMail API Access Token",
|
||||
type: :string,
|
||||
suggestions: ["GMAIL_API_ACCESS_TOKEN"]
|
||||
description: "`Swoosh.Adapters.Gmail` adapter specific setting"
|
||||
}
|
||||
]
|
||||
},
|
||||
%{
|
||||
group: :swoosh,
|
||||
type: :group,
|
||||
description: "`Swoosh.Adapters.Local` adapter specific settings",
|
||||
children: [
|
||||
%{
|
||||
group: {:subgroup, Swoosh.Adapters.Local},
|
||||
key: :serve_mailbox,
|
||||
type: :boolean,
|
||||
description: "Run the preview server together as part of your app"
|
||||
},
|
||||
%{
|
||||
group: {:subgroup, Swoosh.Adapters.Local},
|
||||
key: :preview_port,
|
||||
type: :integer,
|
||||
description: "The preview server port",
|
||||
suggestions: [4001]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -459,63 +495,6 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
%{
|
||||
group: :pleroma,
|
||||
key: :features,
|
||||
type: :group,
|
||||
description: "Customizable features",
|
||||
children: [
|
||||
%{
|
||||
key: :improved_hashtag_timeline,
|
||||
type: {:dropdown, :atom},
|
||||
description:
|
||||
"Setting to force toggle / force disable improved hashtags timeline. `:enabled` forces hashtags to be fetched from `hashtags` table for hashtags timeline. `:disabled` forces object-embedded hashtags to be used (slower). Keep it `:auto` for automatic behaviour (it is auto-set to `:enabled` [unless overridden] when HashtagsTableMigrator completes).",
|
||||
suggestions: [:auto, :enabled, :disabled]
|
||||
}
|
||||
]
|
||||
},
|
||||
%{
|
||||
group: :pleroma,
|
||||
key: :populate_hashtags_table,
|
||||
type: :group,
|
||||
description: "`populate_hashtags_table` background migration settings",
|
||||
children: [
|
||||
%{
|
||||
key: :fault_rate_allowance,
|
||||
type: :float,
|
||||
description:
|
||||
"Max accepted rate of objects that failed in the migration. Any value from 0.0 which tolerates no errors to 1.0 which will enable the feature even if hashtags transfer failed for all records.",
|
||||
suggestions: [0.01]
|
||||
},
|
||||
%{
|
||||
key: :sleep_interval_ms,
|
||||
type: :integer,
|
||||
description:
|
||||
"Sleep interval between each chunk of processed records in order to decrease the load on the system (defaults to 0 and should be keep default on most instances)."
|
||||
}
|
||||
]
|
||||
},
|
||||
%{
|
||||
group: :pleroma,
|
||||
key: :delete_context_objects,
|
||||
type: :group,
|
||||
description: "`delete_context_objects` background migration settings",
|
||||
children: [
|
||||
%{
|
||||
key: :fault_rate_allowance,
|
||||
type: :float,
|
||||
description:
|
||||
"Max accepted rate of objects that failed in the migration. Any value from 0.0 which tolerates no errors to 1.0 which will enable the feature even if context object deletion failed for all records.",
|
||||
suggestions: [0.01]
|
||||
},
|
||||
%{
|
||||
key: :sleep_interval_ms,
|
||||
type: :integer,
|
||||
description:
|
||||
"Sleep interval between each chunk of processed records in order to decrease the load on the system (defaults to 0 and should be keep default on most instances)."
|
||||
}
|
||||
]
|
||||
},
|
||||
%{
|
||||
group: :pleroma,
|
||||
key: :instance,
|
||||
|
@ -557,15 +536,6 @@
|
|||
"Very cool instance"
|
||||
]
|
||||
},
|
||||
%{
|
||||
key: :short_description,
|
||||
type: :string,
|
||||
description:
|
||||
"Shorter version of instance description. It can be seen on `/api/v1/instance`",
|
||||
suggestions: [
|
||||
"Cool instance"
|
||||
]
|
||||
},
|
||||
%{
|
||||
key: :limit,
|
||||
type: :integer,
|
||||
|
@ -574,6 +544,14 @@
|
|||
5_000
|
||||
]
|
||||
},
|
||||
%{
|
||||
key: :chat_limit,
|
||||
type: :integer,
|
||||
description: "Character limit of the instance chat messages",
|
||||
suggestions: [
|
||||
5_000
|
||||
]
|
||||
},
|
||||
%{
|
||||
key: :remote_limit,
|
||||
type: :integer,
|
||||
|
@ -582,14 +560,6 @@
|
|||
100_000
|
||||
]
|
||||
},
|
||||
%{
|
||||
key: :max_media_attachments,
|
||||
type: :integer,
|
||||
description: "Maximum number of post media attachments",
|
||||
suggestions: [
|
||||
1_000_000
|
||||
]
|
||||
},
|
||||
%{
|
||||
key: :upload_limit,
|
||||
type: :integer,
|
||||
|
@ -712,8 +682,7 @@
|
|||
%{
|
||||
key: :allow_relay,
|
||||
type: :boolean,
|
||||
description:
|
||||
"Permits remote instances to subscribe to all public posts of your instance. (Important!) This may increase the visibility of your instance."
|
||||
description: "Enable Pleroma's Relay, which makes it possible to follow a whole instance"
|
||||
},
|
||||
%{
|
||||
key: :public,
|
||||
|
@ -780,16 +749,6 @@
|
|||
3
|
||||
]
|
||||
},
|
||||
%{
|
||||
key: :max_endorsed_users,
|
||||
type: :integer,
|
||||
description: "The maximum number of recommended accounts. 0 will disable the feature.",
|
||||
suggestions: [
|
||||
0,
|
||||
1,
|
||||
3
|
||||
]
|
||||
},
|
||||
%{
|
||||
key: :autofollowed_nicknames,
|
||||
type: {:list, :string},
|
||||
|
@ -815,13 +774,6 @@
|
|||
1_000
|
||||
]
|
||||
},
|
||||
%{
|
||||
key: :report_strip_status,
|
||||
label: "Report strip status",
|
||||
type: :boolean,
|
||||
description:
|
||||
"Strip associated statuses in reports to ids when closed/resolved, otherwise keep a copy"
|
||||
},
|
||||
%{
|
||||
key: :safe_dm_mentions,
|
||||
label: "Safe DM mentions",
|
||||
|
@ -991,67 +943,6 @@
|
|||
key: :show_reactions,
|
||||
type: :boolean,
|
||||
description: "Let favourites and emoji reactions be viewed through the API."
|
||||
},
|
||||
%{
|
||||
key: :profile_directory,
|
||||
type: :boolean,
|
||||
description: "Enable profile directory."
|
||||
},
|
||||
%{
|
||||
key: :admin_privileges,
|
||||
type: {:list, :atom},
|
||||
suggestions: [
|
||||
:users_read,
|
||||
:users_manage_invites,
|
||||
:users_manage_activation_state,
|
||||
:users_manage_tags,
|
||||
:users_manage_credentials,
|
||||
:users_delete,
|
||||
:messages_read,
|
||||
:messages_delete,
|
||||
:instances_delete,
|
||||
:reports_manage_reports,
|
||||
:moderation_log_read,
|
||||
:announcements_manage_announcements,
|
||||
:emoji_manage_emoji,
|
||||
:statistics_read
|
||||
],
|
||||
description:
|
||||
"What extra privileges to allow admins (e.g. updating user credentials, get password reset token, delete users, index and read private statuses and chats)"
|
||||
},
|
||||
%{
|
||||
key: :moderator_privileges,
|
||||
type: {:list, :atom},
|
||||
suggestions: [
|
||||
:users_read,
|
||||
:users_manage_invites,
|
||||
:users_manage_activation_state,
|
||||
:users_manage_tags,
|
||||
:users_manage_credentials,
|
||||
:users_delete,
|
||||
:messages_read,
|
||||
:messages_delete,
|
||||
:instances_delete,
|
||||
:reports_manage_reports,
|
||||
:moderation_log_read,
|
||||
:announcements_manage_announcements,
|
||||
:emoji_manage_emoji,
|
||||
:statistics_read
|
||||
],
|
||||
description:
|
||||
"What extra privileges to allow moderators (e.g. updating user credentials, get password reset token, delete users, index and read private statuses and chats)"
|
||||
},
|
||||
%{
|
||||
key: :birthday_required,
|
||||
type: :boolean,
|
||||
description: "Require users to enter their birthday."
|
||||
},
|
||||
%{
|
||||
key: :birthday_min_age,
|
||||
type: :integer,
|
||||
description:
|
||||
"Minimum required age (in days) for users to create account. Only used if birthday is required.",
|
||||
suggestions: [6570]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -1235,13 +1126,52 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
%{
|
||||
group: :quack,
|
||||
type: :group,
|
||||
label: "Quack Logger",
|
||||
description: "Quack-related settings",
|
||||
children: [
|
||||
%{
|
||||
key: :level,
|
||||
type: {:dropdown, :atom},
|
||||
description: "Log level",
|
||||
suggestions: [:debug, :info, :warn, :error]
|
||||
},
|
||||
%{
|
||||
key: :meta,
|
||||
type: {:list, :atom},
|
||||
description: "Configure which metadata you want to report on",
|
||||
suggestions: [
|
||||
:application,
|
||||
:module,
|
||||
:file,
|
||||
:function,
|
||||
:line,
|
||||
:pid,
|
||||
:crash_reason,
|
||||
:initial_call,
|
||||
:registered_name,
|
||||
:all,
|
||||
:none
|
||||
]
|
||||
},
|
||||
%{
|
||||
key: :webhook_url,
|
||||
label: "Webhook URL",
|
||||
type: :string,
|
||||
description: "Configure the Slack incoming webhook",
|
||||
suggestions: ["https://hooks.slack.com/services/YOUR-KEY-HERE"]
|
||||
}
|
||||
]
|
||||
},
|
||||
%{
|
||||
group: :pleroma,
|
||||
key: :frontend_configurations,
|
||||
type: :group,
|
||||
description:
|
||||
"This form can be used to configure a keyword list that keeps the configuration data for any " <>
|
||||
"kind of frontend. By default, settings for pleroma_fe are configured. If you want to " <>
|
||||
"kind of frontend. By default, settings for pleroma_fe and masto_fe are configured. If you want to " <>
|
||||
"add your own configuration your settings all fields must be complete.",
|
||||
children: [
|
||||
%{
|
||||
|
@ -1254,6 +1184,7 @@
|
|||
alwaysShowSubjectInput: true,
|
||||
background: "/static/aurora_borealis.jpg",
|
||||
collapseMessageWithSubject: false,
|
||||
disableChat: false,
|
||||
greentext: false,
|
||||
hideFilteredStatuses: false,
|
||||
hideMutedPosts: false,
|
||||
|
@ -1300,6 +1231,12 @@
|
|||
description:
|
||||
"When a message has a subject (aka Content Warning), collapse it by default"
|
||||
},
|
||||
%{
|
||||
key: :disableChat,
|
||||
label: "PleromaFE Chat",
|
||||
type: :boolean,
|
||||
description: "Disables PleromaFE Chat component"
|
||||
},
|
||||
%{
|
||||
key: :greentext,
|
||||
label: "Greentext",
|
||||
|
@ -1441,6 +1378,25 @@
|
|||
suggestions: ["pleroma-dark"]
|
||||
}
|
||||
]
|
||||
},
|
||||
%{
|
||||
key: :masto_fe,
|
||||
label: "Masto FE",
|
||||
type: :map,
|
||||
description: "Settings for Masto FE",
|
||||
suggestions: [
|
||||
%{
|
||||
showInstanceSpecificPanel: true
|
||||
}
|
||||
],
|
||||
children: [
|
||||
%{
|
||||
key: :showInstanceSpecificPanel,
|
||||
label: "Show instance specific panel",
|
||||
type: :boolean,
|
||||
description: "Whenether to show the instance's specific panel"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -1591,8 +1547,7 @@
|
|||
%{
|
||||
key: :max_body_length,
|
||||
type: :integer,
|
||||
description:
|
||||
"Maximum file size (in bytes) allowed through the Pleroma MediaProxy cache."
|
||||
description: "Maximum file size allowed through the Pleroma MediaProxy cache."
|
||||
},
|
||||
%{
|
||||
key: :max_read_duration,
|
||||
|
@ -1642,7 +1597,7 @@
|
|||
key: :min_content_length,
|
||||
type: :integer,
|
||||
description:
|
||||
"Min content length (in bytes) to perform preview. Media smaller in size will be served without thumbnailing."
|
||||
"Min content length to perform preview, in bytes. If greater than 0, media smaller in size will be served as is, without thumbnailing."
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -1680,21 +1635,13 @@
|
|||
group: :pleroma,
|
||||
key: Pleroma.Web.MediaProxy.Invalidation.Script,
|
||||
type: :group,
|
||||
description: "Invalidation script settings",
|
||||
description: "Script invalidate settings",
|
||||
children: [
|
||||
%{
|
||||
key: :script_path,
|
||||
type: :string,
|
||||
description: "Path to executable script which will purge cached items.",
|
||||
description: "Path to shell script. Which will run purge cache.",
|
||||
suggestions: ["./installation/nginx-cache-purge.sh.example"]
|
||||
},
|
||||
%{
|
||||
key: :url_format,
|
||||
label: "URL Format",
|
||||
type: :string,
|
||||
description:
|
||||
"Optional URL format preprocessing. Only required for Apache's htcacheclean.",
|
||||
suggestions: [":htcacheclean"]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -1747,21 +1694,11 @@
|
|||
type: :boolean,
|
||||
description: "Whether to federate blocks to other instances"
|
||||
},
|
||||
%{
|
||||
key: :blockers_visible,
|
||||
type: :boolean,
|
||||
description: "Whether a user can see someone who has blocked them"
|
||||
},
|
||||
%{
|
||||
key: :sign_object_fetches,
|
||||
type: :boolean,
|
||||
description: "Sign object fetches with HTTP signatures"
|
||||
},
|
||||
%{
|
||||
key: :authorized_fetch_mode,
|
||||
type: :boolean,
|
||||
description: "Require HTTP signatures for AP fetches"
|
||||
},
|
||||
%{
|
||||
key: :note_replies_output_limit,
|
||||
type: :integer,
|
||||
|
@ -2708,22 +2645,13 @@
|
|||
},
|
||||
%{
|
||||
group: :pleroma,
|
||||
key: :shout,
|
||||
key: :chat,
|
||||
type: :group,
|
||||
description: "Pleroma shout settings",
|
||||
description: "Pleroma chat settings",
|
||||
children: [
|
||||
%{
|
||||
key: :enabled,
|
||||
type: :boolean,
|
||||
description: "Enables the backend Shoutbox chat feature."
|
||||
},
|
||||
%{
|
||||
key: :limit,
|
||||
type: :integer,
|
||||
description: "Shout message character limit.",
|
||||
suggestions: [
|
||||
5_000
|
||||
]
|
||||
type: :boolean
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -2768,7 +2696,7 @@
|
|||
key: :versions,
|
||||
type: {:list, :atom},
|
||||
description: "List of TLS version to use",
|
||||
suggestions: [:tlsv1, ":tlsv1.1", ":tlsv1.2", ":tlsv1.3"]
|
||||
suggestions: [:tlsv1, ":tlsv1.1", ":tlsv1.2"]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -2955,7 +2883,7 @@
|
|||
type: :integer,
|
||||
description:
|
||||
"Activity pub routes (except question activities). Default: `nil` (no expiration).",
|
||||
suggestions: [nil]
|
||||
suggestions: [30_000, nil]
|
||||
},
|
||||
%{
|
||||
key: :activity_pub_question,
|
||||
|
@ -3007,23 +2935,6 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
%{
|
||||
group: :pleroma,
|
||||
key: :mrf_follow_bot,
|
||||
tab: :mrf,
|
||||
related_policy: "Pleroma.Web.ActivityPub.MRF.FollowBotPolicy",
|
||||
label: "MRF FollowBot Policy",
|
||||
type: :group,
|
||||
description: "Automatically follows newly discovered accounts.",
|
||||
children: [
|
||||
%{
|
||||
key: :follower_nickname,
|
||||
type: :string,
|
||||
description: "The name of the bot account to use for following newly discovered users.",
|
||||
suggestions: ["followbot"]
|
||||
}
|
||||
]
|
||||
},
|
||||
%{
|
||||
group: :pleroma,
|
||||
key: :modules,
|
||||
|
@ -3308,12 +3219,6 @@
|
|||
type: :string,
|
||||
description: "S3 host",
|
||||
suggestions: ["s3.eu-central-1.amazonaws.com"]
|
||||
},
|
||||
%{
|
||||
key: :region,
|
||||
type: :string,
|
||||
description: "S3 region (for AWS)",
|
||||
suggestions: ["us-east-1"]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -3410,9 +3315,9 @@
|
|||
},
|
||||
%{
|
||||
key: :ip_whitelist,
|
||||
label: "IP Whitelist",
|
||||
type: [{:list, :string}, {:list, :charlist}, {:list, :tuple}],
|
||||
description: "Restrict access of app metrics endpoint to the specified IP addresses."
|
||||
description:
|
||||
"[Pleroma extension] If non-empty, restricts access to app metrics endpoint to specified IP addresses."
|
||||
},
|
||||
%{
|
||||
key: :auth,
|
||||
|
@ -3433,53 +3338,5 @@
|
|||
suggestions: [:text, :protobuf]
|
||||
}
|
||||
]
|
||||
},
|
||||
%{
|
||||
group: :pleroma,
|
||||
key: ConcurrentLimiter,
|
||||
type: :group,
|
||||
description: "Limits configuration for background tasks.",
|
||||
children: [
|
||||
%{
|
||||
key: Pleroma.Web.RichMedia.Helpers,
|
||||
type: :keyword,
|
||||
description: "Concurrent limits configuration for getting RichMedia for activities.",
|
||||
suggestions: [max_running: 5, max_waiting: 5],
|
||||
children: [
|
||||
%{
|
||||
key: :max_running,
|
||||
type: :integer,
|
||||
description: "Max running concurrently jobs.",
|
||||
suggestion: [5]
|
||||
},
|
||||
%{
|
||||
key: :max_waiting,
|
||||
type: :integer,
|
||||
description: "Max waiting jobs.",
|
||||
suggestion: [5]
|
||||
}
|
||||
]
|
||||
},
|
||||
%{
|
||||
key: Pleroma.Web.ActivityPub.MRF.MediaProxyWarmingPolicy,
|
||||
type: :keyword,
|
||||
description: "Concurrent limits configuration for MediaProxyWarmingPolicy.",
|
||||
suggestions: [max_running: 5, max_waiting: 5],
|
||||
children: [
|
||||
%{
|
||||
key: :max_running,
|
||||
type: :integer,
|
||||
description: "Max running concurrently jobs.",
|
||||
suggestion: [5]
|
||||
},
|
||||
%{
|
||||
key: :max_waiting,
|
||||
type: :integer,
|
||||
description: "Max waiting jobs.",
|
||||
suggestion: [5]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import Config
|
||||
use Mix.Config
|
||||
|
||||
# For development, we disable any cache and enable
|
||||
# debugging and code reloading.
|
||||
|
@ -54,15 +54,10 @@
|
|||
|
||||
config :pleroma, Pleroma.Web.ApiSpec.CastAndValidate, strict: true
|
||||
|
||||
# Reduce recompilation time
|
||||
# https://dashbit.co/blog/speeding-up-re-compilation-of-elixir-projects
|
||||
config :phoenix, :plug_init_mode, :runtime
|
||||
|
||||
if File.exists?("./config/dev.secret.exs") do
|
||||
import_config "dev.secret.exs"
|
||||
else
|
||||
IO.puts(
|
||||
:stderr,
|
||||
"!!! RUNNING IN LOCALHOST DEV MODE! !!!\nFEDERATION WON'T WORK UNTIL YOU CONFIGURE A dev.secret.exs"
|
||||
)
|
||||
end
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
password: System.fetch_env!("DB_PASS"),
|
||||
database: System.get_env("DB_NAME", "pleroma"),
|
||||
hostname: System.get_env("DB_HOST", "db"),
|
||||
port: System.get_env("DB_PORT", "5432"),
|
||||
pool_size: 10
|
||||
|
||||
# Configure web push notifications
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import Config
|
||||
use Mix.Config
|
||||
|
||||
config :pleroma, Pleroma.Web.Endpoint,
|
||||
http: [
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
firefox, /emoji/Firefox.gif, Gif,Fun
|
||||
blank, /emoji/blank.png, Fun
|
||||
dinosaur, /emoji/dino walking.gif, Gif
|
||||
external_emoji, https://example.com/emoji.png
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import Config
|
||||
use Mix.Config
|
||||
|
||||
# For production, we often load configuration from external
|
||||
# sources, such as your system environment. For this reason,
|
||||
|
@ -63,12 +63,7 @@
|
|||
|
||||
# Finally import the config/prod.secret.exs
|
||||
# which should be versioned separately.
|
||||
if File.exists?("./config/prod.secret.exs") do
|
||||
import_config "prod.secret.exs"
|
||||
else
|
||||
"`config/prod.secret.exs` not found. You may want to create one by running `mix pleroma.instance gen`"
|
||||
|> IO.warn([])
|
||||
end
|
||||
import_config "prod.secret.exs"
|
||||
|
||||
if File.exists?("./config/prod.exported_from_db.secret.exs"),
|
||||
do: import_config("prod.exported_from_db.secret.exs")
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import Config
|
||||
use Mix.Config
|
||||
|
||||
# We don't run a server during test. If one is required,
|
||||
# you can enable the server option below.
|
||||
|
@ -38,7 +38,7 @@
|
|||
external_user_synchronization: false,
|
||||
static_dir: "test/instance_static/"
|
||||
|
||||
config :pleroma, :activitypub, sign_object_fetches: false, follow_handshake_timeout: 0
|
||||
config :pleroma, :activitypub, sign_object_fetches: false
|
||||
|
||||
# Configure your database
|
||||
config :pleroma, Pleroma.Repo,
|
||||
|
@ -47,7 +47,6 @@
|
|||
password: "postgres",
|
||||
database: "pleroma_test",
|
||||
hostname: System.get_env("DB_HOST") || "localhost",
|
||||
port: System.get_env("DB_PORT") || "5432",
|
||||
pool: Ecto.Adapters.SQL.Sandbox,
|
||||
pool_size: 50
|
||||
|
||||
|
@ -82,7 +81,10 @@
|
|||
"BLH1qVhJItRGCfxgTtONfsOKDc9VRAraXw-3NsmjMngWSh7NxOizN6bkuRA7iLTMPS82PjwJAr3UoK9EC1IFrz4",
|
||||
private_key: "_-XZ0iebPrRfZ_o0-IatTdszYa8VCH1yLN-JauK7HHA"
|
||||
|
||||
config :pleroma, Oban, testing: :manual
|
||||
config :pleroma, Oban,
|
||||
queues: false,
|
||||
crontab: false,
|
||||
plugins: false
|
||||
|
||||
config :pleroma, Pleroma.ScheduledActivity,
|
||||
daily_user_limit: 2,
|
||||
|
@ -113,6 +115,11 @@
|
|||
|
||||
config :pleroma, Pleroma.Web.ApiSpec.CastAndValidate, strict: true
|
||||
|
||||
config :pleroma, Pleroma.Uploaders.S3,
|
||||
bucket: nil,
|
||||
streaming_enabled: true,
|
||||
public_endpoint: nil
|
||||
|
||||
config :tzdata, :autoupdate, :disabled
|
||||
|
||||
config :pleroma, :mrf, policies: []
|
||||
|
@ -127,16 +134,10 @@
|
|||
|
||||
config :pleroma, :cachex, provider: Pleroma.CachexMock
|
||||
|
||||
config :pleroma, Pleroma.Web.WebFinger, update_nickname_on_user_fetch: false
|
||||
|
||||
config :pleroma, :side_effects,
|
||||
ap_streamer: Pleroma.Web.ActivityPub.ActivityPubMock,
|
||||
logger: Pleroma.LoggerMock
|
||||
|
||||
# Reduce recompilation time
|
||||
# https://dashbit.co/blog/speeding-up-re-compilation-of-elixir-projects
|
||||
config :phoenix, :plug_init_mode, :runtime
|
||||
|
||||
if File.exists?("./config/test.secret.exs") do
|
||||
import_config "test.secret.exs"
|
||||
else
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
set -e
|
||||
|
||||
echo "-- Waiting for database..."
|
||||
while ! pg_isready -U ${DB_USER:-pleroma} -d postgres://${DB_HOST:-db}:${DB_PORT:-5432}/${DB_NAME:-pleroma} -t 1; do
|
||||
while ! pg_isready -U ${DB_USER:-pleroma} -d postgres://${DB_HOST:-db}:5432/${DB_NAME:-pleroma} -t 1; do
|
||||
sleep 1s
|
||||
done
|
||||
|
||||
|
|
|
@ -32,20 +32,16 @@
|
|||
config :pleroma, configurable_from_database: false
|
||||
```
|
||||
|
||||
Options:
|
||||
|
||||
- `<path>` - where to save migrated config. E.g. `--path=/tmp`. If file saved into non standart folder, you must manually copy file into directory where Pleroma can read it. For OTP install path will be `PLEROMA_CONFIG_PATH` or `/etc/pleroma`. For installation from source - `config` directory in the pleroma folder.
|
||||
- `<env>` - environment, for which is migrated config. By default is `prod`.
|
||||
- To delete transferred settings from database optional flag `-d` can be used
|
||||
To delete transferred settings from database optional flag `-d` can be used. `<env>` is `prod` by default.
|
||||
|
||||
=== "OTP"
|
||||
```sh
|
||||
./bin/pleroma_ctl config migrate_from_db [--env=<env>] [-d] [--path=<path>]
|
||||
./bin/pleroma_ctl config migrate_from_db [--env=<env>] [-d]
|
||||
```
|
||||
|
||||
=== "From Source"
|
||||
```sh
|
||||
mix pleroma.config migrate_from_db [--env=<env>] [-d] [--path=<path>]
|
||||
mix pleroma.config migrate_from_db [--env=<env>] [-d]
|
||||
```
|
||||
|
||||
## Dump all of the config settings defined in the database
|
||||
|
|
|
@ -141,21 +141,3 @@ but should only be run if necessary. **It is safe to cancel this.**
|
|||
```sh
|
||||
mix pleroma.database ensure_expiration
|
||||
```
|
||||
|
||||
## Change Text Search Configuration
|
||||
|
||||
Change `default_text_search_config` for database and (if necessary) text_search_config used in index, then rebuild index (it may take time).
|
||||
|
||||
=== "OTP"
|
||||
|
||||
```sh
|
||||
./bin/pleroma_ctl database set_text_search_config english
|
||||
```
|
||||
|
||||
=== "From Source"
|
||||
|
||||
```sh
|
||||
mix pleroma.database set_text_search_config english
|
||||
```
|
||||
|
||||
See [PostgreSQL documentation](https://www.postgresql.org/docs/current/textsearch-configuration.html) and `docs/configuration/howto_search_cjk.md` for more detail.
|
||||
|
|
|
@ -22,7 +22,7 @@ Currently, known `<frontend>` values are:
|
|||
- [kenoma](http://git.pleroma.social/lambadalambda/kenoma)
|
||||
- [pleroma-fe](http://git.pleroma.social/pleroma/pleroma-fe)
|
||||
- [fedi-fe](https://git.pleroma.social/pleroma/fedi-fe)
|
||||
- [soapbox](https://gitlab.com/soapbox-pub/soapbox)
|
||||
- [soapbox-fe](https://gitlab.com/soapbox-pub/soapbox-fe)
|
||||
|
||||
You can still install frontends that are not configured, see below.
|
||||
|
||||
|
|
|
@ -37,8 +37,7 @@ If any of the options are left unspecified, you will be prompted interactively.
|
|||
- `--static-dir <path>` - the directory custom public files should be read from (custom emojis, frontend bundle overrides, robots.txt, etc.)
|
||||
- `--listen-ip <ip>` - the ip the app should listen to, defaults to 127.0.0.1
|
||||
- `--listen-port <port>` - the port the app should listen to, defaults to 4000
|
||||
- `--strip-uploads-location <Y|N>` - use ExifTool to strip uploads of sensitive location data
|
||||
- `--read-uploads-description <Y|N>` - use ExifTool to read image descriptions from uploads
|
||||
- `--strip-uploads <Y|N>` - use ExifTool to strip uploads of sensitive location data
|
||||
- `--anonymize-uploads <Y|N>` - randomize uploaded filenames
|
||||
- `--dedupe-uploads <Y|N>` - store files based on their hash to reduce data storage requirements if duplicates are uploaded with different filenames
|
||||
- `--skip-release-env` - skip generation the release environment file
|
||||
|
|
|
@ -133,20 +133,22 @@
|
|||
mix pleroma.user sign_out <nickname>
|
||||
```
|
||||
|
||||
## Activate a user
|
||||
|
||||
## Deactivate or activate a user
|
||||
|
||||
=== "OTP"
|
||||
|
||||
```sh
|
||||
./bin/pleroma_ctl user activate NICKNAME
|
||||
./bin/pleroma_ctl user toggle_activated <nickname>
|
||||
```
|
||||
|
||||
=== "From Source"
|
||||
|
||||
```sh
|
||||
mix pleroma.user activate NICKNAME
|
||||
mix pleroma.user toggle_activated <nickname>
|
||||
```
|
||||
|
||||
|
||||
## Deactivate a user and unsubscribes local users from the user
|
||||
|
||||
=== "OTP"
|
||||
|
|
|
@ -17,11 +17,11 @@ su pleroma -s $SHELL -lc "./bin/pleroma_ctl migrate"
|
|||
## For from source installations (using git)
|
||||
|
||||
1. Go to the working directory of Pleroma (default is `/opt/pleroma`)
|
||||
2. Run `git checkout <tagged release>` [^1]. e.g. `git checkout v2.4.5` This pulls the [tagged release](https://git.pleroma.social/pleroma/pleroma/-/releases) from upstream.
|
||||
2. Run `git pull`. This pulls the latest changes from upstream.
|
||||
3. Run `mix deps.get` [^1]. This pulls in any new dependencies.
|
||||
4. Stop the Pleroma service.
|
||||
5. Run `mix ecto.migrate` [^1] [^2]. This task performs database migrations, if there were any.
|
||||
6. Start the Pleroma service.
|
||||
|
||||
[^1]: Depending on which install guide you followed (for example on Debian/Ubuntu), you want to run `git` and `mix` tasks as `pleroma` user by adding `sudo -Hu pleroma` before the command.
|
||||
[^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.
|
||||
|
|
|
@ -17,7 +17,7 @@ Feel free to contact us to be added to this list!
|
|||
- Features: MastoAPI
|
||||
|
||||
### Whalebird
|
||||
- Homepage: <https://whalebird.social/>
|
||||
- Homepage: <https://whalebird.org/>
|
||||
- Source Code: <https://github.com/h3poteto/whalebird-desktop>
|
||||
- Contact: [@h3poteto@pleroma.io](https://pleroma.io/users/h3poteto)
|
||||
- Platforms: Windows, Mac, Linux
|
||||
|
@ -116,9 +116,3 @@ Feel free to contact us to be added to this list!
|
|||
- Contact: [@r@freesoftwareextremist.com](https://freesoftwareextremist.com/users/r)
|
||||
- Features: Does not requires JavaScript
|
||||
- Features: MastoAPI
|
||||
|
||||
### Glitch-lily
|
||||
- Source Code: <https://lily.kazv.moe/infra/glitch-lily>
|
||||
- Contact: [@tusooa@kazv.moe](https://kazv.moe/users/tusooa)
|
||||
- Features: MastoAPI
|
||||
- Based on [glitch-soc](https://github.com/glitch-soc/mastodon) frontend
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
See `Authentication` section of [the configuration cheatsheet](../configuration/cheatsheet.md#authentication).
|
|
@ -8,19 +8,18 @@ For from source installations Pleroma configuration works by first importing the
|
|||
|
||||
To add configuration to your config file, you can copy it from the base config. The latest version of it can be viewed [here](https://git.pleroma.social/pleroma/pleroma/blob/develop/config/config.exs). You can also use this file if you don't know how an option is supposed to be formatted.
|
||||
|
||||
## :shout
|
||||
## :chat
|
||||
|
||||
* `enabled` - Enables the backend Shoutbox chat feature. Defaults to `true`.
|
||||
* `limit` - Shout character limit. Defaults to `5_000`
|
||||
* `enabled` - Enables the backend chat. Defaults to `true`.
|
||||
|
||||
## :instance
|
||||
* `name`: The instance’s name.
|
||||
* `email`: Email used to reach an Administrator/Moderator of the instance.
|
||||
* `notify_email`: Email used for notifications.
|
||||
* `description`: The instance’s description, can be seen in nodeinfo and ``/api/v1/instance``.
|
||||
* `short_description`: Shorter version of instance description, can be seen on ``/api/v1/instance``.
|
||||
* `limit`: Posts character limit (CW/Subject included in the counter).
|
||||
* `description_limit`: The character limit for image descriptions.
|
||||
* `chat_limit`: Character limit of the instance chat messages.
|
||||
* `remote_limit`: Hard character limit beyond which remote posts will be dropped.
|
||||
* `upload_limit`: File size limit of uploads (except for avatar, background, banner).
|
||||
* `avatar_upload_limit`: File size limit of user’s profile avatars.
|
||||
|
@ -38,7 +37,7 @@ To add configuration to your config file, you can copy it from the base config.
|
|||
* `federating`: Enable federation with other instances.
|
||||
* `federation_incoming_replies_max_depth`: Max. depth of reply-to activities fetching on incoming federation, to prevent out-of-memory situations while fetching very long threads. If set to `nil`, threads of any depth will be fetched. Lower this value if you experience out-of-memory crashes.
|
||||
* `federation_reachability_timeout_days`: Timeout (in days) of each external federation target being unreachable prior to pausing federating to it.
|
||||
* `allow_relay`: Permits remote instances to subscribe to all public posts of your instance. This may increase the visibility of your instance.
|
||||
* `allow_relay`: Enable Pleroma’s Relay, which makes it possible to follow a whole instance.
|
||||
* `public`: Makes the client API in authenticated mode-only except for user-profiles. Useful for disabling the Local Timeline and The Whole Known Network. Note that there is a dependent setting restricting or allowing unauthenticated access to specific resources, see `restrict_unauthenticated` for more details.
|
||||
* `quarantined_instances`: ActivityPub instances where private (DMs, followers-only) activities will not be send.
|
||||
* `allowed_post_formats`: MIME-type list of formats allowed to be posted (transformed into HTML).
|
||||
|
@ -49,9 +48,8 @@ To add configuration to your config file, you can copy it from the base config.
|
|||
* `autofollowing_nicknames`: Set to nicknames of (local) users that automatically follows every newly registered user.
|
||||
* `attachment_links`: Set to true to enable automatically adding attachment link text to statuses.
|
||||
* `max_report_comment_size`: The maximum size of the report comment (Default: `1000`).
|
||||
* `report_strip_status`: Strip associated statuses in reports to ids when closed/resolved, otherwise keep a copy.
|
||||
* `safe_dm_mentions`: If set to true, only mentions at the beginning of a post will be used to address people in direct messages. This is to prevent accidental mentioning of people when talking about them (e.g. "@friend hey i really don't like @enemy"). Default: `false`.
|
||||
* `healthcheck`: If set to true, system data will be shown on ``/api/v1/pleroma/healthcheck``.
|
||||
* `healthcheck`: If set to true, system data will be shown on ``/api/pleroma/healthcheck``.
|
||||
* `remote_post_retention_days`: The default amount of days to retain remote posts when pruning the database.
|
||||
* `user_bio_length`: A user bio maximum length (default: `5000`).
|
||||
* `user_name_length`: A user name maximum length (default: `100`).
|
||||
|
@ -66,43 +64,6 @@ To add configuration to your config file, you can copy it from the base config.
|
|||
* `cleanup_attachments`: Remove attachments along with statuses. Does not affect duplicate files and attachments without status. Enabling this will increase load to database when deleting statuses on larger instances.
|
||||
* `show_reactions`: Let favourites and emoji reactions be viewed through the API (default: `true`).
|
||||
* `password_reset_token_validity`: The time after which reset tokens aren't accepted anymore, in seconds (default: one day).
|
||||
* `admin_privileges`: A list of privileges an admin has (e.g. delete messages, manage reports...)
|
||||
* Possible values are:
|
||||
* `:users_read`
|
||||
* Allows admins to fetch users through the admin API.
|
||||
* `:users_manage_invites`
|
||||
* Allows admins to manage invites. This includes sending, resending, revoking and approving invites.
|
||||
* `:users_manage_activation_state`
|
||||
* Allows admins to activate and deactivate accounts. This also allows them to see deactivated users through the Mastodon API.
|
||||
* `:users_manage_tags`
|
||||
* Allows admins to set and remove tags for users. This can be useful in combination with MRF policies, such as `Pleroma.Web.ActivityPub.MRF.TagPolicy`.
|
||||
* `:users_manage_credentials`
|
||||
* Allows admins to trigger a password reset and set new credentials for an user.
|
||||
* `:users_delete`
|
||||
* Allows admins to delete accounts. Note that deleting an account is actually deactivating it and removing all data like posts, profile information, etc.
|
||||
* `:messages_read`
|
||||
* Allows admins to read messages through the admin API, including non-public posts and chats.
|
||||
* `:messages_delete`
|
||||
* Allows admins to delete messages from other users.
|
||||
* `:instances_delete,`
|
||||
* Allows admins to remove a whole remote instance from your instance. This will delete all users and messages from that remote instance.
|
||||
* `:reports_manage_reports`
|
||||
* Allows admins to see and manage reports.
|
||||
* `:moderation_log_read,`
|
||||
* Allows admins to read the entries in the moderation log.
|
||||
* `:emoji_manage_emoji`
|
||||
* Allows admins to manage custom emoji on the instance.
|
||||
* `:statistics_read,`
|
||||
* Allows admins to see some simple statistics about the instance.
|
||||
* `moderator_privileges`: A list of privileges a moderator has (e.g. delete messages, manage reports...)
|
||||
* Possible values are the same as for `admin_privileges`
|
||||
|
||||
## :database
|
||||
* `improved_hashtag_timeline`: Setting to force toggle / force disable improved hashtags timeline. `:enabled` forces hashtags to be fetched from `hashtags` table for hashtags timeline. `:disabled` forces object-embedded hashtags to be used (slower). Keep it `:auto` for automatic behaviour (it is auto-set to `:enabled` [unless overridden] when HashtagsTableMigrator completes).
|
||||
|
||||
## Background migrations
|
||||
* `populate_hashtags_table/sleep_interval_ms`: Sleep interval between each chunk of processed records in order to decrease the load on the system (defaults to 0 and should be keep default on most instances).
|
||||
* `populate_hashtags_table/fault_rate_allowance`: Max rate of failed objects to actually processed objects in order to enable the feature (any value from 0.0 which tolerates no errors to 1.0 which will enable the feature even if hashtags transfer failed for all records).
|
||||
|
||||
## Welcome
|
||||
* `direct_message`: - welcome message sent as a direct message.
|
||||
|
@ -156,10 +117,6 @@ To add configuration to your config file, you can copy it from the base config.
|
|||
* `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.Workers.PurgeExpiredActivity` to be enabled for processing the scheduled delections.
|
||||
* `Pleroma.Web.ActivityPub.MRF.ForceBotUnlistedPolicy`: Makes all bot posts to disappear from public timelines.
|
||||
* `Pleroma.Web.ActivityPub.MRF.FollowBotPolicy`: Automatically follows newly discovered users from the specified bot account. Local accounts, locked accounts, and users with "#nobot" in their bio are respected and excluded from being followed.
|
||||
* `Pleroma.Web.ActivityPub.MRF.AntiFollowbotPolicy`: Drops follow requests from followbots. Users can still allow bots to follow them by first following the bot.
|
||||
* `Pleroma.Web.ActivityPub.MRF.KeywordPolicy`: Rejects or removes from the federated timeline or replaces keywords. (See [`:mrf_keyword`](#mrf_keyword)).
|
||||
* `Pleroma.Web.ActivityPub.MRF.ForceMentionsInContent`: Forces every mentioned user to be reflected in the post content.
|
||||
* `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.
|
||||
|
||||
|
@ -235,7 +192,7 @@ config :pleroma, :mrf_user_allowlist, %{
|
|||
e.g., A value of 900 results in any post with a timestamp older than 15 minutes will be acted upon.
|
||||
* `actions`: A list of actions to apply to the post:
|
||||
* `:delist` removes the post from public timelines
|
||||
* `:strip_followers` removes followers from the ActivityPub recipient list, ensuring they won't be delivered to home timelines, additionally for followers-only it degrades to a direct message
|
||||
* `:strip_followers` removes followers from the ActivityPub recipient list, ensuring they won't be delivered to home timelines
|
||||
* `:reject` rejects the message entirely
|
||||
|
||||
#### :mrf_steal_emoji
|
||||
|
@ -247,25 +204,9 @@ config :pleroma, :mrf_user_allowlist, %{
|
|||
|
||||
* `days`: Default global expiration time for all local Create activities (in days)
|
||||
|
||||
#### :mrf_hashtag
|
||||
|
||||
* `sensitive`: List of hashtags to mark activities as sensitive (default: `nsfw`)
|
||||
* `federated_timeline_removal`: List of hashtags to remove activities from the federated timeline (aka TWNK)
|
||||
* `reject`: List of hashtags to reject activities from
|
||||
|
||||
Notes:
|
||||
- The hashtags in the configuration do not have a leading `#`.
|
||||
- This MRF Policy is always enabled, if you want to disable it you have to set empty lists
|
||||
|
||||
#### :mrf_follow_bot
|
||||
|
||||
* `follower_nickname`: The name of the bot account to use for following newly discovered users. Using `followbot` or similar is strongly suggested.
|
||||
|
||||
|
||||
### :activitypub
|
||||
* `unfollow_blocked`: Whether blocks result in people getting unfollowed
|
||||
* `outgoing_blocks`: Whether to federate blocks to other instances
|
||||
* `blockers_visible`: Whether a user can see the posts of users who blocked them
|
||||
* `deny_follow_blocked`: Whether to disallow following an account that has blocked the user in question
|
||||
* `sign_object_fetches`: Sign object fetches with HTTP signatures
|
||||
* `authorized_fetch_mode`: Require HTTP signatures for AP fetches
|
||||
|
@ -283,9 +224,9 @@ Notes:
|
|||
|
||||
### :frontend_configurations
|
||||
|
||||
This can be used to configure a keyword list that keeps the configuration data for any kind of frontend. By default, settings for `pleroma_fe` are configured. You can find the documentation for `pleroma_fe` configuration into [Pleroma-FE configuration and customization for instance administrators](/frontend/CONFIGURATION/#options).
|
||||
This can be used to configure a keyword list that keeps the configuration data for any kind of frontend. By default, settings for `pleroma_fe` and `masto_fe` are configured. You can find the documentation for `pleroma_fe` configuration into [Pleroma-FE configuration and customization for instance administrators](/frontend/CONFIGURATION/#options).
|
||||
|
||||
Frontends can access these settings at `/api/v1/pleroma/frontend_configurations`
|
||||
Frontends can access these settings at `/api/pleroma/frontend_configurations`
|
||||
|
||||
To add your own configuration for PleromaFE, use it like this:
|
||||
|
||||
|
@ -294,7 +235,10 @@ config :pleroma, :frontend_configurations,
|
|||
pleroma_fe: %{
|
||||
theme: "pleroma-dark",
|
||||
# ... see /priv/static/static/config.json for the available keys.
|
||||
}
|
||||
},
|
||||
masto_fe: %{
|
||||
showInstanceSpecificPanel: true
|
||||
}
|
||||
```
|
||||
|
||||
These settings **need to be complete**, they will override the defaults.
|
||||
|
@ -378,10 +322,9 @@ This section describe PWA manifest instance-specific values. Currently this opti
|
|||
#### Pleroma.Web.MediaProxy.Invalidation.Script
|
||||
|
||||
This strategy allow perform external shell script to purge cache.
|
||||
Urls of attachments are passed to the script as arguments.
|
||||
Urls of attachments pass to script as arguments.
|
||||
|
||||
* `script_path`: Path to the external script.
|
||||
* `url_format`: Set to `:htcacheclean` if using Apache's htcacheclean utility.
|
||||
* `script_path`: path to external script.
|
||||
|
||||
Example:
|
||||
|
||||
|
@ -607,7 +550,7 @@ the source code is here: [kocaptcha](https://github.com/koto-bank/kocaptcha). Th
|
|||
* `uploader`: Which one of the [uploaders](#uploaders) to use.
|
||||
* `filters`: List of [upload filters](#upload-filters) to use.
|
||||
* `link_name`: When enabled Pleroma will add a `name` parameter to the url of the upload, for example `https://instance.tld/media/corndog.png?name=corndog.png`. This is needed to provide the correct filename in Content-Disposition headers when using filters like `Pleroma.Upload.Filter.Dedupe`
|
||||
* `base_url`: The base URL to access a user-uploaded file. Useful when you want to host the media files via another domain or are using a 3rd party S3 provider.
|
||||
* `base_url`: The base URL to access a user-uploaded file. Useful when you want to proxy the media files via another host.
|
||||
* `proxy_remote`: If you're using a remote uploader, Pleroma will proxy media requests instead of redirecting to it.
|
||||
* `proxy_opts`: Proxy options, see `Pleroma.ReverseProxy` documentation.
|
||||
* `filename_display_max_length`: Set max length of a filename to display. 0 = no limit. Default: 30.
|
||||
|
@ -628,7 +571,10 @@ Don't forget to configure [Ex AWS S3](#ex-aws-s3-settings)
|
|||
|
||||
* `bucket`: S3 bucket name.
|
||||
* `bucket_namespace`: S3 bucket namespace.
|
||||
* `public_endpoint`: S3 endpoint that the user finally accesses(ex. "https://s3.dualstack.ap-northeast-1.amazonaws.com")
|
||||
* `truncated_namespace`: If you use S3 compatible service such as Digital Ocean Spaces or CDN, set folder name or "" etc.
|
||||
For example, when using CDN to S3 virtual host format, set "".
|
||||
At this time, write CNAME to CDN in public_endpoint.
|
||||
* `streaming_enabled`: Enable streaming uploads, when enabled the file will be sent to the server in chunks as it's being read. This may be unsupported by some providers, try disabling this if you have upload problems.
|
||||
|
||||
#### Ex AWS S3 settings
|
||||
|
@ -659,18 +605,12 @@ This filter replaces the filename (not the path) of an upload. For complete obfu
|
|||
|
||||
No specific configuration.
|
||||
|
||||
#### Pleroma.Upload.Filter.Exiftool.StripLocation
|
||||
#### Pleroma.Upload.Filter.Exiftool
|
||||
|
||||
This filter only strips the GPS and location metadata with Exiftool leaving color profiles and attributes intact.
|
||||
|
||||
No specific configuration.
|
||||
|
||||
#### Pleroma.Upload.Filter.Exiftool.ReadDescription
|
||||
|
||||
This filter reads the ImageDescription and iptc:Caption-Abstract fields with Exiftool so clients can prefill the media description field.
|
||||
|
||||
No specific configuration.
|
||||
|
||||
#### Pleroma.Upload.Filter.Mogrify
|
||||
|
||||
* `args`: List of actions for the `mogrify` command like `"strip"` or `["strip", "auto-orient", {"implode", "1"}]`.
|
||||
|
@ -808,7 +748,7 @@ Web Push Notifications configuration. You can use the mix task `mix web_push.gen
|
|||
* ``private_key``: VAPID private key
|
||||
|
||||
## :logger
|
||||
* `backends`: `:console` is used to send logs to stdout, `{ExSyslogger, :ex_syslogger}` to log to syslog
|
||||
* `backends`: `:console` is used to send logs to stdout, `{ExSyslogger, :ex_syslogger}` to log to syslog, and `Quack.Logger` to log to Slack
|
||||
|
||||
An example to enable ONLY ExSyslogger (f/ex in ``prod.secret.exs``) with info and debug suppressed:
|
||||
```elixir
|
||||
|
@ -831,10 +771,10 @@ config :logger, :ex_syslogger,
|
|||
|
||||
See: [logger’s documentation](https://hexdocs.pm/logger/Logger.html) and [ex_syslogger’s documentation](https://hexdocs.pm/ex_syslogger/)
|
||||
|
||||
An example of logging info to local syslog, but debug to console:
|
||||
An example of logging info to local syslog, but warn to a Slack channel:
|
||||
```elixir
|
||||
config :logger,
|
||||
backends: [ {ExSyslogger, :ex_syslogger}, :console ],
|
||||
backends: [ {ExSyslogger, :ex_syslogger}, Quack.Logger ],
|
||||
level: :info
|
||||
|
||||
config :logger, :ex_syslogger,
|
||||
|
@ -842,12 +782,14 @@ config :logger, :ex_syslogger,
|
|||
ident: "pleroma",
|
||||
format: "$metadata[$level] $message"
|
||||
|
||||
config :logger, :console,
|
||||
level: :debug,
|
||||
format: "\n$time $metadata[$level] $message\n",
|
||||
metadata: [:request_id]
|
||||
config :quack,
|
||||
level: :warn,
|
||||
meta: [:all],
|
||||
webhook_url: "https://hooks.slack.com/services/YOUR-API-KEY-HERE"
|
||||
```
|
||||
|
||||
See the [Quack Github](https://github.com/azohra/quack) for more details
|
||||
|
||||
|
||||
|
||||
## Database options
|
||||
|
@ -909,13 +851,13 @@ config :pleroma, :admin_token, "somerandomtoken"
|
|||
You can then do
|
||||
|
||||
```shell
|
||||
curl "http://localhost:4000/api/v1/pleroma/admin/users/invites?admin_token=somerandomtoken"
|
||||
curl "http://localhost:4000/api/pleroma/admin/users/invites?admin_token=somerandomtoken"
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
```shell
|
||||
curl -H "X-Admin-Token: somerandomtoken" "http://localhost:4000/api/v1/pleroma/admin/users/invites"
|
||||
curl -H "X-Admin-Token: somerandomtoken" "http://localhost:4000/api/pleroma/admin/users/invites"
|
||||
```
|
||||
|
||||
Warning: it's discouraged to use this feature because of the associated security risk: static / rarely changed instance-wide token is much weaker compared to email-password pair of a real admin user; consider using HTTP Basic Auth or OAuth-based authentication instead.
|
||||
|
@ -954,22 +896,6 @@ Pleroma account will be created with the same name as the LDAP user name.
|
|||
Note, if your LDAP server is an Active Directory server the correct value is commonly `uid: "cn"`, but if you use an
|
||||
OpenLDAP server the value may be `uid: "uid"`.
|
||||
|
||||
### :oauth2 (Pleroma as OAuth 2.0 provider settings)
|
||||
|
||||
OAuth 2.0 provider settings:
|
||||
|
||||
* `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.
|
||||
* `clean_expired_tokens` - Enable a background job to clean expired oauth tokens. Defaults to `false`.
|
||||
|
||||
OAuth 2.0 provider and related endpoints:
|
||||
|
||||
* `POST /api/v1/apps` creates client app basing on provided params.
|
||||
* `GET/POST /oauth/authorize` renders/submits authorization form.
|
||||
* `POST /oauth/token` creates/renews OAuth token.
|
||||
* `POST /oauth/revoke` revokes provided OAuth token.
|
||||
* `GET /api/v1/accounts/verify_credentials` (with proper `Authorization` header or `access_token` URI param) returns user info on requester (with `acct` field containing local nickname and `fqn` field containing fully-qualified nickname which could generally be used as email stub for OAuth software that demands email field in identity endpoint response, like Peertube).
|
||||
|
||||
### OAuth consumer mode
|
||||
|
||||
OAuth consumer mode allows sign in / sign up via external OAuth providers (e.g. Twitter, Facebook, Google, Microsoft, etc.).
|
||||
|
@ -1042,6 +968,14 @@ config :ueberauth, Ueberauth,
|
|||
]
|
||||
```
|
||||
|
||||
### OAuth 2.0 provider - :oauth2
|
||||
|
||||
Configure OAuth 2 provider capabilities:
|
||||
|
||||
* `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.
|
||||
* `clean_expired_tokens` - Enable a background job to clean expired oauth tokens. Defaults to `false`.
|
||||
|
||||
## Link parsing
|
||||
|
||||
### :uri_schemes
|
||||
|
@ -1180,15 +1114,3 @@ 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.
|
||||
|
||||
## ConcurrentLimiter
|
||||
|
||||
Settings to restrict concurrently running jobs. Jobs which can be configured:
|
||||
|
||||
* `Pleroma.Web.RichMedia.Helpers` - generating link previews of URLs in activities
|
||||
* `Pleroma.Web.ActivityPub.MRF.MediaProxyWarmingPolicy` - warming remote media cache via MediaProxyWarmingPolicy
|
||||
|
||||
Each job has these settings:
|
||||
|
||||
* `:max_running` - max concurrently runnings jobs
|
||||
* `:max_waiting` - max waiting jobs
|
||||
|
|
|
@ -1,62 +0,0 @@
|
|||
# How to use a different domain name for Pleroma and the users it serves
|
||||
|
||||
Pleroma users are primarily identified by a `user@example.org` handle, and you might want this identifier to be the same as your email or jabber account, for instance.
|
||||
However, in this case, you are almost certainly serving some web content on `https://example.org` already, and you might want to use another domain (say `pleroma.example.org`) for Pleroma itself.
|
||||
|
||||
Pleroma supports that, but it might be tricky to set up, and any error might prevent you from federating with other instances.
|
||||
|
||||
*If you are already running Pleroma on `example.org`, it is no longer possible to move it to `pleroma.example.org`.*
|
||||
|
||||
## Account identifiers
|
||||
|
||||
It is important to understand that for federation purposes, a user in Pleroma has two unique identifiers associated:
|
||||
|
||||
- A webfinger `acct:` URI, used for discovery and as a verifiable global name for the user across Pleroma instances. In our example, our account's acct: URI is `acct:user@example.org`
|
||||
- An author/actor URI, used in every other aspect of federation. This is the way in which users are identified in ActivityPub, the underlying protocol used for federation with other Pleroma instances.
|
||||
In our case, it is `https://pleroma.example.org/users/user`.
|
||||
|
||||
Both account identifiers are unique and required for Pleroma. An important risk if you set up your Pleroma instance incorrectly is to create two users (with different acct: URIs) with conflicting author/actor URIs.
|
||||
|
||||
## WebFinger
|
||||
|
||||
As said earlier, each Pleroma user has an `acct`: URI, which is used for discovery and authentication. When you add @user@example.org, a webfinger query is performed. This is done in two steps:
|
||||
|
||||
1. Querying `https://example.org/.well-known/host-meta` (where the domain of the URL matches the domain part of the `acct`: URI) to get information on how to perform the query.
|
||||
This file will indeed contain a URL template of the form `https://example.org/.well-known/webfinger?resource={uri}` that will be used in the second step.
|
||||
2. Fill the returned template with the `acct`: URI to be queried and perform the query: `https://example.org/.well-known/webfinger?resource=acct:user@example.org`
|
||||
|
||||
## Configuring your Pleroma instance
|
||||
|
||||
**_DO NOT ATTEMPT TO CONFIGURE YOUR INSTANCE THIS WAY IF YOU DID NOT UNDERSTAND THE ABOVE_**
|
||||
|
||||
### Configuring Pleroma
|
||||
|
||||
Pleroma has a two configuration settings to enable using different domains for your users and Pleroma itself. `host` in `Pleroma.Web.Endpoint` and `domain` in `Pleroma.Web.WebFinger`. When the latter is not set, it defaults to the value of `host`.
|
||||
|
||||
*Be extra careful when configuring your Pleroma instance, as changing `host` may cause remote instances to register different accounts with the same author/actor URI, which will result in federation issues!*
|
||||
|
||||
```elixir
|
||||
config :pleroma, Pleroma.Web.Endpoint,
|
||||
url: [host: "pleroma.example.org"]
|
||||
|
||||
config :pleroma, Pleroma.Web.WebFinger, domain: "example.org"
|
||||
```
|
||||
|
||||
- `domain` - is the domain for which your Pleroma instance has authority, it's the domain used in `acct:` URI. In our example, `domain` would be set to `example.org`. This is used in WebFinger account ids, which are the canonical account identifier in some other fediverse software like Mastodon. **If you change `domain`, the accounts on your server will be shown as different accounts in those software**.
|
||||
- `host` - is the domain used for any URL generated for your instance, including the author/actor URL's. In our case, that would be `pleroma.example.org`. This is used in AP ids, which are the canonical account identifier in Pleroma and some other fediverse software. **You should not change this after you have set up the instance**.
|
||||
|
||||
### Configuring WebFinger domain
|
||||
|
||||
Now, you have Pleroma running at `https://pleroma.example.org` as well as a website at `https://example.org`. If you recall how webfinger queries work, the first step is to query `https://example.org/.well-known/host-meta`, which will contain an URL template.
|
||||
|
||||
Therefore, the easiest way to configure `example.org` is to redirect `/.well-known/host-meta` to `pleroma.example.org`.
|
||||
|
||||
With nginx, it would be as simple as adding:
|
||||
|
||||
```nginx
|
||||
location = /.well-known/host-meta {
|
||||
return 301 https://pleroma.example.org$request_uri;
|
||||
}
|
||||
```
|
||||
|
||||
in example.org's server block.
|
|
@ -59,7 +59,7 @@ The configuration of Pleroma has traditionally been managed with a config file,
|
|||
Here is an example of a server config stripped down after migration:
|
||||
|
||||
```
|
||||
import Config
|
||||
use Mix.Config
|
||||
|
||||
config :pleroma, Pleroma.Web.Endpoint,
|
||||
url: [host: "cool.pleroma.site", scheme: "https", port: 443]
|
||||
|
|
|
@ -1,42 +0,0 @@
|
|||
# How to enable text search for Chinese, Japanese and Korean
|
||||
|
||||
Pleroma's full text search feature is powered by PostgreSQL's native [text search](https://www.postgresql.org/docs/current/textsearch.html), it works well out of box for most of languages, but needs extra configurations for some asian languages like Chinese, Japanese and Korean (CJK).
|
||||
|
||||
|
||||
## Setup and test the new search config
|
||||
|
||||
In most cases, you would need an extension installed to support parsing CJK text. Here are a few extensions you may choose from, or you are more than welcome to share additional ones you found working for you with the rest of Pleroma community.
|
||||
|
||||
* [a generic n-gram parser](https://github.com/huangjimmy/pg_cjk_parser) supports Simplifed/Traditional Chinese, Japanese, and Korean
|
||||
* [a Korean parser](https://github.com/i0seph/textsearch_ko) based on mecab
|
||||
* [a Japanese parser](https://www.amris.co.jp/tsja/index.html) based on mecab
|
||||
* [zhparser](https://github.com/amutu/zhparser/) is a PostgreSQL extension base on the Simple Chinese Word Segmentation(SCWS)
|
||||
* [another Chinese parser](https://github.com/jaiminpan/pg_jieba) based on Jieba Chinese Word Segmentation
|
||||
|
||||
Once you have the new search config , make sure you test it with the `pleroma` user in PostgreSQL (change `YOUR.CONFIG` to your real configuration name)
|
||||
```
|
||||
SELECT ts_debug('YOUR.CONFIG', '安装和配置Nginx, ElixirとErlangをインストールします');
|
||||
```
|
||||
Check output of the query, and see if it matches your expectation.
|
||||
|
||||
|
||||
## Update text search config and index in database
|
||||
|
||||
=== "OTP"
|
||||
|
||||
```sh
|
||||
./bin/pleroma_ctl database set_text_search_config YOUR.CONFIG
|
||||
```
|
||||
|
||||
=== "From Source"
|
||||
|
||||
```sh
|
||||
mix pleroma.database set_text_search_config YOUR.CONFIG
|
||||
```
|
||||
|
||||
Note: index update may take a while, and it can be done while the instance is up and running, so you may restart db connection as soon as you see `Recreate index` in task output.
|
||||
|
||||
## Restart database connection
|
||||
Since some changes above will only apply with a new database connection, you will have to restart either Pleroma or PostgreSQL process, or use `pg_terminate_backend` SQL command without restarting either.
|
||||
|
||||
Now the search results of statuses should be much more friendly for your language of choice, the results for searching users and tags were not changed, as the default parsing/matching should work for most cases.
|
|
@ -82,7 +82,7 @@ For example, here is a sample policy module which rewrites all messages to "new
|
|||
```elixir
|
||||
defmodule Pleroma.Web.ActivityPub.MRF.RewritePolicy do
|
||||
@moduledoc "MRF policy which rewrites all Notes to have 'new message content'."
|
||||
@behaviour Pleroma.Web.ActivityPub.MRF.Policy
|
||||
@behaviour Pleroma.Web.ActivityPub.MRF
|
||||
|
||||
# Catch messages which contain Note objects with actual data to filter.
|
||||
# Capture the object as `object`, the message content as `content` and the
|
||||
|
|
|
@ -1,28 +1,10 @@
|
|||
# Optimizing PostgreSQL performance
|
||||
# Optimizing your PostgreSQL performance
|
||||
|
||||
Pleroma performance is largely dependent on performance of the underlying database. Better performance can be achieved by adjusting a few settings.
|
||||
Pleroma performance depends to a large extent on good database performance. The default PostgreSQL settings are mostly fine, but often you can get better performance by changing a few settings.
|
||||
|
||||
## PGTune
|
||||
You can use [PGTune](https://pgtune.leopard.in.ua) to get recommendations for your setup. If you do, set the "Number of Connections" field to 20, as Pleroma will only use 10 concurrent connections anyway. If you don't, it will give you advice that might even hurt your performance.
|
||||
|
||||
[PgTune](https://pgtune.leopard.in.ua) can be used to get recommended settings. Be sure to set "Number of Connections" to 20, otherwise it might produce settings hurtful to database performance. It is also recommended to not use "Network Storage" option.
|
||||
|
||||
## Disable generic query plans
|
||||
|
||||
When PostgreSQL receives a query, it decides on a strategy for searching the requested data, this is called a query plan. The query planner has two modes: generic and custom. Generic makes a plan for all queries of the same shape, ignoring the parameters, which is then cached and reused. Custom, on the contrary, generates a unique query plan based on query parameters.
|
||||
|
||||
By default PostgreSQL has an algorithm to decide which mode is more efficient for particular query, however this algorithm has been observed to be wrong on some of the queries Pleroma sends, leading to serious performance loss. Therefore, it is recommended to disable generic mode.
|
||||
|
||||
|
||||
Pleroma already avoids generic query plans by default, however the method it uses is not the most efficient because it needs to be compatible with all supported PostgreSQL versions. For PostgreSQL 12 and higher additional performance can be gained by adding the following to Pleroma configuration:
|
||||
```elixir
|
||||
config :pleroma, Pleroma.Repo,
|
||||
prepare: :named,
|
||||
parameters: [
|
||||
plan_cache_mode: "force_custom_plan"
|
||||
]
|
||||
```
|
||||
|
||||
A more detailed explaination of the issue can be found at <https://blog.soykaf.com/post/postgresql-elixir-troubles/>.
|
||||
We also recommend not using the "Network Storage" option.
|
||||
|
||||
## Example configurations
|
||||
|
||||
|
@ -46,3 +28,4 @@ max_worker_processes = 2
|
|||
max_parallel_workers_per_gather = 1
|
||||
max_parallel_workers = 2
|
||||
```
|
||||
|
||||
|
|
|
@ -2,9 +2,14 @@
|
|||
|
||||
Authentication is required and the user must be an admin.
|
||||
|
||||
The `/api/v1/pleroma/admin/*` path is backwards compatible with `/api/pleroma/admin/*` (`/api/pleroma/admin/*` will be deprecated in the future).
|
||||
Configuration options:
|
||||
|
||||
## `GET /api/v1/pleroma/admin/users`
|
||||
* `[:auth, :enforce_oauth_admin_scope_usage]` — OAuth admin scope requirement toggle.
|
||||
If `true`, admin actions explicitly demand admin OAuth scope(s) presence in OAuth token (client app must support admin scopes).
|
||||
If `false` and token doesn't have admin scope(s), `is_admin` user flag grants access to admin-specific actions.
|
||||
Note that client app needs to explicitly support admin scopes and request them when obtaining auth token.
|
||||
|
||||
## `GET /api/pleroma/admin/users`
|
||||
|
||||
### List users
|
||||
|
||||
|
@ -25,7 +30,7 @@ The `/api/v1/pleroma/admin/*` path is backwards compatible with `/api/pleroma/ad
|
|||
- *optional* `actor_types`: **[string]** actor type list (`Person`, `Service`, `Application`)
|
||||
- *optional* `name`: **string** user display name
|
||||
- *optional* `email`: **string** user email
|
||||
- Example: `https://mypleroma.org/api/v1/pleroma/admin/users?query=john&filters=local,active&page=1&page_size=10&tags[]=some_tag&tags[]=another_tag&name=display_name&email=email@example.com`
|
||||
- Example: `https://mypleroma.org/api/pleroma/admin/users?query=john&filters=local,active&page=1&page_size=10&tags[]=some_tag&tags[]=another_tag&name=display_name&email=email@example.com`
|
||||
- Response:
|
||||
|
||||
```json
|
||||
|
@ -54,7 +59,7 @@ The `/api/v1/pleroma/admin/*` path is backwards compatible with `/api/pleroma/ad
|
|||
}
|
||||
```
|
||||
|
||||
## DEPRECATED `DELETE /api/v1/pleroma/admin/users`
|
||||
## DEPRECATED `DELETE /api/pleroma/admin/users`
|
||||
|
||||
### Remove a user
|
||||
|
||||
|
@ -62,7 +67,7 @@ The `/api/v1/pleroma/admin/*` path is backwards compatible with `/api/pleroma/ad
|
|||
- `nickname`
|
||||
- Response: User’s nickname
|
||||
|
||||
## `DELETE /api/v1/pleroma/admin/users`
|
||||
## `DELETE /api/pleroma/admin/users`
|
||||
|
||||
### Remove a user
|
||||
|
||||
|
@ -83,7 +88,7 @@ The `/api/v1/pleroma/admin/*` path is backwards compatible with `/api/pleroma/ad
|
|||
]
|
||||
- Response: User’s nickname
|
||||
|
||||
## `POST /api/v1/pleroma/admin/users/follow`
|
||||
## `POST /api/pleroma/admin/users/follow`
|
||||
|
||||
### Make a user follow another user
|
||||
|
||||
|
@ -93,7 +98,7 @@ The `/api/v1/pleroma/admin/*` path is backwards compatible with `/api/pleroma/ad
|
|||
- Response:
|
||||
- "ok"
|
||||
|
||||
## `POST /api/v1/pleroma/admin/users/unfollow`
|
||||
## `POST /api/pleroma/admin/users/unfollow`
|
||||
|
||||
### Make a user unfollow another user
|
||||
|
||||
|
@ -103,7 +108,7 @@ The `/api/v1/pleroma/admin/*` path is backwards compatible with `/api/pleroma/ad
|
|||
- Response:
|
||||
- "ok"
|
||||
|
||||
## `PATCH /api/v1/pleroma/admin/users/:nickname/toggle_activation`
|
||||
## `PATCH /api/pleroma/admin/users/:nickname/toggle_activation`
|
||||
|
||||
### Toggle user activation
|
||||
|
||||
|
@ -119,7 +124,7 @@ The `/api/v1/pleroma/admin/*` path is backwards compatible with `/api/pleroma/ad
|
|||
}
|
||||
```
|
||||
|
||||
## `PUT /api/v1/pleroma/admin/users/tag`
|
||||
## `PUT /api/pleroma/admin/users/tag`
|
||||
|
||||
### Tag a list of users
|
||||
|
||||
|
@ -127,7 +132,7 @@ The `/api/v1/pleroma/admin/*` path is backwards compatible with `/api/pleroma/ad
|
|||
- `nicknames` (array)
|
||||
- `tags` (array)
|
||||
|
||||
## `DELETE /api/v1/pleroma/admin/users/tag`
|
||||
## `DELETE /api/pleroma/admin/users/tag`
|
||||
|
||||
### Untag a list of users
|
||||
|
||||
|
@ -135,7 +140,7 @@ The `/api/v1/pleroma/admin/*` path is backwards compatible with `/api/pleroma/ad
|
|||
- `nicknames` (array)
|
||||
- `tags` (array)
|
||||
|
||||
## `GET /api/v1/pleroma/admin/users/:nickname/permission_group`
|
||||
## `GET /api/pleroma/admin/users/:nickname/permission_group`
|
||||
|
||||
### Get user user permission groups membership
|
||||
|
||||
|
@ -149,7 +154,7 @@ The `/api/v1/pleroma/admin/*` path is backwards compatible with `/api/pleroma/ad
|
|||
}
|
||||
```
|
||||
|
||||
## `GET /api/v1/pleroma/admin/users/:nickname/permission_group/:permission_group`
|
||||
## `GET /api/pleroma/admin/users/:nickname/permission_group/:permission_group`
|
||||
|
||||
Note: Available `:permission_group` is currently moderator and admin. 404 is returned when the permission group doesn’t exist.
|
||||
|
||||
|
@ -165,7 +170,7 @@ Note: Available `:permission_group` is currently moderator and admin. 404 is ret
|
|||
}
|
||||
```
|
||||
|
||||
## DEPRECATED `POST /api/v1/pleroma/admin/users/:nickname/permission_group/:permission_group`
|
||||
## DEPRECATED `POST /api/pleroma/admin/users/:nickname/permission_group/:permission_group`
|
||||
|
||||
### Add user to permission group
|
||||
|
||||
|
@ -174,7 +179,7 @@ Note: Available `:permission_group` is currently moderator and admin. 404 is ret
|
|||
- On failure: `{"error": "…"}`
|
||||
- On success: JSON of the user
|
||||
|
||||
## `POST /api/v1/pleroma/admin/users/permission_group/:permission_group`
|
||||
## `POST /api/pleroma/admin/users/permission_group/:permission_group`
|
||||
|
||||
### Add users to permission group
|
||||
|
||||
|
@ -184,9 +189,9 @@ Note: Available `:permission_group` is currently moderator and admin. 404 is ret
|
|||
- On failure: `{"error": "…"}`
|
||||
- On success: JSON of the user
|
||||
|
||||
## DEPRECATED `DELETE /api/v1/pleroma/admin/users/:nickname/permission_group/:permission_group`
|
||||
## DEPRECATED `DELETE /api/pleroma/admin/users/:nickname/permission_group/:permission_group`
|
||||
|
||||
## `DELETE /api/v1/pleroma/admin/users/:nickname/permission_group/:permission_group`
|
||||
## `DELETE /api/pleroma/admin/users/:nickname/permission_group/:permission_group`
|
||||
|
||||
### Remove user from permission group
|
||||
|
||||
|
@ -196,7 +201,7 @@ Note: Available `:permission_group` is currently moderator and admin. 404 is ret
|
|||
- On success: JSON of the user
|
||||
- Note: An admin cannot revoke their own admin status.
|
||||
|
||||
## `DELETE /api/v1/pleroma/admin/users/permission_group/:permission_group`
|
||||
## `DELETE /api/pleroma/admin/users/permission_group/:permission_group`
|
||||
|
||||
### Remove users from permission group
|
||||
|
||||
|
@ -207,7 +212,7 @@ Note: Available `:permission_group` is currently moderator and admin. 404 is ret
|
|||
- On success: JSON of the user
|
||||
- Note: An admin cannot revoke their own admin status.
|
||||
|
||||
## `PATCH /api/v1/pleroma/admin/users/activate`
|
||||
## `PATCH /api/pleroma/admin/users/activate`
|
||||
|
||||
### Activate user
|
||||
|
||||
|
@ -225,7 +230,7 @@ Note: Available `:permission_group` is currently moderator and admin. 404 is ret
|
|||
}
|
||||
```
|
||||
|
||||
## `PATCH /api/v1/pleroma/admin/users/deactivate`
|
||||
## `PATCH /api/pleroma/admin/users/deactivate`
|
||||
|
||||
### Deactivate user
|
||||
|
||||
|
@ -243,7 +248,7 @@ Note: Available `:permission_group` is currently moderator and admin. 404 is ret
|
|||
}
|
||||
```
|
||||
|
||||
## `PATCH /api/v1/pleroma/admin/users/approve`
|
||||
## `PATCH /api/pleroma/admin/users/approve`
|
||||
|
||||
### Approve user
|
||||
|
||||
|
@ -261,47 +266,7 @@ Note: Available `:permission_group` is currently moderator and admin. 404 is ret
|
|||
}
|
||||
```
|
||||
|
||||
## `PATCH /api/v1/pleroma/admin/users/suggest`
|
||||
|
||||
### Suggest a user
|
||||
|
||||
Adds the user(s) to follower recommendations.
|
||||
|
||||
- Params:
|
||||
- `nicknames`: nicknames array
|
||||
- Response:
|
||||
|
||||
```json
|
||||
{
|
||||
users: [
|
||||
{
|
||||
// user object
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## `PATCH /api/v1/pleroma/admin/users/unsuggest`
|
||||
|
||||
### Unsuggest a user
|
||||
|
||||
Removes the user(s) from follower recommendations.
|
||||
|
||||
- Params:
|
||||
- `nicknames`: nicknames array
|
||||
- Response:
|
||||
|
||||
```json
|
||||
{
|
||||
users: [
|
||||
{
|
||||
// user object
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## `GET /api/v1/pleroma/admin/users/:nickname_or_id`
|
||||
## `GET /api/pleroma/admin/users/:nickname_or_id`
|
||||
|
||||
### Retrive the details of a user
|
||||
|
||||
|
@ -311,7 +276,7 @@ Removes the user(s) from follower recommendations.
|
|||
- On failure: `Not found`
|
||||
- On success: JSON of the user
|
||||
|
||||
## `GET /api/v1/pleroma/admin/users/:nickname_or_id/statuses`
|
||||
## `GET /api/pleroma/admin/users/:nickname_or_id/statuses`
|
||||
|
||||
### Retrive user's latest statuses
|
||||
|
||||
|
@ -322,20 +287,9 @@ Removes the user(s) from follower recommendations.
|
|||
- *optional* `with_reblogs`: `true`/`false` – allows to see reblogs (default is false)
|
||||
- Response:
|
||||
- On failure: `Not found`
|
||||
- On success: JSON, where:
|
||||
- `total`: total count of the statuses for the user
|
||||
- `activities`: list of the statuses for the user
|
||||
- On success: JSON array of user's latest statuses
|
||||
|
||||
```json
|
||||
{
|
||||
"total" : 1,
|
||||
"activities": [
|
||||
// activities list
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## `GET /api/v1/pleroma/admin/instances/:instance/statuses`
|
||||
## `GET /api/pleroma/admin/instances/:instance/statuses`
|
||||
|
||||
### Retrive instance's latest statuses
|
||||
|
||||
|
@ -346,36 +300,9 @@ Removes the user(s) from follower recommendations.
|
|||
- *optional* `with_reblogs`: `true`/`false` – allows to see reblogs (default is false)
|
||||
- Response:
|
||||
- On failure: `Not found`
|
||||
- On success: JSON, where:
|
||||
- `total`: total count of the statuses for the instance
|
||||
- `activities`: list of the statuses for the instance
|
||||
- On success: JSON array of instance's latest statuses
|
||||
|
||||
```json
|
||||
{
|
||||
"total" : 1,
|
||||
"activities": [
|
||||
// activities list
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## `DELETE /api/v1/pleroma/admin/instances/:instance`
|
||||
|
||||
### Delete all users and activities from a remote instance
|
||||
|
||||
Note: this will trigger a job to remove instance content in the background.
|
||||
It may take some time.
|
||||
|
||||
- Params:
|
||||
- `instance`: remote instance host
|
||||
- Response:
|
||||
- The `instance` name as a string
|
||||
|
||||
```json
|
||||
"lain.com"
|
||||
```
|
||||
|
||||
## `GET /api/v1/pleroma/admin/statuses`
|
||||
## `GET /api/pleroma/admin/statuses`
|
||||
|
||||
### Retrives all latest statuses
|
||||
|
||||
|
@ -388,7 +315,7 @@ It may take some time.
|
|||
- On failure: `Not found`
|
||||
- On success: JSON array of user's latest statuses
|
||||
|
||||
## `GET /api/v1/pleroma/admin/relay`
|
||||
## `GET /api/pleroma/admin/relay`
|
||||
|
||||
### List Relays
|
||||
|
||||
|
@ -404,7 +331,7 @@ Response:
|
|||
]
|
||||
```
|
||||
|
||||
## `POST /api/v1/pleroma/admin/relay`
|
||||
## `POST /api/pleroma/admin/relay`
|
||||
|
||||
### Follow a Relay
|
||||
|
||||
|
@ -420,7 +347,7 @@ Response:
|
|||
{"actor": "https://example.com/relay", "followed_back": true}
|
||||
```
|
||||
|
||||
## `DELETE /api/v1/pleroma/admin/relay`
|
||||
## `DELETE /api/pleroma/admin/relay`
|
||||
|
||||
### Unfollow a Relay
|
||||
|
||||
|
@ -436,7 +363,7 @@ Response:
|
|||
{"https://example.com/relay"}
|
||||
```
|
||||
|
||||
## `POST /api/v1/pleroma/admin/users/invite_token`
|
||||
## `POST /api/pleroma/admin/users/invite_token`
|
||||
|
||||
### Create an account registration invite token
|
||||
|
||||
|
@ -457,7 +384,7 @@ Response:
|
|||
}
|
||||
```
|
||||
|
||||
## `GET /api/v1/pleroma/admin/users/invites`
|
||||
## `GET /api/pleroma/admin/users/invites`
|
||||
|
||||
### Get a list of generated invites
|
||||
|
||||
|
@ -482,7 +409,7 @@ Response:
|
|||
}
|
||||
```
|
||||
|
||||
## `POST /api/v1/pleroma/admin/users/revoke_invite`
|
||||
## `POST /api/pleroma/admin/users/revoke_invite`
|
||||
|
||||
### Revoke invite by token
|
||||
|
||||
|
@ -503,7 +430,7 @@ Response:
|
|||
}
|
||||
```
|
||||
|
||||
## `POST /api/v1/pleroma/admin/users/email_invite`
|
||||
## `POST /api/pleroma/admin/users/email_invite`
|
||||
|
||||
### Sends registration invite via email
|
||||
|
||||
|
@ -524,7 +451,7 @@ Response:
|
|||
]
|
||||
```
|
||||
|
||||
## `GET /api/v1/pleroma/admin/users/:nickname/password_reset`
|
||||
## `GET /api/pleroma/admin/users/:nickname/password_reset`
|
||||
|
||||
### Get a password reset token for a given nickname
|
||||
|
||||
|
@ -535,11 +462,11 @@ Response:
|
|||
```json
|
||||
{
|
||||
"token": "base64 reset token",
|
||||
"link": "https://pleroma.social/api/v1/pleroma/password_reset/url-encoded-base64-token"
|
||||
"link": "https://pleroma.social/api/pleroma/password_reset/url-encoded-base64-token"
|
||||
}
|
||||
```
|
||||
|
||||
## `PATCH /api/v1/pleroma/admin/users/force_password_reset`
|
||||
## `PATCH /api/pleroma/admin/users/force_password_reset`
|
||||
|
||||
### Force passord reset for a user with a given nickname
|
||||
|
||||
|
@ -547,7 +474,7 @@ Response:
|
|||
- `nicknames`
|
||||
- Response: none (code `204`)
|
||||
|
||||
## PUT `/api/v1/pleroma/admin/users/disable_mfa`
|
||||
## PUT `/api/pleroma/admin/users/disable_mfa`
|
||||
|
||||
### Disable mfa for user's account.
|
||||
|
||||
|
@ -555,7 +482,7 @@ Response:
|
|||
- `nickname`
|
||||
- Response: User’s nickname
|
||||
|
||||
## `GET /api/v1/pleroma/admin/users/:nickname/credentials`
|
||||
## `GET /api/pleroma/admin/users/:nickname/credentials`
|
||||
|
||||
### Get the user's email, password, display and settings-related fields
|
||||
|
||||
|
@ -603,7 +530,7 @@ Response:
|
|||
}
|
||||
```
|
||||
|
||||
## `PATCH /api/v1/pleroma/admin/users/:nickname/credentials`
|
||||
## `PATCH /api/pleroma/admin/users/:nickname/credentials`
|
||||
|
||||
### Change the user's email, password, display and settings-related fields
|
||||
|
||||
|
@ -654,7 +581,7 @@ Status: 404
|
|||
{"error": "Not found"}
|
||||
```
|
||||
|
||||
## `GET /api/v1/pleroma/admin/reports`
|
||||
## `GET /api/pleroma/admin/reports`
|
||||
|
||||
### Get a list of reports
|
||||
|
||||
|
@ -814,17 +741,17 @@ Status: 404
|
|||
}
|
||||
```
|
||||
|
||||
## `GET /api/v1/pleroma/admin/grouped_reports`
|
||||
## `GET /api/pleroma/admin/grouped_reports`
|
||||
|
||||
### Get a list of reports, grouped by status
|
||||
|
||||
- Params: none
|
||||
- On success: JSON, returns a list of reports, where:
|
||||
- `date`: date of the latest report
|
||||
- `account`: the user who has been reported (see `/api/v1/pleroma/admin/reports` for reference)
|
||||
- `status`: reported status (see `/api/v1/pleroma/admin/reports` for reference)
|
||||
- `actors`: users who had reported this status (see `/api/v1/pleroma/admin/reports` for reference)
|
||||
- `reports`: reports (see `/api/v1/pleroma/admin/reports` for reference)
|
||||
- `account`: the user who has been reported (see `/api/pleroma/admin/reports` for reference)
|
||||
- `status`: reported status (see `/api/pleroma/admin/reports` for reference)
|
||||
- `actors`: users who had reported this status (see `/api/pleroma/admin/reports` for reference)
|
||||
- `reports`: reports (see `/api/pleroma/admin/reports` for reference)
|
||||
|
||||
```json
|
||||
"reports": [
|
||||
|
@ -838,7 +765,7 @@ Status: 404
|
|||
]
|
||||
```
|
||||
|
||||
## `GET /api/v1/pleroma/admin/reports/:id`
|
||||
## `GET /api/pleroma/admin/reports/:id`
|
||||
|
||||
### Get an individual report
|
||||
|
||||
|
@ -850,7 +777,7 @@ Status: 404
|
|||
- 404 Not Found `"Not found"`
|
||||
- On success: JSON, Report object (see above)
|
||||
|
||||
## `PATCH /api/v1/pleroma/admin/reports`
|
||||
## `PATCH /api/pleroma/admin/reports`
|
||||
|
||||
### Change the state of one or multiple reports
|
||||
|
||||
|
@ -881,7 +808,7 @@ Status: 404
|
|||
|
||||
- On success: `204`, empty response
|
||||
|
||||
## `POST /api/v1/pleroma/admin/reports/:id/notes`
|
||||
## `POST /api/pleroma/admin/reports/:id/notes`
|
||||
|
||||
### Create report note
|
||||
|
||||
|
@ -893,7 +820,7 @@ Status: 404
|
|||
- 400 Bad Request `"Invalid parameters"` when `status` is missing
|
||||
- On success: `204`, empty response
|
||||
|
||||
## `DELETE /api/v1/pleroma/admin/reports/:report_id/notes/:id`
|
||||
## `DELETE /api/pleroma/admin/reports/:report_id/notes/:id`
|
||||
|
||||
### Delete report note
|
||||
|
||||
|
@ -905,7 +832,7 @@ Status: 404
|
|||
- 400 Bad Request `"Invalid parameters"` when `status` is missing
|
||||
- On success: `204`, empty response
|
||||
|
||||
## `GET /api/v1/pleroma/admin/statuses/:id`
|
||||
## `GET /api/pleroma/admin/statuses/:id`
|
||||
|
||||
### Show status by id
|
||||
|
||||
|
@ -916,7 +843,7 @@ Status: 404
|
|||
- 404 Not Found `"Not Found"`
|
||||
- On success: JSON, Mastodon Status entity
|
||||
|
||||
## `PUT /api/v1/pleroma/admin/statuses/:id`
|
||||
## `PUT /api/pleroma/admin/statuses/:id`
|
||||
|
||||
### Change the scope of an individual reported status
|
||||
|
||||
|
@ -931,7 +858,7 @@ Status: 404
|
|||
- 404 Not Found `"Not found"`
|
||||
- On success: JSON, Mastodon Status entity
|
||||
|
||||
## `DELETE /api/v1/pleroma/admin/statuses/:id`
|
||||
## `DELETE /api/pleroma/admin/statuses/:id`
|
||||
|
||||
### Delete an individual reported status
|
||||
|
||||
|
@ -943,7 +870,7 @@ Status: 404
|
|||
- 404 Not Found `"Not found"`
|
||||
- On success: 200 OK `{}`
|
||||
|
||||
## `GET /api/v1/pleroma/admin/restart`
|
||||
## `GET /api/pleroma/admin/restart`
|
||||
|
||||
### Restarts pleroma application
|
||||
|
||||
|
@ -958,7 +885,7 @@ Status: 404
|
|||
{}
|
||||
```
|
||||
|
||||
## `GET /api/v1/pleroma/admin/need_reboot`
|
||||
## `GET /api/pleroma/admin/need_reboot`
|
||||
|
||||
### Returns the flag whether the pleroma should be restarted
|
||||
|
||||
|
@ -971,7 +898,7 @@ Status: 404
|
|||
}
|
||||
```
|
||||
|
||||
## `GET /api/v1/pleroma/admin/config`
|
||||
## `GET /api/pleroma/admin/config`
|
||||
|
||||
### Get list of merged default settings with saved in database.
|
||||
|
||||
|
@ -998,7 +925,7 @@ Status: 404
|
|||
}
|
||||
```
|
||||
|
||||
## `POST /api/v1/pleroma/admin/config`
|
||||
## `POST /api/pleroma/admin/config`
|
||||
|
||||
### Update config settings
|
||||
|
||||
|
@ -1064,6 +991,7 @@ List of settings which support only full update by key:
|
|||
```elixir
|
||||
@full_key_update [
|
||||
{:pleroma, :ecto_repos},
|
||||
{:quack, :meta},
|
||||
{:mime, :types},
|
||||
{:cors_plug, [:max_age, :methods, :expose, :headers]},
|
||||
{:auto_linker, :opts},
|
||||
|
@ -1083,18 +1011,18 @@ List of settings which support only full update by subkey:
|
|||
]
|
||||
```
|
||||
|
||||
*Settings without explicit key must be sent in separate config object params.*
|
||||
*Settings without explicit key must be sended in separate config object params.*
|
||||
```elixir
|
||||
config :foo,
|
||||
bar: :baz,
|
||||
meta: [:data],
|
||||
config :quack,
|
||||
level: :debug,
|
||||
meta: [:all],
|
||||
...
|
||||
```
|
||||
```json
|
||||
{
|
||||
"configs": [
|
||||
{"group": ":foo", "key": ":bar", "value": ":baz"},
|
||||
{"group": ":foo", "key": ":meta", "value": [":data"]},
|
||||
{"group": ":quack", "key": ":level", "value": ":debug"},
|
||||
{"group": ":quack", "key": ":meta", "value": [":all"]},
|
||||
...
|
||||
]
|
||||
}
|
||||
|
@ -1146,7 +1074,7 @@ config :foo,
|
|||
}
|
||||
```
|
||||
|
||||
## ` GET /api/v1/pleroma/admin/config/descriptions`
|
||||
## ` GET /api/pleroma/admin/config/descriptions`
|
||||
|
||||
### Get JSON with config descriptions.
|
||||
Loads json generated from `config/descriptions.exs`.
|
||||
|
@ -1179,7 +1107,7 @@ Loads json generated from `config/descriptions.exs`.
|
|||
}]
|
||||
```
|
||||
|
||||
## `GET /api/v1/pleroma/admin/moderation_log`
|
||||
## `GET /api/pleroma/admin/moderation_log`
|
||||
|
||||
### Get moderation log
|
||||
|
||||
|
@ -1209,7 +1137,7 @@ Loads json generated from `config/descriptions.exs`.
|
|||
]
|
||||
```
|
||||
|
||||
## `POST /api/v1/pleroma/admin/reload_emoji`
|
||||
## `POST /api/pleroma/admin/reload_emoji`
|
||||
|
||||
### Reload the instance's custom emoji
|
||||
|
||||
|
@ -1217,7 +1145,7 @@ Loads json generated from `config/descriptions.exs`.
|
|||
- Params: None
|
||||
- Response: JSON, "ok" and 200 status
|
||||
|
||||
## `PATCH /api/v1/pleroma/admin/users/confirm_email`
|
||||
## `PATCH /api/pleroma/admin/users/confirm_email`
|
||||
|
||||
### Confirm users' emails
|
||||
|
||||
|
@ -1225,7 +1153,7 @@ Loads json generated from `config/descriptions.exs`.
|
|||
- `nicknames`
|
||||
- Response: Array of user nicknames
|
||||
|
||||
## `PATCH /api/v1/pleroma/admin/users/resend_confirmation_email`
|
||||
## `PATCH /api/pleroma/admin/users/resend_confirmation_email`
|
||||
|
||||
### Resend confirmation email
|
||||
|
||||
|
@ -1233,13 +1161,13 @@ Loads json generated from `config/descriptions.exs`.
|
|||
- `nicknames`
|
||||
- Response: Array of user nicknames
|
||||
|
||||
## `GET /api/v1/pleroma/admin/stats`
|
||||
## `GET /api/pleroma/admin/stats`
|
||||
|
||||
### Stats
|
||||
|
||||
- Query Params:
|
||||
- *optional* `instance`: **string** instance hostname (without protocol) to get stats for
|
||||
- Example: `https://mypleroma.org/api/v1/pleroma/admin/stats?instance=lain.com`
|
||||
- Example: `https://mypleroma.org/api/pleroma/admin/stats?instance=lain.com`
|
||||
|
||||
- Response:
|
||||
|
||||
|
@ -1254,7 +1182,7 @@ Loads json generated from `config/descriptions.exs`.
|
|||
}
|
||||
```
|
||||
|
||||
## `GET /api/v1/pleroma/admin/oauth_app`
|
||||
## `GET /api/pleroma/admin/oauth_app`
|
||||
|
||||
### List OAuth app
|
||||
|
||||
|
@ -1286,7 +1214,7 @@ Loads json generated from `config/descriptions.exs`.
|
|||
```
|
||||
|
||||
|
||||
## `POST /api/v1/pleroma/admin/oauth_app`
|
||||
## `POST /api/pleroma/admin/oauth_app`
|
||||
|
||||
### Create OAuth App
|
||||
|
||||
|
@ -1319,7 +1247,7 @@ Loads json generated from `config/descriptions.exs`.
|
|||
}
|
||||
```
|
||||
|
||||
## `PATCH /api/v1/pleroma/admin/oauth_app/:id`
|
||||
## `PATCH /api/pleroma/admin/oauth_app/:id`
|
||||
|
||||
### Update OAuth App
|
||||
|
||||
|
@ -1344,7 +1272,7 @@ Loads json generated from `config/descriptions.exs`.
|
|||
}
|
||||
```
|
||||
|
||||
## `DELETE /api/v1/pleroma/admin/oauth_app/:id`
|
||||
## `DELETE /api/pleroma/admin/oauth_app/:id`
|
||||
|
||||
### Delete OAuth App
|
||||
|
||||
|
@ -1355,7 +1283,7 @@ Loads json generated from `config/descriptions.exs`.
|
|||
- On failure:
|
||||
- 400 Bad Request `"Invalid parameters"` when `status` is missing
|
||||
|
||||
## `GET /api/v1/pleroma/admin/media_proxy_caches`
|
||||
## `GET /api/pleroma/admin/media_proxy_caches`
|
||||
|
||||
### Get a list of all banned MediaProxy URLs in Cachex
|
||||
|
||||
|
@ -1379,7 +1307,7 @@ Loads json generated from `config/descriptions.exs`.
|
|||
|
||||
```
|
||||
|
||||
## `POST /api/v1/pleroma/admin/media_proxy_caches/delete`
|
||||
## `POST /api/pleroma/admin/media_proxy_caches/delete`
|
||||
|
||||
### Remove a banned MediaProxy URL from Cachex
|
||||
|
||||
|
@ -1394,7 +1322,7 @@ Loads json generated from `config/descriptions.exs`.
|
|||
|
||||
```
|
||||
|
||||
## `POST /api/v1/pleroma/admin/media_proxy_caches/purge`
|
||||
## `POST /api/pleroma/admin/media_proxy_caches/purge`
|
||||
|
||||
### Purge a MediaProxy URL
|
||||
|
||||
|
@ -1410,7 +1338,7 @@ Loads json generated from `config/descriptions.exs`.
|
|||
|
||||
```
|
||||
|
||||
## GET /api/v1/pleroma/admin/users/:nickname/chats
|
||||
## GET /api/pleroma/admin/users/:nickname/chats
|
||||
|
||||
### List a user's chats
|
||||
|
||||
|
@ -1439,7 +1367,7 @@ Loads json generated from `config/descriptions.exs`.
|
|||
]
|
||||
```
|
||||
|
||||
## GET /api/v1/pleroma/admin/chats/:chat_id
|
||||
## GET /api/pleroma/admin/chats/:chat_id
|
||||
|
||||
### View a single chat
|
||||
|
||||
|
@ -1466,7 +1394,7 @@ Loads json generated from `config/descriptions.exs`.
|
|||
}
|
||||
```
|
||||
|
||||
## GET /api/v1/pleroma/admin/chats/:chat_id/messages
|
||||
## GET /api/pleroma/admin/chats/:chat_id/messages
|
||||
|
||||
### List the messages in a chat
|
||||
|
||||
|
@ -1504,7 +1432,7 @@ Loads json generated from `config/descriptions.exs`.
|
|||
]
|
||||
```
|
||||
|
||||
## DELETE /api/v1/pleroma/admin/chats/:chat_id/messages/:message_id
|
||||
## DELETE /api/pleroma/admin/chats/:chat_id/messages/:message_id
|
||||
|
||||
### Delete a single message
|
||||
|
||||
|
@ -1531,7 +1459,7 @@ Loads json generated from `config/descriptions.exs`.
|
|||
}
|
||||
```
|
||||
|
||||
## `GET /api/v1/pleroma/admin/instance_document/:document_name`
|
||||
## `GET /api/pleroma/admin/instance_document/:document_name`
|
||||
|
||||
### Get an instance document
|
||||
|
||||
|
@ -1545,7 +1473,7 @@ Returns the content of the document
|
|||
<h1>Instance panel</h1>
|
||||
```
|
||||
|
||||
## `PATCH /api/v1/pleroma/admin/instance_document/:document_name`
|
||||
## `PATCH /api/pleroma/admin/instance_document/:document_name`
|
||||
- Params:
|
||||
- `file` (the file to be uploaded, using multipart form data.)
|
||||
|
||||
|
@ -1561,7 +1489,7 @@ Returns the content of the document
|
|||
}
|
||||
```
|
||||
|
||||
## `DELETE /api/v1/pleroma/admin/instance_document/:document_name`
|
||||
## `DELETE /api/pleroma/admin/instance_document/:document_name`
|
||||
|
||||
### Delete an instance document
|
||||
|
||||
|
@ -1573,7 +1501,7 @@ Returns the content of the document
|
|||
}
|
||||
```
|
||||
|
||||
## `GET /api/v1/pleroma/admin/frontends
|
||||
## `GET /api/pleroma/admin/frontends
|
||||
|
||||
### List available frontends
|
||||
|
||||
|
@ -1598,7 +1526,7 @@ Returns the content of the document
|
|||
]
|
||||
```
|
||||
|
||||
## `POST /api/v1/pleroma/admin/frontends/install`
|
||||
## `POST /api/pleroma/admin/frontends/install`
|
||||
|
||||
### Install a frontend
|
||||
|
||||
|
@ -1635,117 +1563,3 @@ Returns the content of the document
|
|||
"error": "Could not install frontend"
|
||||
}
|
||||
```
|
||||
|
||||
## `GET /api/v1/pleroma/admin/announcements`
|
||||
|
||||
### List announcements
|
||||
|
||||
- Params: `offset`, `limit`
|
||||
|
||||
- Response: JSON, list of announcements
|
||||
|
||||
```json
|
||||
[
|
||||
{
|
||||
"id": "AHDp0GBdRn1EPN5HN2",
|
||||
"content": "some content",
|
||||
"starts_at": null,
|
||||
"ends_at": null,
|
||||
"all_day": false,
|
||||
"published_at": "2022-03-09T02:13:05",
|
||||
"reactions": [],
|
||||
"statuses": [],
|
||||
"tags": [],
|
||||
"emojis": [],
|
||||
"updated_at": "2022-03-09T02:13:05"
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
Note that this differs from the Mastodon API variant: Mastodon API only returns *active* announcements, while this returns all.
|
||||
|
||||
## `GET /api/v1/pleroma/admin/announcements/:id`
|
||||
|
||||
### Display one announcement
|
||||
|
||||
- Response: JSON, one announcement
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "AHDp0GBdRn1EPN5HN2",
|
||||
"content": "some content",
|
||||
"starts_at": null,
|
||||
"ends_at": null,
|
||||
"all_day": false,
|
||||
"published_at": "2022-03-09T02:13:05",
|
||||
"reactions": [],
|
||||
"statuses": [],
|
||||
"tags": [],
|
||||
"emojis": [],
|
||||
"updated_at": "2022-03-09T02:13:05"
|
||||
}
|
||||
```
|
||||
|
||||
## `POST /api/v1/pleroma/admin/announcements`
|
||||
|
||||
### Create an announcement
|
||||
|
||||
- Params:
|
||||
- `content`: string, required, announcement content
|
||||
- `starts_at`: datetime, optional, default to null, the time when the announcement will become active (displayed to users); if it is null, the announcement will be active immediately
|
||||
- `ends_at`: datetime, optional, default to null, the time when the announcement will become inactive (no longer displayed to users); if it is null, the announcement will be active until an admin deletes it
|
||||
- `all_day`: boolean, optional, default to false, tells the client whether to only display dates for `starts_at` and `ends_at`
|
||||
|
||||
- Response: JSON, created announcement
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "AHDp0GBdRn1EPN5HN2",
|
||||
"content": "some content",
|
||||
"starts_at": null,
|
||||
"ends_at": null,
|
||||
"all_day": false,
|
||||
"published_at": "2022-03-09T02:13:05",
|
||||
"reactions": [],
|
||||
"statuses": [],
|
||||
"tags": [],
|
||||
"emojis": [],
|
||||
"updated_at": "2022-03-09T02:13:05"
|
||||
}
|
||||
```
|
||||
|
||||
## `PATCH /api/v1/pleroma/admin/announcements/:id`
|
||||
|
||||
### Change an announcement
|
||||
|
||||
- Params: same as `POST /api/v1/pleroma/admin/announcements`, except no param is required.
|
||||
|
||||
- Updates the announcement according to params. Missing params are kept as-is.
|
||||
|
||||
- Response: JSON, updated announcement
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "AHDp0GBdRn1EPN5HN2",
|
||||
"content": "some content",
|
||||
"starts_at": null,
|
||||
"ends_at": null,
|
||||
"all_day": false,
|
||||
"published_at": "2022-03-09T02:13:05",
|
||||
"reactions": [],
|
||||
"statuses": [],
|
||||
"tags": [],
|
||||
"emojis": [],
|
||||
"updated_at": "2022-03-09T02:13:05"
|
||||
}
|
||||
```
|
||||
|
||||
## `DELETE /api/v1/pleroma/admin/announcements/:id`
|
||||
|
||||
### Delete an announcement
|
||||
|
||||
- Response: JSON, empty object
|
||||
|
||||
```json
|
||||
{}
|
||||
```
|
||||
|
|
|
@ -16,12 +16,6 @@ Adding the parameter `reply_visibility` to the public and home timelines queries
|
|||
|
||||
Adding the parameter `instance=lain.com` to the public timeline will show only statuses originating from `lain.com` (or any remote instance).
|
||||
|
||||
Home, public, hashtag & list timelines accept these parameters:
|
||||
|
||||
- `only_media`: show only statuses with media attached
|
||||
- `local`: show only local statuses
|
||||
- `remote`: show only remote statuses
|
||||
|
||||
## Statuses
|
||||
|
||||
- `visibility`: has additional possible values `list` and `local` (for local-only statuses)
|
||||
|
@ -38,17 +32,6 @@ Has these additional fields under the `pleroma` object:
|
|||
- `thread_muted`: true if the thread the post belongs to is muted
|
||||
- `emoji_reactions`: A list with emoji / reaction maps. The format is `{name: "☕", count: 1, me: true}`. Contains no information about the reacting users, for that use the `/statuses/:id/reactions` endpoint.
|
||||
- `parent_visible`: If the parent of this post is visible to the user or not.
|
||||
- `pinned_at`: a datetime (iso8601) when status was pinned, `null` otherwise.
|
||||
|
||||
The `GET /api/v1/statuses/:id/source` endpoint additionally has the following attributes:
|
||||
|
||||
- `content_type`: The content type of the status source.
|
||||
|
||||
## Scheduled statuses
|
||||
|
||||
Has these additional fields in `params`:
|
||||
|
||||
- `expires_in`: the number of seconds the posted activity should expire in.
|
||||
|
||||
## Media Attachments
|
||||
|
||||
|
@ -71,23 +54,6 @@ The `id` parameter can also be the `nickname` of the user. This only works in th
|
|||
- `/api/v1/accounts/:id`
|
||||
- `/api/v1/accounts/:id/statuses`
|
||||
|
||||
`/api/v1/accounts/:id/statuses` endpoint accepts these parameters:
|
||||
|
||||
- `pinned`: include only pinned statuses
|
||||
- `tagged`: with tag
|
||||
- `only_media`: include only statuses with media attached
|
||||
- `with_muted`: include statuses/reactions from muted accounts
|
||||
- `exclude_reblogs`: exclude reblogs
|
||||
- `exclude_replies`: exclude replies
|
||||
- `exclude_visibilities`: exclude visibilities
|
||||
|
||||
Endpoints which accept `with_relationships` parameter:
|
||||
|
||||
- `/api/v1/accounts/:id`
|
||||
- `/api/v1/accounts/:id/followers`
|
||||
- `/api/v1/accounts/:id/following`
|
||||
- `/api/v1/mutes`
|
||||
|
||||
Has these additional fields under the `pleroma` object:
|
||||
|
||||
- `ap_id`: nullable URL string, ActivityPub id of the user
|
||||
|
@ -103,12 +69,12 @@ Has these additional fields under the `pleroma` object:
|
|||
- `hide_followers_count`: boolean, true when the user has follower stat hiding enabled
|
||||
- `hide_follows_count`: boolean, true when the user has follow stat hiding enabled
|
||||
- `settings_store`: A generic map of settings for frontends. Opaque to the backend. Only returned in `/api/v1/accounts/verify_credentials` and `/api/v1/accounts/update_credentials`
|
||||
- `chat_token`: The token needed for Pleroma shoutbox. Only returned in `/api/v1/accounts/verify_credentials`
|
||||
- `chat_token`: The token needed for Pleroma chat. Only returned in `/api/v1/accounts/verify_credentials`
|
||||
- `deactivated`: boolean, true when the user is deactivated
|
||||
- `allow_following_move`: boolean, true when the user allows automatically follow moved following accounts
|
||||
- `unread_conversation_count`: The count of unread conversations. Only returned to the account owner.
|
||||
- `unread_notifications_count`: The count of unread notifications. Only returned to the account owner.
|
||||
- `notification_settings`: object, can be absent. See `/api/v1/pleroma/notification_settings` for the parameters/keys returned.
|
||||
- `notification_settings`: object, can be absent. See `/api/pleroma/notification_settings` for the parameters/keys returned.
|
||||
- `accepts_chat_messages`: boolean, but can be null if we don't have that information about a user
|
||||
- `favicon`: nullable URL string, Favicon image of the user's instance
|
||||
|
||||
|
@ -245,7 +211,6 @@ Additional parameters can be added to the JSON body/Form data:
|
|||
- `discoverable` - if true, external services (search bots) etc. are allowed to index / list the account (regardless of this setting, user will still appear in regular search results).
|
||||
- `actor_type` - the type of this account.
|
||||
- `accepts_chat_messages` - if false, this account will reject all chat messages.
|
||||
- `language` - user's preferred language for receiving emails (digest, confirmation, etc.)
|
||||
|
||||
All images (avatar, banner and background) can be reset to the default by sending an empty string ("") instead of a file.
|
||||
|
||||
|
@ -261,29 +226,9 @@ This information is returned in the `/api/v1/accounts/verify_credentials` endpoi
|
|||
|
||||
*Pleroma supports refreshing tokens.*
|
||||
|
||||
### POST `/oauth/token`
|
||||
`POST /oauth/token`
|
||||
|
||||
You can obtain access tokens for a user in a few additional ways.
|
||||
|
||||
#### Refreshing a token
|
||||
|
||||
To obtain a new access token from a refresh token, pass `grant_type=refresh_token` with the following extra parameters:
|
||||
|
||||
- `refresh_token`: The refresh token.
|
||||
|
||||
#### Getting a token with a password
|
||||
|
||||
To obtain a token from a user's password, pass `grant_type=password` with the following extra parameters:
|
||||
|
||||
- `username`: Username to authenticate.
|
||||
- `password`: The user's password.
|
||||
|
||||
#### Response body
|
||||
|
||||
Additional fields are returned in the response:
|
||||
|
||||
- `id`: The primary key of this token in Pleroma's database.
|
||||
- `me` (user tokens only): The ActivityPub ID of the user who owns the token.
|
||||
Post here request with `grant_type=refresh_token` to obtain new access token. Returns an access token.
|
||||
|
||||
## Account Registration
|
||||
|
||||
|
@ -297,7 +242,6 @@ Has these additional parameters (which are the same as in Pleroma-API):
|
|||
- `captcha_token`: optional, contains provider-specific captcha token
|
||||
- `captcha_answer_data`: optional, contains provider-specific captcha data
|
||||
- `token`: invite token required when the registrations aren't public.
|
||||
- `language`: optional, user's preferred language for receiving emails (digest, confirmation, etc.), default to the language set in the `userLanguage` cookies or `Accept-Language` header.
|
||||
|
||||
## Instance
|
||||
|
||||
|
@ -383,6 +327,18 @@ Pleroma is generally compatible with the Mastodon 2.7.2 API, but some newer feat
|
|||
|
||||
- `GET /api/v1/identity_proofs`: Returns an empty array, `[]`
|
||||
|
||||
### Endorsements
|
||||
|
||||
*Added in Mastodon 2.5.0*
|
||||
|
||||
- `GET /api/v1/endorsements`: Returns an empty array, `[]`
|
||||
|
||||
### Profile directory
|
||||
|
||||
*Added in Mastodon 3.0.0*
|
||||
|
||||
- `GET /api/v1/directory`: Returns HTTP 404
|
||||
|
||||
### Featured tags
|
||||
|
||||
*Added in Mastodon 3.0.0*
|
||||
|
|
|
@ -1,347 +0,0 @@
|
|||
# Nodeinfo
|
||||
|
||||
See also [the Nodeinfo standard](https://nodeinfo.diaspora.software/).
|
||||
|
||||
## `/.well-known/nodeinfo`
|
||||
### The well-known path
|
||||
* Method: `GET`
|
||||
* Authentication: not required
|
||||
* Params: none
|
||||
* Response: JSON
|
||||
* Example response:
|
||||
```json
|
||||
{
|
||||
"links":[
|
||||
{
|
||||
"href":"https://example.com/nodeinfo/2.0.json",
|
||||
"rel":"http://nodeinfo.diaspora.software/ns/schema/2.0"
|
||||
},
|
||||
{
|
||||
"href":"https://example.com/nodeinfo/2.1.json",
|
||||
"rel":"http://nodeinfo.diaspora.software/ns/schema/2.1"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## `/nodeinfo/2.0.json`
|
||||
### Nodeinfo 2.0
|
||||
* Method: `GET`
|
||||
* Authentication: not required
|
||||
* Params: none
|
||||
* Response: JSON
|
||||
* Example response:
|
||||
```json
|
||||
{
|
||||
"metadata":{
|
||||
"accountActivationRequired":false,
|
||||
"features":[
|
||||
"pleroma_api",
|
||||
"mastodon_api",
|
||||
"mastodon_api_streaming",
|
||||
"polls",
|
||||
"pleroma_explicit_addressing",
|
||||
"shareable_emoji_packs",
|
||||
"multifetch",
|
||||
"pleroma:api/v1/notifications:include_types_filter",
|
||||
"chat",
|
||||
"shout",
|
||||
"relay",
|
||||
"pleroma_emoji_reactions",
|
||||
"pleroma_chat_messages"
|
||||
],
|
||||
"federation":{
|
||||
"enabled":true,
|
||||
"exclusions":false,
|
||||
"mrf_hashtag":{
|
||||
"federated_timeline_removal":[
|
||||
|
||||
],
|
||||
"reject":[
|
||||
|
||||
],
|
||||
"sensitive":[
|
||||
"nsfw"
|
||||
]
|
||||
},
|
||||
"mrf_object_age":{
|
||||
"actions":[
|
||||
"delist",
|
||||
"strip_followers"
|
||||
],
|
||||
"threshold":604800
|
||||
},
|
||||
"mrf_policies":[
|
||||
"ObjectAgePolicy",
|
||||
"TagPolicy",
|
||||
"HashtagPolicy"
|
||||
],
|
||||
"quarantined_instances":[
|
||||
|
||||
]
|
||||
},
|
||||
"fieldsLimits":{
|
||||
"maxFields":10,
|
||||
"maxRemoteFields":20,
|
||||
"nameLength":512,
|
||||
"valueLength":2048
|
||||
},
|
||||
"invitesEnabled":false,
|
||||
"mailerEnabled":false,
|
||||
"nodeDescription":"Pleroma: An efficient and flexible fediverse server",
|
||||
"nodeName":"Example",
|
||||
"pollLimits":{
|
||||
"max_expiration":31536000,
|
||||
"max_option_chars":200,
|
||||
"max_options":20,
|
||||
"min_expiration":0
|
||||
},
|
||||
"postFormats":[
|
||||
"text/plain",
|
||||
"text/html",
|
||||
"text/markdown",
|
||||
"text/bbcode"
|
||||
],
|
||||
"private":false,
|
||||
"restrictedNicknames":[
|
||||
".well-known",
|
||||
"~",
|
||||
"about",
|
||||
"activities",
|
||||
"api",
|
||||
"auth",
|
||||
"check_password",
|
||||
"dev",
|
||||
"friend-requests",
|
||||
"inbox",
|
||||
"internal",
|
||||
"main",
|
||||
"media",
|
||||
"nodeinfo",
|
||||
"notice",
|
||||
"oauth",
|
||||
"objects",
|
||||
"ostatus_subscribe",
|
||||
"pleroma",
|
||||
"proxy",
|
||||
"push",
|
||||
"registration",
|
||||
"relay",
|
||||
"settings",
|
||||
"status",
|
||||
"tag",
|
||||
"user-search",
|
||||
"user_exists",
|
||||
"users",
|
||||
"web",
|
||||
"verify_credentials",
|
||||
"update_credentials",
|
||||
"relationships",
|
||||
"search",
|
||||
"confirmation_resend",
|
||||
"mfa"
|
||||
],
|
||||
"skipThreadContainment":true,
|
||||
"staffAccounts":[
|
||||
"https://example.com/users/admin",
|
||||
"https://example.com/users/staff"
|
||||
],
|
||||
"suggestions":{
|
||||
"enabled":false
|
||||
},
|
||||
"uploadLimits":{
|
||||
"avatar":2000000,
|
||||
"background":4000000,
|
||||
"banner":4000000,
|
||||
"general":16000000
|
||||
}
|
||||
},
|
||||
"openRegistrations":true,
|
||||
"protocols":[
|
||||
"activitypub"
|
||||
],
|
||||
"services":{
|
||||
"inbound":[
|
||||
|
||||
],
|
||||
"outbound":[
|
||||
|
||||
]
|
||||
},
|
||||
"software":{
|
||||
"name":"pleroma",
|
||||
"version":"2.4.1"
|
||||
},
|
||||
"usage":{
|
||||
"localPosts":27,
|
||||
"users":{
|
||||
"activeHalfyear":129,
|
||||
"activeMonth":70,
|
||||
"total":235
|
||||
}
|
||||
},
|
||||
"version":"2.0"
|
||||
}
|
||||
```
|
||||
|
||||
## `/nodeinfo/2.1.json`
|
||||
### Nodeinfo 2.1
|
||||
* Method: `GET`
|
||||
* Authentication: not required
|
||||
* Params: none
|
||||
* Response: JSON
|
||||
* Example response:
|
||||
```json
|
||||
{
|
||||
"metadata":{
|
||||
"accountActivationRequired":false,
|
||||
"features":[
|
||||
"pleroma_api",
|
||||
"mastodon_api",
|
||||
"mastodon_api_streaming",
|
||||
"polls",
|
||||
"pleroma_explicit_addressing",
|
||||
"shareable_emoji_packs",
|
||||
"multifetch",
|
||||
"pleroma:api/v1/notifications:include_types_filter",
|
||||
"chat",
|
||||
"shout",
|
||||
"relay",
|
||||
"pleroma_emoji_reactions",
|
||||
"pleroma_chat_messages"
|
||||
],
|
||||
"federation":{
|
||||
"enabled":true,
|
||||
"exclusions":false,
|
||||
"mrf_hashtag":{
|
||||
"federated_timeline_removal":[
|
||||
|
||||
],
|
||||
"reject":[
|
||||
|
||||
],
|
||||
"sensitive":[
|
||||
"nsfw"
|
||||
]
|
||||
},
|
||||
"mrf_object_age":{
|
||||
"actions":[
|
||||
"delist",
|
||||
"strip_followers"
|
||||
],
|
||||
"threshold":604800
|
||||
},
|
||||
"mrf_policies":[
|
||||
"ObjectAgePolicy",
|
||||
"TagPolicy",
|
||||
"HashtagPolicy"
|
||||
],
|
||||
"quarantined_instances":[
|
||||
|
||||
]
|
||||
},
|
||||
"fieldsLimits":{
|
||||
"maxFields":10,
|
||||
"maxRemoteFields":20,
|
||||
"nameLength":512,
|
||||
"valueLength":2048
|
||||
},
|
||||
"invitesEnabled":false,
|
||||
"mailerEnabled":false,
|
||||
"nodeDescription":"Pleroma: An efficient and flexible fediverse server",
|
||||
"nodeName":"Example",
|
||||
"pollLimits":{
|
||||
"max_expiration":31536000,
|
||||
"max_option_chars":200,
|
||||
"max_options":20,
|
||||
"min_expiration":0
|
||||
},
|
||||
"postFormats":[
|
||||
"text/plain",
|
||||
"text/html",
|
||||
"text/markdown",
|
||||
"text/bbcode"
|
||||
],
|
||||
"private":false,
|
||||
"restrictedNicknames":[
|
||||
".well-known",
|
||||
"~",
|
||||
"about",
|
||||
"activities",
|
||||
"api",
|
||||
"auth",
|
||||
"check_password",
|
||||
"dev",
|
||||
"friend-requests",
|
||||
"inbox",
|
||||
"internal",
|
||||
"main",
|
||||
"media",
|
||||
"nodeinfo",
|
||||
"notice",
|
||||
"oauth",
|
||||
"objects",
|
||||
"ostatus_subscribe",
|
||||
"pleroma",
|
||||
"proxy",
|
||||
"push",
|
||||
"registration",
|
||||
"relay",
|
||||
"settings",
|
||||
"status",
|
||||
"tag",
|
||||
"user-search",
|
||||
"user_exists",
|
||||
"users",
|
||||
"web",
|
||||
"verify_credentials",
|
||||
"update_credentials",
|
||||
"relationships",
|
||||
"search",
|
||||
"confirmation_resend",
|
||||
"mfa"
|
||||
],
|
||||
"skipThreadContainment":true,
|
||||
"staffAccounts":[
|
||||
"https://example.com/users/admin",
|
||||
"https://example.com/users/staff"
|
||||
],
|
||||
"suggestions":{
|
||||
"enabled":false
|
||||
},
|
||||
"uploadLimits":{
|
||||
"avatar":2000000,
|
||||
"background":4000000,
|
||||
"banner":4000000,
|
||||
"general":16000000
|
||||
}
|
||||
},
|
||||
"openRegistrations":true,
|
||||
"protocols":[
|
||||
"activitypub"
|
||||
],
|
||||
"services":{
|
||||
"inbound":[
|
||||
|
||||
],
|
||||
"outbound":[
|
||||
|
||||
]
|
||||
},
|
||||
"software":{
|
||||
"name":"pleroma",
|
||||
"repository":"https://git.pleroma.social/pleroma/pleroma",
|
||||
"version":"2.4.1"
|
||||
},
|
||||
"usage":{
|
||||
"localPosts":27,
|
||||
"users":{
|
||||
"activeHalfyear":129,
|
||||
"activeMonth":70,
|
||||
"total":235
|
||||
}
|
||||
},
|
||||
"version":"2.1"
|
||||
}
|
||||
```
|
||||
|
|
@ -4,9 +4,7 @@ Requests that require it can be authenticated with [an OAuth token](https://tool
|
|||
|
||||
Request parameters can be passed via [query strings](https://en.wikipedia.org/wiki/Query_string) or as [form data](https://www.w3.org/TR/html401/interact/forms.html). Files must be uploaded as `multipart/form-data`.
|
||||
|
||||
The `/api/v1/pleroma/*` path is backwards compatible with `/api/pleroma/*` (`/api/pleroma/*` will be deprecated in the future).
|
||||
|
||||
## `/api/v1/pleroma/emoji`
|
||||
## `/api/pleroma/emoji`
|
||||
### Lists the custom emoji on that server.
|
||||
* Method: `GET`
|
||||
* Authentication: not required
|
||||
|
@ -62,7 +60,7 @@ The `/api/v1/pleroma/*` path is backwards compatible with `/api/pleroma/*` (`/ap
|
|||
* `list`: STRING or FILE containing a whitespace-separated list of accounts to mute
|
||||
* Response: HTTP 200 on success, 500 on error
|
||||
|
||||
## `/api/v1/pleroma/captcha`
|
||||
## `/api/pleroma/captcha`
|
||||
### Get a new captcha
|
||||
* Method: `GET`
|
||||
* Authentication: not required
|
||||
|
@ -93,8 +91,7 @@ The `/api/v1/pleroma/*` path is backwards compatible with `/api/pleroma/*` (`/ap
|
|||
* method: `GET`
|
||||
* Authentication: required
|
||||
* OAuth scope: `read:security`
|
||||
* Response: JSON. Returns `{"settings": {"enabled": "false", "totp": false }}`
|
||||
* Note: `enabled` is whether multi-factor auth is enabled for the user in general, while `totp` is one type of MFA.
|
||||
* Response: JSON. Returns `{"enabled": "false", "totp": false }`
|
||||
|
||||
## `/api/pleroma/accounts/mfa/setup/totp`
|
||||
#### Pre-setup the MFA/TOTP method
|
||||
|
@ -131,7 +128,7 @@ The `/api/v1/pleroma/*` path is backwards compatible with `/api/pleroma/*` (`/ap
|
|||
* OAuth scope: `write:security`
|
||||
* Response: JSON. Returns `{"codes": codes}`when successful, otherwise HTTP 422 `{"error": "[error message]"}`
|
||||
|
||||
## `/api/v1/pleroma/admin/`
|
||||
## `/api/pleroma/admin/`
|
||||
See [Admin-API](admin_api.md)
|
||||
|
||||
## `/api/v1/pleroma/notifications/read`
|
||||
|
@ -160,12 +157,10 @@ See [Admin-API](admin_api.md)
|
|||
"muting": false,
|
||||
"muting_notifications": false,
|
||||
"subscribing": true,
|
||||
"notifying": true,
|
||||
"requested": false,
|
||||
"domain_blocking": false,
|
||||
"showing_reblogs": true,
|
||||
"endorsed": false,
|
||||
"note": ""
|
||||
"endorsed": false
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -186,12 +181,10 @@ See [Admin-API](admin_api.md)
|
|||
"muting": false,
|
||||
"muting_notifications": false,
|
||||
"subscribing": false,
|
||||
"notifying": false,
|
||||
"requested": false,
|
||||
"domain_blocking": false,
|
||||
"showing_reblogs": true,
|
||||
"endorsed": false,
|
||||
"note": ""
|
||||
"endorsed": false
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -314,7 +307,7 @@ See [Admin-API](admin_api.md)
|
|||
* `hide_notification_contents`: BOOLEAN field. When set to true, it removes the contents of a message from the push notification.
|
||||
* Response: JSON. Returns `{"status": "success"}` if the update was successful, otherwise returns `{"error": "error_msg"}`
|
||||
|
||||
## `/api/v1/pleroma/healthcheck`
|
||||
## `/api/pleroma/healthcheck`
|
||||
### Healthcheck endpoint with additional system data.
|
||||
* Method `GET`
|
||||
* Authentication: not required
|
||||
|
@ -342,36 +335,6 @@ See [Admin-API](admin_api.md)
|
|||
* Response: JSON. Returns `{"status": "success"}` if the change was successful, `{"error": "[error message]"}` otherwise
|
||||
* Note: Currently, Mastodon has no API for changing email. If they add it in future it might be incompatible with Pleroma.
|
||||
|
||||
## `/api/pleroma/move_account`
|
||||
### Move account
|
||||
* Method `POST`
|
||||
* Authentication: required
|
||||
* Params:
|
||||
* `password`: user's password
|
||||
* `target_account`: the nickname of the target account (e.g. `foo@example.org`)
|
||||
* Response: JSON. Returns `{"status": "success"}` if the change was successful, `{"error": "[error message]"}` otherwise
|
||||
* Note: This endpoint emits a `Move` activity to all followers of the current account. Some remote servers will automatically unfollow the current account and follow the target account upon seeing this, but this depends on the remote server implementation and cannot be guaranteed. For local followers , they will automatically unfollow and follow if and only if they have set the `allow_following_move` preference ("Allow auto-follow when following account moves").
|
||||
|
||||
## `/api/pleroma/aliases`
|
||||
### Get aliases of the current account
|
||||
* Method `GET`
|
||||
* Authentication: required
|
||||
* Response: JSON. Returns `{"aliases": [alias, ...]}`, where `alias` is the nickname of an alias, e.g. `foo@example.org`.
|
||||
|
||||
### Add alias to the current account
|
||||
* Method `PUT`
|
||||
* Authentication: required
|
||||
* Params:
|
||||
* `alias`: the nickname of the alias to add, e.g. `foo@example.org`.
|
||||
* Response: JSON. Returns `{"status": "success"}` if the change was successful, `{"error": "[error message]"}` otherwise
|
||||
|
||||
### Delete alias from the current account
|
||||
* Method `DELETE`
|
||||
* Authentication: required
|
||||
* Params:
|
||||
* `alias`: the nickname of the alias to delete, e.g. `foo@example.org`.
|
||||
* Response: JSON. Returns `{"status": "success"}` if the change was successful, `{"error": "[error message]"}` otherwise
|
||||
|
||||
# Pleroma Conversations
|
||||
|
||||
Pleroma Conversations have the same general structure that Mastodon Conversations have. The behavior differs in the following ways when using these endpoints:
|
||||
|
@ -415,7 +378,7 @@ The status posting endpoint takes an additional parameter, `in_reply_to_conversa
|
|||
* Params: None
|
||||
* Response: JSON, returns a list of Mastodon Conversation entities that were marked as read (200 - healthy, 503 unhealthy).
|
||||
|
||||
## `GET /api/v1/pleroma/emoji/pack?name=:name`
|
||||
## `GET /api/pleroma/emoji/pack?name=:name`
|
||||
|
||||
### Get pack.json for the pack
|
||||
|
||||
|
@ -434,7 +397,7 @@ The status posting endpoint takes an additional parameter, `in_reply_to_conversa
|
|||
}
|
||||
```
|
||||
|
||||
## `POST /api/v1/pleroma/emoji/pack?name=:name`
|
||||
## `POST /api/pleroma/emoji/pack?name=:name`
|
||||
|
||||
### Creates an empty pack
|
||||
|
||||
|
@ -444,7 +407,7 @@ The status posting endpoint takes an additional parameter, `in_reply_to_conversa
|
|||
* `name`: pack name
|
||||
* Response: JSON, "ok" and 200 status or 409 if the pack with that name already exists
|
||||
|
||||
## `PATCH /api/v1/pleroma/emoji/pack?name=:name`
|
||||
## `PATCH /api/pleroma/emoji/pack?name=:name`
|
||||
|
||||
### Updates (replaces) pack metadata
|
||||
|
||||
|
@ -462,7 +425,7 @@ The status posting endpoint takes an additional parameter, `in_reply_to_conversa
|
|||
* Response: JSON, updated "metadata" section of the pack and 200 status or 400 if there was a
|
||||
problem with the new metadata (the error is specified in the "error" part of the response JSON)
|
||||
|
||||
## `DELETE /api/v1/pleroma/emoji/pack?name=:name`
|
||||
## `DELETE /api/pleroma/emoji/pack?name=:name`
|
||||
|
||||
### Delete a custom emoji pack
|
||||
|
||||
|
@ -472,7 +435,7 @@ The status posting endpoint takes an additional parameter, `in_reply_to_conversa
|
|||
* `name`: pack name
|
||||
* Response: JSON, "ok" and 200 status or 500 if there was an error deleting the pack
|
||||
|
||||
## `GET /api/v1/pleroma/emoji/packs/import`
|
||||
## `GET /api/pleroma/emoji/packs/import`
|
||||
|
||||
### Imports packs from filesystem
|
||||
|
||||
|
@ -481,7 +444,7 @@ The status posting endpoint takes an additional parameter, `in_reply_to_conversa
|
|||
* Params: None
|
||||
* Response: JSON, returns a list of imported packs.
|
||||
|
||||
## `GET /api/v1/pleroma/emoji/packs/remote`
|
||||
## `GET /api/pleroma/emoji/packs/remote`
|
||||
|
||||
### Make request to another instance for packs list
|
||||
|
||||
|
@ -493,7 +456,7 @@ The status posting endpoint takes an additional parameter, `in_reply_to_conversa
|
|||
* `page_size`: page size for packs (default 50)
|
||||
* Response: JSON with the pack list, hashmap with pack name and pack contents
|
||||
|
||||
## `POST /api/v1/pleroma/emoji/packs/download`
|
||||
## `POST /api/pleroma/emoji/packs/download`
|
||||
|
||||
### Download pack from another instance
|
||||
|
||||
|
@ -506,7 +469,7 @@ The status posting endpoint takes an additional parameter, `in_reply_to_conversa
|
|||
* Response: JSON, "ok" with 200 status if the pack was downloaded, or 500 if there were
|
||||
errors downloading the pack
|
||||
|
||||
## `POST /api/v1/pleroma/emoji/packs/files?name=:name`
|
||||
## `POST /api/pleroma/emoji/packs/files?name=:name`
|
||||
|
||||
### Add new file to the pack
|
||||
|
||||
|
@ -519,7 +482,7 @@ The status posting endpoint takes an additional parameter, `in_reply_to_conversa
|
|||
* `filename`: (*optional*) new emoji file name. If not specified will be taken from original filename.
|
||||
* Response: JSON, list of files for updated pack (hashmap -> shortcode => filename) with status 200, either error status with error message.
|
||||
|
||||
## `PATCH /api/v1/pleroma/emoji/packs/files?name=:name`
|
||||
## `PATCH /api/pleroma/emoji/packs/files?name=:name`
|
||||
|
||||
### Update emoji file from pack
|
||||
|
||||
|
@ -533,7 +496,7 @@ The status posting endpoint takes an additional parameter, `in_reply_to_conversa
|
|||
* `force`: (*optional*) with true value to overwrite existing emoji with new shortcode
|
||||
* Response: JSON, list with updated files for updated pack (hashmap -> shortcode => filename) with status 200, either error status with error message.
|
||||
|
||||
## `DELETE /api/v1/pleroma/emoji/packs/files?name=:name`
|
||||
## `DELETE /api/pleroma/emoji/packs/files?name=:name`
|
||||
|
||||
### Delete emoji file from pack
|
||||
|
||||
|
@ -544,7 +507,7 @@ The status posting endpoint takes an additional parameter, `in_reply_to_conversa
|
|||
* `shortcode`: emoji file shortcode
|
||||
* Response: JSON, list with updated files for updated pack (hashmap -> shortcode => filename) with status 200, either error status with error message.
|
||||
|
||||
## `GET /api/v1/pleroma/emoji/packs`
|
||||
## `GET /api/pleroma/emoji/packs`
|
||||
|
||||
### Lists local custom emoji packs
|
||||
|
||||
|
@ -565,7 +528,7 @@ The status posting endpoint takes an additional parameter, `in_reply_to_conversa
|
|||
}
|
||||
```
|
||||
|
||||
## `GET /api/v1/pleroma/emoji/packs/archive?name=:name`
|
||||
## `GET /api/pleroma/emoji/packs/archive?name=:name`
|
||||
|
||||
### Requests a local pack archive from the instance
|
||||
|
||||
|
@ -690,77 +653,3 @@ Emoji reactions work a lot like favourites do. They make it possible to react to
|
|||
"url": "https://example.com/media/backups/archive-foobar-20200910T161803-QUhx6VYDRQ2wfV0SdA2Pfj_2CLM_ATUlw-D5l5TJf4Q.zip"
|
||||
}]
|
||||
```
|
||||
|
||||
## `GET /api/oauth_tokens`
|
||||
### Retrieve a list of active sessions for the user
|
||||
* Method: `GET`
|
||||
* Authentication: required
|
||||
* Params: none
|
||||
* Response: JSON
|
||||
* Example response:
|
||||
|
||||
```json
|
||||
[
|
||||
{
|
||||
"app_name": "Pleroma FE",
|
||||
"id": 9275,
|
||||
"valid_until": "2121-11-24T15:51:08.234234"
|
||||
},
|
||||
{
|
||||
"app_name": "Patron",
|
||||
"id": 8805,
|
||||
"valid_until": "2121-10-26T18:09:59.857150"
|
||||
},
|
||||
{
|
||||
"app_name": "Soapbox FE",
|
||||
"id": 9727,
|
||||
"valid_until": "2121-12-25T16:52:39.692877"
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
## `DELETE /api/oauth_tokens/:id`
|
||||
### Revoke a user session by its ID
|
||||
* Method: `DELETE`
|
||||
* Authentication: required
|
||||
* Params: none
|
||||
* Response: HTTP 200 on success, 500 on error
|
||||
|
||||
## `/api/v1/pleroma/settings/:app`
|
||||
### Gets settings for some application
|
||||
* Method `GET`
|
||||
* Authentication: `read:accounts`
|
||||
|
||||
* Response: JSON. The settings for that application, or empty object if there is none.
|
||||
* Example response:
|
||||
```json
|
||||
{
|
||||
"some key": "some value"
|
||||
}
|
||||
```
|
||||
|
||||
### Updates settings for some application
|
||||
* Method `PATCH`
|
||||
* Authentication: `write:accounts`
|
||||
* Request body: JSON object. The object will be merged recursively with old settings. If some field is set to null, it is removed.
|
||||
* Example request:
|
||||
```json
|
||||
{
|
||||
"some key": "some value",
|
||||
"key to remove": null,
|
||||
"nested field": {
|
||||
"some key": "some value",
|
||||
"key to remove": null
|
||||
}
|
||||
}
|
||||
```
|
||||
* Response: JSON. Updated (merged) settings for that application.
|
||||
* Example response:
|
||||
```json
|
||||
{
|
||||
"some key": "some value",
|
||||
"nested field": {
|
||||
"some key": "some value",
|
||||
}
|
||||
}
|
||||
```
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
# Setting up a Gitlab-runner
|
||||
|
||||
When you push changes, a pipeline will start some automated jobs. These are done with so called [runners](https://docs.gitlab.com/runner/), services that run somewhere on a server and run these automated jobs. These jobs typically run tests and should pass. If not, you probably need to fix something.
|
||||
|
||||
Generally, Pleroma provides a runner, so you don't need to set up your own. However, if for whatever reason you want to set up your own, here's some high level instructions.
|
||||
|
||||
1. We use docker to run the jobs, so you should install that. For Debian, you need to allow non-free packages in the [source list](https://wiki.debian.org/SourcesList). Then you can install docker with `apt install docker-compose`.
|
||||
2. You can [install](https://docs.gitlab.com/runner/install/index.html) and [configure](https://docs.gitlab.com/runner/register/index.html) a Gitlab-runner. It's probably easiest to install from the packages, but there are other options as well.
|
||||
3. When registering the runner, you'll need some values. You can find them in the project under your own name. Choose "Settings", "CI/CD", and then expand "Runners". For executor you can choose "docker". For default image, you can use the image used in <https://git.pleroma.social/pleroma/pleroma/-/blob/develop/.gitlab-ci.yml#L1> (although it shouldn't matter much).
|
|
@ -17,3 +17,10 @@ Great! Now you can explore the fediverse! Open the login page for your Pleroma i
|
|||
|
||||
### Pleroma-FE
|
||||
The default front-end used by Pleroma is Pleroma-FE. You can find more information on what it is and how to use it in the [Introduction to Pleroma-FE](../frontend).
|
||||
|
||||
### Mastodon interface
|
||||
If the Pleroma interface isn't your thing, or you're just trying something new but you want to keep using the familiar Mastodon interface, we got that too!
|
||||
Just add a "/web" after your instance url (e.g. <https://pleroma.soycaf.com/web>) and you'll end on the Mastodon web interface, but with a Pleroma backend! MAGIC!
|
||||
The Mastodon interface is from the Glitch-soc fork. For more information on the Mastodon interface you can check the [Mastodon](https://docs.joinmastodon.org/) and [Glitch-soc](https://glitch-soc.github.io/docs/) documentation.
|
||||
|
||||
Remember, what you see is only the frontend part of Mastodon, the backend is still Pleroma.
|
||||
|
|
|
@ -1,14 +1,29 @@
|
|||
# Installing on Alpine Linux
|
||||
|
||||
{! backend/installation/otp_vs_from_source_source.include !}
|
||||
|
||||
## Installation
|
||||
|
||||
This guide is a step-by-step installation guide for Alpine Linux. The instructions were verified against Alpine v3.10 standard image. You might miss additional dependencies if you use `netboot` instead.
|
||||
|
||||
It assumes that you have administrative rights, either as root or a user with [sudo permissions](https://www.linode.com/docs/tools-reference/custom-kernels-distros/install-alpine-linux-on-your-linode/#configuration). If you want to run this guide with root, ignore the `sudo` at the beginning of the lines, unless it calls a user like `sudo -Hu pleroma`; in this case, use `su -l <username> -s $SHELL -c 'command'` instead.
|
||||
|
||||
{! backend/installation/generic_dependencies.include !}
|
||||
### Required packages
|
||||
|
||||
* `postgresql`
|
||||
* `elixir`
|
||||
* `erlang`
|
||||
* `erlang-parsetools`
|
||||
* `erlang-xmerl`
|
||||
* `git`
|
||||
* `file-dev`
|
||||
* Development Tools
|
||||
* `cmake`
|
||||
|
||||
#### Optional packages used in this guide
|
||||
|
||||
* `nginx` (preferred, example configs for other reverse proxies can be found in the repo)
|
||||
* `certbot` (or any other ACME client for Let’s Encrypt certificates)
|
||||
* `ImageMagick`
|
||||
* `ffmpeg`
|
||||
* `exiftool`
|
||||
|
||||
### Prepare the system
|
||||
|
||||
|
@ -102,7 +117,7 @@ cd /opt/pleroma
|
|||
sudo -Hu pleroma mix deps.get
|
||||
```
|
||||
|
||||
* Generate the configuration: `sudo -Hu pleroma MIX_ENV=prod mix pleroma.instance gen`
|
||||
* Generate the configuration: `sudo -Hu pleroma mix pleroma.instance gen`
|
||||
* Answer with `yes` if it asks you to install `rebar3`.
|
||||
* This may take some time, because parts of pleroma get compiled first.
|
||||
* After that it will ask you a few questions about your instance and generates a configuration file in `config/generated_config.exs`.
|
||||
|
@ -110,7 +125,7 @@ sudo -Hu pleroma mix deps.get
|
|||
* Check the configuration and if all looks right, rename it, so Pleroma will load it (`prod.secret.exs` for productive instance, `dev.secret.exs` for development instances):
|
||||
|
||||
```shell
|
||||
sudo -Hu pleroma mv config/{generated_config.exs,prod.secret.exs}
|
||||
mv config/{generated_config.exs,prod.secret.exs}
|
||||
```
|
||||
|
||||
* The previous command creates also the file `config/setup_db.psql`, with which you can create the database:
|
||||
|
@ -225,4 +240,4 @@ sudo -Hu pleroma MIX_ENV=prod mix pleroma.user new <username> <your@emailaddress
|
|||
|
||||
## Questions
|
||||
|
||||
Questions about the installation or didn’t it work as it should be, ask in [#pleroma:libera.chat](https://matrix.to/#/#pleroma:libera.chat) via Matrix or **#pleroma** on **libera.chat** via IRC.
|
||||
Questions about the installation or didn’t it work as it should be, ask in [#pleroma:matrix.org](https://matrix.heldscal.la/#/room/#freenode_#pleroma:matrix.org) or IRC Channel **#pleroma** on **Freenode**.
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
# Installing on Arch Linux
|
||||
|
||||
{! backend/installation/otp_vs_from_source_source.include !}
|
||||
|
||||
## Installation
|
||||
|
||||
This guide will assume that you have administrative rights, either as root or a user with [sudo permissions](https://wiki.archlinux.org/index.php/Sudo). If you want to run this guide with root, ignore the `sudo` at the beginning of the lines, unless it calls a user like `sudo -Hu pleroma`; in this case, use `su <username> -s $SHELL -c 'command'` instead.
|
||||
|
@ -95,7 +92,7 @@ cd /opt/pleroma
|
|||
sudo -Hu pleroma mix deps.get
|
||||
```
|
||||
|
||||
* Generate the configuration: `sudo -Hu pleroma MIX_ENV=prod mix pleroma.instance gen`
|
||||
* Generate the configuration: `sudo -Hu pleroma mix pleroma.instance gen`
|
||||
* Answer with `yes` if it asks you to install `rebar3`.
|
||||
* This may take some time, because parts of pleroma get compiled first.
|
||||
* After that it will ask you a few questions about your instance and generates a configuration file in `config/generated_config.exs`.
|
||||
|
@ -103,7 +100,7 @@ sudo -Hu pleroma mix deps.get
|
|||
* Check the configuration and if all looks right, rename it, so Pleroma will load it (`prod.secret.exs` for productive instance, `dev.secret.exs` for development instances):
|
||||
|
||||
```shell
|
||||
sudo -Hu pleroma mv config/{generated_config.exs,prod.secret.exs}
|
||||
mv config/{generated_config.exs,prod.secret.exs}
|
||||
```
|
||||
|
||||
* The previous command creates also the file `config/setup_db.psql`, with which you can create the database:
|
||||
|
@ -218,4 +215,4 @@ sudo -Hu pleroma MIX_ENV=prod mix pleroma.user new <username> <your@emailaddress
|
|||
|
||||
## Questions
|
||||
|
||||
Questions about the installation or didn’t it work as it should be, ask in [#pleroma:libera.chat](https://matrix.to/#/#pleroma:libera.chat) via Matrix or **#pleroma** on **libera.chat** via IRC.
|
||||
Questions about the installation or didn’t it work as it should be, ask in [#pleroma:matrix.org](https://matrix.heldscal.la/#/room/#freenode_#pleroma:matrix.org) or IRC Channel **#pleroma** on **Freenode**.
|
||||
|
|
|
@ -1,12 +1,27 @@
|
|||
# Installing on Debian Based Distributions
|
||||
|
||||
{! backend/installation/otp_vs_from_source_source.include !}
|
||||
|
||||
## Installation
|
||||
|
||||
This guide will assume you are on Debian 11 (“bullseye”) or later. This guide should also work with Ubuntu 18.04 (“Bionic Beaver”) and later. It also assumes that you have administrative rights, either as root or a user with [sudo permissions](https://www.digitalocean.com/community/tutorials/how-to-add-delete-and-grant-sudo-privileges-to-users-on-a-debian-vps). If you want to run this guide with root, ignore the `sudo` at the beginning of the lines, unless it calls a user like `sudo -Hu pleroma`; in this case, use `su <username> -s $SHELL -c 'command'` instead.
|
||||
This guide will assume you are on Debian Stretch. This guide should also work with Ubuntu 16.04 and 18.04. It also assumes that you have administrative rights, either as root or a user with [sudo permissions](https://www.digitalocean.com/community/tutorials/how-to-add-delete-and-grant-sudo-privileges-to-users-on-a-debian-vps). If you want to run this guide with root, ignore the `sudo` at the beginning of the lines, unless it calls a user like `sudo -Hu pleroma`; in this case, use `su <username> -s $SHELL -c 'command'` instead.
|
||||
|
||||
{! backend/installation/generic_dependencies.include !}
|
||||
### Required packages
|
||||
|
||||
* `postgresql` (9.6+, Ubuntu 16.04 comes with 9.5, you can get a newer version from [here](https://www.postgresql.org/download/linux/ubuntu/))
|
||||
* `postgresql-contrib` (9.6+, same situtation as above)
|
||||
* `elixir` (1.8+, Follow the guide to install from the Erlang Solutions repo or use [asdf](https://github.com/asdf-vm/asdf) as the pleroma user)
|
||||
* `erlang-dev`
|
||||
* `erlang-nox`
|
||||
* `libmagic-dev`
|
||||
* `git`
|
||||
* `build-essential`
|
||||
* `cmake`
|
||||
|
||||
#### Optional packages used in this guide
|
||||
|
||||
* `nginx` (preferred, example configs for other reverse proxies can be found in the repo)
|
||||
* `certbot` (or any other ACME client for Let’s Encrypt certificates)
|
||||
* `ImageMagick`
|
||||
* `ffmpeg`
|
||||
* `exiftool`
|
||||
|
||||
### Prepare the system
|
||||
|
||||
|
@ -25,14 +40,20 @@ sudo apt install git build-essential postgresql postgresql-contrib cmake libmagi
|
|||
|
||||
### Install Elixir and Erlang
|
||||
|
||||
* Install Elixir and Erlang (you might need to use backports or [asdf](https://github.com/asdf-vm/asdf) on old systems):
|
||||
* Download and add the Erlang repository:
|
||||
|
||||
```shell
|
||||
wget -P /tmp/ https://packages.erlang-solutions.com/erlang-solutions_2.0_all.deb
|
||||
sudo dpkg -i /tmp/erlang-solutions_2.0_all.deb
|
||||
```
|
||||
|
||||
* Install Elixir and Erlang:
|
||||
|
||||
```shell
|
||||
sudo apt update
|
||||
sudo apt install elixir erlang-dev erlang-nox
|
||||
```
|
||||
|
||||
|
||||
### Optional packages: [`docs/installation/optional/media_graphics_packages.md`](../installation/optional/media_graphics_packages.md)
|
||||
|
||||
```shell
|
||||
|
@ -69,7 +90,7 @@ cd /opt/pleroma
|
|||
sudo -Hu pleroma mix deps.get
|
||||
```
|
||||
|
||||
* Generate the configuration: `sudo -Hu pleroma MIX_ENV=prod mix pleroma.instance gen`
|
||||
* Generate the configuration: `sudo -Hu pleroma mix pleroma.instance gen`
|
||||
* Answer with `yes` if it asks you to install `rebar3`.
|
||||
* This may take some time, because parts of pleroma get compiled first.
|
||||
* After that it will ask you a few questions about your instance and generates a configuration file in `config/generated_config.exs`.
|
||||
|
@ -77,7 +98,7 @@ sudo -Hu pleroma mix deps.get
|
|||
* Check the configuration and if all looks right, rename it, so Pleroma will load it (`prod.secret.exs` for productive instance, `dev.secret.exs` for development instances):
|
||||
|
||||
```shell
|
||||
sudo -Hu pleroma mv config/{generated_config.exs,prod.secret.exs}
|
||||
mv config/{generated_config.exs,prod.secret.exs}
|
||||
```
|
||||
|
||||
|
||||
|
@ -181,4 +202,4 @@ sudo -Hu pleroma MIX_ENV=prod mix pleroma.user new <username> <your@emailaddress
|
|||
|
||||
## Questions
|
||||
|
||||
Questions about the installation or didn’t it work as it should be, ask in [#pleroma:libera.chat](https://matrix.to/#/#pleroma:libera.chat) via Matrix or **#pleroma** on **libera.chat** via IRC.
|
||||
Questions about the installation or didn’t it work as it should be, ask in [#pleroma:matrix.org](https://matrix.heldscal.la/#/room/#freenode_#pleroma:matrix.org) or IRC Channel **#pleroma** on **Freenode**.
|
||||
|
|
|
@ -89,7 +89,7 @@ sudo -Hu pleroma mix deps.get
|
|||
|
||||
* コンフィギュレーションを生成します。
|
||||
```
|
||||
sudo -Hu pleroma MIX_ENV=prod mix pleroma.instance gen
|
||||
sudo -Hu pleroma mix pleroma.instance gen
|
||||
```
|
||||
* rebar3をインストールしてもよいか聞かれたら、yesを入力してください。
|
||||
* このときにpleromaの一部がコンパイルされるため、この処理には時間がかかります。
|
||||
|
@ -98,12 +98,12 @@ sudo -Hu pleroma MIX_ENV=prod mix pleroma.instance gen
|
|||
|
||||
* コンフィギュレーションを確認して、もし問題なければ、ファイル名を変更してください。
|
||||
```
|
||||
sudo -Hu pleroma mv config/{generated_config.exs,prod.secret.exs}
|
||||
mv config/{generated_config.exs,prod.secret.exs}
|
||||
```
|
||||
|
||||
* 先程のコマンドで、すでに `config/setup_db.psql` というファイルが作られています。このファイルをもとに、データベースを作成します。
|
||||
```
|
||||
sudo -Hu pleroma MIX_ENV=prod mix pleroma.instance gen
|
||||
sudo -Hu pleroma mix pleroma.instance gen
|
||||
```
|
||||
|
||||
* そして、データベースのマイグレーションを実行します。
|
||||
|
@ -191,5 +191,5 @@ sudo -Hu pleroma MIX_ENV=prod mix pleroma.user new <username> <your@emailaddress
|
|||
|
||||
インストールについて質問がある、もしくは、うまくいかないときは、以下のところで質問できます。
|
||||
|
||||
* [#pleroma:libera.chat](https://matrix.to/#/#pleroma:libera.chat)
|
||||
* **libera.chat** の **#pleroma** IRCチャンネル
|
||||
* [#pleroma:matrix.org](https://matrix.heldscal.la/#/room/#freenode_#pleroma:matrix.org)
|
||||
* **Freenode** の **#pleroma** IRCチャンネル
|
||||
|
|
|
@ -2,9 +2,7 @@
|
|||
|
||||
This document was written for FreeBSD 12.1, but should be work on future releases.
|
||||
|
||||
{! backend/installation/generic_dependencies.include !}
|
||||
|
||||
## Installing software used in this guide
|
||||
## Required software
|
||||
|
||||
This assumes the target system has `pkg(8)`.
|
||||
|
||||
|
@ -56,7 +54,7 @@ Configure Pleroma. Note that you need a domain name at this point:
|
|||
```
|
||||
$ cd /home/pleroma/pleroma
|
||||
$ mix deps.get # Enter "y" when asked to install Hex
|
||||
$ MIX_ENV=prod mix pleroma.instance gen # You will be asked a few questions here.
|
||||
$ mix pleroma.instance gen # You will be asked a few questions here.
|
||||
$ cp config/generated_config.exs config/prod.secret.exs
|
||||
```
|
||||
|
||||
|
@ -215,4 +213,4 @@ incorrect timestamps. You should have ntpd running.
|
|||
|
||||
## Questions
|
||||
|
||||
Questions about the installation or didn’t it work as it should be, ask in [#pleroma:libera.chat](https://matrix.to/#/#pleroma:libera.chat) via Matrix or **#pleroma** on **libera.chat** via IRC.
|
||||
Questions about the installation or didn’t it work as it should be, ask in [#pleroma:matrix.org](https://matrix.heldscal.la/#/room/#freenode_#pleroma:matrix.org) or IRC Channel **#pleroma** on **Freenode**.
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
## Required dependencies
|
||||
|
||||
* PostgreSQL 9.6+
|
||||
* Elixir 1.10+
|
||||
* Erlang OTP 22.2+
|
||||
* git
|
||||
* file / libmagic
|
||||
* gcc (clang might also work)
|
||||
* GNU make
|
||||
* CMake
|
||||
|
||||
## Optional dependencies
|
||||
|
||||
* ImageMagick
|
||||
* FFmpeg
|
||||
* exiftool
|
|
@ -1,12 +1,11 @@
|
|||
# Installing on Gentoo GNU/Linux
|
||||
|
||||
{! backend/installation/otp_vs_from_source_source.include !}
|
||||
|
||||
## Installation
|
||||
|
||||
This guide will assume that you have administrative rights, either as root or a user with [sudo permissions](https://wiki.gentoo.org/wiki/Sudo). Lines that begin with `#` indicate that they should be run as the superuser. Lines using `$` should be run as the indicated user, e.g. `pleroma$` should be run as the `pleroma` user.
|
||||
|
||||
{! backend/installation/generic_dependencies.include !}
|
||||
### Configuring your hostname (optional)
|
||||
|
||||
If you would like your prompt to permanently include your host/domain, change `/etc/conf.d/hostname` to your hostname. You can reboot or use the `hostname` command to make immediate changes.
|
||||
|
||||
### Your make.conf, package.use, and USE flags
|
||||
|
||||
|
@ -136,7 +135,7 @@ pleroma$ mix deps.get
|
|||
* Generate the configuration:
|
||||
|
||||
```shell
|
||||
pleroma$ MIX_ENV=prod mix pleroma.instance gen
|
||||
pleroma$ mix pleroma.instance gen
|
||||
```
|
||||
|
||||
* Answer with `yes` if it asks you to install `rebar3`.
|
||||
|
@ -299,4 +298,4 @@ If you opted to allow sudo for the `pleroma` user but would like to remove the a
|
|||
|
||||
## Questions
|
||||
|
||||
Questions about the installation or didn’t it work as it should be, ask in [#pleroma:libera.chat](https://matrix.to/#/#pleroma:libera.chat) via Matrix or **#pleroma** on **libera.chat** via IRC.
|
||||
Questions about the installation or didn’t it work as it should be, ask in [#pleroma:matrix.org](https://matrix.heldscal.la/#/room/#freenode_#pleroma:matrix.org) or IRC Channel **#pleroma** on **Freenode**.
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
# Switching a from-source install to OTP releases
|
||||
|
||||
{! backend/installation/otp_vs_from_source.include !}
|
||||
|
||||
In this guide we cover how you can migrate from a from source installation to one using OTP releases.
|
||||
## What are OTP releases?
|
||||
OTP releases are as close as you can get to binary releases with Erlang/Elixir. The release is self-contained, and provides everything needed to boot it, it is easily administered via the provided shell script to open up a remote console, start/stop/restart the release, start in the background, send remote commands, and more.
|
||||
|
||||
## Pre-requisites
|
||||
You will be running commands as root. If you aren't root already, please elevate your privileges by executing `sudo su`/`su`.
|
||||
You will be running commands as root. If you aren't root already, please elevate your priviledges by executing `sudo su`/`su`.
|
||||
|
||||
The system needs to have `curl` and `unzip` installed for downloading and unpacking release builds.
|
||||
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
# Installing on NetBSD
|
||||
|
||||
{! backend/installation/generic_dependencies.include !}
|
||||
|
||||
## Installing software used in this guide
|
||||
## Required software
|
||||
|
||||
pkgin should have been installed by the NetBSD installer if you selected
|
||||
the right options. If it isn't installed, install it using pkg_add.
|
||||
|
@ -73,7 +71,7 @@ Configure Pleroma. Note that you need a domain name at this point:
|
|||
```
|
||||
$ cd /home/pleroma/pleroma
|
||||
$ mix deps.get
|
||||
$ MIX_ENV=prod mix pleroma.instance gen # You will be asked a few questions here.
|
||||
$ mix pleroma.instance gen # You will be asked a few questions here.
|
||||
```
|
||||
|
||||
Since Postgres is configured, we can now initialize the database. There should
|
||||
|
@ -195,6 +193,8 @@ Run `# /etc/rc.d/pleroma start` to start Pleroma.
|
|||
|
||||
Restart nginx with `# /etc/rc.d/nginx restart` and you should be up and running.
|
||||
|
||||
If you need further help, contact niaa on freenode.
|
||||
|
||||
Make sure your time is in sync, or other instances will receive your posts with
|
||||
incorrect timestamps. You should have ntpd running.
|
||||
|
||||
|
@ -208,4 +208,4 @@ incorrect timestamps. You should have ntpd running.
|
|||
|
||||
## Questions
|
||||
|
||||
Questions about the installation or didn’t it work as it should be, ask in [#pleroma:libera.chat](https://matrix.to/#/#pleroma:libera.chat) via Matrix or **#pleroma** on **libera.chat** via IRC.
|
||||
Questions about the installation or didn’t it work as it should be, ask in [#pleroma:matrix.org](https://matrix.heldscal.la/#/room/#freenode_#pleroma:matrix.org) or IRC Channel **#pleroma** on **Freenode**.
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
# Installing on NixOS
|
||||
|
||||
NixOS contains a source build package of pleroma and a NixOS module to install it.
|
||||
For installation add this to your configuration.nix and add a config.exs next to it:
|
||||
```nix
|
||||
services.pleroma = {
|
||||
enable = true;
|
||||
configs = [ (lib.fileContents ./config.exs) ];
|
||||
secretConfigFile = "/var/lib/pleroma/secret.exs";
|
||||
};
|
||||
```
|
||||
|
||||
## Questions
|
||||
The nix community uses matrix for communication: [#nix:nixos.org](https://matrix.to/#/#nix:nixos.org)
|
||||
|
|
@ -4,11 +4,19 @@ This guide describes the installation and configuration of pleroma (and the requ
|
|||
|
||||
For any additional information regarding commands and configuration files mentioned here, check the man pages [online](https://man.openbsd.org/) or directly on your server with the man command.
|
||||
|
||||
{! backend/installation/generic_dependencies.include !}
|
||||
|
||||
### Preparing the system
|
||||
#### Required software
|
||||
|
||||
The following packages need to be installed:
|
||||
|
||||
* elixir
|
||||
* gmake
|
||||
* git
|
||||
* postgresql-server
|
||||
* postgresql-contrib
|
||||
* cmake
|
||||
* ffmpeg
|
||||
* ImageMagick
|
||||
|
||||
To install them, run the following command (with doas or as root):
|
||||
|
||||
```
|
||||
|
@ -231,7 +239,7 @@ Enter a shell as \_pleroma (as root `su _pleroma -`) and enter pleroma's install
|
|||
Then follow the main installation guide:
|
||||
|
||||
* run `mix deps.get`
|
||||
* run `MIX_ENV=prod mix pleroma.instance gen` and enter your instance's information when asked
|
||||
* run `mix pleroma.instance gen` and enter your instance's information when asked
|
||||
* copy config/generated\_config.exs to config/prod.secret.exs. The default values should be sufficient but you should edit it and check that everything seems OK.
|
||||
* exit your current shell back to a root one and run `psql -U postgres -f /home/_pleroma/pleroma/config/setup_db.psql` to setup the database.
|
||||
* return to a \_pleroma shell into pleroma's installation directory (`su _pleroma -;cd ~/pleroma`) and run `MIX_ENV=prod mix ecto.migrate`
|
||||
|
@ -256,4 +264,4 @@ LC_ALL=en_US.UTF-8 MIX_ENV=prod mix pleroma.user new <username> <your@emailaddre
|
|||
|
||||
## Questions
|
||||
|
||||
Questions about the installation or didn’t it work as it should be, ask in [#pleroma:libera.chat](https://matrix.to/#/#pleroma:libera.chat) via Matrix or **#pleroma** on **libera.chat** via IRC.
|
||||
Questions about the installation or didn’t it work as it should be, ask in [#pleroma:matrix.org](https://matrix.heldscal.la/#/room/#freenode_#pleroma:matrix.org) or IRC Channel **#pleroma** on **Freenode**.
|
||||
|
|
|
@ -10,8 +10,8 @@ suositeltavaa tehdä komennon `doas` avulla, katso `doas (1)` ja `doas.conf (5)`
|
|||
Tästä eteenpäin oletuksena on, että domain "esimerkki.com" osoittaa
|
||||
serverin IP-osoitteeseen.
|
||||
|
||||
Jos asennuksen kanssa on ongelmia, IRC-kanava #pleroma Libera.chat tai
|
||||
Matrix-kanava #pleroma:libera.chat ovat hyviä paikkoja löytää apua
|
||||
Jos asennuksen kanssa on ongelmia, IRC-kanava #pleroma Freenodessa tai
|
||||
Matrix-kanava #freenode_#pleroma:matrix.org ovat hyviä paikkoja löytää apua
|
||||
(englanniksi), `/msg eal kukkuu` jos haluat välttämättä puhua härmää.
|
||||
|
||||
Asenna tarvittava ohjelmisto:
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
# Optional software packages needed for specific functionality
|
||||
|
||||
For specific Pleroma functionality (which is disabled by default) some or all of the below packages are required:
|
||||
* `ImageMagic`
|
||||
* `ffmpeg`
|
||||
* `exiftool`
|
||||
* `ImageMagic`
|
||||
* `ffmpeg`
|
||||
* `exiftool`
|
||||
|
||||
Please refer to documentation in `docs/installation` on how to install them on specific OS.
|
||||
|
||||
|
@ -14,20 +14,19 @@ Note: the packages are not required with the current default settings of Pleroma
|
|||
`ImageMagick` is a set of tools to create, edit, compose, or convert bitmap images.
|
||||
|
||||
It is required for the following Pleroma features:
|
||||
* `Pleroma.Upload.Filters.Mogrify`, `Pleroma.Upload.Filters.Mogrifun` upload filters (related config: `Plaroma.Upload/filters` in `config/config.exs`)
|
||||
* Media preview proxy for still images (related config: `media_preview_proxy/enabled` in `config/config.exs`)
|
||||
* `Pleroma.Upload.Filters.Mogrify`, `Pleroma.Upload.Filters.Mogrifun` upload filters (related config: `Plaroma.Upload/filters` in `config/config.exs`)
|
||||
* Media preview proxy for still images (related config: `media_preview_proxy/enabled` in `config/config.exs`)
|
||||
|
||||
## `ffmpeg`
|
||||
|
||||
`ffmpeg` is software to record, convert and stream audio and video.
|
||||
|
||||
It is required for the following Pleroma features:
|
||||
* Media preview proxy for videos (related config: `media_preview_proxy/enabled` in `config/config.exs`)
|
||||
* Media preview proxy for videos (related config: `media_preview_proxy/enabled` in `config/config.exs`)
|
||||
|
||||
## `exiftool`
|
||||
|
||||
`exiftool` is media files metadata reader/writer.
|
||||
|
||||
It is required for the following Pleroma features:
|
||||
* `Pleroma.Upload.Filters.Exiftool.StripLocation` upload filter (related config: `Plaroma.Upload/filters` in `config/config.exs`)
|
||||
* `Pleroma.Upload.Filters.Exiftool.ReadDescription` upload filter (related config: `Plaroma.Upload/filters` in `config/config.exs`)
|
||||
* `Pleroma.Upload.Filters.Exiftool` upload filter (related config: `Plaroma.Upload/filters` in `config/config.exs`)
|
||||
|
|
|
@ -1,14 +1,10 @@
|
|||
# Installing on Linux using OTP releases
|
||||
|
||||
{! backend/installation/otp_vs_from_source.include !}
|
||||
|
||||
This guide covers a installation using an OTP release. To install Pleroma from source, please check out the corresponding guide for your distro.
|
||||
|
||||
## Pre-requisites
|
||||
* A machine running Linux with GNU (e.g. Debian, Ubuntu) or musl (e.g. Alpine) libc and `x86_64`, `aarch64` or `armv7l` CPU, you have root access to. If you are not sure if it's compatible see [Detecting flavour section](#detecting-flavour) below
|
||||
* A (sub)domain pointed to the machine
|
||||
|
||||
You will be running commands as root. If you aren't root already, please elevate your privileges by executing `sudo su`/`su`.
|
||||
You will be running commands as root. If you aren't root already, please elevate your priviledges by executing `sudo su`/`su`.
|
||||
|
||||
While in theory OTP releases are possbile to install on any compatible machine, for the sake of simplicity this guide focuses only on Debian/Ubuntu and Alpine.
|
||||
|
||||
|
@ -35,7 +31,7 @@ Other than things bundled in the OTP release Pleroma depends on:
|
|||
|
||||
=== "Alpine"
|
||||
```
|
||||
awk 'NR==2' /etc/apk/repositories | sed 's/main/community/' | tee -a /etc/apk/repositories
|
||||
echo "http://nl.alpinelinux.org/alpine/latest-stable/community" >> /etc/apk/repositories
|
||||
apk update
|
||||
apk add curl unzip ncurses postgresql postgresql-contrib nginx certbot file-dev
|
||||
```
|
||||
|
@ -54,6 +50,7 @@ Per [`docs/installation/optional/media_graphics_packages.md`](optional/media_gra
|
|||
|
||||
=== "Alpine"
|
||||
```
|
||||
echo "http://nl.alpinelinux.org/alpine/latest-stable/community" >> /etc/apk/repositories
|
||||
apk update
|
||||
apk add imagemagick ffmpeg exiftool
|
||||
```
|
||||
|
@ -92,8 +89,6 @@ RUM indexes are an alternative indexing scheme that is not included in PostgreSQ
|
|||
#### (Optional) Performance configuration
|
||||
It is encouraged to check [Optimizing your PostgreSQL performance](../configuration/postgresql.md) document, for tips on PostgreSQL tuning.
|
||||
|
||||
Restart PostgreSQL to apply configuration changes:
|
||||
|
||||
=== "Alpine"
|
||||
```
|
||||
rc-service postgresql restart
|
||||
|
@ -104,6 +99,17 @@ Restart PostgreSQL to apply configuration changes:
|
|||
systemctl restart postgresql
|
||||
```
|
||||
|
||||
If you are using PostgreSQL 12 or higher, add this to your Ecto database configuration
|
||||
|
||||
```elixir
|
||||
#
|
||||
config :pleroma, Pleroma.Repo,
|
||||
prepare: :named,
|
||||
parameters: [
|
||||
plan_cache_mode: "force_custom_plan"
|
||||
]
|
||||
```
|
||||
|
||||
### Installing Pleroma
|
||||
```sh
|
||||
# Create a Pleroma user
|
||||
|
@ -153,7 +159,7 @@ su pleroma -s $SHELL -lc "./bin/pleroma_ctl migrate"
|
|||
# su pleroma -s $SHELL -lc "./bin/pleroma_ctl migrate --migrations-path priv/repo/optional_migrations/rum_indexing/"
|
||||
|
||||
# Start the instance to verify that everything is working as expected
|
||||
su pleroma -s $SHELL -lc "./bin/pleroma daemon"
|
||||
su pleroma -s $SHELL -lc "export $(cat /opt/pleroma/config/pleroma.env); ./bin/pleroma daemon"
|
||||
|
||||
# Wait for about 20 seconds and query the instance endpoint, if it shows your uri, name and email correctly, you are configured correctly
|
||||
sleep 20 && curl http://localhost:4000/api/v1/instance
|
||||
|
@ -235,7 +241,7 @@ At this point if you open your (sub)domain in a browser you should see a 502 err
|
|||
|
||||
If everything worked, you should see Pleroma-FE when visiting your domain. If that didn't happen, try reviewing the installation steps, starting Pleroma in the foreground and seeing if there are any errrors.
|
||||
|
||||
Questions about the installation or didn’t it work as it should be, ask in [#pleroma:libera.chat](https://matrix.to/#/#pleroma:libera.chat) via Matrix or **#pleroma** on **libera.chat** via IRC, you can also [file an issue on our Gitlab](https://git.pleroma.social/pleroma/pleroma-support/issues/new).
|
||||
Still doesn't work? Feel free to contact us on [#pleroma on freenode](https://irc.pleroma.social) or via matrix at <https://matrix.heldscal.la/#/room/#freenode_#pleroma:matrix.org>, you can also [file an issue on our Gitlab](https://git.pleroma.social/pleroma/pleroma-support/issues/new)
|
||||
|
||||
## Post installation
|
||||
|
||||
|
@ -293,7 +299,7 @@ nginx -t
|
|||
|
||||
## Create your first user and set as admin
|
||||
```sh
|
||||
cd /opt/pleroma
|
||||
cd /opt/pleroma/bin
|
||||
su pleroma -s $SHELL -lc "./bin/pleroma_ctl user new joeuser joeuser@sld.tld --admin"
|
||||
```
|
||||
This will create an account withe the username of 'joeuser' with the email address of joeuser@sld.tld, and set that user's account as an admin. This will result in a link that you can paste into the browser, which logs you in and enables you to set the password.
|
||||
|
@ -304,4 +310,4 @@ This will create an account withe the username of 'joeuser' with the email addre
|
|||
|
||||
## Questions
|
||||
|
||||
Questions about the installation or didn’t it work as it should be, ask in [#pleroma:libera.chat](https://matrix.to/#/#pleroma:libera.chat) via Matrix or **#pleroma** on **libera.chat** via IRC, you can also [file an issue on our Gitlab](https://git.pleroma.social/pleroma/pleroma-support/issues/new).
|
||||
Questions about the installation or didn’t it work as it should be, ask in [#pleroma:matrix.org](https://matrix.heldscal.la/#/room/#freenode_#pleroma:matrix.org) or IRC Channel **#pleroma** on **Freenode**.
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
## OTP releases vs from-source installations
|
||||
|
||||
There are two ways to install Pleroma. You can use OTP releases or do a from-source installation. OTP releases are as close as you can get to binary releases with Erlang/Elixir. The release is self-contained, and provides everything needed to boot it, it is easily administered via the provided shell script to open up a remote console, start/stop/restart the release, start in the background, send remote commands, and more. With from source installations you install Pleroma from source, meaning you have to install certain dependencies like Erlang+Elixir and compile Pleroma yourself.
|
|
@ -1,3 +0,0 @@
|
|||
{! backend/installation/otp_vs_from_source.include !}
|
||||
|
||||
This guide covers a from-source installation. To install using OTP releases, please check out [the OTP guide](./otp_en.md).
|
|
@ -1,9 +0,0 @@
|
|||
# Installing on Yunohost
|
||||
|
||||
[YunoHost](https://yunohost.org) is a server operating system aimed at self-hosting. The YunoHost community maintains a package of Pleroma which allows you to install Pleroma on YunoHost. You can install it via the normal way through the admin web interface, or through the CLI. More information can be found at [the repo of the package](https://github.com/YunoHost-Apps/pleroma_ynh).
|
||||
|
||||
## Questions
|
||||
|
||||
Questions and problems related to the YunoHost parts can be done through the [regular YunoHost channels](https://yunohost.org/en/help).
|
||||
|
||||
For questions about Pleroma, ask in [#pleroma:libera.chat](https://matrix.to/#/#pleroma:libera.chat) via Matrix or **#pleroma** on **libera.chat** via IRC.
|
|
@ -1,2 +1,2 @@
|
|||
elixir_version=1.10.4
|
||||
elixir_version=1.9.4
|
||||
erlang_version=22.3.4.1
|
||||
|
|
|
@ -1,36 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
# A simple shell script to delete a media from Apache's mod_disk_cache.
|
||||
# You will likely need to setup a sudo rule like the following:
|
||||
#
|
||||
# Cmnd_Alias HTCACHECLEAN = /usr/local/sbin/htcacheclean
|
||||
# pleroma ALL=HTCACHECLEAN, NOPASSWD: HTCACHECLEAN
|
||||
#
|
||||
# Please also ensure you have enabled:
|
||||
#
|
||||
# config :pleroma, Pleroma.Web.MediaProxy.Invalidation.Script, url_format: :htcacheclean
|
||||
#
|
||||
# which will correctly format the URLs passed to this script for the htcacheclean utility.
|
||||
#
|
||||
|
||||
SCRIPTNAME=${0##*/}
|
||||
|
||||
# mod_disk_cache directory
|
||||
CACHE_DIRECTORY="/tmp/pleroma-media-cache"
|
||||
|
||||
## Removes an item via the htcacheclean utility
|
||||
## $1 - the filename, can be a pattern .
|
||||
## $2 - the cache directory.
|
||||
purge_item() {
|
||||
sudo htcacheclean -v -p "${2}" "${1}"
|
||||
} # purge_item
|
||||
|
||||
purge() {
|
||||
for url in $@
|
||||
do
|
||||
echo "$SCRIPTNAME delete \`$url\` from cache ($CACHE_DIRECTORY)"
|
||||
purge_item "$url" $CACHE_DIRECTORY
|
||||
done
|
||||
}
|
||||
|
||||
purge $@
|
|
@ -5,13 +5,34 @@
|
|||
# 2. Copy this section into your Caddyfile and restart Caddy.
|
||||
|
||||
example.tld {
|
||||
log {
|
||||
output file /var/log/caddy/pleroma.log
|
||||
}
|
||||
log /var/log/caddy/pleroma_access.log
|
||||
errors /var/log/caddy/pleroma_error.log
|
||||
|
||||
encode gzip
|
||||
gzip
|
||||
|
||||
# this is explicitly IPv4 since Pleroma.Web.Endpoint binds on IPv4 only
|
||||
# and `localhost.` resolves to [::0] on some systems: see issue #930
|
||||
reverse_proxy 127.0.0.1:4000
|
||||
proxy / 127.0.0.1:4000 {
|
||||
websocket
|
||||
transparent
|
||||
}
|
||||
|
||||
tls {
|
||||
# Remove the rest of the lines in here, if you want to support older devices
|
||||
key_type p256
|
||||
ciphers ECDHE-ECDSA-WITH-CHACHA20-POLY1305 ECDHE-RSA-WITH-CHACHA20-POLY1305 ECDHE-ECDSA-AES256-GCM-SHA384 ECDHE-RSA-AES256-GCM-SHA384 ECDHE-ECDSA-AES128-GCM-SHA256 ECDHE-RSA-AES128-GCM-SHA256
|
||||
}
|
||||
|
||||
# If you do not want to use the mediaproxy function, remove these lines.
|
||||
# To use this directive, you need the http.cache plugin for Caddy.
|
||||
cache {
|
||||
match_path /media
|
||||
default_max_age 720m
|
||||
}
|
||||
|
||||
cache {
|
||||
match_path /proxy
|
||||
default_max_age 720m
|
||||
}
|
||||
# Stop removing lines here.
|
||||
}
|
||||
|
|
|
@ -0,0 +1,48 @@
|
|||
#!/bin/sh
|
||||
# Pleroma: A lightweight social networking server
|
||||
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
project_id="74"
|
||||
project_branch="rebase/glitch-soc"
|
||||
static_dir="instance/static"
|
||||
# For bundling:
|
||||
# project_branch="pleroma"
|
||||
# static_dir="priv/static"
|
||||
|
||||
if [ ! -d "${static_dir}" ]
|
||||
then
|
||||
echo "Error: ${static_dir} directory is missing, are you sure you are running this script at the root of pleroma’s repository?"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
last_modified="$(curl --fail -s -I 'https://git.pleroma.social/api/v4/projects/'${project_id}'/jobs/artifacts/'${project_branch}'/download?job=build' | grep '^Last-Modified:' | cut -d: -f2-)"
|
||||
|
||||
echo "branch:${project_branch}"
|
||||
echo "Last-Modified:${last_modified}"
|
||||
|
||||
artifact="mastofe.zip"
|
||||
|
||||
if [ "${last_modified}x" = "x" ]
|
||||
then
|
||||
echo "ERROR: Couldn't get the modification date of the latest build archive, maybe it expired, exiting..."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -e mastofe.timestamp ] && [ "$(cat mastofe.timestamp)" = "${last_modified}" ]
|
||||
then
|
||||
echo "MastoFE is up-to-date, exiting..."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
curl --fail -c - "https://git.pleroma.social/api/v4/projects/${project_id}/jobs/artifacts/${project_branch}/download?job=build" -o "${artifact}" || exit
|
||||
|
||||
# TODO: Update the emoji as well
|
||||
rm -fr "${static_dir}/sw.js" "${static_dir}/packs" || exit
|
||||
unzip -q "${artifact}" || exit
|
||||
|
||||
cp public/assets/sw.js "${static_dir}/sw.js" || exit
|
||||
cp -r public/packs "${static_dir}/packs" || exit
|
||||
|
||||
echo "${last_modified}" > mastofe.timestamp
|
||||
rm -fr public
|
||||
rm -i "${artifact}"
|
|
@ -1,84 +1,73 @@
|
|||
# Sample Apache config for Pleroma
|
||||
# default Apache site config for Pleroma
|
||||
#
|
||||
# needed modules: define headers proxy proxy_http proxy_wstunnel rewrite ssl
|
||||
# optional modules: cache cache_disk
|
||||
#
|
||||
# Simple installation instructions:
|
||||
# 1. Install your TLS certificate. We recommend using Let's Encrypt via Certbot
|
||||
# 2. Replace 'example.tld' with your instance's domain.
|
||||
# 3. This assumes a Debian-style Apache config. Copy this file to
|
||||
# /etc/apache2/sites-available/ and then activate the site by running
|
||||
# 'a2ensite pleroma-apache.conf', then restart Apache.
|
||||
# 1. Install your TLS certificate, possibly using Let's Encrypt.
|
||||
# 2. Replace 'example.tld' with your instance's domain wherever it appears.
|
||||
# 3. This assumes a Debian style Apache config. Copy this file to
|
||||
# /etc/apache2/sites-available/ and then add a symlink to it in
|
||||
# /etc/apache2/sites-enabled/ by running 'a2ensite pleroma-apache.conf', then restart Apache.
|
||||
#
|
||||
# Optional: enable disk-based caching for the media proxy
|
||||
# For details, see https://git.pleroma.social/pleroma/pleroma/wikis/How%20to%20activate%20mediaproxy
|
||||
#
|
||||
# 1. Create a directory as shown below for the CacheRoot and make sure
|
||||
# 1. Create the directory listed below as the CacheRoot, and make sure
|
||||
# the Apache user can write to it.
|
||||
# 2. Configure Apache's htcacheclean to clean the directory periodically.
|
||||
# Your OS may provide a service you can enable to do this automatically.
|
||||
# 3. Run 'a2enmod cache cache_disk' and restart Apache.
|
||||
|
||||
Define servername example.tld
|
||||
|
||||
<IfModule !proxy_module>
|
||||
LoadModule proxy_module libexec/apache24/mod_proxy.so
|
||||
</IfModule>
|
||||
<IfModule !proxy_http_module>
|
||||
LoadModule proxy_http_module libexec/apache24/mod_proxy_http.so
|
||||
</IfModule>
|
||||
<IfModule !proxy_wstunnel_module>
|
||||
LoadModule proxy_wstunnel_module libexec/apache24/mod_proxy_wstunnel.so
|
||||
</IfModule>
|
||||
<IfModule !rewrite_module>
|
||||
LoadModule rewrite_module libexec/apache24/mod_rewrite.so
|
||||
</IfModule>
|
||||
<IfModule !ssl_module>
|
||||
LoadModule ssl_module libexec/apache24/mod_ssl.so
|
||||
</IfModule>
|
||||
<IfModule !cache_module>
|
||||
LoadModule cache_module libexec/apache24/mod_cache.so
|
||||
</IfModule>
|
||||
<IfModule !cache_disk_module>
|
||||
LoadModule cache_disk_module libexec/apache24/mod_cache_disk.so
|
||||
</IfModule>
|
||||
|
||||
ServerName ${servername}
|
||||
ServerTokens Prod
|
||||
|
||||
# If you want Pleroma-specific logs
|
||||
#ErrorLog /var/log/httpd-pleroma-error.log
|
||||
#CustomLog /var/log/httpd-pleroma-access.log combined
|
||||
ErrorLog ${APACHE_LOG_DIR}/error.log
|
||||
CustomLog ${APACHE_LOG_DIR}/access.log combined
|
||||
|
||||
<VirtualHost *:80>
|
||||
RewriteEngine on
|
||||
RewriteCond %{SERVER_NAME} =${servername}
|
||||
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
|
||||
Redirect permanent / https://${servername}
|
||||
</VirtualHost>
|
||||
|
||||
<VirtualHost *:443>
|
||||
SSLEngine on
|
||||
SSLCertificateFile /etc/letsencrypt/live/${servername}/fullchain.pem
|
||||
SSLCertificateKeyFile /etc/letsencrypt/live/${servername}/privkey.pem
|
||||
# Make sure you have the certbot-apache module installed
|
||||
Include /etc/letsencrypt/options-ssl-apache.conf
|
||||
|
||||
# Uncomment the following to enable MediaProxy caching on disk
|
||||
#CacheRoot /tmp/pleroma-media-cache/
|
||||
#CacheDirLevels 1
|
||||
#CacheDirLength 2
|
||||
#CacheEnable disk /proxy
|
||||
#CacheLock on
|
||||
#CacheHeader on
|
||||
#CacheDetailHeader on
|
||||
## 16MB max filesize for caching, configure as desired
|
||||
#CacheMaxFileSize 16000000
|
||||
#CacheDefaultExpire 86400
|
||||
# Mozilla modern configuration, tweak to your needs
|
||||
SSLProtocol all -SSLv3 -TLSv1 -TLSv1.1
|
||||
SSLCipherSuite ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256
|
||||
SSLHonorCipherOrder on
|
||||
SSLCompression off
|
||||
SSLSessionTickets off
|
||||
|
||||
# uncomment the following to enable mediaproxy caching on disk
|
||||
# <IfModule mod_cache_disk.c>
|
||||
# CacheRoot /var/cache/apache2/mod_cache_disk
|
||||
# CacheDirLevels 1
|
||||
# CacheDirLength 2
|
||||
# CacheEnable disk /proxy
|
||||
# CacheLock on
|
||||
# </IfModule>
|
||||
|
||||
RewriteEngine On
|
||||
RewriteCond %{HTTP:Connection} Upgrade [NC]
|
||||
RewriteCond %{HTTP:Upgrade} websocket [NC]
|
||||
RewriteRule /(.*) ws://127.0.0.1:4000/$1 [P,L]
|
||||
RewriteRule /(.*) ws://localhost:4000/$1 [P,L]
|
||||
|
||||
#ProxyRequests must be off or you open your server to abuse as an open proxy
|
||||
ProxyRequests off
|
||||
# this is explicitly IPv4 since Pleroma.Web.Endpoint binds on IPv4 only
|
||||
# and `localhost.` resolves to [::0] on some systems: see issue #930
|
||||
ProxyPass / http://127.0.0.1:4000/
|
||||
ProxyPassReverse / http://127.0.0.1:4000/
|
||||
|
||||
RequestHeader set Host ${servername}
|
||||
ProxyPreserveHost On
|
||||
</VirtualHost>
|
||||
|
||||
# OCSP Stapling, only in httpd 2.3.3 and later
|
||||
SSLUseStapling on
|
||||
SSLStaplingResponderTimeout 5
|
||||
SSLStaplingReturnResponderErrors off
|
||||
SSLStaplingCache shmcb:/var/run/ocsp(128000)
|
||||
|
|
|
@ -466,7 +466,7 @@
|
|||
|
||||
%% == PostgreSQL ==
|
||||
%% {rdbms, global, default, [{workers, 10}],
|
||||
%% [{server, {pgsql, "server", "port", "database", "username", "password"}}]},
|
||||
%% [{server, {pgsql, "server", 5432, "database", "username", "password"}}]},
|
||||
|
||||
%% == ODBC (MSSQL) ==
|
||||
%% {rdbms, global, default, [{workers, 10}],
|
||||
|
|
|
@ -81,19 +81,6 @@ server {
|
|||
proxy_pass http://phoenix;
|
||||
}
|
||||
|
||||
# Uncomment this if you want notice compatibility routes for frontends like Soapbox.
|
||||
# location ~ ^/@[^/]+/([^/]+)$ {
|
||||
# proxy_pass http://phoenix/notice/$1;
|
||||
# }
|
||||
#
|
||||
# location ~ ^/@[^/]+/posts/([^/]+)$ {
|
||||
# proxy_pass http://phoenix/notice/$1;
|
||||
# }
|
||||
#
|
||||
# location ~ ^/[^/]+/status/([^/]+)$ {
|
||||
# proxy_pass http://phoenix/notice/$1;
|
||||
# }
|
||||
|
||||
location ~ ^/(media|proxy) {
|
||||
proxy_cache pleroma_media_cache;
|
||||
slice 1m;
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
# Recommended varnishncsa logging format: '%h %l %u %t "%m %{X-Forwarded-Proto}i://%{Host}i%U%q %H" %s %b "%{Referer}i" "%{User-agent}i"'
|
||||
# Please use Varnish 7.0+ for proper Range Requests / Chunked encoding support
|
||||
vcl 4.1;
|
||||
import std;
|
||||
|
||||
|
@ -23,6 +22,11 @@ sub vcl_recv {
|
|||
set req.http.X-Forwarded-Proto = "https";
|
||||
}
|
||||
|
||||
# CHUNKED SUPPORT
|
||||
if (req.http.Range ~ "bytes=") {
|
||||
set req.http.x-range = req.http.Range;
|
||||
}
|
||||
|
||||
# Pipe if WebSockets request is coming through
|
||||
if (req.http.upgrade ~ "(?i)websocket") {
|
||||
return (pipe);
|
||||
|
@ -31,9 +35,9 @@ sub vcl_recv {
|
|||
# Allow purging of the cache
|
||||
if (req.method == "PURGE") {
|
||||
if (!client.ip ~ purge) {
|
||||
return (synth(405,"Not allowed."));
|
||||
return(synth(405,"Not allowed."));
|
||||
}
|
||||
return (purge);
|
||||
return(purge);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -49,11 +53,10 @@ sub vcl_backend_response {
|
|||
return (retry);
|
||||
}
|
||||
|
||||
# Bypass cache for large files
|
||||
# 50000000 ~ 50MB
|
||||
if (std.integer(beresp.http.content-length, 0) > 50000000) {
|
||||
set beresp.uncacheable = true;
|
||||
return (deliver);
|
||||
# CHUNKED SUPPORT
|
||||
if (bereq.http.x-range ~ "bytes=" && beresp.status == 206) {
|
||||
set beresp.ttl = 10m;
|
||||
set beresp.http.CR = beresp.http.content-range;
|
||||
}
|
||||
|
||||
# Don't cache objects that require authentication
|
||||
|
@ -84,7 +87,7 @@ sub vcl_synth {
|
|||
if (resp.status == 750) {
|
||||
set resp.status = 301;
|
||||
set resp.http.Location = req.http.x-redir;
|
||||
return (deliver);
|
||||
return(deliver);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -96,12 +99,25 @@ sub vcl_pipe {
|
|||
}
|
||||
}
|
||||
|
||||
sub vcl_hash {
|
||||
# CHUNKED SUPPORT
|
||||
if (req.http.x-range ~ "bytes=") {
|
||||
hash_data(req.http.x-range);
|
||||
unset req.http.Range;
|
||||
}
|
||||
}
|
||||
|
||||
sub vcl_backend_fetch {
|
||||
# Be more lenient for slow servers on the fediverse
|
||||
if (bereq.url ~ "^/proxy/") {
|
||||
set bereq.first_byte_timeout = 300s;
|
||||
}
|
||||
|
||||
# CHUNKED SUPPORT
|
||||
if (bereq.http.x-range) {
|
||||
set bereq.http.Range = bereq.http.x-range;
|
||||
}
|
||||
|
||||
if (bereq.retries == 0) {
|
||||
# Clean up the X-Varnish-Backend-503 flag that is used internally
|
||||
# to mark broken backend responses that should be retried.
|
||||
|
@ -120,6 +136,14 @@ sub vcl_backend_fetch {
|
|||
}
|
||||
}
|
||||
|
||||
sub vcl_deliver {
|
||||
# CHUNKED SUPPORT
|
||||
if (resp.http.CR) {
|
||||
set resp.http.Content-Range = resp.http.CR;
|
||||
unset resp.http.CR;
|
||||
}
|
||||
}
|
||||
|
||||
sub vcl_backend_error {
|
||||
# Retry broken backend responses.
|
||||
set bereq.http.X-Varnish-Backend-503 = "1";
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Pleroma: A lightweight social networking server
|
||||
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
|
||||
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
defmodule Mix.Pleroma do
|
||||
|
@ -13,8 +13,7 @@ defmodule Mix.Pleroma do
|
|||
:flake_id,
|
||||
:swoosh,
|
||||
:timex,
|
||||
:fast_html,
|
||||
:oban
|
||||
:fast_html
|
||||
]
|
||||
@cachex_children ["object", "user", "scrubber", "web_resp"]
|
||||
@doc "Common functions to be reused in mix tasks"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Pleroma: A lightweight social networking server
|
||||
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
|
||||
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
defmodule Mix.Tasks.Pleroma.App do
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Pleroma: A lightweight social networking server
|
||||
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
|
||||
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
defmodule Mix.Tasks.Pleroma.Benchmark do
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Pleroma: A lightweight social networking server
|
||||
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
|
||||
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
defmodule Mix.Tasks.Pleroma.Config do
|
||||
|
@ -27,7 +27,7 @@ def run(["migrate_from_db" | options]) do
|
|||
|
||||
{opts, _} =
|
||||
OptionParser.parse!(options,
|
||||
strict: [env: :string, delete: :boolean, path: :string],
|
||||
strict: [env: :string, delete: :boolean],
|
||||
aliases: [d: :delete]
|
||||
)
|
||||
|
||||
|
@ -259,41 +259,18 @@ defp create(group, settings) do
|
|||
defp migrate_from_db(opts) do
|
||||
env = opts[:env] || Pleroma.Config.get(:env)
|
||||
|
||||
filename = "#{env}.exported_from_db.secret.exs"
|
||||
|
||||
config_path =
|
||||
cond do
|
||||
opts[:path] ->
|
||||
opts[:path]
|
||||
|
||||
Pleroma.Config.get(:release) ->
|
||||
:config_path
|
||||
|> Pleroma.Config.get()
|
||||
|> Path.dirname()
|
||||
|
||||
true ->
|
||||
"config"
|
||||
if Pleroma.Config.get(:release) do
|
||||
:config_path
|
||||
|> Pleroma.Config.get()
|
||||
|> Path.dirname()
|
||||
else
|
||||
"config"
|
||||
end
|
||||
|> Path.join(filename)
|
||||
|> Path.join("#{env}.exported_from_db.secret.exs")
|
||||
|
||||
with {:ok, file} <- File.open(config_path, [:write, :utf8]) do
|
||||
write_config(file, config_path, opts)
|
||||
shell_info("Database configuration settings have been exported to #{config_path}")
|
||||
else
|
||||
_ ->
|
||||
shell_error("Impossible to save settings to this directory #{Path.dirname(config_path)}")
|
||||
tmp_config_path = Path.join(System.tmp_dir!(), filename)
|
||||
file = File.open!(tmp_config_path)
|
||||
file = File.open!(config_path, [:write, :utf8])
|
||||
|
||||
shell_info(
|
||||
"Saving database configuration settings to #{tmp_config_path}. Copy it to the #{Path.dirname(config_path)} manually."
|
||||
)
|
||||
|
||||
write_config(file, tmp_config_path, opts)
|
||||
end
|
||||
end
|
||||
|
||||
defp write_config(file, path, opts) do
|
||||
IO.write(file, config_header())
|
||||
|
||||
ConfigDB
|
||||
|
@ -301,11 +278,20 @@ defp write_config(file, path, opts) do
|
|||
|> Enum.each(&write_and_delete(&1, file, opts[:delete]))
|
||||
|
||||
:ok = File.close(file)
|
||||
System.cmd("mix", ["format", path])
|
||||
System.cmd("mix", ["format", config_path])
|
||||
|
||||
shell_info(
|
||||
"Database configuration settings have been exported to config/#{env}.exported_from_db.secret.exs"
|
||||
)
|
||||
end
|
||||
|
||||
defp config_header, do: "import Config\r\n\r\n"
|
||||
defp read_file(config_file), do: Config.Reader.read_imports!(config_file)
|
||||
if Code.ensure_loaded?(Config.Reader) do
|
||||
defp config_header, do: "import Config\r\n\r\n"
|
||||
defp read_file(config_file), do: Config.Reader.read_imports!(config_file)
|
||||
else
|
||||
defp config_header, do: "use Mix.Config\r\n\r\n"
|
||||
defp read_file(config_file), do: Mix.Config.eval!(config_file)
|
||||
end
|
||||
|
||||
defp write_and_delete(config, file, delete?) do
|
||||
config
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Pleroma: A lightweight social networking server
|
||||
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
|
||||
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
defmodule Mix.Tasks.Pleroma.CountStatuses do
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Pleroma: A lightweight social networking server
|
||||
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
|
||||
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
defmodule Mix.Tasks.Pleroma.Database do
|
||||
|
@ -8,13 +8,10 @@ defmodule Mix.Tasks.Pleroma.Database do
|
|||
alias Pleroma.Object
|
||||
alias Pleroma.Repo
|
||||
alias Pleroma.User
|
||||
|
||||
require Logger
|
||||
require Pleroma.Constants
|
||||
|
||||
import Ecto.Query
|
||||
import Mix.Pleroma
|
||||
|
||||
use Mix.Task
|
||||
|
||||
@shortdoc "A collection of database related tasks"
|
||||
|
@ -96,15 +93,6 @@ def run(["prune_objects" | args]) do
|
|||
)
|
||||
|> Repo.delete_all(timeout: :infinity)
|
||||
|
||||
prune_hashtags_query = """
|
||||
DELETE FROM hashtags AS ht
|
||||
WHERE NOT EXISTS (
|
||||
SELECT 1 FROM hashtags_objects hto
|
||||
WHERE ht.id = hto.hashtag_id)
|
||||
"""
|
||||
|
||||
Repo.query(prune_hashtags_query)
|
||||
|
||||
if Keyword.get(options, :vacuum) do
|
||||
Maintenance.vacuum("full")
|
||||
end
|
||||
|
@ -154,8 +142,9 @@ def run(["ensure_expiration"]) do
|
|||
|> join(:inner, [a], o in Object,
|
||||
on:
|
||||
fragment(
|
||||
"(?->>'id') = associated_object_id((?))",
|
||||
"(?->>'id') = COALESCE((?)->'object'->> 'id', (?)->>'object')",
|
||||
o.data,
|
||||
a.data,
|
||||
a.data
|
||||
)
|
||||
)
|
||||
|
@ -178,83 +167,4 @@ def run(["ensure_expiration"]) do
|
|||
end)
|
||||
|> Stream.run()
|
||||
end
|
||||
|
||||
def run(["set_text_search_config", tsconfig]) do
|
||||
start_pleroma()
|
||||
%{rows: [[tsc]]} = Ecto.Adapters.SQL.query!(Pleroma.Repo, "SHOW default_text_search_config;")
|
||||
shell_info("Current default_text_search_config: #{tsc}")
|
||||
|
||||
%{rows: [[db]]} = Ecto.Adapters.SQL.query!(Pleroma.Repo, "SELECT current_database();")
|
||||
shell_info("Update default_text_search_config: #{tsconfig}")
|
||||
|
||||
%{messages: msg} =
|
||||
Ecto.Adapters.SQL.query!(
|
||||
Pleroma.Repo,
|
||||
"ALTER DATABASE #{db} SET default_text_search_config = '#{tsconfig}';"
|
||||
)
|
||||
|
||||
# non-exist config will not raise excpetion but only give >0 messages
|
||||
if length(msg) > 0 do
|
||||
shell_info("Error: #{inspect(msg, pretty: true)}")
|
||||
else
|
||||
rum_enabled = Pleroma.Config.get([:database, :rum_enabled])
|
||||
shell_info("Recreate index, RUM: #{rum_enabled}")
|
||||
|
||||
# Note SQL below needs to be kept up-to-date with latest GIN or RUM index definition in future
|
||||
if rum_enabled do
|
||||
Ecto.Adapters.SQL.query!(
|
||||
Pleroma.Repo,
|
||||
"CREATE OR REPLACE FUNCTION objects_fts_update() RETURNS trigger AS $$ BEGIN
|
||||
new.fts_content := to_tsvector(new.data->>'content');
|
||||
RETURN new;
|
||||
END
|
||||
$$ LANGUAGE plpgsql",
|
||||
[],
|
||||
timeout: :infinity
|
||||
)
|
||||
|
||||
shell_info("Refresh RUM index")
|
||||
Ecto.Adapters.SQL.query!(Pleroma.Repo, "UPDATE objects SET updated_at = NOW();")
|
||||
else
|
||||
Ecto.Adapters.SQL.query!(Pleroma.Repo, "DROP INDEX IF EXISTS objects_fts;")
|
||||
|
||||
Ecto.Adapters.SQL.query!(
|
||||
Pleroma.Repo,
|
||||
"CREATE INDEX CONCURRENTLY objects_fts ON objects USING gin(to_tsvector('#{tsconfig}', data->>'content')); ",
|
||||
[],
|
||||
timeout: :infinity
|
||||
)
|
||||
end
|
||||
|
||||
shell_info('Done.')
|
||||
end
|
||||
end
|
||||
|
||||
# Rolls back a specific migration (leaving subsequent migrations applied).
|
||||
# WARNING: imposes a risk of unrecoverable data loss — proceed at your own responsibility.
|
||||
# Based on https://stackoverflow.com/a/53825840
|
||||
def run(["rollback", version]) do
|
||||
prompt = "SEVERE WARNING: this operation may result in unrecoverable data loss. Continue?"
|
||||
|
||||
if shell_prompt(prompt, "n") in ~w(Yn Y y) do
|
||||
{_, result, _} =
|
||||
Ecto.Migrator.with_repo(Pleroma.Repo, fn repo ->
|
||||
version = String.to_integer(version)
|
||||
re = ~r/^#{version}_.*\.exs/
|
||||
path = Ecto.Migrator.migrations_path(repo)
|
||||
|
||||
with {_, "" <> file} <- {:find, Enum.find(File.ls!(path), &String.match?(&1, re))},
|
||||
{_, [{mod, _} | _]} <- {:compile, Code.compile_file(Path.join(path, file))},
|
||||
{_, :ok} <- {:rollback, Ecto.Migrator.down(repo, version, mod)} do
|
||||
{:ok, "Reversed migration: #{file}"}
|
||||
else
|
||||
{:find, _} -> {:error, "No migration found with version prefix: #{version}"}
|
||||
{:compile, e} -> {:error, "Problem compiling migration module: #{inspect(e)}"}
|
||||
{:rollback, e} -> {:error, "Problem reversing migration: #{inspect(e)}"}
|
||||
end
|
||||
end)
|
||||
|
||||
shell_info(inspect(result))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Pleroma: A lightweight social networking server
|
||||
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
|
||||
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
defmodule Mix.Tasks.Pleroma.Digest do
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Pleroma: A lightweight social networking server
|
||||
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
|
||||
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
defmodule Mix.Tasks.Pleroma.Docs do
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Pleroma: A lightweight social networking server
|
||||
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
|
||||
# SPDX-License-Identifier: AGPL-3.0-onl
|
||||
|
||||
defmodule Mix.Tasks.Pleroma.Ecto do
|
||||
@doc """
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Pleroma: A lightweight social networking server
|
||||
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
|
||||
# SPDX-License-Identifier: AGPL-3.0-onl
|
||||
|
||||
defmodule Mix.Tasks.Pleroma.Ecto.Migrate do
|
||||
use Mix.Task
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Pleroma: A lightweight social networking server
|
||||
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
|
||||
# SPDX-License-Identifier: AGPL-3.0-onl
|
||||
|
||||
defmodule Mix.Tasks.Pleroma.Ecto.Rollback do
|
||||
use Mix.Task
|
||||
|
@ -20,8 +20,7 @@ defmodule Mix.Tasks.Pleroma.Ecto.Rollback do
|
|||
start: :boolean,
|
||||
quiet: :boolean,
|
||||
log_sql: :boolean,
|
||||
migrations_path: :string,
|
||||
env: :string
|
||||
migrations_path: :string
|
||||
]
|
||||
|
||||
@moduledoc """
|
||||
|
@ -60,7 +59,7 @@ def run(args \\ []) do
|
|||
level = Logger.level()
|
||||
Logger.configure(level: :info)
|
||||
|
||||
if opts[:env] == "test" do
|
||||
if Pleroma.Config.get(:env) == :test do
|
||||
Logger.info("Rollback succesfully")
|
||||
else
|
||||
{:ok, _, _} =
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Pleroma: A lightweight social networking server
|
||||
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
|
||||
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
defmodule Mix.Tasks.Pleroma.Email do
|
||||
|
@ -33,12 +33,12 @@ def run(["resend_confirmation_emails"]) do
|
|||
|
||||
Pleroma.User.Query.build(%{
|
||||
local: true,
|
||||
is_active: true,
|
||||
is_confirmed: false,
|
||||
deactivated: false,
|
||||
confirmation_pending: true,
|
||||
invisible: false
|
||||
})
|
||||
|> Pleroma.Repo.chunk_stream(500)
|
||||
|> Stream.each(&Pleroma.User.maybe_send_confirmation_email(&1))
|
||||
|> Stream.each(&Pleroma.User.try_send_confirmation_email(&1))
|
||||
|> Stream.run()
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Pleroma: A lightweight social networking server
|
||||
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
|
||||
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
defmodule Mix.Tasks.Pleroma.Emoji do
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Pleroma: A lightweight social networking server
|
||||
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
|
||||
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
defmodule Mix.Tasks.Pleroma.Frontend do
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Pleroma: A lightweight social networking server
|
||||
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
|
||||
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
defmodule Mix.Tasks.Pleroma.Instance do
|
||||
|
@ -34,8 +34,7 @@ def run(["gen" | rest]) do
|
|||
static_dir: :string,
|
||||
listen_ip: :string,
|
||||
listen_port: :string,
|
||||
strip_uploads_location: :string,
|
||||
read_uploads_description: :string,
|
||||
strip_uploads: :string,
|
||||
anonymize_uploads: :string,
|
||||
dedupe_uploads: :string
|
||||
],
|
||||
|
@ -162,7 +161,7 @@ def run(["gen" | rest]) do
|
|||
)
|
||||
|> Path.expand()
|
||||
|
||||
{strip_uploads_location_message, strip_uploads_location_default} =
|
||||
{strip_uploads_message, strip_uploads_default} =
|
||||
if Pleroma.Utils.command_available?("exiftool") do
|
||||
{"Do you want to strip location (GPS) data from uploaded images? This requires exiftool, it was detected as installed. (y/n)",
|
||||
"y"}
|
||||
|
@ -171,29 +170,12 @@ def run(["gen" | rest]) do
|
|||
"n"}
|
||||
end
|
||||
|
||||
strip_uploads_location =
|
||||
strip_uploads =
|
||||
get_option(
|
||||
options,
|
||||
:strip_uploads_location,
|
||||
strip_uploads_location_message,
|
||||
strip_uploads_location_default
|
||||
) === "y"
|
||||
|
||||
{read_uploads_description_message, read_uploads_description_default} =
|
||||
if Pleroma.Utils.command_available?("exiftool") do
|
||||
{"Do you want to read data from uploaded files so clients can use it to prefill fields like image description? This requires exiftool, it was detected as installed. (y/n)",
|
||||
"y"}
|
||||
else
|
||||
{"Do you want to read data from uploaded files so clients can use it to prefill fields like image description? This requires exiftool, it was detected as not installed, please install it if you answer yes. (y/n)",
|
||||
"n"}
|
||||
end
|
||||
|
||||
read_uploads_description =
|
||||
get_option(
|
||||
options,
|
||||
:read_uploads_description,
|
||||
read_uploads_description_message,
|
||||
read_uploads_description_default
|
||||
:strip_uploads,
|
||||
strip_uploads_message,
|
||||
strip_uploads_default
|
||||
) === "y"
|
||||
|
||||
anonymize_uploads =
|
||||
|
@ -217,7 +199,6 @@ def run(["gen" | rest]) do
|
|||
secret = :crypto.strong_rand_bytes(64) |> Base.encode64() |> binary_part(0, 64)
|
||||
jwt_secret = :crypto.strong_rand_bytes(64) |> Base.encode64() |> binary_part(0, 64)
|
||||
signing_salt = :crypto.strong_rand_bytes(8) |> Base.encode64() |> binary_part(0, 8)
|
||||
lv_signing_salt = :crypto.strong_rand_bytes(8) |> Base.encode64() |> binary_part(0, 8)
|
||||
{web_push_public_key, web_push_private_key} = :crypto.generate_key(:ecdh, :prime256v1)
|
||||
template_dir = Application.app_dir(:pleroma, "priv") <> "/templates"
|
||||
|
||||
|
@ -236,7 +217,6 @@ def run(["gen" | rest]) do
|
|||
secret: secret,
|
||||
jwt_secret: jwt_secret,
|
||||
signing_salt: signing_salt,
|
||||
lv_signing_salt: lv_signing_salt,
|
||||
web_push_public_key: Base.url_encode64(web_push_public_key, padding: false),
|
||||
web_push_private_key: Base.url_encode64(web_push_private_key, padding: false),
|
||||
db_configurable?: db_configurable?,
|
||||
|
@ -247,8 +227,7 @@ def run(["gen" | rest]) do
|
|||
listen_port: listen_port,
|
||||
upload_filters:
|
||||
upload_filters(%{
|
||||
strip_location: strip_uploads_location,
|
||||
read_description: read_uploads_description,
|
||||
strip: strip_uploads,
|
||||
anonymize: anonymize_uploads,
|
||||
dedupe: dedupe_uploads
|
||||
})
|
||||
|
@ -263,13 +242,6 @@ def run(["gen" | rest]) do
|
|||
rum_enabled: rum_enabled
|
||||
)
|
||||
|
||||
config_dir = Path.dirname(config_path)
|
||||
psql_dir = Path.dirname(psql_path)
|
||||
|
||||
[config_dir, psql_dir, static_dir, uploads_dir]
|
||||
|> Enum.reject(&File.exists?/1)
|
||||
|> Enum.map(&File.mkdir_p!/1)
|
||||
|
||||
shell_info("Writing config to #{config_path}.")
|
||||
|
||||
File.write(config_path, result_config)
|
||||
|
@ -303,6 +275,10 @@ defp write_robots_txt(static_dir, indexable, template_dir) do
|
|||
indexable: indexable
|
||||
)
|
||||
|
||||
unless File.exists?(static_dir) do
|
||||
File.mkdir_p!(static_dir)
|
||||
end
|
||||
|
||||
robots_txt_path = Path.join(static_dir, "robots.txt")
|
||||
|
||||
if File.exists?(robots_txt_path) do
|
||||
|
@ -316,19 +292,12 @@ defp write_robots_txt(static_dir, indexable, template_dir) do
|
|||
|
||||
defp upload_filters(filters) when is_map(filters) do
|
||||
enabled_filters =
|
||||
if filters.strip_location do
|
||||
[Pleroma.Upload.Filter.Exiftool.StripLocation]
|
||||
if filters.strip do
|
||||
[Pleroma.Upload.Filter.Exiftool]
|
||||
else
|
||||
[]
|
||||
end
|
||||
|
||||
enabled_filters =
|
||||
if filters.read_description do
|
||||
enabled_filters ++ [Pleroma.Upload.Filter.Exiftool.ReadDescription]
|
||||
else
|
||||
enabled_filters
|
||||
end
|
||||
|
||||
enabled_filters =
|
||||
if filters.anonymize do
|
||||
enabled_filters ++ [Pleroma.Upload.Filter.AnonymizeFilename]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Pleroma: A lightweight social networking server
|
||||
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
|
||||
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
defmodule Mix.Tasks.Pleroma.NotificationSettings do
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
# Pleroma: A lightweight social networking server
|
||||
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
defmodule Mix.Tasks.Pleroma.OpenapiSpec do
|
||||
def run([path]) do
|
||||
# Load Pleroma application to get version info
|
||||
Application.load(:pleroma)
|
||||
spec = Pleroma.Web.ApiSpec.spec(server_specific: false) |> Jason.encode!()
|
||||
File.write(path, spec)
|
||||
end
|
||||
end
|
|
@ -1,5 +1,5 @@
|
|||
# Pleroma: A lightweight social networking server
|
||||
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
|
||||
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
defmodule Mix.Tasks.Pleroma.RefreshCounterCache do
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Pleroma: A lightweight social networking server
|
||||
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
|
||||
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
defmodule Mix.Tasks.Pleroma.Relay do
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Pleroma: A lightweight social networking server
|
||||
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
|
||||
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
defmodule Mix.Tasks.Pleroma.RobotsTxt do
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Pleroma: A lightweight social networking server
|
||||
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
|
||||
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
defmodule Mix.Tasks.Pleroma.Uploads do
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Pleroma: A lightweight social networking server
|
||||
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
|
||||
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
defmodule Mix.Tasks.Pleroma.User do
|
||||
|
@ -51,7 +51,9 @@ def run(["new", nickname, email | rest]) do
|
|||
A user will be created with the following information:
|
||||
- nickname: #{nickname}
|
||||
- email: #{email}
|
||||
- password: #{if(generated_password?, do: "[generated; a reset link will be created]", else: password)}
|
||||
- password: #{
|
||||
if(generated_password?, do: "[generated; a reset link will be created]", else: password)
|
||||
}
|
||||
- name: #{name}
|
||||
- bio: #{bio}
|
||||
- moderator: #{if(moderator?, do: "true", else: "false")}
|
||||
|
@ -72,7 +74,7 @@ def run(["new", nickname, email | rest]) do
|
|||
bio: bio
|
||||
}
|
||||
|
||||
changeset = User.register_changeset(%User{}, params, is_confirmed: true)
|
||||
changeset = User.register_changeset(%User{}, params, need_confirmation: false)
|
||||
{:ok, _user} = User.register(changeset)
|
||||
|
||||
shell_info("User #{nickname} created")
|
||||
|
@ -105,6 +107,21 @@ def run(["rm", nickname]) do
|
|||
end
|
||||
end
|
||||
|
||||
def run(["toggle_activated", nickname]) do
|
||||
start_pleroma()
|
||||
|
||||
with %User{} = user <- User.get_cached_by_nickname(nickname) do
|
||||
{:ok, user} = User.deactivate(user, !user.deactivated)
|
||||
|
||||
shell_info(
|
||||
"Activation status of #{nickname}: #{if(user.deactivated, do: "de", else: "")}activated"
|
||||
)
|
||||
else
|
||||
_ ->
|
||||
shell_error("No user #{nickname}")
|
||||
end
|
||||
end
|
||||
|
||||
def run(["reset_password", nickname]) do
|
||||
start_pleroma()
|
||||
|
||||
|
@ -112,10 +129,15 @@ def run(["reset_password", nickname]) do
|
|||
{:ok, token} <- Pleroma.PasswordResetToken.create_token(user) do
|
||||
shell_info("Generated password reset token for #{user.nickname}")
|
||||
|
||||
url =
|
||||
Pleroma.Web.Router.Helpers.reset_password_url(Pleroma.Web.Endpoint, :reset, token.token)
|
||||
|
||||
IO.puts("URL: #{url}")
|
||||
IO.puts(
|
||||
"URL: #{
|
||||
Pleroma.Web.Router.Helpers.reset_password_url(
|
||||
Pleroma.Web.Endpoint,
|
||||
:reset,
|
||||
token.token
|
||||
)
|
||||
}"
|
||||
)
|
||||
else
|
||||
_ ->
|
||||
shell_error("No local user #{nickname}")
|
||||
|
@ -134,41 +156,20 @@ def run(["reset_mfa", nickname]) do
|
|||
end
|
||||
end
|
||||
|
||||
def run(["activate", nickname]) do
|
||||
start_pleroma()
|
||||
|
||||
with %User{} = user <- User.get_cached_by_nickname(nickname),
|
||||
false <- user.is_active do
|
||||
User.set_activation(user, true)
|
||||
:timer.sleep(500)
|
||||
|
||||
shell_info("Successfully activated #{nickname}")
|
||||
else
|
||||
true ->
|
||||
shell_info("User #{nickname} already activated")
|
||||
|
||||
_ ->
|
||||
shell_error("No user #{nickname}")
|
||||
end
|
||||
end
|
||||
|
||||
def run(["deactivate", nickname]) do
|
||||
start_pleroma()
|
||||
|
||||
with %User{} = user <- User.get_cached_by_nickname(nickname),
|
||||
true <- user.is_active do
|
||||
User.set_activation(user, false)
|
||||
with %User{} = user <- User.get_cached_by_nickname(nickname) do
|
||||
shell_info("Deactivating #{user.nickname}")
|
||||
User.deactivate(user)
|
||||
:timer.sleep(500)
|
||||
|
||||
user = User.get_cached_by_id(user.id)
|
||||
|
||||
if Enum.empty?(Enum.filter(User.get_friends(user), & &1.local)) do
|
||||
shell_info("Successfully deactivated #{nickname} and unsubscribed all local followers")
|
||||
shell_info("Successfully unsubscribed all local followers from #{user.nickname}")
|
||||
end
|
||||
else
|
||||
false ->
|
||||
shell_info("User #{nickname} already deactivated")
|
||||
|
||||
_ ->
|
||||
shell_error("No user #{nickname}")
|
||||
end
|
||||
|
@ -212,7 +213,7 @@ def run(["set", nickname | rest]) do
|
|||
user =
|
||||
case Keyword.get(options, :confirmed) do
|
||||
nil -> user
|
||||
value -> set_confirmation(user, value)
|
||||
value -> set_confirmed(user, value)
|
||||
end
|
||||
|
||||
user =
|
||||
|
@ -314,7 +315,9 @@ def run(["invites"]) do
|
|||
end
|
||||
|
||||
shell_info(
|
||||
"ID: #{invite.id} | Token: #{invite.token} | Token type: #{invite.invite_type} | Used: #{invite.used}#{expire_info}#{using_info}"
|
||||
"ID: #{invite.id} | Token: #{invite.token} | Token type: #{invite.invite_type} | Used: #{
|
||||
invite.used
|
||||
}#{expire_info}#{using_info}"
|
||||
)
|
||||
end)
|
||||
end
|
||||
|
@ -348,7 +351,7 @@ def run(["confirm", nickname]) do
|
|||
with %User{} = user <- User.get_cached_by_nickname(nickname) do
|
||||
{:ok, user} = User.confirm(user)
|
||||
|
||||
message = if !user.is_confirmed, do: "needs", else: "doesn't need"
|
||||
message = if user.confirmation_pending, do: "needs", else: "doesn't need"
|
||||
|
||||
shell_info("#{nickname} #{message} confirmation.")
|
||||
else
|
||||
|
@ -362,7 +365,7 @@ def run(["confirm_all"]) do
|
|||
|
||||
Pleroma.User.Query.build(%{
|
||||
local: true,
|
||||
is_active: true,
|
||||
deactivated: false,
|
||||
is_moderator: false,
|
||||
is_admin: false,
|
||||
invisible: false
|
||||
|
@ -370,7 +373,7 @@ def run(["confirm_all"]) do
|
|||
|> Pleroma.Repo.chunk_stream(500, :batches)
|
||||
|> Stream.each(fn users ->
|
||||
users
|
||||
|> Enum.each(fn user -> User.set_confirmation(user, true) end)
|
||||
|> Enum.each(fn user -> User.need_confirmation(user, false) end)
|
||||
end)
|
||||
|> Stream.run()
|
||||
end
|
||||
|
@ -380,7 +383,7 @@ def run(["unconfirm_all"]) do
|
|||
|
||||
Pleroma.User.Query.build(%{
|
||||
local: true,
|
||||
is_active: true,
|
||||
deactivated: false,
|
||||
is_moderator: false,
|
||||
is_admin: false,
|
||||
invisible: false
|
||||
|
@ -388,7 +391,7 @@ def run(["unconfirm_all"]) do
|
|||
|> Pleroma.Repo.chunk_stream(500, :batches)
|
||||
|> Stream.each(fn users ->
|
||||
users
|
||||
|> Enum.each(fn user -> User.set_confirmation(user, false) end)
|
||||
|> Enum.each(fn user -> User.need_confirmation(user, true) end)
|
||||
end)
|
||||
|> Stream.run()
|
||||
end
|
||||
|
@ -415,45 +418,15 @@ def run(["list"]) do
|
|||
users
|
||||
|> Enum.each(fn user ->
|
||||
shell_info(
|
||||
"#{user.nickname} moderator: #{user.is_moderator}, admin: #{user.is_admin}, locked: #{user.is_locked}, is_active: #{user.is_active}"
|
||||
"#{user.nickname} moderator: #{user.is_moderator}, admin: #{user.is_admin}, locked: #{
|
||||
user.is_locked
|
||||
}, deactivated: #{user.deactivated}"
|
||||
)
|
||||
end)
|
||||
end)
|
||||
|> Stream.run()
|
||||
end
|
||||
|
||||
def run(["fix_follow_state", local_user, remote_user]) do
|
||||
start_pleroma()
|
||||
|
||||
with {:local, %User{} = local} <- {:local, User.get_by_nickname(local_user)},
|
||||
{:remote, %User{} = remote} <- {:remote, User.get_by_nickname(remote_user)},
|
||||
{:follow_data, %{data: %{"state" => request_state}}} <-
|
||||
{:follow_data, Pleroma.Web.ActivityPub.Utils.fetch_latest_follow(local, remote)} do
|
||||
calculated_state = User.following?(local, remote)
|
||||
|
||||
shell_info(
|
||||
"Request state is #{request_state}, vs calculated state of following=#{calculated_state}"
|
||||
)
|
||||
|
||||
if calculated_state == false && request_state == "accept" do
|
||||
shell_info("Discrepancy found, fixing")
|
||||
Pleroma.Web.CommonAPI.reject_follow_request(local, remote)
|
||||
shell_info("Relationship fixed")
|
||||
else
|
||||
shell_info("No discrepancy found")
|
||||
end
|
||||
else
|
||||
{:local, _} ->
|
||||
shell_error("No local user #{local_user}")
|
||||
|
||||
{:remote, _} ->
|
||||
shell_error("No remote user #{remote_user}")
|
||||
|
||||
{:follow_data, _} ->
|
||||
shell_error("No follow data for #{local_user} and #{remote_user}")
|
||||
end
|
||||
end
|
||||
|
||||
defp set_moderator(user, value) do
|
||||
{:ok, user} =
|
||||
user
|
||||
|
@ -481,10 +454,10 @@ defp set_locked(user, value) do
|
|||
user
|
||||
end
|
||||
|
||||
defp set_confirmation(user, value) do
|
||||
{:ok, user} = User.set_confirmation(user, value)
|
||||
defp set_confirmed(user, value) do
|
||||
{:ok, user} = User.need_confirmation(user, !value)
|
||||
|
||||
shell_info("Confirmation status of #{user.nickname}: #{user.is_confirmed}")
|
||||
shell_info("Confirmation pending status of #{user.nickname}: #{user.confirmation_pending}")
|
||||
user
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Pleroma: A lightweight social networking server
|
||||
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
|
||||
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
defmodule Phoenix.Transports.WebSocket.Raw do
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Pleroma: A lightweight social networking server
|
||||
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
|
||||
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
defmodule Pleroma.Activity do
|
||||
|
@ -53,7 +53,7 @@ defmodule Pleroma.Activity do
|
|||
#
|
||||
# ```
|
||||
# |> join(:inner, [activity], o in Object,
|
||||
# on: fragment("(?->>'id') = associated_object_id((?))",
|
||||
# on: fragment("(?->>'id') = COALESCE((?)->'object'->> 'id', (?)->>'object')",
|
||||
# o.data, activity.data, activity.data))
|
||||
# |> preload([activity, object], [object: object])
|
||||
# ```
|
||||
|
@ -69,8 +69,9 @@ def with_joined_object(query, join_type \\ :inner) do
|
|||
join(query, join_type, [activity], o in Object,
|
||||
on:
|
||||
fragment(
|
||||
"(?->>'id') = associated_object_id(?)",
|
||||
"(?->>'id') = COALESCE(?->'object'->>'id', ?->>'object')",
|
||||
o.data,
|
||||
activity.data,
|
||||
activity.data
|
||||
),
|
||||
as: :object
|
||||
|
@ -112,7 +113,6 @@ def with_preloaded_bookmark(query, %User{} = user) do
|
|||
from([a] in query,
|
||||
left_join: b in Bookmark,
|
||||
on: b.user_id == ^user.id and b.activity_id == a.id,
|
||||
as: :bookmark,
|
||||
preload: [bookmark: b]
|
||||
)
|
||||
end
|
||||
|
@ -123,7 +123,6 @@ def with_preloaded_report_notes(query) do
|
|||
from([a] in query,
|
||||
left_join: r in ReportNote,
|
||||
on: a.id == r.activity_id,
|
||||
as: :report_note,
|
||||
preload: [report_notes: r]
|
||||
)
|
||||
end
|
||||
|
@ -183,48 +182,40 @@ def get_by_ap_id_with_object(ap_id) do
|
|||
|> Repo.one()
|
||||
end
|
||||
|
||||
@doc """
|
||||
Gets activity by ID, doesn't load activities from deactivated actors by default.
|
||||
"""
|
||||
@spec get_by_id(String.t(), keyword()) :: t() | nil
|
||||
def get_by_id(id, opts \\ [filter: [:restrict_deactivated]]), do: get_by_id_with_opts(id, opts)
|
||||
@spec get_by_id(String.t()) :: Activity.t() | nil
|
||||
def get_by_id(id) do
|
||||
case FlakeId.flake_id?(id) do
|
||||
true ->
|
||||
Activity
|
||||
|> where([a], a.id == ^id)
|
||||
|> restrict_deactivated_users()
|
||||
|> Repo.one()
|
||||
|
||||
@spec get_by_id_with_user_actor(String.t()) :: t() | nil
|
||||
def get_by_id_with_user_actor(id), do: get_by_id_with_opts(id, preload: [:user_actor])
|
||||
|
||||
@spec get_by_id_with_object(String.t()) :: t() | nil
|
||||
def get_by_id_with_object(id), do: get_by_id_with_opts(id, preload: [:object])
|
||||
|
||||
defp get_by_id_with_opts(id, opts) do
|
||||
if FlakeId.flake_id?(id) do
|
||||
query = Queries.by_id(id)
|
||||
|
||||
with_filters_query =
|
||||
if is_list(opts[:filter]) do
|
||||
Enum.reduce(opts[:filter], query, fn
|
||||
{:type, type}, acc -> Queries.by_type(acc, type)
|
||||
:restrict_deactivated, acc -> restrict_deactivated_users(acc)
|
||||
_, acc -> acc
|
||||
end)
|
||||
else
|
||||
query
|
||||
end
|
||||
|
||||
with_preloads_query =
|
||||
if is_list(opts[:preload]) do
|
||||
Enum.reduce(opts[:preload], with_filters_query, fn
|
||||
:user_actor, acc -> with_preloaded_user_actor(acc)
|
||||
:object, acc -> with_preloaded_object(acc)
|
||||
_, acc -> acc
|
||||
end)
|
||||
else
|
||||
with_filters_query
|
||||
end
|
||||
|
||||
Repo.one(with_preloads_query)
|
||||
_ ->
|
||||
nil
|
||||
end
|
||||
end
|
||||
|
||||
def get_by_id_with_user_actor(id) do
|
||||
case FlakeId.flake_id?(id) do
|
||||
true ->
|
||||
Activity
|
||||
|> where([a], a.id == ^id)
|
||||
|> with_preloaded_user_actor()
|
||||
|> Repo.one()
|
||||
|
||||
_ ->
|
||||
nil
|
||||
end
|
||||
end
|
||||
|
||||
def get_by_id_with_object(id) do
|
||||
Activity
|
||||
|> where(id: ^id)
|
||||
|> with_preloaded_object()
|
||||
|> Repo.one()
|
||||
end
|
||||
|
||||
def all_by_ids_with_object(ids) do
|
||||
Activity
|
||||
|> where([a], a.id in ^ids)
|
||||
|
@ -276,11 +267,6 @@ def get_create_by_object_ap_id_with_object(ap_id) when is_binary(ap_id) do
|
|||
|
||||
def get_create_by_object_ap_id_with_object(_), do: nil
|
||||
|
||||
@spec create_by_id_with_object(String.t()) :: t() | nil
|
||||
def create_by_id_with_object(id) do
|
||||
get_by_id_with_opts(id, preload: [:object], filter: [type: "Create"])
|
||||
end
|
||||
|
||||
defp get_in_reply_to_activity_from_object(%Object{data: %{"inReplyTo" => ap_id}}) do
|
||||
get_create_by_object_ap_id_with_object(ap_id)
|
||||
end
|
||||
|
@ -291,8 +277,7 @@ def get_in_reply_to_activity(%Activity{} = activity) do
|
|||
get_in_reply_to_activity_from_object(Object.normalize(activity, fetch: false))
|
||||
end
|
||||
|
||||
def normalize(%Activity{data: %{"id" => ap_id}}), do: get_by_ap_id_with_object(ap_id)
|
||||
def normalize(%{"id" => ap_id}), do: get_by_ap_id_with_object(ap_id)
|
||||
def normalize(obj) when is_map(obj), do: get_by_ap_id_with_object(obj["id"])
|
||||
def normalize(ap_id) when is_binary(ap_id), do: get_by_ap_id_with_object(ap_id)
|
||||
def normalize(_), do: nil
|
||||
|
||||
|
@ -301,7 +286,7 @@ def delete_all_by_object_ap_id(id) when is_binary(id) do
|
|||
|> Queries.by_object_id()
|
||||
|> Queries.exclude_type("Delete")
|
||||
|> select([u], u)
|
||||
|> Repo.delete_all(timeout: :infinity)
|
||||
|> Repo.delete_all()
|
||||
|> elem(1)
|
||||
|> Enum.find(fn
|
||||
%{data: %{"type" => "Create", "object" => ap_id}} when is_binary(ap_id) -> ap_id == id
|
||||
|
@ -313,15 +298,13 @@ def delete_all_by_object_ap_id(id) when is_binary(id) do
|
|||
|
||||
def delete_all_by_object_ap_id(_), do: nil
|
||||
|
||||
defp purge_web_resp_cache(%Activity{data: %{"id" => id}} = activity) when is_binary(id) do
|
||||
with %{path: path} <- URI.parse(id) do
|
||||
@cachex.del(:web_resp_cache, path)
|
||||
end
|
||||
|
||||
defp purge_web_resp_cache(%Activity{} = activity) do
|
||||
%{path: path} = URI.parse(activity.data["id"])
|
||||
@cachex.del(:web_resp_cache, path)
|
||||
activity
|
||||
end
|
||||
|
||||
defp purge_web_resp_cache(activity), do: activity
|
||||
defp purge_web_resp_cache(nil), do: nil
|
||||
|
||||
def follow_accepted?(
|
||||
%Activity{data: %{"type" => "Follow", "object" => followed_ap_id}} = activity
|
||||
|
@ -361,11 +344,11 @@ def following_requests_for_actor(%User{ap_id: ap_id}) do
|
|||
end
|
||||
|
||||
def restrict_deactivated_users(query) do
|
||||
query
|
||||
|> join(:inner, [activity], user in User,
|
||||
as: :user,
|
||||
on: activity.actor == user.ap_id and user.is_active == true
|
||||
)
|
||||
deactivated_users =
|
||||
from(u in User.Query.build(%{deactivated: true}), select: u.ap_id)
|
||||
|> Repo.all()
|
||||
|
||||
Activity.Queries.exclude_authors(query, deactivated_users)
|
||||
end
|
||||
|
||||
defdelegate search(user, query, options \\ []), to: Pleroma.Activity.Search
|
||||
|
@ -383,6 +366,12 @@ def direct_conversation_id(activity, for_user) do
|
|||
end
|
||||
end
|
||||
|
||||
@spec pinned_by_actor?(Activity.t()) :: boolean()
|
||||
def pinned_by_actor?(%Activity{} = activity) do
|
||||
actor = user_actor(activity)
|
||||
activity.id in actor.pinned_activities
|
||||
end
|
||||
|
||||
@spec get_by_object_ap_id_with_object(String.t()) :: t() | nil
|
||||
def get_by_object_ap_id_with_object(ap_id) when is_binary(ap_id) do
|
||||
ap_id
|
||||
|
@ -393,13 +382,4 @@ def get_by_object_ap_id_with_object(ap_id) when is_binary(ap_id) do
|
|||
end
|
||||
|
||||
def get_by_object_ap_id_with_object(_), do: nil
|
||||
|
||||
@spec add_by_params_query(String.t(), String.t(), String.t()) :: Ecto.Query.t()
|
||||
def add_by_params_query(object_id, actor, target) do
|
||||
object_id
|
||||
|> Queries.by_object_id()
|
||||
|> Queries.by_type("Add")
|
||||
|> Queries.by_actor(actor)
|
||||
|> where([a], fragment("?->>'target' = ?", a.data, ^target))
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,81 +0,0 @@
|
|||
# Pleroma: A lightweight social networking server
|
||||
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
defmodule Pleroma.Activity.HTML do
|
||||
alias Pleroma.HTML
|
||||
alias Pleroma.Object
|
||||
|
||||
@cachex Pleroma.Config.get([:cachex, :provider], Cachex)
|
||||
|
||||
# We store a list of cache keys related to an activity in a
|
||||
# separate cache, scrubber_management_cache. It has the same
|
||||
# size as scrubber_cache (see application.ex). Every time we add
|
||||
# a cache to scrubber_cache, we update scrubber_management_cache.
|
||||
#
|
||||
# The most recent write of a certain key in the management cache
|
||||
# is the same as the most recent write of any record related to that
|
||||
# key in the main cache.
|
||||
# Assuming LRW ( https://hexdocs.pm/cachex/Cachex.Policy.LRW.html ),
|
||||
# this means when the management cache is evicted by cachex, all
|
||||
# related records in the main cache will also have been evicted.
|
||||
|
||||
defp get_cache_keys_for(activity_id) do
|
||||
with {:ok, list} when is_list(list) <- @cachex.get(:scrubber_management_cache, activity_id) do
|
||||
list
|
||||
else
|
||||
_ -> []
|
||||
end
|
||||
end
|
||||
|
||||
defp add_cache_key_for(activity_id, additional_key) do
|
||||
current = get_cache_keys_for(activity_id)
|
||||
|
||||
unless additional_key in current do
|
||||
@cachex.put(:scrubber_management_cache, activity_id, [additional_key | current])
|
||||
end
|
||||
end
|
||||
|
||||
def invalidate_cache_for(activity_id) do
|
||||
keys = get_cache_keys_for(activity_id)
|
||||
Enum.map(keys, &@cachex.del(:scrubber_cache, &1))
|
||||
@cachex.del(:scrubber_management_cache, activity_id)
|
||||
end
|
||||
|
||||
def get_cached_scrubbed_html_for_activity(
|
||||
content,
|
||||
scrubbers,
|
||||
activity,
|
||||
key \\ "",
|
||||
callback \\ fn x -> x end
|
||||
) do
|
||||
key = "#{key}#{generate_scrubber_signature(scrubbers)}|#{activity.id}"
|
||||
|
||||
@cachex.fetch!(:scrubber_cache, key, fn _key ->
|
||||
object = Object.normalize(activity, fetch: false)
|
||||
|
||||
add_cache_key_for(activity.id, key)
|
||||
HTML.ensure_scrubbed_html(content, scrubbers, object.data["fake"] || false, callback)
|
||||
end)
|
||||
end
|
||||
|
||||
def get_cached_stripped_html_for_activity(content, activity, key) do
|
||||
get_cached_scrubbed_html_for_activity(
|
||||
content,
|
||||
FastSanitize.Sanitizer.StripTags,
|
||||
activity,
|
||||
key,
|
||||
&HtmlEntities.decode/1
|
||||
)
|
||||
end
|
||||
|
||||
defp generate_scrubber_signature(scrubber) when is_atom(scrubber) do
|
||||
generate_scrubber_signature([scrubber])
|
||||
end
|
||||
|
||||
defp generate_scrubber_signature(scrubbers) do
|
||||
Enum.reduce(scrubbers, "", fn scrubber, signature ->
|
||||
"#{signature}#{to_string(scrubber)}"
|
||||
end)
|
||||
end
|
||||
end
|
|
@ -1,5 +1,5 @@
|
|||
# Pleroma: A lightweight social networking server
|
||||
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
|
||||
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
defmodule Pleroma.Activity.Ir.Topics do
|
||||
|
@ -13,14 +13,6 @@ def get_activity_topics(activity) do
|
|||
|> List.flatten()
|
||||
end
|
||||
|
||||
defp generate_topics(%{data: %{"type" => "ChatMessage"}}, %{data: %{"type" => "Delete"}}) do
|
||||
["user", "user:pleroma_chat"]
|
||||
end
|
||||
|
||||
defp generate_topics(%{data: %{"type" => "ChatMessage"}}, %{data: %{"type" => "Create"}}) do
|
||||
[]
|
||||
end
|
||||
|
||||
defp generate_topics(%{data: %{"type" => "Answer"}}, _) do
|
||||
[]
|
||||
end
|
||||
|
@ -29,7 +21,7 @@ defp generate_topics(object, activity) do
|
|||
["user", "list"] ++ visibility_tags(object, activity)
|
||||
end
|
||||
|
||||
defp visibility_tags(object, %{data: %{"type" => type}} = activity) when type != "Announce" do
|
||||
defp visibility_tags(object, activity) do
|
||||
case Visibility.get_visibility(activity) do
|
||||
"public" ->
|
||||
if activity.local do
|
||||
|
@ -39,10 +31,6 @@ defp visibility_tags(object, %{data: %{"type" => type}} = activity) when type !=
|
|||
end
|
||||
|> item_creation_tags(object, activity)
|
||||
|
||||
"local" ->
|
||||
["public:local"]
|
||||
|> item_creation_tags(object, activity)
|
||||
|
||||
"direct" ->
|
||||
["direct"]
|
||||
|
||||
|
@ -51,10 +39,6 @@ defp visibility_tags(object, %{data: %{"type" => type}} = activity) when type !=
|
|||
end
|
||||
end
|
||||
|
||||
defp visibility_tags(_object, _activity) do
|
||||
[]
|
||||
end
|
||||
|
||||
defp item_creation_tags(tags, object, %{data: %{"type" => "Create"}} = activity) do
|
||||
tags ++
|
||||
remote_topics(activity) ++ hashtags_to_topics(object) ++ attachment_topics(object, activity)
|
||||
|
@ -64,12 +48,14 @@ defp item_creation_tags(tags, _, _) do
|
|||
tags
|
||||
end
|
||||
|
||||
defp hashtags_to_topics(object) do
|
||||
object
|
||||
|> Object.hashtags()
|
||||
|> Enum.map(fn hashtag -> "hashtag:" <> hashtag end)
|
||||
defp hashtags_to_topics(%{data: %{"tag" => tags}}) do
|
||||
tags
|
||||
|> Enum.filter(&is_bitstring(&1))
|
||||
|> Enum.map(fn tag -> "hashtag:" <> tag end)
|
||||
end
|
||||
|
||||
defp hashtags_to_topics(_), do: []
|
||||
|
||||
defp remote_topics(%{local: true}), do: []
|
||||
|
||||
defp remote_topics(%{actor: actor}) when is_binary(actor),
|
||||
|
@ -79,18 +65,7 @@ defp remote_topics(_), do: []
|
|||
|
||||
defp attachment_topics(%{data: %{"attachment" => []}}, _act), do: []
|
||||
|
||||
defp attachment_topics(_object, %{local: true} = activity) do
|
||||
case Visibility.get_visibility(activity) do
|
||||
"public" ->
|
||||
["public:media", "public:local:media"]
|
||||
|
||||
"local" ->
|
||||
["public:local:media"]
|
||||
|
||||
_ ->
|
||||
[]
|
||||
end
|
||||
end
|
||||
defp attachment_topics(_object, %{local: true}), do: ["public:media", "public:local:media"]
|
||||
|
||||
defp attachment_topics(_object, %{actor: actor}) when is_binary(actor),
|
||||
do: ["public:media", "public:remote:media:" <> URI.parse(actor).host]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Pleroma: A lightweight social networking server
|
||||
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
|
||||
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
defmodule Pleroma.Activity.Queries do
|
||||
|
@ -14,11 +14,6 @@ defmodule Pleroma.Activity.Queries do
|
|||
alias Pleroma.Activity
|
||||
alias Pleroma.User
|
||||
|
||||
@spec by_id(query(), String.t()) :: query()
|
||||
def by_id(query \\ Activity, id) do
|
||||
from(a in query, where: a.id == ^id)
|
||||
end
|
||||
|
||||
@spec by_ap_id(query, String.t()) :: query
|
||||
def by_ap_id(query \\ Activity, ap_id) do
|
||||
from(
|
||||
|
@ -52,7 +47,8 @@ def by_object_id(query, object_ids) when is_list(object_ids) do
|
|||
activity in query,
|
||||
where:
|
||||
fragment(
|
||||
"associated_object_id((?)) = ANY(?)",
|
||||
"coalesce((?)->'object'->>'id', (?)->>'object') = ANY(?)",
|
||||
activity.data,
|
||||
activity.data,
|
||||
^object_ids
|
||||
)
|
||||
|
@ -63,7 +59,8 @@ def by_object_id(query, object_id) when is_binary(object_id) do
|
|||
from(activity in query,
|
||||
where:
|
||||
fragment(
|
||||
"associated_object_id((?)) = ?",
|
||||
"coalesce((?)->'object'->>'id', (?)->>'object') = ?",
|
||||
activity.data,
|
||||
activity.data,
|
||||
^object_id
|
||||
)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Pleroma: A lightweight social networking server
|
||||
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
|
||||
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
defmodule Pleroma.Activity.Search do
|
||||
|
@ -26,23 +26,19 @@ def search(user, search_query, options \\ []) do
|
|||
:plain
|
||||
end
|
||||
|
||||
try do
|
||||
Activity
|
||||
|> Activity.with_preloaded_object()
|
||||
|> Activity.restrict_deactivated_users()
|
||||
|> restrict_public(user)
|
||||
|> query_with(index_type, search_query, search_function)
|
||||
|> maybe_restrict_local(user)
|
||||
|> maybe_restrict_author(author)
|
||||
|> maybe_restrict_blocked(user)
|
||||
|> Pagination.fetch_paginated(
|
||||
%{"offset" => offset, "limit" => limit, "skip_order" => index_type == :rum},
|
||||
:offset
|
||||
)
|
||||
|> maybe_fetch(user, search_query)
|
||||
rescue
|
||||
_ -> maybe_fetch([], user, search_query)
|
||||
end
|
||||
Activity
|
||||
|> Activity.with_preloaded_object()
|
||||
|> Activity.restrict_deactivated_users()
|
||||
|> restrict_public()
|
||||
|> query_with(index_type, search_query, search_function)
|
||||
|> maybe_restrict_local(user)
|
||||
|> maybe_restrict_author(author)
|
||||
|> maybe_restrict_blocked(user)
|
||||
|> Pagination.fetch_paginated(
|
||||
%{"offset" => offset, "limit" => limit, "skip_order" => index_type == :rum},
|
||||
:offset
|
||||
)
|
||||
|> maybe_fetch(user, search_query)
|
||||
end
|
||||
|
||||
def maybe_restrict_author(query, %User{} = author) do
|
||||
|
@ -57,19 +53,7 @@ def maybe_restrict_blocked(query, %User{} = user) do
|
|||
|
||||
def maybe_restrict_blocked(query, _), do: query
|
||||
|
||||
defp restrict_public(q, user) when not is_nil(user) do
|
||||
intended_recipients = [
|
||||
Pleroma.Constants.as_public(),
|
||||
Pleroma.Web.ActivityPub.Utils.as_local_public()
|
||||
]
|
||||
|
||||
from([a, o] in q,
|
||||
where: fragment("?->>'type' = 'Create'", a.data),
|
||||
where: fragment("? && ?", ^intended_recipients, a.recipients)
|
||||
)
|
||||
end
|
||||
|
||||
defp restrict_public(q, _user) do
|
||||
defp restrict_public(q) do
|
||||
from([a, o] in q,
|
||||
where: fragment("?->>'type' = 'Create'", a.data),
|
||||
where: ^Pleroma.Constants.as_public() in a.recipients
|
||||
|
@ -77,17 +61,10 @@ defp restrict_public(q, _user) do
|
|||
end
|
||||
|
||||
defp query_with(q, :gin, search_query, :plain) do
|
||||
%{rows: [[tsc]]} =
|
||||
Ecto.Adapters.SQL.query!(
|
||||
Pleroma.Repo,
|
||||
"select current_setting('default_text_search_config')::regconfig::oid;"
|
||||
)
|
||||
|
||||
from([a, o] in q,
|
||||
where:
|
||||
fragment(
|
||||
"to_tsvector(?::oid::regconfig, ?->>'content') @@ plainto_tsquery(?)",
|
||||
^tsc,
|
||||
"to_tsvector('english', ?->>'content') @@ plainto_tsquery('english', ?)",
|
||||
o.data,
|
||||
^search_query
|
||||
)
|
||||
|
@ -95,17 +72,10 @@ defp query_with(q, :gin, search_query, :plain) do
|
|||
end
|
||||
|
||||
defp query_with(q, :gin, search_query, :websearch) do
|
||||
%{rows: [[tsc]]} =
|
||||
Ecto.Adapters.SQL.query!(
|
||||
Pleroma.Repo,
|
||||
"select current_setting('default_text_search_config')::regconfig::oid;"
|
||||
)
|
||||
|
||||
from([a, o] in q,
|
||||
where:
|
||||
fragment(
|
||||
"to_tsvector(?::oid::regconfig, ?->>'content') @@ websearch_to_tsquery(?)",
|
||||
^tsc,
|
||||
"to_tsvector('english', ?->>'content') @@ websearch_to_tsquery('english', ?)",
|
||||
o.data,
|
||||
^search_query
|
||||
)
|
||||
|
@ -116,7 +86,7 @@ defp query_with(q, :rum, search_query, :plain) do
|
|||
from([a, o] in q,
|
||||
where:
|
||||
fragment(
|
||||
"? @@ plainto_tsquery(?)",
|
||||
"? @@ plainto_tsquery('english', ?)",
|
||||
o.fts_content,
|
||||
^search_query
|
||||
),
|
||||
|
@ -128,7 +98,7 @@ defp query_with(q, :rum, search_query, :websearch) do
|
|||
from([a, o] in q,
|
||||
where:
|
||||
fragment(
|
||||
"? @@ websearch_to_tsquery(?)",
|
||||
"? @@ websearch_to_tsquery('english', ?)",
|
||||
o.fts_content,
|
||||
^search_query
|
||||
),
|
||||
|
|
|
@ -1,160 +0,0 @@
|
|||
# Pleroma: A lightweight social networking server
|
||||
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
defmodule Pleroma.Announcement do
|
||||
use Ecto.Schema
|
||||
|
||||
import Ecto.Changeset, only: [cast: 3, validate_required: 2]
|
||||
import Ecto.Query
|
||||
|
||||
alias Pleroma.AnnouncementReadRelationship
|
||||
alias Pleroma.Repo
|
||||
|
||||
@type t :: %__MODULE__{}
|
||||
@primary_key {:id, FlakeId.Ecto.CompatType, autogenerate: true}
|
||||
|
||||
schema "announcements" do
|
||||
field(:data, :map)
|
||||
field(:starts_at, :utc_datetime)
|
||||
field(:ends_at, :utc_datetime)
|
||||
field(:rendered, :map)
|
||||
|
||||
timestamps(type: :utc_datetime)
|
||||
end
|
||||
|
||||
def change(struct, params \\ %{}) do
|
||||
struct
|
||||
|> cast(validate_params(struct, params), [:data, :starts_at, :ends_at, :rendered])
|
||||
|> validate_required([:data])
|
||||
end
|
||||
|
||||
defp validate_params(struct, params) do
|
||||
base_data =
|
||||
%{
|
||||
"content" => "",
|
||||
"all_day" => false
|
||||
}
|
||||
|> Map.merge((struct && struct.data) || %{})
|
||||
|
||||
merged_data =
|
||||
Map.merge(base_data, params.data)
|
||||
|> Map.take(["content", "all_day"])
|
||||
|
||||
params
|
||||
|> Map.merge(%{data: merged_data})
|
||||
|> add_rendered_properties()
|
||||
end
|
||||
|
||||
def add_rendered_properties(params) do
|
||||
{content_html, _, _} =
|
||||
Pleroma.Web.CommonAPI.Utils.format_input(params.data["content"], "text/plain",
|
||||
mentions_format: :full
|
||||
)
|
||||
|
||||
rendered = %{
|
||||
"content" => content_html
|
||||
}
|
||||
|
||||
params
|
||||
|> Map.put(:rendered, rendered)
|
||||
end
|
||||
|
||||
def add(params) do
|
||||
changeset = change(%__MODULE__{}, params)
|
||||
|
||||
Repo.insert(changeset)
|
||||
end
|
||||
|
||||
def update(announcement, params) do
|
||||
changeset = change(announcement, params)
|
||||
|
||||
Repo.update(changeset)
|
||||
end
|
||||
|
||||
def list_all do
|
||||
__MODULE__
|
||||
|> Repo.all()
|
||||
end
|
||||
|
||||
def list_paginated(%{limit: limited_number, offset: offset_number}) do
|
||||
__MODULE__
|
||||
|> limit(^limited_number)
|
||||
|> offset(^offset_number)
|
||||
|> Repo.all()
|
||||
end
|
||||
|
||||
def get_by_id(id) do
|
||||
Repo.get_by(__MODULE__, id: id)
|
||||
end
|
||||
|
||||
def delete_by_id(id) do
|
||||
with announcement when not is_nil(announcement) <- get_by_id(id),
|
||||
{:ok, _} <- Repo.delete(announcement) do
|
||||
:ok
|
||||
else
|
||||
_ ->
|
||||
:error
|
||||
end
|
||||
end
|
||||
|
||||
def read_by?(announcement, user) do
|
||||
AnnouncementReadRelationship.exists?(user, announcement)
|
||||
end
|
||||
|
||||
def mark_read_by(announcement, user) do
|
||||
AnnouncementReadRelationship.mark_read(user, announcement)
|
||||
end
|
||||
|
||||
def render_json(announcement, opts \\ []) do
|
||||
extra_params =
|
||||
case Keyword.fetch(opts, :for) do
|
||||
{:ok, user} when not is_nil(user) ->
|
||||
%{read: read_by?(announcement, user)}
|
||||
|
||||
_ ->
|
||||
%{}
|
||||
end
|
||||
|
||||
admin_extra_params =
|
||||
case Keyword.fetch(opts, :admin) do
|
||||
{:ok, true} ->
|
||||
%{pleroma: %{raw_content: announcement.data["content"]}}
|
||||
|
||||
_ ->
|
||||
%{}
|
||||
end
|
||||
|
||||
base = %{
|
||||
id: announcement.id,
|
||||
content: announcement.rendered["content"],
|
||||
starts_at: announcement.starts_at,
|
||||
ends_at: announcement.ends_at,
|
||||
all_day: announcement.data["all_day"],
|
||||
published_at: announcement.inserted_at,
|
||||
updated_at: announcement.updated_at,
|
||||
mentions: [],
|
||||
statuses: [],
|
||||
tags: [],
|
||||
emojis: [],
|
||||
reactions: []
|
||||
}
|
||||
|
||||
base
|
||||
|> Map.merge(extra_params)
|
||||
|> Map.merge(admin_extra_params)
|
||||
end
|
||||
|
||||
# "visible" means:
|
||||
# starts_at < time < ends_at
|
||||
def list_all_visible_when(time) do
|
||||
__MODULE__
|
||||
|> where([a], is_nil(a.starts_at) or a.starts_at < ^time)
|
||||
|> where([a], is_nil(a.ends_at) or a.ends_at > ^time)
|
||||
|> Repo.all()
|
||||
end
|
||||
|
||||
def list_all_visible do
|
||||
list_all_visible_when(DateTime.now("Etc/UTC") |> elem(1))
|
||||
end
|
||||
end
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue