Compare commits
9 Commits
d7be3a4fdf
...
f141caf76c
Author | SHA1 | Date |
---|---|---|
ida schmidt | f141caf76c | |
Eugen Rochko | 5034418e2c | |
Daigo 3 Dango | 541b9cd15b | |
Yamagishi Kazutoshi | a5c558f052 | |
Yamagishi Kazutoshi | b02169f124 | |
Eugen Rochko | a1f04c1e34 | |
Yamagishi Kazutoshi | 67bef15e53 | |
dependabot-preview[bot] | 1051c5cffa | |
Yamagishi Kazutoshi | 172eaeba3f |
|
@ -115,6 +115,20 @@ SMTP_FROM_ADDRESS=notifications@example.com
|
||||||
# S3_ENDPOINT=
|
# S3_ENDPOINT=
|
||||||
# S3_SIGNATURE_VERSION=
|
# S3_SIGNATURE_VERSION=
|
||||||
|
|
||||||
|
# Google Cloud Storage (optional)
|
||||||
|
# Use S3 compatible API. Since GCS does not support Multipart Upload,
|
||||||
|
# increase the value of S3_MULTIPART_THRESHOLD to disable Multipart Upload.
|
||||||
|
# The attachment host must allow cross origin request - see the description
|
||||||
|
# above.
|
||||||
|
# S3_ENABLED=true
|
||||||
|
# AWS_ACCESS_KEY_ID=
|
||||||
|
# AWS_SECRET_ACCESS_KEY=
|
||||||
|
# S3_REGION=
|
||||||
|
# S3_PROTOCOL=https
|
||||||
|
# S3_HOSTNAME=storage.googleapis.com
|
||||||
|
# S3_ENDPOINT=https://storage.googleapis.com
|
||||||
|
# S3_MULTIPART_THRESHOLD=52428801 # 50.megabytes
|
||||||
|
|
||||||
# Swift (optional)
|
# Swift (optional)
|
||||||
# The attachment host must allow cross origin request - see the description
|
# The attachment host must allow cross origin request - see the description
|
||||||
# above.
|
# above.
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
2.6.1
|
2.6.4
|
||||||
|
|
168
CHANGELOG.md
168
CHANGELOG.md
|
@ -5,7 +5,173 @@ All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
TODO
|
### Added
|
||||||
|
|
||||||
|
- Add "not available" label to unloaded media attachments in web UI ([Gargron](https://github.com/tootsuite/mastodon/pull/11715), [Gargron](https://github.com/tootsuite/mastodon/pull/11745))
|
||||||
|
- **Add profile directory to web UI** ([Gargron](https://github.com/tootsuite/mastodon/pull/11688), [mayaeh](https://github.com/tootsuite/mastodon/pull/11872))
|
||||||
|
- Add profile directory opt-in federation
|
||||||
|
- Add profile directory REST API
|
||||||
|
- Add special alert for throttled requests in web UI ([ThibG](https://github.com/tootsuite/mastodon/pull/11677))
|
||||||
|
- Add confirmation modal when logging out from the web UI ([ThibG](https://github.com/tootsuite/mastodon/pull/11671))
|
||||||
|
- **Add audio player in web UI** ([Gargron](https://github.com/tootsuite/mastodon/pull/11644), [Gargron](https://github.com/tootsuite/mastodon/pull/11652), [Gargron](https://github.com/tootsuite/mastodon/pull/11654), [ThibG](https://github.com/tootsuite/mastodon/pull/11629))
|
||||||
|
- **Add autosuggestions for hashtags in web UI** ([Gargron](https://github.com/tootsuite/mastodon/pull/11422), [ThibG](https://github.com/tootsuite/mastodon/pull/11632), [Gargron](https://github.com/tootsuite/mastodon/pull/11764), [Gargron](https://github.com/tootsuite/mastodon/pull/11588), [Gargron](https://github.com/tootsuite/mastodon/pull/11442))
|
||||||
|
- **Add media editing modal with OCR tool in web UI** ([Gargron](https://github.com/tootsuite/mastodon/pull/11563), [Gargron](https://github.com/tootsuite/mastodon/pull/11566), [ThibG](https://github.com/tootsuite/mastodon/pull/11575), [ThibG](https://github.com/tootsuite/mastodon/pull/11576), [Gargron](https://github.com/tootsuite/mastodon/pull/11577), [Gargron](https://github.com/tootsuite/mastodon/pull/11573), [Gargron](https://github.com/tootsuite/mastodon/pull/11571))
|
||||||
|
- Add indicator of unread notifications to window title when web UI is out of focus ([Gargron](https://github.com/tootsuite/mastodon/pull/11560), [Gargron](https://github.com/tootsuite/mastodon/pull/11572))
|
||||||
|
- Add indicator for which options you voted for in a poll in web UI ([ThibG](https://github.com/tootsuite/mastodon/pull/11195))
|
||||||
|
- **Add search results pagination to web UI** ([Gargron](https://github.com/tootsuite/mastodon/pull/11409), [ThibG](https://github.com/tootsuite/mastodon/pull/11447))
|
||||||
|
- **Add option to disable real-time updates in web UI ("slow mode")** ([Gargron](https://github.com/tootsuite/mastodon/pull/9984), [ykzts](https://github.com/tootsuite/mastodon/pull/11880), [ThibG](https://github.com/tootsuite/mastodon/pull/11883), [Gargron](https://github.com/tootsuite/mastodon/pull/11898), [ThibG](https://github.com/tootsuite/mastodon/pull/11859))
|
||||||
|
- Add option to disable blurhash previews in web UI ([ThibG](https://github.com/tootsuite/mastodon/pull/11188))
|
||||||
|
- Add native smooth scrolling when supported in web UI ([ThibG](https://github.com/tootsuite/mastodon/pull/11207))
|
||||||
|
- Add search and sort functions to hashtag admin UI ([mayaeh](https://github.com/tootsuite/mastodon/pull/11829), [Gargron](https://github.com/tootsuite/mastodon/pull/11897), [mayaeh](https://github.com/tootsuite/mastodon/pull/11875))
|
||||||
|
- Add setting for default search engine indexing in admin UI ([brortao](https://github.com/tootsuite/mastodon/pull/11804))
|
||||||
|
- Add account bio to account view in admin UI ([ThibG](https://github.com/tootsuite/mastodon/pull/11473))
|
||||||
|
- **Add option to include reported statuses in warning e-mail from admin UI** ([Gargron](https://github.com/tootsuite/mastodon/pull/11639), [Gargron](https://github.com/tootsuite/mastodon/pull/11812), [Gargron](https://github.com/tootsuite/mastodon/pull/11741), [Gargron](https://github.com/tootsuite/mastodon/pull/11698), [mayaeh](https://github.com/tootsuite/mastodon/pull/11765))
|
||||||
|
- Add number of pending accounts and pending hashtags to dashboard in admin UI ([Gargron](https://github.com/tootsuite/mastodon/pull/11514))
|
||||||
|
- **Add account migration UI** ([Gargron](https://github.com/tootsuite/mastodon/pull/11846), [noellabo](https://github.com/tootsuite/mastodon/pull/11905), [noellabo](https://github.com/tootsuite/mastodon/pull/11907), [noellabo](https://github.com/tootsuite/mastodon/pull/11906), [noellabo](https://github.com/tootsuite/mastodon/pull/11902))
|
||||||
|
- **Add table of contents to about page** ([Gargron](https://github.com/tootsuite/mastodon/pull/11885), [ykzts](https://github.com/tootsuite/mastodon/pull/11941), [ykzts](https://github.com/tootsuite/mastodon/pull/11895), [Kjwon15](https://github.com/tootsuite/mastodon/pull/11916))
|
||||||
|
- **Add password challenge to 2FA settings, e-mail notifications** ([Gargron](https://github.com/tootsuite/mastodon/pull/11878))
|
||||||
|
- Add optional invite comments ([ThibG](https://github.com/tootsuite/mastodon/pull/10465))
|
||||||
|
- **Add optional public list of domain blocks with comments** ([ThibG](https://github.com/tootsuite/mastodon/pull/11298), [ThibG](https://github.com/tootsuite/mastodon/pull/11515), [Gargron](https://github.com/tootsuite/mastodon/pull/11908))
|
||||||
|
- Add an RSS feed for featured hashtags ([noellabo](https://github.com/tootsuite/mastodon/pull/10502))
|
||||||
|
- Add explanations to featured hashtags UI and profile ([Gargron](https://github.com/tootsuite/mastodon/pull/11586))
|
||||||
|
- **Add hashtag trends with admin and user settings** ([Gargron](https://github.com/tootsuite/mastodon/pull/11490), [Gargron](https://github.com/tootsuite/mastodon/pull/11502), [Gargron](https://github.com/tootsuite/mastodon/pull/11641), [Gargron](https://github.com/tootsuite/mastodon/pull/11594), [Gargron](https://github.com/tootsuite/mastodon/pull/11517), [mayaeh](https://github.com/tootsuite/mastodon/pull/11845), [Gargron](https://github.com/tootsuite/mastodon/pull/11774), [Gargron](https://github.com/tootsuite/mastodon/pull/11712), [Gargron](https://github.com/tootsuite/mastodon/pull/11791), [Gargron](https://github.com/tootsuite/mastodon/pull/11743), [Gargron](https://github.com/tootsuite/mastodon/pull/11740), [Gargron](https://github.com/tootsuite/mastodon/pull/11714), [ThibG](https://github.com/tootsuite/mastodon/pull/11631), [Sasha-Sorokin](https://github.com/tootsuite/mastodon/pull/11569), [Gargron](https://github.com/tootsuite/mastodon/pull/11524), [Gargron](https://github.com/tootsuite/mastodon/pull/11513))
|
||||||
|
- Add hashtag usage breakdown to admin UI
|
||||||
|
- Add batch actions for hashtags to admin UI
|
||||||
|
- Add trends to web UI
|
||||||
|
- Add trends to public pages
|
||||||
|
- Add user preference to hide trends
|
||||||
|
- Add admin setting to disable trends
|
||||||
|
- **Add categories for custom emojis** ([Gargron](https://github.com/tootsuite/mastodon/pull/11196), [Gargron](https://github.com/tootsuite/mastodon/pull/11793), [Gargron](https://github.com/tootsuite/mastodon/pull/11920), [highemerly](https://github.com/tootsuite/mastodon/pull/11876))
|
||||||
|
- Add custom emoji categories to emoji picker in web UI
|
||||||
|
- Add `category` to custom emojis in REST API
|
||||||
|
- Add batch actions for custom emojis in admin UI
|
||||||
|
- Add max image dimensions to error message ([raboof](https://github.com/tootsuite/mastodon/pull/11552))
|
||||||
|
- Add aac, m4a, 3gp, amr, wma to allowed audio formats ([Gargron](https://github.com/tootsuite/mastodon/pull/11342), [umonaca](https://github.com/tootsuite/mastodon/pull/11687))
|
||||||
|
- **Add search syntax for operators and phrases** ([Gargron](https://github.com/tootsuite/mastodon/pull/11411))
|
||||||
|
- **Add REST API for managing featured hashtags** ([noellabo](https://github.com/tootsuite/mastodon/pull/11778))
|
||||||
|
- **Add REST API for managing timeline read markers** ([Gargron](https://github.com/tootsuite/mastodon/pull/11762))
|
||||||
|
- **Add ActivityPub secure mode** ([Gargron](https://github.com/tootsuite/mastodon/pull/11269), [ThibG](https://github.com/tootsuite/mastodon/pull/11332), [ThibG](https://github.com/tootsuite/mastodon/pull/11295))
|
||||||
|
- Add HTTP signatures to all outgoing ActivityPub GET requests ([Gargron](https://github.com/tootsuite/mastodon/pull/11284), [ThibG](https://github.com/tootsuite/mastodon/pull/11300))
|
||||||
|
- Add support for ActivityPub Audio activities ([ThibG](https://github.com/tootsuite/mastodon/pull/11189))
|
||||||
|
- Add ActivityPub actor representing the entire server ([ThibG](https://github.com/tootsuite/mastodon/pull/11321), [rtucker](https://github.com/tootsuite/mastodon/pull/11400), [ThibG](https://github.com/tootsuite/mastodon/pull/11561), [Gargron](https://github.com/tootsuite/mastodon/pull/11798))
|
||||||
|
- **Add whitelist mode** ([Gargron](https://github.com/tootsuite/mastodon/pull/11291), [mayaeh](https://github.com/tootsuite/mastodon/pull/11634))
|
||||||
|
- Add config of multipart threshold for S3 ([ykzts](https://github.com/tootsuite/mastodon/pull/11924), [ykzts](https://github.com/tootsuite/mastodon/pull/11944))
|
||||||
|
- Add health check endpoint for web ([ykzts](https://github.com/tootsuite/mastodon/pull/11770), [ykzts](https://github.com/tootsuite/mastodon/pull/11947))
|
||||||
|
- Add HTTP signature keyId to request log ([Gargron](https://github.com/tootsuite/mastodon/pull/11591))
|
||||||
|
- Add `SMTP_REPLY_TO` environment variable ([hugogameiro](https://github.com/tootsuite/mastodon/pull/11718))
|
||||||
|
- Add `tootctl preview_cards remove` command ([mayaeh](https://github.com/tootsuite/mastodon/pull/11320))
|
||||||
|
- Add `tootctl media refresh` command ([Gargron](https://github.com/tootsuite/mastodon/pull/11775))
|
||||||
|
- Add `tootctl cache recount` command ([Gargron](https://github.com/tootsuite/mastodon/pull/11597))
|
||||||
|
- Add option to exclude suspended domains from `tootctl domains crawl` ([dariusk](https://github.com/tootsuite/mastodon/pull/11454))
|
||||||
|
- Add soft delete for statuses for instant deletes through API ([Gargron](https://github.com/tootsuite/mastodon/pull/11623), [Gargron](https://github.com/tootsuite/mastodon/pull/11648))
|
||||||
|
- Add rails-level JSON caching ([Gargron](https://github.com/tootsuite/mastodon/pull/11333), [Gargron](https://github.com/tootsuite/mastodon/pull/11271))
|
||||||
|
- **Add request pool to improve delivery performance** ([Gargron](https://github.com/tootsuite/mastodon/pull/10353), [ykzts](https://github.com/tootsuite/mastodon/pull/11756))
|
||||||
|
- Add concurrent connection attempts to resolved IP addresses ([ThibG](https://github.com/tootsuite/mastodon/pull/11757))
|
||||||
|
- Add index for remember_token to improve login performance ([abcang](https://github.com/tootsuite/mastodon/pull/11881))
|
||||||
|
- **Add more accurate hashtag search** ([Gargron](https://github.com/tootsuite/mastodon/pull/11579), [Gargron](https://github.com/tootsuite/mastodon/pull/11427), [Gargron](https://github.com/tootsuite/mastodon/pull/11448))
|
||||||
|
- **Add more accurate account search** ([Gargron](https://github.com/tootsuite/mastodon/pull/11537), [Gargron](https://github.com/tootsuite/mastodon/pull/11580))
|
||||||
|
- **Add a spam check** ([Gargron](https://github.com/tootsuite/mastodon/pull/11217), [Gargron](https://github.com/tootsuite/mastodon/pull/11806), [ThibG](https://github.com/tootsuite/mastodon/pull/11296))
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- **Change conversations UI** ([Gargron](https://github.com/tootsuite/mastodon/pull/11896))
|
||||||
|
- Change dashboard to short number notation ([noellabo](https://github.com/tootsuite/mastodon/pull/11847), [noellabo](https://github.com/tootsuite/mastodon/pull/11911))
|
||||||
|
- Change REST API `GET /api/v1/timelines/public` to require authentication when public preview is off ([ThibG](https://github.com/tootsuite/mastodon/pull/11802))
|
||||||
|
- Change REST API `POST /api/v1/follow_requests/:id/(approve|reject)` to return relationship ([ThibG](https://github.com/tootsuite/mastodon/pull/11800))
|
||||||
|
- Change rate limit for media proxy ([ykzts](https://github.com/tootsuite/mastodon/pull/11814))
|
||||||
|
- Change unlisted custom emoji to not appear in autosuggestions ([Gargron](https://github.com/tootsuite/mastodon/pull/11818))
|
||||||
|
- Change max length of media descriptions from 420 to 1500 characters ([Gargron](https://github.com/tootsuite/mastodon/pull/11819), [ThibG](https://github.com/tootsuite/mastodon/pull/11836))
|
||||||
|
- **Change deletes to preserve soft-deleted statuses in unresolved reports** ([Gargron](https://github.com/tootsuite/mastodon/pull/11805))
|
||||||
|
- **Change tootctl to use inline parallelization instead of Sidekiq** ([Gargron](https://github.com/tootsuite/mastodon/pull/11776))
|
||||||
|
- **Change account deletion page to have better explanations** ([Gargron](https://github.com/tootsuite/mastodon/pull/11753), [Gargron](https://github.com/tootsuite/mastodon/pull/11763))
|
||||||
|
- Change hashtag component in web UI to show numbers for 2 last days ([Gargron](https://github.com/tootsuite/mastodon/pull/11742), [Gargron](https://github.com/tootsuite/mastodon/pull/11755), [Gargron](https://github.com/tootsuite/mastodon/pull/11754))
|
||||||
|
- Change OpenGraph description on sign-up page to reflect invite ([Gargron](https://github.com/tootsuite/mastodon/pull/11744))
|
||||||
|
- Change layout of public profile directory to be the same as in web UI ([Gargron](https://github.com/tootsuite/mastodon/pull/11705))
|
||||||
|
- Change detailed status child ordering to sort self-replies on top ([ThibG](https://github.com/tootsuite/mastodon/pull/11686))
|
||||||
|
- Change window resize handler to switch to/from mobile layout as soon as needed ([ThibG](https://github.com/tootsuite/mastodon/pull/11656))
|
||||||
|
- Change icon button styles to make hover/focus states more obvious ([ThibG](https://github.com/tootsuite/mastodon/pull/11474))
|
||||||
|
- Change contrast of status links that are not mentions or hashtags ([ThibG](https://github.com/tootsuite/mastodon/pull/11406))
|
||||||
|
- **Change hashtags to preserve first-used casing** ([Gargron](https://github.com/tootsuite/mastodon/pull/11416), [Gargron](https://github.com/tootsuite/mastodon/pull/11508), [Gargron](https://github.com/tootsuite/mastodon/pull/11504), [Gargron](https://github.com/tootsuite/mastodon/pull/11507), [Gargron](https://github.com/tootsuite/mastodon/pull/11441))
|
||||||
|
- **Change unconfirmed user login behaviour** ([Gargron](https://github.com/tootsuite/mastodon/pull/11375), [ThibG](https://github.com/tootsuite/mastodon/pull/11394), [Gargron](https://github.com/tootsuite/mastodon/pull/11860))
|
||||||
|
- **Change single-column mode to scroll the whole page** ([Gargron](https://github.com/tootsuite/mastodon/pull/11359), [Gargron](https://github.com/tootsuite/mastodon/pull/11894), [Gargron](https://github.com/tootsuite/mastodon/pull/11891), [ThibG](https://github.com/tootsuite/mastodon/pull/11655), [Gargron](https://github.com/tootsuite/mastodon/pull/11463), [Gargron](https://github.com/tootsuite/mastodon/pull/11458), [ThibG](https://github.com/tootsuite/mastodon/pull/11395), [Gargron](https://github.com/tootsuite/mastodon/pull/11418))
|
||||||
|
- Change `tootctl accounts follow` to only work with local accounts ([angristan](https://github.com/tootsuite/mastodon/pull/11592))
|
||||||
|
- Change Dockerfile ([Shleeble](https://github.com/tootsuite/mastodon/pull/11710), [ykzts](https://github.com/tootsuite/mastodon/pull/11768), [Shleeble](https://github.com/tootsuite/mastodon/pull/11707))
|
||||||
|
- Change supported Node versions to include v12 ([abcang](https://github.com/tootsuite/mastodon/pull/11706))
|
||||||
|
- Change Portuguese language from `pt` to `pt-PT` ([Gargron](https://github.com/tootsuite/mastodon/pull/11820))
|
||||||
|
|
||||||
|
### Removed
|
||||||
|
|
||||||
|
- **Remove OStatus support** ([Gargron](https://github.com/tootsuite/mastodon/pull/11205), [Gargron](https://github.com/tootsuite/mastodon/pull/11303), [Gargron](https://github.com/tootsuite/mastodon/pull/11460), [ThibG](https://github.com/tootsuite/mastodon/pull/11280), [ThibG](https://github.com/tootsuite/mastodon/pull/11278))
|
||||||
|
- Remove Atom feeds and old URLs in the form of `GET /:username/updates/:id` ([Gargron](https://github.com/tootsuite/mastodon/pull/11247))
|
||||||
|
- Remove WebP support ([angristan](https://github.com/tootsuite/mastodon/pull/11589))
|
||||||
|
- Remove deprecated config options from Heroku and Scalingo ([ykzts](https://github.com/tootsuite/mastodon/pull/11925))
|
||||||
|
- Remove deprecated REST API `GET /api/v1/search` API ([Gargron](https://github.com/tootsuite/mastodon/pull/11823))
|
||||||
|
- Remove deprecated REST API `GET /api/v1/statuses/:id/card` ([Gargron](https://github.com/tootsuite/mastodon/pull/11213))
|
||||||
|
- Remove deprecated REST API `POST /api/v1/notifications/dismiss?id=:id` ([Gargron](https://github.com/tootsuite/mastodon/pull/11214))
|
||||||
|
- Remove deprecated REST API `GET /api/v1/timelines/direct` ([Gargron](https://github.com/tootsuite/mastodon/pull/11212))
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Fix manifest warning ([ykzts](https://github.com/tootsuite/mastodon/pull/11767))
|
||||||
|
- Fix admin UI for custom emoji not respecting GIF autoplay preference ([ThibG](https://github.com/tootsuite/mastodon/pull/11801))
|
||||||
|
- Fix page body not being scrollable in admin/settings layout ([Gargron](https://github.com/tootsuite/mastodon/pull/11893))
|
||||||
|
- Fix placeholder colors for inputs not being explicitly defined ([Gargron](https://github.com/tootsuite/mastodon/pull/11890))
|
||||||
|
- Fix incorrect enclosure length in RSS ([tsia](https://github.com/tootsuite/mastodon/pull/11889))
|
||||||
|
- Fix TOTP codes not being filtered from logs during enabling/disabling ([Gargron](https://github.com/tootsuite/mastodon/pull/11877))
|
||||||
|
- Fix webfinger response not returning 410 when account is suspended ([Gargron](https://github.com/tootsuite/mastodon/pull/11869))
|
||||||
|
- Fix ActivityPub Move handler queuing jobs that will fail if account is suspended ([Gargron](https://github.com/tootsuite/mastodon/pull/11864))
|
||||||
|
- Fix SSO login not using existing account when e-mail is verified ([Gargron](https://github.com/tootsuite/mastodon/pull/11862))
|
||||||
|
- Fix web UI allowing uploads past status limit via drag & drop ([Gargron](https://github.com/tootsuite/mastodon/pull/11863))
|
||||||
|
- Fix expiring polls not being displayed as such in web UI ([ThibG](https://github.com/tootsuite/mastodon/pull/11835))
|
||||||
|
- Fix 2FA challenge and password challenge for non-database users ([Gargron](https://github.com/tootsuite/mastodon/pull/11831), [Gargron](https://github.com/tootsuite/mastodon/pull/11943))
|
||||||
|
- Fix profile fields overflowing page width in web UI ([Gargron](https://github.com/tootsuite/mastodon/pull/11828))
|
||||||
|
- Fix web push subscriptions being deleted on rate limit or timeout ([Gargron](https://github.com/tootsuite/mastodon/pull/11826))
|
||||||
|
- Fix display of long poll options in web UI ([ThibG](https://github.com/tootsuite/mastodon/pull/11717), [ThibG](https://github.com/tootsuite/mastodon/pull/11833))
|
||||||
|
- Fix search API not resolving URL when `type` is given ([Gargron](https://github.com/tootsuite/mastodon/pull/11822))
|
||||||
|
- Fix hashtags being split by ZWNJ character ([Gargron](https://github.com/tootsuite/mastodon/pull/11821))
|
||||||
|
- Fix scroll position resetting when opening media modals in web UI ([Gargron](https://github.com/tootsuite/mastodon/pull/11815))
|
||||||
|
- Fix duplicate HTML IDs on about page ([ThibG](https://github.com/tootsuite/mastodon/pull/11803))
|
||||||
|
- Fix admin UI showing superfluous reject media/reports on suspended domain blocks ([ThibG](https://github.com/tootsuite/mastodon/pull/11749))
|
||||||
|
- Fix ActivityPub context not being dynamically computed ([ThibG](https://github.com/tootsuite/mastodon/pull/11746))
|
||||||
|
- Fix Mastodon logo style on hover on public pages' footer ([ThibG](https://github.com/tootsuite/mastodon/pull/11735))
|
||||||
|
- Fix height of dashboard counters ([ThibG](https://github.com/tootsuite/mastodon/pull/11736))
|
||||||
|
- Fix custom emoji animation on hover in web UI directory bios ([ThibG](https://github.com/tootsuite/mastodon/pull/11716))
|
||||||
|
- Fix non-numbers being passed to Redis and causing an error ([Gargron](https://github.com/tootsuite/mastodon/pull/11697))
|
||||||
|
- Fix error in REST API for an account's statuses ([Gargron](https://github.com/tootsuite/mastodon/pull/11700))
|
||||||
|
- Fix uncaught error when resource param is missing in Webfinger request ([Gargron](https://github.com/tootsuite/mastodon/pull/11701))
|
||||||
|
- Fix uncaught domain normalization error in remote follow ([Gargron](https://github.com/tootsuite/mastodon/pull/11703))
|
||||||
|
- Fix uncaught 422 and 500 errors ([Gargron](https://github.com/tootsuite/mastodon/pull/11590), [Gargron](https://github.com/tootsuite/mastodon/pull/11811))
|
||||||
|
- Fix uncaught parameter missing exceptions and missing error templates ([Gargron](https://github.com/tootsuite/mastodon/pull/11702))
|
||||||
|
- Fix encoding error when checking e-mail MX records ([Gargron](https://github.com/tootsuite/mastodon/pull/11696))
|
||||||
|
- Fix items in StatusContent render list not all having a key ([ThibG](https://github.com/tootsuite/mastodon/pull/11645))
|
||||||
|
- Fix remote and staff-removed statuses leaving media behind for a day ([Gargron](https://github.com/tootsuite/mastodon/pull/11638))
|
||||||
|
- Fix CSP needlessly allowing blob URLs in script-src ([ThibG](https://github.com/tootsuite/mastodon/pull/11620))
|
||||||
|
- Fix ignoring whole status because of one invalid hashtag ([Gargron](https://github.com/tootsuite/mastodon/pull/11621))
|
||||||
|
- Fix hidden statuses losing focus ([ThibG](https://github.com/tootsuite/mastodon/pull/11208))
|
||||||
|
- Fix loading bar being obscured by other elements in web UI ([Gargron](https://github.com/tootsuite/mastodon/pull/11598))
|
||||||
|
- Fix multiple issues with replies collection for pages further than self-replies ([ThibG](https://github.com/tootsuite/mastodon/pull/11582))
|
||||||
|
- Fix blurhash and autoplay not working on public pages ([Gargron](https://github.com/tootsuite/mastodon/pull/11585))
|
||||||
|
- Fix 422 being returned instead of 404 when POSTing to unmatched routes ([Gargron](https://github.com/tootsuite/mastodon/pull/11574), [Gargron](https://github.com/tootsuite/mastodon/pull/11704))
|
||||||
|
- Fix client-side resizing of image uploads ([ThibG](https://github.com/tootsuite/mastodon/pull/11570))
|
||||||
|
- Fix short number formatting for numbers above million in web UI ([Gargron](https://github.com/tootsuite/mastodon/pull/11559))
|
||||||
|
- Fix ActivityPub and REST API queries setting cookies and preventing caching ([ThibG](https://github.com/tootsuite/mastodon/pull/11539), [ThibG](https://github.com/tootsuite/mastodon/pull/11557), [ThibG](https://github.com/tootsuite/mastodon/pull/11336), [ThibG](https://github.com/tootsuite/mastodon/pull/11331))
|
||||||
|
- Fix some emojis in profile metadata labels are not emojified. ([kedamaDQ](https://github.com/tootsuite/mastodon/pull/11534))
|
||||||
|
- Fix account search always returning exact match on paginated results ([Gargron](https://github.com/tootsuite/mastodon/pull/11525))
|
||||||
|
- Fix acct URIs with IDN domains not being resolved ([Gargron](https://github.com/tootsuite/mastodon/pull/11520))
|
||||||
|
- Fix admin dashboard missing latest features ([Gargron](https://github.com/tootsuite/mastodon/pull/11505))
|
||||||
|
- Fix jumping of toot date when clicking spoiler button ([ariasuni](https://github.com/tootsuite/mastodon/pull/11449))
|
||||||
|
- Fix boost to original audience not working on mobile in web UI ([ThibG](https://github.com/tootsuite/mastodon/pull/11371))
|
||||||
|
- Fix handling of webfinger redirects in ResolveAccountService ([ThibG](https://github.com/tootsuite/mastodon/pull/11279))
|
||||||
|
- Fix URLs appearing twice in errors of ActivityPub::DeliveryWorker ([Gargron](https://github.com/tootsuite/mastodon/pull/11231))
|
||||||
|
- Fix support for HTTP proxies ([ThibG](https://github.com/tootsuite/mastodon/pull/11245))
|
||||||
|
- Fix HTTP requests to IPv6 hosts ([ThibG](https://github.com/tootsuite/mastodon/pull/11240))
|
||||||
|
- Fix error in ElasticSearch index import ([mayaeh](https://github.com/tootsuite/mastodon/pull/11192))
|
||||||
|
- Fix duplicate account error when seeding development database ([ysksn](https://github.com/tootsuite/mastodon/pull/11366))
|
||||||
|
- Fix performance of session clean-up scheduler ([abcang](https://github.com/tootsuite/mastodon/pull/11871))
|
||||||
|
- Fix older migrations not running ([zunda](https://github.com/tootsuite/mastodon/pull/11377))
|
||||||
|
- Fix URLs counting towards RTL detection ([ahangarha](https://github.com/tootsuite/mastodon/pull/11759))
|
||||||
|
- Fix unnecessary status re-rendering in web UI ([ThibG](https://github.com/tootsuite/mastodon/pull/11211))
|
||||||
|
- Fix http_parser.rb gem not being compiled when no network available ([petabyteboy](https://github.com/tootsuite/mastodon/pull/11444))
|
||||||
|
|
||||||
## [2.9.3] - 2019-08-10
|
## [2.9.3] - 2019-08-10
|
||||||
### Added
|
### Added
|
||||||
|
|
6
Gemfile
6
Gemfile
|
@ -5,7 +5,7 @@ ruby '>= 2.4.0', '< 2.7.0'
|
||||||
|
|
||||||
gem 'pkg-config', '~> 1.3'
|
gem 'pkg-config', '~> 1.3'
|
||||||
|
|
||||||
gem 'puma', '~> 4.1'
|
gem 'puma', '~> 4.2'
|
||||||
gem 'rails', '~> 5.2.3'
|
gem 'rails', '~> 5.2.3'
|
||||||
gem 'thor', '~> 0.20'
|
gem 'thor', '~> 0.20'
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ gem 'bootsnap', '~> 1.4', require: false
|
||||||
gem 'browser'
|
gem 'browser'
|
||||||
gem 'charlock_holmes', '~> 0.7.6'
|
gem 'charlock_holmes', '~> 0.7.6'
|
||||||
gem 'iso-639'
|
gem 'iso-639'
|
||||||
gem 'chewy', '~> 5.0'
|
gem 'chewy', '~> 5.1'
|
||||||
gem 'cld3', '~> 3.2.4'
|
gem 'cld3', '~> 3.2.4'
|
||||||
gem 'devise', '~> 4.7'
|
gem 'devise', '~> 4.7'
|
||||||
gem 'devise-two-factor', '~> 3.1'
|
gem 'devise-two-factor', '~> 3.1'
|
||||||
|
@ -50,7 +50,7 @@ gem 'fastimage'
|
||||||
gem 'goldfinger', '~> 2.1'
|
gem 'goldfinger', '~> 2.1'
|
||||||
gem 'hiredis', '~> 0.6'
|
gem 'hiredis', '~> 0.6'
|
||||||
gem 'redis-namespace', '~> 1.5'
|
gem 'redis-namespace', '~> 1.5'
|
||||||
gem 'health_check', '~> 3.0'
|
gem 'health_check', git: 'https://github.com/ianheggie/health_check', ref: '0b799ead604f900ed50685e9b2d469cd2befba5b'
|
||||||
gem 'htmlentities', '~> 4.3'
|
gem 'htmlentities', '~> 4.3'
|
||||||
gem 'http', '~> 3.3'
|
gem 'http', '~> 3.3'
|
||||||
gem 'http_accept_language', '~> 2.1'
|
gem 'http_accept_language', '~> 2.1'
|
||||||
|
|
22
Gemfile.lock
22
Gemfile.lock
|
@ -1,3 +1,11 @@
|
||||||
|
GIT
|
||||||
|
remote: https://github.com/ianheggie/health_check
|
||||||
|
revision: 0b799ead604f900ed50685e9b2d469cd2befba5b
|
||||||
|
ref: 0b799ead604f900ed50685e9b2d469cd2befba5b
|
||||||
|
specs:
|
||||||
|
health_check (4.0.0.pre)
|
||||||
|
rails (>= 4.0)
|
||||||
|
|
||||||
GIT
|
GIT
|
||||||
remote: https://github.com/rtomayko/posix-spawn
|
remote: https://github.com/rtomayko/posix-spawn
|
||||||
revision: 58465d2e213991f8afb13b984854a49fcdcc980c
|
revision: 58465d2e213991f8afb13b984854a49fcdcc980c
|
||||||
|
@ -161,7 +169,7 @@ GEM
|
||||||
case_transform (0.2)
|
case_transform (0.2)
|
||||||
activesupport
|
activesupport
|
||||||
charlock_holmes (0.7.6)
|
charlock_holmes (0.7.6)
|
||||||
chewy (5.0.1)
|
chewy (5.1.0)
|
||||||
activesupport (>= 4.0)
|
activesupport (>= 4.0)
|
||||||
elasticsearch (>= 2.0.0)
|
elasticsearch (>= 2.0.0)
|
||||||
elasticsearch-dsl
|
elasticsearch-dsl
|
||||||
|
@ -278,8 +286,6 @@ GEM
|
||||||
concurrent-ruby (~> 1.0)
|
concurrent-ruby (~> 1.0)
|
||||||
hashdiff (1.0.0)
|
hashdiff (1.0.0)
|
||||||
hashie (3.6.0)
|
hashie (3.6.0)
|
||||||
health_check (3.0.0)
|
|
||||||
railties (>= 5.0)
|
|
||||||
heapy (0.1.4)
|
heapy (0.1.4)
|
||||||
highline (2.0.1)
|
highline (2.0.1)
|
||||||
hiredis (0.6.3)
|
hiredis (0.6.3)
|
||||||
|
@ -445,7 +451,7 @@ GEM
|
||||||
pry-rails (0.3.9)
|
pry-rails (0.3.9)
|
||||||
pry (>= 0.10.4)
|
pry (>= 0.10.4)
|
||||||
public_suffix (4.0.1)
|
public_suffix (4.0.1)
|
||||||
puma (4.1.1)
|
puma (4.2.0)
|
||||||
nio4r (~> 2.0)
|
nio4r (~> 2.0)
|
||||||
pundit (2.1.0)
|
pundit (2.1.0)
|
||||||
activesupport (>= 3.0.0)
|
activesupport (>= 3.0.0)
|
||||||
|
@ -687,7 +693,7 @@ DEPENDENCIES
|
||||||
capistrano-yarn (~> 2.0)
|
capistrano-yarn (~> 2.0)
|
||||||
capybara (~> 3.29)
|
capybara (~> 3.29)
|
||||||
charlock_holmes (~> 0.7.6)
|
charlock_holmes (~> 0.7.6)
|
||||||
chewy (~> 5.0)
|
chewy (~> 5.1)
|
||||||
cld3 (~> 3.2.4)
|
cld3 (~> 3.2.4)
|
||||||
climate_control (~> 0.2)
|
climate_control (~> 0.2)
|
||||||
concurrent-ruby
|
concurrent-ruby
|
||||||
|
@ -708,7 +714,7 @@ DEPENDENCIES
|
||||||
fuubar (~> 2.4)
|
fuubar (~> 2.4)
|
||||||
goldfinger (~> 2.1)
|
goldfinger (~> 2.1)
|
||||||
hamlit-rails (~> 0.2)
|
hamlit-rails (~> 0.2)
|
||||||
health_check (~> 3.0)
|
health_check!
|
||||||
hiredis (~> 0.6)
|
hiredis (~> 0.6)
|
||||||
htmlentities (~> 4.3)
|
htmlentities (~> 4.3)
|
||||||
http (~> 3.3)
|
http (~> 3.3)
|
||||||
|
@ -752,7 +758,7 @@ DEPENDENCIES
|
||||||
private_address_check (~> 0.5)
|
private_address_check (~> 0.5)
|
||||||
pry-byebug (~> 3.7)
|
pry-byebug (~> 3.7)
|
||||||
pry-rails (~> 0.3)
|
pry-rails (~> 0.3)
|
||||||
puma (~> 4.1)
|
puma (~> 4.2)
|
||||||
pundit (~> 2.1)
|
pundit (~> 2.1)
|
||||||
rack-attack (~> 6.1)
|
rack-attack (~> 6.1)
|
||||||
rack-cors (~> 1.0)
|
rack-cors (~> 1.0)
|
||||||
|
@ -793,7 +799,7 @@ DEPENDENCIES
|
||||||
webpush
|
webpush
|
||||||
|
|
||||||
RUBY VERSION
|
RUBY VERSION
|
||||||
ruby 2.6.1p33
|
ruby 2.6.4p104
|
||||||
|
|
||||||
BUNDLED WITH
|
BUNDLED WITH
|
||||||
1.17.3
|
1.17.3
|
||||||
|
|
|
@ -8,6 +8,8 @@ class Auth::SessionsController < Devise::SessionsController
|
||||||
skip_before_action :require_no_authentication, only: [:create]
|
skip_before_action :require_no_authentication, only: [:create]
|
||||||
skip_before_action :require_functional!
|
skip_before_action :require_functional!
|
||||||
|
|
||||||
|
prepend_before_action :authenticate_with_two_factor, if: :two_factor_enabled?, only: [:create]
|
||||||
|
|
||||||
before_action :set_instance_presenter, only: [:new]
|
before_action :set_instance_presenter, only: [:new]
|
||||||
before_action :set_body_classes
|
before_action :set_body_classes
|
||||||
|
|
||||||
|
@ -20,22 +22,9 @@ class Auth::SessionsController < Devise::SessionsController
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
self.resource = begin
|
super do |resource|
|
||||||
if user_params[:email].blank? && session[:otp_user_id].present?
|
remember_me(resource)
|
||||||
User.find(session[:otp_user_id])
|
flash.delete(:notice)
|
||||||
else
|
|
||||||
warden.authenticate!(auth_options)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if resource.otp_required_for_login?
|
|
||||||
if user_params[:otp_attempt].present? && session[:otp_user_id].present?
|
|
||||||
authenticate_with_two_factor_via_otp(resource)
|
|
||||||
else
|
|
||||||
prompt_for_two_factor(resource)
|
|
||||||
end
|
|
||||||
else
|
|
||||||
authenticate_and_respond(resource)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -49,6 +38,16 @@ class Auth::SessionsController < Devise::SessionsController
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
|
||||||
|
def find_user
|
||||||
|
if session[:otp_user_id]
|
||||||
|
User.find(session[:otp_user_id])
|
||||||
|
else
|
||||||
|
user = User.authenticate_with_ldap(user_params) if Devise.ldap_authentication
|
||||||
|
user ||= User.authenticate_with_pam(user_params) if Devise.pam_authentication
|
||||||
|
user ||= User.find_for_authentication(email: user_params[:email])
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def user_params
|
def user_params
|
||||||
params.require(:user).permit(:email, :password, :otp_attempt)
|
params.require(:user).permit(:email, :password, :otp_attempt)
|
||||||
end
|
end
|
||||||
|
@ -71,6 +70,10 @@ class Auth::SessionsController < Devise::SessionsController
|
||||||
super
|
super
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def two_factor_enabled?
|
||||||
|
find_user&.otp_required_for_login?
|
||||||
|
end
|
||||||
|
|
||||||
def valid_otp_attempt?(user)
|
def valid_otp_attempt?(user)
|
||||||
user.validate_and_consume_otp!(user_params[:otp_attempt]) ||
|
user.validate_and_consume_otp!(user_params[:otp_attempt]) ||
|
||||||
user.invalidate_otp_backup_code!(user_params[:otp_attempt])
|
user.invalidate_otp_backup_code!(user_params[:otp_attempt])
|
||||||
|
@ -78,10 +81,24 @@ class Auth::SessionsController < Devise::SessionsController
|
||||||
false
|
false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def authenticate_with_two_factor
|
||||||
|
user = self.resource = find_user
|
||||||
|
|
||||||
|
if user_params[:otp_attempt].present? && session[:otp_user_id]
|
||||||
|
authenticate_with_two_factor_via_otp(user)
|
||||||
|
elsif user.present? && (user.encrypted_password.blank? || user.valid_password?(user_params[:password]))
|
||||||
|
# If encrypted_password is blank, we got the user from LDAP or PAM,
|
||||||
|
# so credentials are already valid
|
||||||
|
|
||||||
|
prompt_for_two_factor(user)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def authenticate_with_two_factor_via_otp(user)
|
def authenticate_with_two_factor_via_otp(user)
|
||||||
if valid_otp_attempt?(user)
|
if valid_otp_attempt?(user)
|
||||||
session.delete(:otp_user_id)
|
session.delete(:otp_user_id)
|
||||||
authenticate_and_respond(user)
|
remember_me(user)
|
||||||
|
sign_in(user)
|
||||||
else
|
else
|
||||||
flash.now[:alert] = I18n.t('users.invalid_otp_token')
|
flash.now[:alert] = I18n.t('users.invalid_otp_token')
|
||||||
prompt_for_two_factor(user)
|
prompt_for_two_factor(user)
|
||||||
|
@ -90,16 +107,10 @@ class Auth::SessionsController < Devise::SessionsController
|
||||||
|
|
||||||
def prompt_for_two_factor(user)
|
def prompt_for_two_factor(user)
|
||||||
session[:otp_user_id] = user.id
|
session[:otp_user_id] = user.id
|
||||||
|
@body_classes = 'lighter'
|
||||||
render :two_factor
|
render :two_factor
|
||||||
end
|
end
|
||||||
|
|
||||||
def authenticate_and_respond(user)
|
|
||||||
sign_in(user)
|
|
||||||
remember_me(user)
|
|
||||||
|
|
||||||
respond_with user, location: after_sign_in_path_for(user)
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def set_instance_presenter
|
def set_instance_presenter
|
||||||
|
@ -112,11 +123,9 @@ class Auth::SessionsController < Devise::SessionsController
|
||||||
|
|
||||||
def home_paths(resource)
|
def home_paths(resource)
|
||||||
paths = [about_path]
|
paths = [about_path]
|
||||||
|
|
||||||
if single_user_mode? && resource.is_a?(User)
|
if single_user_mode? && resource.is_a?(User)
|
||||||
paths << short_account_path(username: resource.account)
|
paths << short_account_path(username: resource.account)
|
||||||
end
|
end
|
||||||
|
|
||||||
paths
|
paths
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@ class TOCGenerator
|
||||||
parsed_html.traverse do |node|
|
parsed_html.traverse do |node|
|
||||||
next unless TARGET_ELEMENTS.include?(node.name)
|
next unless TARGET_ELEMENTS.include?(node.name)
|
||||||
|
|
||||||
anchor = node['id'] || node.text.parameterize
|
anchor = node['id'] || node.text.parameterize.presence || 'sec'
|
||||||
@slugs[anchor] += 1
|
@slugs[anchor] += 1
|
||||||
anchor = "#{anchor}-#{@slugs[anchor]}" if @slugs[anchor] > 1
|
anchor = "#{anchor}-#{@slugs[anchor]}" if @slugs[anchor] > 1
|
||||||
|
|
||||||
|
|
|
@ -3,24 +3,50 @@
|
||||||
module LdapAuthenticable
|
module LdapAuthenticable
|
||||||
extend ActiveSupport::Concern
|
extend ActiveSupport::Concern
|
||||||
|
|
||||||
def ldap_setup(_attributes)
|
class_methods do
|
||||||
self.confirmed_at = Time.now.utc
|
def authenticate_with_ldap(params = {})
|
||||||
self.admin = false
|
ldap = Net::LDAP.new(ldap_options)
|
||||||
self.external = true
|
filter = format(Devise.ldap_search_filter, uid: Devise.ldap_uid, email: params[:email])
|
||||||
|
|
||||||
save!
|
if (user_info = ldap.bind_as(base: Devise.ldap_base, filter: filter, password: params[:password]))
|
||||||
|
ldap_get_user(user_info.first)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class_methods do
|
|
||||||
def ldap_get_user(attributes = {})
|
def ldap_get_user(attributes = {})
|
||||||
resource = joins(:account).find_by(accounts: { username: attributes[Devise.ldap_uid.to_sym].first })
|
resource = joins(:account).find_by(accounts: { username: attributes[Devise.ldap_uid.to_sym].first })
|
||||||
|
|
||||||
if resource.blank?
|
if resource.blank?
|
||||||
resource = new(email: attributes[:mail].first, agreement: true, account_attributes: { username: attributes[Devise.ldap_uid.to_sym].first })
|
resource = new(email: attributes[:mail].first, agreement: true, account_attributes: { username: attributes[Devise.ldap_uid.to_sym].first }, admin: false, external: true, confirmed_at: Time.now.utc)
|
||||||
resource.ldap_setup(attributes)
|
resource.save!
|
||||||
end
|
end
|
||||||
|
|
||||||
resource
|
resource
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def ldap_options
|
||||||
|
opts = {
|
||||||
|
host: Devise.ldap_host,
|
||||||
|
port: Devise.ldap_port,
|
||||||
|
base: Devise.ldap_base,
|
||||||
|
|
||||||
|
auth: {
|
||||||
|
method: :simple,
|
||||||
|
username: Devise.ldap_bind_dn,
|
||||||
|
password: Devise.ldap_password,
|
||||||
|
},
|
||||||
|
|
||||||
|
connect_timeout: 10,
|
||||||
|
}
|
||||||
|
|
||||||
|
if [:simple_tls, :start_tls].include?(Devise.ldap_method)
|
||||||
|
opts[:encryption] = {
|
||||||
|
method: Devise.ldap_method,
|
||||||
|
tls_options: OpenSSL::SSL::SSLContext::DEFAULT_PARAMS.tap { |options| options[:verify_mode] = OpenSSL::SSL::VERIFY_NONE if Devise.ldap_tls_no_verify },
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
opts
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -13,7 +13,8 @@ require_relative '../lib/paperclip/video_transcoder'
|
||||||
require_relative '../lib/paperclip/type_corrector'
|
require_relative '../lib/paperclip/type_corrector'
|
||||||
require_relative '../lib/mastodon/snowflake'
|
require_relative '../lib/mastodon/snowflake'
|
||||||
require_relative '../lib/mastodon/version'
|
require_relative '../lib/mastodon/version'
|
||||||
require_relative '../lib/devise/ldap_authenticatable'
|
require_relative '../lib/devise/two_factor_ldap_authenticatable'
|
||||||
|
require_relative '../lib/devise/two_factor_pam_authenticatable'
|
||||||
|
|
||||||
Dotenv::Railtie.load
|
Dotenv::Railtie.load
|
||||||
|
|
||||||
|
|
|
@ -71,13 +71,10 @@ end
|
||||||
|
|
||||||
Devise.setup do |config|
|
Devise.setup do |config|
|
||||||
config.warden do |manager|
|
config.warden do |manager|
|
||||||
manager.default_strategies(scope: :user).unshift :database_authenticatable
|
manager.default_strategies(scope: :user).unshift :two_factor_ldap_authenticatable if Devise.ldap_authentication
|
||||||
manager.default_strategies(scope: :user).unshift :ldap_authenticatable if Devise.ldap_authentication
|
manager.default_strategies(scope: :user).unshift :two_factor_pam_authenticatable if Devise.pam_authentication
|
||||||
manager.default_strategies(scope: :user).unshift :pam_authenticatable if Devise.pam_authentication
|
manager.default_strategies(scope: :user).unshift :two_factor_authenticatable
|
||||||
|
manager.default_strategies(scope: :user).unshift :two_factor_backupable
|
||||||
# We handle 2FA in our own sessions controller so this gets in the way
|
|
||||||
manager.default_strategies(scope: :user).delete :two_factor_backupable
|
|
||||||
manager.default_strategies(scope: :user).delete :two_factor_authenticatable
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# The secret key used by Devise. Devise uses this key to generate
|
# The secret key used by Devise. Devise uses this key to generate
|
||||||
|
|
|
@ -3,4 +3,6 @@ HealthCheck.setup do |config|
|
||||||
|
|
||||||
config.standard_checks = %w(database migrations cache)
|
config.standard_checks = %w(database migrations cache)
|
||||||
config.full_checks = %w(database migrations cache)
|
config.full_checks = %w(database migrations cache)
|
||||||
|
|
||||||
|
config.include_error_in_response_body = false
|
||||||
end
|
end
|
||||||
|
|
|
@ -25,6 +25,7 @@ if ENV['S3_ENABLED'] == 'true'
|
||||||
s3_protocol: s3_protocol,
|
s3_protocol: s3_protocol,
|
||||||
s3_host_name: s3_hostname,
|
s3_host_name: s3_hostname,
|
||||||
s3_headers: {
|
s3_headers: {
|
||||||
|
'X-Amz-Multipart-Threshold' => ENV.fetch('S3_MULTIPART_THRESHOLD') { 15.megabytes }.to_i,
|
||||||
'Cache-Control' => 'public, max-age=315576000, immutable',
|
'Cache-Control' => 'public, max-age=315576000, immutable',
|
||||||
},
|
},
|
||||||
s3_permissions: ENV.fetch('S3_PERMISSION') { 'public-read' },
|
s3_permissions: ENV.fetch('S3_PERMISSION') { 'public-read' },
|
||||||
|
|
|
@ -1,55 +0,0 @@
|
||||||
# frozen_string_literal: true
|
|
||||||
|
|
||||||
require 'net/ldap'
|
|
||||||
require 'devise/strategies/authenticatable'
|
|
||||||
|
|
||||||
module Devise
|
|
||||||
module Strategies
|
|
||||||
class LdapAuthenticatable < Authenticatable
|
|
||||||
def authenticate!
|
|
||||||
if params[:user]
|
|
||||||
ldap = Net::LDAP.new(
|
|
||||||
host: Devise.ldap_host,
|
|
||||||
port: Devise.ldap_port,
|
|
||||||
base: Devise.ldap_base,
|
|
||||||
encryption: {
|
|
||||||
method: Devise.ldap_method,
|
|
||||||
tls_options: tls_options,
|
|
||||||
},
|
|
||||||
auth: {
|
|
||||||
method: :simple,
|
|
||||||
username: Devise.ldap_bind_dn,
|
|
||||||
password: Devise.ldap_password,
|
|
||||||
},
|
|
||||||
connect_timeout: 10
|
|
||||||
)
|
|
||||||
|
|
||||||
filter = format(Devise.ldap_search_filter, uid: Devise.ldap_uid, email: email)
|
|
||||||
|
|
||||||
if (user_info = ldap.bind_as(base: Devise.ldap_base, filter: filter, password: password))
|
|
||||||
user = User.ldap_get_user(user_info.first)
|
|
||||||
success!(user)
|
|
||||||
else
|
|
||||||
return fail(:invalid)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def email
|
|
||||||
params[:user][:email]
|
|
||||||
end
|
|
||||||
|
|
||||||
def password
|
|
||||||
params[:user][:password]
|
|
||||||
end
|
|
||||||
|
|
||||||
def tls_options
|
|
||||||
OpenSSL::SSL::SSLContext::DEFAULT_PARAMS.tap do |options|
|
|
||||||
options[:verify_mode] = OpenSSL::SSL::VERIFY_NONE if Devise.ldap_tls_no_verify
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
Warden::Strategies.add(:ldap_authenticatable, Devise::Strategies::LdapAuthenticatable)
|
|
|
@ -0,0 +1,32 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
require 'net/ldap'
|
||||||
|
require 'devise/strategies/base'
|
||||||
|
|
||||||
|
module Devise
|
||||||
|
module Strategies
|
||||||
|
class TwoFactorLdapAuthenticatable < Base
|
||||||
|
def valid?
|
||||||
|
valid_params? && mapping.to.respond_to?(:authenticate_with_ldap)
|
||||||
|
end
|
||||||
|
|
||||||
|
def authenticate!
|
||||||
|
resource = mapping.to.authenticate_with_ldap(params[scope])
|
||||||
|
|
||||||
|
if resource && !resource.otp_required_for_login?
|
||||||
|
success!(resource)
|
||||||
|
else
|
||||||
|
fail(:invalid)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
protected
|
||||||
|
|
||||||
|
def valid_params?
|
||||||
|
params[scope] && params[scope][:password].present?
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
Warden::Strategies.add(:two_factor_ldap_authenticatable, Devise::Strategies::TwoFactorLdapAuthenticatable)
|
|
@ -0,0 +1,31 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
require 'devise/strategies/base'
|
||||||
|
|
||||||
|
module Devise
|
||||||
|
module Strategies
|
||||||
|
class TwoFactorPamAuthenticatable < Base
|
||||||
|
def valid?
|
||||||
|
valid_params? && mapping.to.respond_to?(:authenticate_with_pam)
|
||||||
|
end
|
||||||
|
|
||||||
|
def authenticate!
|
||||||
|
resource = mapping.to.authenticate_with_pam(params[scope])
|
||||||
|
|
||||||
|
if resource && !resource.otp_required_for_login?
|
||||||
|
success!(resource)
|
||||||
|
else
|
||||||
|
fail(:invalid)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
protected
|
||||||
|
|
||||||
|
def valid_params?
|
||||||
|
params[scope] && params[scope][:password].present?
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
Warden::Strategies.add(:two_factor_pam_authenticatable, Devise::Strategies::TwoFactorPamAuthenticatable)
|
|
@ -135,7 +135,7 @@ namespace :mastodon do
|
||||||
prompt.say "\n"
|
prompt.say "\n"
|
||||||
|
|
||||||
if prompt.yes?('Do you want to store uploaded files on the cloud?', default: false)
|
if prompt.yes?('Do you want to store uploaded files on the cloud?', default: false)
|
||||||
case prompt.select('Provider', ['Amazon S3', 'Wasabi', 'Minio'])
|
case prompt.select('Provider', ['Amazon S3', 'Wasabi', 'Minio', 'Google Cloud Storage'])
|
||||||
when 'Amazon S3'
|
when 'Amazon S3'
|
||||||
env['S3_ENABLED'] = 'true'
|
env['S3_ENABLED'] = 'true'
|
||||||
env['S3_PROTOCOL'] = 'https'
|
env['S3_PROTOCOL'] = 'https'
|
||||||
|
@ -217,6 +217,34 @@ namespace :mastodon do
|
||||||
q.required true
|
q.required true
|
||||||
q.modify :strip
|
q.modify :strip
|
||||||
end
|
end
|
||||||
|
when 'Google Cloud Storage'
|
||||||
|
env['S3_ENABLED'] = 'true'
|
||||||
|
env['S3_PROTOCOL'] = 'https'
|
||||||
|
env['S3_HOSTNAME'] = 'storage.googleapis.com'
|
||||||
|
env['S3_ENDPOINT'] = 'https://storage.googleapis.com'
|
||||||
|
env['S3_MULTIPART_THRESHOLD'] = 50.megabytes
|
||||||
|
|
||||||
|
env['S3_BUCKET'] = prompt.ask('GCS bucket name:') do |q|
|
||||||
|
q.required true
|
||||||
|
q.default "files.#{env['LOCAL_DOMAIN']}"
|
||||||
|
q.modify :strip
|
||||||
|
end
|
||||||
|
|
||||||
|
env['S3_REGION'] = prompt.ask('GCS region:') do |q|
|
||||||
|
q.required true
|
||||||
|
q.default 'us-west1'
|
||||||
|
q.modify :strip
|
||||||
|
end
|
||||||
|
|
||||||
|
env['AWS_ACCESS_KEY_ID'] = prompt.ask('GCS access key:') do |q|
|
||||||
|
q.required true
|
||||||
|
q.modify :strip
|
||||||
|
end
|
||||||
|
|
||||||
|
env['AWS_SECRET_ACCESS_KEY'] = prompt.ask('GCS secret key:') do |q|
|
||||||
|
q.required true
|
||||||
|
q.modify :strip
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if prompt.yes?('Do you want to access the uploaded files from your own domain?')
|
if prompt.yes?('Do you want to access the uploaded files from your own domain?')
|
||||||
|
|
Loading…
Reference in New Issue