diff options
Diffstat (limited to 'config/routes.rb')
-rw-r--r-- | config/routes.rb | 123 |
1 files changed, 75 insertions, 48 deletions
diff --git a/config/routes.rb b/config/routes.rb index 0d49a07d6..49edb4602 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -6,8 +6,12 @@ require 'sidekiq-scheduler/web' Sidekiq::Web.set :session_secret, Rails.application.secrets[:secret_key_base] Rails.application.routes.draw do + root 'home#index' + mount LetterOpenerWeb::Engine, at: 'letter_opener' if Rails.env.development? + health_check_routes + authenticate :user, lambda { |u| u.admin? } do mount Sidekiq::Web, at: 'sidekiq', as: :sidekiq mount PgHero::Engine, at: 'pghero', as: :pghero @@ -20,17 +24,28 @@ Rails.application.routes.draw do end get '.well-known/host-meta', to: 'well_known/host_meta#show', as: :host_meta, defaults: { format: 'xml' } + get '.well-known/nodeinfo', to: 'well_known/nodeinfo#index', as: :nodeinfo, defaults: { format: 'json' } get '.well-known/webfinger', to: 'well_known/webfinger#show', as: :webfinger get '.well-known/change-password', to: redirect('/auth/edit') get '.well-known/keybase-proof-config', to: 'well_known/keybase_proof_config#show' + get '/nodeinfo/2.0', to: 'well_known/nodeinfo#show', as: :nodeinfo_schema + get 'manifest', to: 'manifests#show', defaults: { format: 'json' } get 'intent', to: 'intents#show' get 'custom.css', to: 'custom_css#show', as: :custom_css + resource :instance_actor, path: 'actor', only: [:show] do + resource :inbox, only: [:create], module: :activitypub + end + devise_scope :user do get '/invite/:invite_code', to: 'auth/registrations#new', as: :public_invite - match '/auth/finish_signup' => 'auth/confirmations#finish_signup', via: [:get, :patch], as: :finish_signup + + namespace :auth do + resource :setup, only: [:show, :update], controller: :setup + resource :challenge, only: [:create], controller: :challenges + end end devise_for :users, path: 'auth', controllers: { @@ -45,12 +60,6 @@ Rails.application.routes.draw do get '/authorize_follow', to: redirect { |_, request| "/authorize_interaction?#{request.params.to_query}" } resources :accounts, path: 'users', only: [:show], param: :username do - resources :stream_entries, path: 'updates', only: [:show] do - member do - get :embed - end - end - get :remote_follow, to: 'remote_follow#new' post :remote_follow, to: 'remote_follow#create' @@ -58,8 +67,9 @@ Rails.application.routes.draw do member do get :activity get :embed - get :replies end + + resources :replies, only: [:index], module: :activitypub end resources :followers, only: [:index], controller: :follower_accounts @@ -129,8 +139,13 @@ Rails.application.routes.draw do resources :flavours, only: [:index, :show, :update], param: :flavour resource :delete, only: [:show, :destroy] - resource :migration, only: [:show, :update] + resource :migration, only: [:show, :create] + namespace :migration do + resource :redirect, only: [:new, :create, :destroy] + end + + resources :aliases, only: [:index, :create, :destroy] resources :sessions, only: [:destroy] resources :featured_tags, only: [:index, :create, :destroy] end @@ -148,16 +163,18 @@ Rails.application.routes.draw do get '/public', to: 'public_timelines#show', as: :public_timeline get '/media_proxy/:id/(*any)', to: 'media_proxy#show', as: :media_proxy - # Remote follow - resource :remote_unfollow, only: [:create] resource :authorize_interaction, only: [:show, :create] resource :share, only: [:show, :create] namespace :admin do get '/dashboard', to: 'dashboard#index' - resources :subscriptions, only: [:index] - resources :domain_blocks, only: [:new, :create, :show, :destroy] + resources :domain_allows, only: [:new, :create, :show, :destroy] + resources :domain_blocks, only: [:new, :create, :show, :destroy, :update] do + member do + get :edit + end + end resources :email_domain_blocks, only: [:index, :new, :create, :destroy] resources :action_logs, only: [:index] resources :warning_presets, except: [:new] @@ -193,8 +210,6 @@ Rails.application.routes.draw do resources :accounts, only: [:index, :show] do member do - post :subscribe - post :unsubscribe post :enable post :unsilence post :unsuspend @@ -238,20 +253,19 @@ Rails.application.routes.draw do resource :two_factor_authentication, only: [:destroy] end - resources :custom_emojis, only: [:index, :new, :create, :update, :destroy] do - member do - post :copy - post :enable - post :disable + resources :custom_emojis, only: [:index, :new, :create] do + collection do + post :batch end end resources :account_moderation_notes, only: [:create, :destroy] - resources :tags, only: [:index] do - member do - post :hide - post :unhide + resources :tags, only: [:index, :show, :update] do + collection do + post :approve_all + post :reject_all + post :batch end end end @@ -259,16 +273,6 @@ Rails.application.routes.draw do get '/admin', to: redirect('/admin/dashboard', status: 302) namespace :api do - # PubSubHubbub outgoing subscriptions - resources :subscriptions, only: [:show] - post '/subscriptions/:id', to: 'subscriptions#update' - - # PubSubHubbub incoming subscriptions - post '/push', to: 'push#update', as: :push - - # Salmon - post '/salmon/:id', to: 'salmon#update', as: :salmon - # OEmbed get '/oembed', to: 'oembed#show', as: :oembed @@ -299,7 +303,6 @@ Rails.application.routes.draw do member do get :context - get :card end end @@ -323,9 +326,6 @@ Rails.application.routes.draw do end end - get '/search', to: 'search#index', as: :search - - resources :follows, only: [:create] resources :media, only: [:create, :update] resources :blocks, only: [:index] resources :mutes, only: [:index] do @@ -336,8 +336,10 @@ Rails.application.routes.draw do resources :favourites, only: [:index] resources :bookmarks, only: [:index] resources :reports, only: [:create] + resources :trends, only: [:index] resources :filters, only: [:index, :create, :show, :update, :destroy] resources :endorsements, only: [:index] + resources :markers, only: [:index, :create] namespace :apps do get :verify_credentials, to: 'credentials#show' @@ -351,6 +353,7 @@ Rails.application.routes.draw do end resource :domain_blocks, only: [:show, :create, :destroy] + resource :directory, only: [:show] resources :follow_requests, only: [:index] do member do @@ -362,7 +365,6 @@ Rails.application.routes.draw do resources :notifications, only: [:index, :show, :destroy] do collection do post :clear - post :dismiss # Deprecated delete :destroy_multiple end @@ -402,6 +404,12 @@ Rails.application.routes.draw do resource :accounts, only: [:show, :create, :destroy], controller: 'lists/accounts' end + namespace :featured_tags do + get :suggestions, to: 'suggestions#index' + end + + resources :featured_tags, only: [:index, :create, :destroy] + resources :polls, only: [:create, :show] do resources :votes, only: :create, controller: 'polls/votes' end @@ -409,6 +417,29 @@ Rails.application.routes.draw do namespace :push do resource :subscription, only: [:create, :show, :update, :destroy] end + + namespace :admin do + resources :accounts, only: [:index, :show] do + member do + post :enable + post :unsilence + post :unsuspend + post :approve + post :reject + end + + resource :action, only: [:create], controller: 'account_actions' + end + + resources :reports, only: [:index, :show] do + member do + post :assign_to_self + post :unassign + post :reopen + post :resolve + end + end + end end namespace :v2 do @@ -428,14 +459,10 @@ Rails.application.routes.draw do get '/web/(*any)', to: 'home#index', as: :web - get '/about', to: 'about#show' - get '/about/more', to: 'about#more' - get '/terms', to: 'about#terms' - - root 'home#index' + get '/about', to: 'about#show' + get '/about/more', to: 'about#more' + get '/terms', to: 'about#terms' - match '*unmatched_route', - via: :all, - to: 'application#raise_not_found', - format: false + match '/', via: [:post, :put, :patch, :delete], to: 'application#raise_not_found', format: false + match '*unmatched_route', via: :all, to: 'application#raise_not_found', format: false end |