Merge branch 'standalone_develop' into pre_trustie_server

This commit is contained in:
2023-03-30 17:33:58 +08:00
88 changed files with 340 additions and 182 deletions

View File

@@ -55,6 +55,8 @@ default: &default
access_key_secret: ''
domain: 'https://testgit.trustie.net'
base_url: '/api/v1'
admin_token: '123123'
hat_base_url: '/api/hat'
accelerator:
access_key_id: ''
access_key_secret: ''

View File

@@ -285,7 +285,7 @@ Doorkeeper.configure do
# #call can be used in order to allow conditional checks (to allow non-SSL
# redirects to localhost for example).
#
# force_ssl_in_redirect_uri !Rails.env.development?
force_ssl_in_redirect_uri false
#
# force_ssl_in_redirect_uri { |uri| uri.host != 'localhost' }

View File

@@ -7,5 +7,14 @@ $gitea_client = Gitea::Api::Client.new({
domain: gitea_config[:domain],
base_url: gitea_config[:base_url],
username: gitea_config[:access_key_id],
password: gitea_config[:access_key_secret]
password: gitea_config[:access_key_secret],
log_filepath: "log/gitea-client.log"
})
$gitea_hat_client = Gitea::Api::Hat::Client.new({
domain: gitea_config[:domain],
hat_base_url: gitea_config[:hat_base_url],
username: gitea_config[:access_key_id],
password: gitea_config[:access_key_secret],
log_filepath: "log/gitea-client.log"
})

View File

@@ -840,6 +840,7 @@ Rails.application.routes.draw do
post :unlock
post :active
post :reset_login_times
post :fresh_gitea_token
end
end
resource :import_disciplines, only: [:create]
@@ -1064,18 +1065,24 @@ Rails.application.routes.draw do
resources :commit_logs, :only => [:create]
scope '/app' do
get '/', to: 'installations#app'
post ':id/auth_active', to: 'installations#auth_active'
post ':id/update_private_key', to: 'installations#update_private_key'
post ':id/update_secret', to: 'installations#update_secret'
resources :installations do
get :repositories, on: :collection
post ':id/update_callback_url', to: 'installations#update_callback_url'
resources :installations, only: [:index, :show] do
member do
post :access_tokens
put :suspended
put :suspended, to: 'installations#suspended'
delete :suspended, to: 'installations#unsuspended'
end
end
end
resources :installations, only: [] do
get :repositories, on: :collection
end
root 'main#index'