From 0327ab9616d723736e3442bbacb8bbae93955549 Mon Sep 17 00:00:00 2001 From: Eugen Date: Tue, 28 Feb 2017 14:58:11 +0100 Subject: Updated sponsors --- docs/Contributing-to-Mastodon/Sponsors.md | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) (limited to 'docs') diff --git a/docs/Contributing-to-Mastodon/Sponsors.md b/docs/Contributing-to-Mastodon/Sponsors.md index 3fee6e1e0..9cdd5b03d 100644 --- a/docs/Contributing-to-Mastodon/Sponsors.md +++ b/docs/Contributing-to-Mastodon/Sponsors.md @@ -6,23 +6,16 @@ These people make the development of Mastodon possible through [Patreon](https:/ **Extra special Patrons** - [World'sTallestLadder](https://mastodon.social/users/carcinoGeneticist) -- [glocal](https://mastodon.social/users/glocal) - [Jimmy Tidey](https://mastodon.social/users/jimmytidey) - [Kurtis Rainbolt-Greene](https://mastodon.social/users/krainboltgreene) - [Kit Redgrave](https://socially.constructed.space/users/KitRedgrave) -- [Zeiphner](https://mastodon.social/users/Zeipher) +- [Zeipher](https://mastodon.social/users/Zeipher) - [Effy Elden](https://toot.zone/users/effy) - [Zoƫ Quinn](https://mastodon.social/users/zoequinn) **Thank you to the following people** -- [Sophia Park](https://mastodon.social/users/sophia) -- [WelshPixie](https://mastodon.social/users/WelshPixie) -- [John Parker](https://mastodon.social/users/Middaparka) -- [Christina Hendricks](https://mastodon.social/users/clhendricksbc) -- [Jelle](http://jelv.nl) - [Harris Bomberguy](https://mastodon.social/users/Hbomberguy) -- [Martin Tithonium](https://mastodon.social/users/tithonium) - [Edward Saperia](https://nwspk.com) - [Yoz Grahame](http://yoz.com/) - [Jenn Kaplan](https://gay.crime.team/users/jkap) @@ -33,5 +26,21 @@ These people make the development of Mastodon possible through [Patreon](https:/ - [Niels Roesen Abildgaard](http://hypesystem.dk/) - [Zatnosk](https://github.com/Zatnosk) - [Spex Bluefox](https://mastodon.social/users/Spex) -- [Sam Waldie](https://mastodon.social/users/denjin) - [J. C. Holder](http://jcholder.com/) +- [glocal](https://mastodon.social/users/glocal) +- [jk](https://mastodon.social/users/jk) +- [C418](https://mastodon.social/users/C418) +- [halcy](https://icosahedron.website/users/halcy) +- [Extropic](https://gnusocial.no/extropic) +- TBD +- TBD +- TBD +- TBD +- TBD +- TBD +- TBD +- TBD +- TBD +- TBD +- TBD +- TBD -- cgit From b4a12c88e7b472bee8f93f976fdaa36c0c81c624 Mon Sep 17 00:00:00 2001 From: shel Date: Tue, 28 Feb 2017 13:02:39 -0500 Subject: Add social.dickseven.com New instance --- docs/Using-Mastodon/List-of-Mastodon-instances.md | 1 + 1 file changed, 1 insertion(+) (limited to 'docs') diff --git a/docs/Using-Mastodon/List-of-Mastodon-instances.md b/docs/Using-Mastodon/List-of-Mastodon-instances.md index ed3c74294..ed549d5bb 100644 --- a/docs/Using-Mastodon/List-of-Mastodon-instances.md +++ b/docs/Using-Mastodon/List-of-Mastodon-instances.md @@ -14,5 +14,6 @@ List of Known Mastodon instances | [gnusocial.me](https://gnusocial.me) |Yes, it's a mastodon instance now|Yes| | [icosahedron.website](https://icosahedron.website/) |Icosahedron-themed (well, visually), open registration.|Yes| | [memetastic.space](https://memetastic.space) |Memes|Yes| +| [social.diskseven.com](https://social.diskseven.com) |Single user|No| Let me know if you start running one so I can add it to the list! (Alternatively, add it yourself as a pull request). -- cgit From fac8bfc03f2fefc5092206a24eff44ed49e21347 Mon Sep 17 00:00:00 2001 From: undrskr Date: Fri, 3 Mar 2017 22:38:10 +0200 Subject: gnusocial.me doesn't use Mastodon anymore The host uses postActiv now. --- docs/Using-Mastodon/List-of-Mastodon-instances.md | 1 - 1 file changed, 1 deletion(-) (limited to 'docs') diff --git a/docs/Using-Mastodon/List-of-Mastodon-instances.md b/docs/Using-Mastodon/List-of-Mastodon-instances.md index ed549d5bb..3dc9cf031 100644 --- a/docs/Using-Mastodon/List-of-Mastodon-instances.md +++ b/docs/Using-Mastodon/List-of-Mastodon-instances.md @@ -11,7 +11,6 @@ List of Known Mastodon instances | [epiktistes.com](https://epiktistes.com) |N/A|Yes| | [on.vu](https://on.vu) | Appears defunct|No| | [gay.crime.team](https://gay.crime.team) |N/A|Yes(?)| -| [gnusocial.me](https://gnusocial.me) |Yes, it's a mastodon instance now|Yes| | [icosahedron.website](https://icosahedron.website/) |Icosahedron-themed (well, visually), open registration.|Yes| | [memetastic.space](https://memetastic.space) |Memes|Yes| | [social.diskseven.com](https://social.diskseven.com) |Single user|No| -- cgit From 851b7303736c1a4806aa80d370f93a9a79bfc35b Mon Sep 17 00:00:00 2001 From: Alexander Acevedo Date: Fri, 3 Mar 2017 19:17:58 -0500 Subject: add social.gestaltzerfall.net instance information Hello fediverse! --- docs/Using-Mastodon/List-of-Mastodon-instances.md | 1 + 1 file changed, 1 insertion(+) (limited to 'docs') diff --git a/docs/Using-Mastodon/List-of-Mastodon-instances.md b/docs/Using-Mastodon/List-of-Mastodon-instances.md index 3dc9cf031..ef3c835de 100644 --- a/docs/Using-Mastodon/List-of-Mastodon-instances.md +++ b/docs/Using-Mastodon/List-of-Mastodon-instances.md @@ -14,5 +14,6 @@ List of Known Mastodon instances | [icosahedron.website](https://icosahedron.website/) |Icosahedron-themed (well, visually), open registration.|Yes| | [memetastic.space](https://memetastic.space) |Memes|Yes| | [social.diskseven.com](https://social.diskseven.com) |Single user|No| +| [social.gestaltzerfall.net](https://social.gestaltzerfall.net) |Single user|No| Let me know if you start running one so I can add it to the list! (Alternatively, add it yourself as a pull request). -- cgit From 5f4e402204c9da289d1a6b5e3902bf2c9cfe61c1 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sun, 5 Mar 2017 17:27:17 +0100 Subject: Improved /api/v1/accounts/:id/statuses with new params: only_media, exclude_replies Redirect /:username to /users/:username Redirect /:username/:id to /users/:username/updates/:id Updated API documentation and sponsors --- app/controllers/api/v1/accounts_controller.rb | 17 ++------------- app/models/status.rb | 9 +++++--- config/routes.rb | 4 +++- docs/Contributing-to-Mastodon/Sponsors.md | 2 +- docs/Using-the-API/API.md | 30 +++++++++++++++++++++++++-- 5 files changed, 40 insertions(+), 22 deletions(-) (limited to 'docs') diff --git a/app/controllers/api/v1/accounts_controller.rb b/app/controllers/api/v1/accounts_controller.rb index d691ac987..c666651b4 100644 --- a/app/controllers/api/v1/accounts_controller.rb +++ b/app/controllers/api/v1/accounts_controller.rb @@ -47,6 +47,8 @@ class Api::V1::AccountsController < ApiController def statuses @statuses = @account.statuses.permitted_for(@account, current_account).paginate_by_max_id(limit_param(DEFAULT_STATUSES_LIMIT), params[:max_id], params[:since_id]) + @statuses = @statuses.where(id: MediaAttachment.where(account: @account).where.not(status_id: nil).reorder('').select('distinct status_id')) if params[:only_media] + @statuses = @statuses.without_replies if params[:exclude_replies] @statuses = cache_collection(@statuses, Status) set_maps(@statuses) @@ -58,21 +60,6 @@ class Api::V1::AccountsController < ApiController set_pagination_headers(next_path, prev_path) end - def media_statuses - media_ids = MediaAttachment.where(account: @account).where.not(status_id: nil).reorder('').select('distinct status_id') - @statuses = @account.statuses.where(id: media_ids).permitted_for(@account, current_account).paginate_by_max_id(limit_param(DEFAULT_STATUSES_LIMIT), params[:max_id], params[:since_id]) - @statuses = cache_collection(@statuses, Status) - - set_maps(@statuses) - set_counters_maps(@statuses) - - next_path = media_statuses_api_v1_account_url(max_id: @statuses.last.id) unless @statuses.empty? - prev_path = media_statuses_api_v1_account_url(since_id: @statuses.first.id) unless @statuses.empty? - - set_pagination_headers(next_path, prev_path) - render action: :statuses - end - def follow FollowService.new.call(current_user.account, @account.acct) set_relationship diff --git a/app/models/status.rb b/app/models/status.rb index e5e740360..663ac1e34 100644 --- a/app/models/status.rb +++ b/app/models/status.rb @@ -37,6 +37,9 @@ class Status < ApplicationRecord scope :remote, -> { where.not(uri: nil) } scope :local, -> { where(uri: nil) } + scope :without_replies, -> { where('statuses.reply = FALSE OR statuses.in_reply_to_account_id = statuses.account_id') } + scope :without_reblogs, -> { where('statuses.reblog_of_id IS NULL') } + cache_associated :account, :application, :media_attachments, :tags, :stream_entry, mentions: :account, reblog: [:account, :application, :stream_entry, :tags, :media_attachments, mentions: :account], thread: :account def reply? @@ -109,8 +112,8 @@ class Status < ApplicationRecord def as_public_timeline(account = nil, local_only = false) query = joins('LEFT OUTER JOIN accounts ON statuses.account_id = accounts.id') .where(visibility: :public) - .where('(statuses.reply = false OR statuses.in_reply_to_account_id = statuses.account_id)') - .where('statuses.reblog_of_id IS NULL') + .without_replies + .without_reblogs query = query.where('accounts.domain IS NULL') if local_only @@ -121,7 +124,7 @@ class Status < ApplicationRecord query = tag.statuses .joins('LEFT OUTER JOIN accounts ON statuses.account_id = accounts.id') .where(visibility: :public) - .where('statuses.reblog_of_id IS NULL') + .without_reblogs query = query.where('accounts.domain IS NULL') if local_only diff --git a/config/routes.rb b/config/routes.rb index f6e2dce5c..a0c76f829 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -153,7 +153,6 @@ Rails.application.routes.draw do member do get :statuses - get 'statuses/media', to: 'accounts#media_statuses', as: :media_statuses get :followers get :following @@ -180,5 +179,8 @@ Rails.application.routes.draw do root 'home#index' + get '/:username', to: redirect('/users/%{username}') + get '/:username/:id', to: redirect('/users/%{username}/updates/%{id}') + match '*unmatched_route', via: :all, to: 'application#raise_not_found' end diff --git a/docs/Contributing-to-Mastodon/Sponsors.md b/docs/Contributing-to-Mastodon/Sponsors.md index 9cdd5b03d..475791684 100644 --- a/docs/Contributing-to-Mastodon/Sponsors.md +++ b/docs/Contributing-to-Mastodon/Sponsors.md @@ -32,7 +32,7 @@ These people make the development of Mastodon possible through [Patreon](https:/ - [C418](https://mastodon.social/users/C418) - [halcy](https://icosahedron.website/users/halcy) - [Extropic](https://gnusocial.no/extropic) -- TBD +- [Pat Monaghan](http://iwrite.software/) - TBD - TBD - TBD diff --git a/docs/Using-the-API/API.md b/docs/Using-the-API/API.md index 07c1b25a9..af7858286 100644 --- a/docs/Using-the-API/API.md +++ b/docs/Using-the-API/API.md @@ -75,6 +75,10 @@ Query parameters: - `max_id` (optional): Skip statuses younger than ID (e.g. navigate backwards in time) - `since_id` (optional): Skip statuses older than ID (e.g. check for updates) +Query parameters for public and tag timelines only: + +- `local` (optional): Only return statuses originating from this instance + ### Notifications **GET /api/v1/notifications** @@ -115,7 +119,14 @@ Returns authenticated user's account. **GET /api/v1/accounts/:id/statuses** -Returns statuses by user. Same options as timeline are permitted. +Returns statuses by user. + +Query parameters: + +- `max_id` (optional): Skip statuses younger than ID (e.g. navigate backwards in time) +- `since_id` (optional): Skip statuses older than ID (e.g. check for updates) +- `only_media` (optional): Only return statuses that have media attachments +- `exclude_replies` (optional): Skip statuses that reply to other statuses **GET /api/v1/accounts/:id/following** @@ -127,7 +138,7 @@ Returns users the given user is followed by. **GET /api/v1/accounts/relationships** -Returns relationships (`following`, `followed_by`, `blocking`) of the current user to a list of given accounts. +Returns relationships (`following`, `followed_by`, `blocking`, `muting`, `requested`) of the current user to a list of given accounts. Query parameters: @@ -146,6 +157,14 @@ Query parameters: Returns accounts blocked by authenticated user. +**GET /api/v1/mutes** + +Returns accounts muted by authenticated user. + +**GET /api/v1/follow_requests** + +Returns accounts that want to follow the authenticated user but are waiting for approval. + **GET /api/v1/favourites** Returns statuses favourited by authenticated user. @@ -207,6 +226,13 @@ Returns the updated relationship to the user. Returns the updated relationship to the user. +# Muting and unmuting users + +**POST /api/v1/accounts/:id/mute** +**POST /api/v1/accounts/:id/unmute** + +Returns the updated relationship to the user. + ### OAuth apps **POST /api/v1/apps** -- cgit From 02349b32696d6559ed64dbe4f401892d5fa5ddf7 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Tue, 14 Mar 2017 15:59:21 +0100 Subject: Obfuscate filenames better, double rate limits --- app/controllers/concerns/obfuscate_filename.rb | 6 +++++- config/initializers/rack-attack.rb | 4 ++-- docs/Using-the-API/Push-notifications.md | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) (limited to 'docs') diff --git a/app/controllers/concerns/obfuscate_filename.rb b/app/controllers/concerns/obfuscate_filename.rb index dde7ce8c6..9c896fb09 100644 --- a/app/controllers/concerns/obfuscate_filename.rb +++ b/app/controllers/concerns/obfuscate_filename.rb @@ -13,6 +13,10 @@ module ObfuscateFilename file = params.dig(*path) return if file.nil? - file.original_filename = 'media' + File.extname(file.original_filename) + file.original_filename = secure_token + File.extname(file.original_filename) + end + + def secure_token(length = 16) + SecureRandom.hex(length / 2) end end diff --git a/config/initializers/rack-attack.rb b/config/initializers/rack-attack.rb index 3f0ee1d7a..70f7846d1 100644 --- a/config/initializers/rack-attack.rb +++ b/config/initializers/rack-attack.rb @@ -1,6 +1,6 @@ class Rack::Attack # Rate limits for the API - throttle('api', limit: 150, period: 5.minutes) do |req| + throttle('api', limit: 300, period: 5.minutes) do |req| req.ip if req.path.match(/\A\/api\/v/) end @@ -11,7 +11,7 @@ class Rack::Attack headers = { 'X-RateLimit-Limit' => match_data[:limit].to_s, 'X-RateLimit-Remaining' => '0', - 'X-RateLimit-Reset' => (now + (match_data[:period] - now.to_i % match_data[:period])).iso8601(6) + 'X-RateLimit-Reset' => (now + (match_data[:period] - now.to_i % match_data[:period])).iso8601(6), } [429, headers, [{ error: 'Throttled' }.to_json]] diff --git a/docs/Using-the-API/Push-notifications.md b/docs/Using-the-API/Push-notifications.md index d98c8833a..fc373e723 100644 --- a/docs/Using-the-API/Push-notifications.md +++ b/docs/Using-the-API/Push-notifications.md @@ -1,4 +1,4 @@ Push notifications ================== -**Note: This push notification design turned out to not be fully operational on the side of Firebase. A different approach is in consideration** +See for an example of how to create push notifications for a mobile app. It involves using the Mastodon streaming API on behalf of the app's users, as a sort of proxy. -- cgit From c1124228e857b0e85f5bf927d2c41c7fadfdf955 Mon Sep 17 00:00:00 2001 From: Eugen Date: Wed, 15 Mar 2017 18:44:37 +0100 Subject: Update list of apps --- docs/Using-Mastodon/Apps.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'docs') diff --git a/docs/Using-Mastodon/Apps.md b/docs/Using-Mastodon/Apps.md index e350e5f95..62d48c5ec 100644 --- a/docs/Using-Mastodon/Apps.md +++ b/docs/Using-Mastodon/Apps.md @@ -5,11 +5,13 @@ Some people have started working on apps for the Mastodon API. Here is a list of |App|Platform|Link|Developer(s)| |---|--------|----|------------| -|Matodor|iOS/Android||[@jeroensmeets@mastodon.social](https://mastodon.social/users/jeroensmeets)| |Tusky|Android||[@Vavassor@mastodon.social](https://mastodon.social/users/Vavassor)| -|Albatross|iOS||[@goldie_ice@mastodon.social](https://mastodon.social/users/goldie_ice)| -|tootstream|command-line||[@Raccoon@mastodon.social](https://mastodon.social/users/Raccoon)| -|mastodroid|Android||| -|Tooter|Chrome extension||[@effy@mastodon.social](https://mastodon.social/users/effy)| +|mastodroid|Android||[@charlag@mastodon.social](https://mastodon.social/users/charlag)| |TootyFruity|Android||[@eggplant@mastodon.social](https://mastodon.social/users/eggplant)| +|Matodor|iOS/Android||[@jeroensmeets@mastodon.social](https://mastodon.social/users/jeroensmeets)| +|Amarok|iOS||[@eurasierboy@mastodon.social](https://mastodon.social/users/eurasierboy)| +|Albatross|iOS||[@goldie_ice@mastodon.social](https://mastodon.social/users/goldie_ice)| +|Tooter|Chrome||[@effy@mastodon.social](https://mastodon.social/users/effy)| +|tootstream|CLI||[@Raccoon@mastodon.social](https://mastodon.social/users/Raccoon)| + If you have a project like this, let me know so I can add it to the list! -- cgit