2021-02-02 11:44:17 +01:00
|
|
|
require 'sidekiq/web'
|
|
|
|
|
|
2020-11-07 14:49:32 +01:00
|
|
|
Rails.application.routes.draw do
|
2023-05-29 23:10:39 +02:00
|
|
|
devise_for :users, controllers: { confirmations: 'users/confirmations' }
|
2020-11-10 11:36:06 +01:00
|
|
|
|
2020-12-02 15:22:58 +01:00
|
|
|
get 'welcome', to: 'welcome#index'
|
|
|
|
|
get 'check_your_email', to: 'welcome#check_your_email'
|
|
|
|
|
|
2020-12-02 19:20:01 +01:00
|
|
|
get 'signup', to: 'signup#index'
|
2020-12-02 20:46:46 +01:00
|
|
|
match 'signup/:step', to: 'signup#steps', as: :signup_steps, via: [:get, :post]
|
|
|
|
|
post 'signup_validate', to: 'signup#validate'
|
2020-12-02 19:20:01 +01:00
|
|
|
|
2022-12-12 14:05:31 +01:00
|
|
|
namespace :contributions do
|
|
|
|
|
root to: 'donations#index'
|
|
|
|
|
get 'projects', to: 'projects#index'
|
|
|
|
|
resources :donations, only: ['index']
|
|
|
|
|
end
|
2021-02-01 18:38:35 +01:00
|
|
|
|
2020-12-02 19:20:01 +01:00
|
|
|
resources :invitations, only: ['index', 'show', 'create', 'destroy']
|
2020-11-07 16:50:26 +01:00
|
|
|
|
2023-05-01 16:13:41 +02:00
|
|
|
namespace :services do
|
2023-08-07 18:16:14 +02:00
|
|
|
resource :chat, only: [:show], controller: 'chat'
|
|
|
|
|
|
2023-11-19 18:49:17 +01:00
|
|
|
resource :mastodon, only: [:show], controller: 'mastodon'
|
|
|
|
|
|
2023-05-01 16:13:41 +02:00
|
|
|
resources :lightning, only: [:index] do
|
|
|
|
|
collection do
|
|
|
|
|
get 'transactions'
|
2023-06-12 18:18:06 +02:00
|
|
|
get 'qr_lnurlp'
|
2023-05-01 16:13:41 +02:00
|
|
|
end
|
|
|
|
|
end
|
2023-08-10 14:52:03 +02:00
|
|
|
|
2023-11-19 18:49:17 +01:00
|
|
|
resource :storage, controller: 'remotestorage', only: [:show] do
|
|
|
|
|
resources :rs_auths, only: [:destroy] do
|
|
|
|
|
member do
|
2023-11-19 19:10:13 +01:00
|
|
|
get :revoke, to: 'rs_auths#destroy'
|
|
|
|
|
get :launch_app
|
2023-11-19 18:49:17 +01:00
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
2023-05-01 16:13:41 +02:00
|
|
|
end
|
2021-11-20 16:13:43 -06:00
|
|
|
|
2023-04-03 13:19:07 +02:00
|
|
|
resources :settings, param: 'section', only: ['index', 'show', 'update'] do
|
|
|
|
|
collection do
|
2023-05-25 16:58:53 +02:00
|
|
|
post 'update_email'
|
2023-04-03 13:19:07 +02:00
|
|
|
post 'reset_password'
|
2023-03-08 13:44:18 +07:00
|
|
|
post 'set_nostr_pubkey'
|
2023-03-08 16:43:59 +07:00
|
|
|
delete 'nostr_pubkey', to: 'settings#remove_nostr_pubkey'
|
2023-04-03 13:19:07 +02:00
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
2023-02-23 17:46:19 +08:00
|
|
|
get 'lnurlpay/:address', to: 'lnurlpay#index',
|
|
|
|
|
as: 'lightning_address', constraints: { address: /[^\/]+/}
|
|
|
|
|
get 'lnurlpay/:address/invoice', to: 'lnurlpay#invoice',
|
|
|
|
|
as: 'lnurlpay_invoice', constraints: { address: /[^\/]+/}
|
|
|
|
|
get 'keysend/:address', to: 'lnurlpay#keysend',
|
|
|
|
|
as: 'lightning_address_keysend', constraints: { address: /[^\/]+/}
|
2021-11-22 15:41:05 -06:00
|
|
|
|
2023-03-18 13:35:02 +07:00
|
|
|
get '.well-known/nostr', to: 'well_known#nostr'
|
|
|
|
|
|
2023-01-11 19:17:27 +08:00
|
|
|
post 'webhooks/lndhub', to: 'webhooks#lndhub'
|
|
|
|
|
|
2022-05-23 22:47:08 +02:00
|
|
|
namespace :api do
|
2023-09-04 16:02:17 +02:00
|
|
|
get 'btcpay/onchain_btc_balance', to: 'btcpay#onchain_btc_balance'
|
|
|
|
|
get 'btcpay/lightning_btc_balance', to: 'btcpay#lightning_btc_balance'
|
2022-05-23 22:47:08 +02:00
|
|
|
end
|
|
|
|
|
|
2020-11-18 00:22:44 +01:00
|
|
|
namespace :admin do
|
|
|
|
|
root to: 'dashboard#index'
|
2023-10-24 17:28:50 +02:00
|
|
|
|
2023-02-23 22:09:23 +08:00
|
|
|
resources 'users', param: 'address', only: ['index', 'show'], constraints: { address: /.*/ }
|
2023-02-10 13:12:36 +08:00
|
|
|
get 'invitations', to: 'invitations#index'
|
2020-12-17 21:55:16 +01:00
|
|
|
resources :donations
|
2023-02-10 13:12:36 +08:00
|
|
|
get 'lightning', to: 'lightning#index'
|
2023-02-17 20:32:29 +08:00
|
|
|
|
2023-10-24 17:28:50 +02:00
|
|
|
namespace :app_catalog do
|
|
|
|
|
resources 'web_apps', only: ['index']
|
|
|
|
|
end
|
|
|
|
|
|
2023-02-17 20:32:29 +08:00
|
|
|
namespace :settings do
|
2023-02-17 21:36:30 +08:00
|
|
|
resources 'registrations', only: ['index', 'create']
|
|
|
|
|
resources 'services', only: ['index', 'create']
|
2023-02-17 20:32:29 +08:00
|
|
|
end
|
2020-11-18 00:22:44 +01:00
|
|
|
end
|
2020-11-10 11:36:06 +01:00
|
|
|
|
2023-03-12 21:46:03 +01:00
|
|
|
namespace :rs do
|
2023-08-01 13:58:52 +02:00
|
|
|
resource :oauth, only: [:new, :create], path_names: {
|
2023-11-01 21:46:38 +01:00
|
|
|
new: ':username', create: ':username'
|
|
|
|
|
}, controller: 'oauth'
|
2023-03-12 21:46:03 +01:00
|
|
|
end
|
|
|
|
|
|
2023-06-20 14:07:46 +02:00
|
|
|
get '.well-known/webfinger', to: 'webfinger#show'
|
2023-04-10 21:23:21 +02:00
|
|
|
|
2023-05-29 23:05:18 +02:00
|
|
|
namespace :discourse do
|
|
|
|
|
get "connect", to: 'sso#connect'
|
|
|
|
|
end
|
2023-04-13 15:02:51 +02:00
|
|
|
|
2021-02-02 11:44:17 +01:00
|
|
|
authenticate :user, ->(user) { user.is_admin? } do
|
2023-05-29 23:10:39 +02:00
|
|
|
mount Sidekiq::Web, at: '/sidekiq'
|
|
|
|
|
mount Flipper::UI.app(Flipper), at: '/flipper'
|
2021-02-02 11:44:17 +01:00
|
|
|
end
|
|
|
|
|
|
2020-11-10 11:36:06 +01:00
|
|
|
# Letter Opener (open "sent" emails in dev and staging)
|
|
|
|
|
if Rails.env.match(/staging|development/)
|
2023-05-29 23:10:39 +02:00
|
|
|
mount LetterOpenerWeb::Engine, at: '/letter_opener'
|
2020-11-10 11:36:06 +01:00
|
|
|
end
|
|
|
|
|
|
2020-11-11 18:56:06 +01:00
|
|
|
root to: 'dashboard#index'
|
2023-10-25 22:14:07 +02:00
|
|
|
|
|
|
|
|
direct :s3_image do |blob|
|
|
|
|
|
File.join(ENV['S3_ALIAS_HOST'], blob.key)
|
|
|
|
|
end
|
2020-11-07 14:49:32 +01:00
|
|
|
end
|