retrospring/config/routes.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

61 lines
2.2 KiB
Ruby
Raw Normal View History

# frozen_string_literal: true
require "sidekiq/web"
2014-08-01 11:23:47 +02:00
Rails.application.routes.draw do
start = Time.zone.now
2014-12-05 07:02:23 +01:00
# Routes only accessible by admins (admin panels, sidekiq, pghero)
authenticate :user, ->(user) { user.has_role?(:administrator) } do
# Admin panel
mount RailsAdmin::Engine => "/justask_admin", :as => "rails_admin"
2014-12-12 18:35:14 +01:00
mount Sidekiq::Web, at: "/sidekiq"
mount PgHero::Engine, at: "/pghero", as: "pghero"
end
root to: "about#index"
2014-08-01 11:23:47 +02:00
get "/about", to: "about#about"
get "/privacy", to: "about#privacy_policy", as: :privacy_policy
get "/terms", to: "about#terms", as: :terms
get "/linkfilter", to: "link_filter#index", as: :linkfilter
get "/manifest.json", to: "manifests#show", as: :webapp_manifest
2014-11-02 17:58:27 +01:00
constraints(Constraints::LocalNetwork) do
get "/metrics", to: "metrics#show"
end
2023-02-13 20:13:32 +01:00
2014-11-02 17:58:27 +01:00
# Devise routes
devise_for :users, path: "user", skip: %i[sessions registrations]
2014-11-02 17:58:27 +01:00
as :user do
# :sessions
get "sign_in" => "user/sessions#new", :as => :new_user_session
post "sign_in" => "user/sessions#create", :as => :user_session
delete "sign_out" => "devise/sessions#destroy", :as => :destroy_user_session
2014-11-02 17:58:27 +01:00
# :registrations
get "settings/delete_account" => "devise/registrations#cancel", :as => :cancel_user_registration
get "/settings/account" => "devise/registrations#edit", :as => :edit_user_registration
patch "/settings/account" => "devise/registrations#update", :as => :update_user_registration
put "/settings/account" => "devise/registrations#update"
delete "/settings/account" => "user/registrations#destroy"
2014-11-02 17:58:27 +01:00
end
namespace :settings do
get :export, to: "export#index"
post :export, to: "export#create"
end
2014-11-03 13:21:41 +01:00
2022-11-21 22:29:47 +01:00
resource :anonymous_block, controller: :anonymous_block, only: %i[create destroy]
2023-01-04 17:08:05 +01:00
namespace :well_known, path: "/.well-known" do
get "/change-password", to: redirect("/settings/account")
get "/nodeinfo", to: "node_info#discovery"
end
get "/nodeinfo/2.1", to: "well_known/node_info#nodeinfo", as: :node_info
2023-10-23 00:45:40 +02:00
get "/modal/close", to: "modal#close", as: :modal_close
puts "processing time of routes.rb: #{"#{(Time.zone.now - start).round(3).to_s.ljust(5, '0')}s".light_green}"
2014-08-01 11:23:47 +02:00
end