143 lines
4.1 KiB
Ruby
143 lines
4.1 KiB
Ruby
Rails.application.routes.draw do
|
|
devise_for :users, controllers: {
|
|
confirmations: 'users/confirmations',
|
|
sessions: 'users/sessions'
|
|
}
|
|
|
|
devise_scope :user do
|
|
post 'users/nostr_login', to: 'users/sessions#nostr_login'
|
|
end
|
|
|
|
get 'welcome', to: 'welcome#index'
|
|
get 'check_your_email', to: 'welcome#check_your_email'
|
|
|
|
get 'signup', to: 'signup#index'
|
|
match 'signup/:step', to: 'signup#steps', as: :signup_steps, via: [:get, :post]
|
|
post 'signup_validate', to: 'signup#validate'
|
|
|
|
get 'privacy', to: 'pages#privacy', as: :privacy_page
|
|
get 'tos', to: 'pages#tos', as: :tos_page
|
|
|
|
get "users/:username/avatars/:hash", to: "avatars#show", as: :user_avatar
|
|
|
|
namespace :contributions do
|
|
root to: 'donations#index'
|
|
resources :donations, only: ['index', 'create'] do
|
|
member do
|
|
get 'confirm_btcpay'
|
|
end
|
|
end
|
|
get 'other', to: 'other#index'
|
|
end
|
|
|
|
resources :invitations, only: ['index', 'show', 'create', 'destroy']
|
|
|
|
namespace :services do
|
|
resource :chat, only: [:show], controller: 'chat'
|
|
|
|
resource :mastodon, only: [:show], controller: 'mastodon'
|
|
|
|
resource :email, only: [:show], controller: 'email' do
|
|
member do
|
|
get 'new_password'
|
|
end
|
|
end
|
|
|
|
resources :lightning, only: [:index] do
|
|
collection do
|
|
get 'transactions'
|
|
get 'qr_lnurlp'
|
|
end
|
|
end
|
|
|
|
resource :storage, controller: 'remotestorage', only: [:show] do
|
|
get :apps, to: "rs_auths#index"
|
|
resources :rs_auths, only: [:index, :destroy] do
|
|
member do
|
|
get :revoke, to: 'rs_auths#destroy'
|
|
get :launch_app
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|
|
resources :settings, param: 'section', only: ['index', 'show', 'update'] do
|
|
collection do
|
|
post 'update_email'
|
|
post 'reset_password'
|
|
post 'reset_email_password'
|
|
post 'set_nostr_pubkey'
|
|
delete 'nostr_pubkey', to: 'settings#remove_nostr_pubkey'
|
|
end
|
|
end
|
|
|
|
get '.well-known/webfinger', to: 'webfinger#show'
|
|
get '.well-known/nostr', to: 'well_known#nostr'
|
|
get '.well-known/lnurlp/:username', to: 'lnurlpay#index', as: :lightning_address
|
|
get '.well-known/keysend/:username', to: 'lnurlpay#keysend', as: :lightning_address_keysend
|
|
get '.well-known/openpgpkey/hu/:hashed_username(.:format)', to: 'web_key_directory#show', as: :wkd_key
|
|
get '.well-known/openpgpkey/policy', to: 'web_key_directory#policy'
|
|
|
|
get 'lnurlpay/:username/invoice', to: 'lnurlpay#invoice', as: :lnurlpay_invoice
|
|
|
|
post 'webhooks/lndhub', to: 'webhooks#lndhub'
|
|
|
|
namespace :api do
|
|
get 'btcpay/onchain_btc_balance', to: 'btcpay#onchain_btc_balance'
|
|
get 'btcpay/lightning_btc_balance', to: 'btcpay#lightning_btc_balance'
|
|
end
|
|
|
|
namespace :admin do
|
|
root to: 'dashboard#index'
|
|
|
|
resources 'users', param: 'username', only: ['index', 'show'] do
|
|
member do
|
|
post 'invitations', to: 'users#create_invitations'
|
|
delete 'invitations', to: 'users#delete_invitations'
|
|
end
|
|
end
|
|
|
|
resources :donations
|
|
resources :editable_contents, except: ['destroy']
|
|
|
|
get 'invitations', to: 'invitations#index'
|
|
get 'lightning', to: 'lightning#index'
|
|
|
|
namespace :app_catalog do
|
|
resources 'web_apps', only: ['index']
|
|
end
|
|
|
|
namespace :settings do
|
|
resource 'registrations', only: ['show', 'update']
|
|
resource 'membership', only: ['show', 'update'], controller: 'membership'
|
|
resources 'services', param: 'service', only: ['index', 'show', 'update']
|
|
end
|
|
end
|
|
|
|
namespace :rs do
|
|
resource :oauth, only: [:new, :create], path_names: {
|
|
new: ':username', create: ':username'
|
|
}, controller: 'oauth'
|
|
end
|
|
|
|
namespace :discourse do
|
|
get "connect", to: 'sso#connect'
|
|
end
|
|
|
|
authenticate :user, ->(user) { user.is_admin? } do
|
|
mount MissionControl::Jobs::Engine, at: "/jobs"
|
|
mount Flipper::UI.app(Flipper), at: '/flipper'
|
|
end
|
|
|
|
# Letter Opener (open "sent" emails in dev and staging)
|
|
if Rails.env.match(/staging|development/)
|
|
mount LetterOpenerWeb::Engine, at: '/letter_opener'
|
|
end
|
|
|
|
root to: 'dashboard#index'
|
|
|
|
direct :s3_image do |blob|
|
|
File.join(ENV['S3_ALIAS_HOST'], blob.key)
|
|
end
|
|
end
|