mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-03 03:40:49 +08:00
新增:导入项目服务参数
This commit is contained in:
@@ -395,7 +395,7 @@ class ProjectsController < ApplicationController
|
||||
end
|
||||
|
||||
def mirror_params
|
||||
params.permit(:user_id, :name, :description, :repository_name, :is_mirror, :auth_username, :auth_token,
|
||||
params.permit(:user_id, :name, :description, :repository_name, :is_mirror, :auth_username, :auth_token, :service,
|
||||
:auth_password, :project_category_id, :project_language_id, :clone_addr, :private)
|
||||
end
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class Projects::MigrateForm < BaseForm
|
||||
attr_accessor :user_id, :name, :repository_name, :project_category_id, :description, :auth_token,
|
||||
attr_accessor :user_id, :name, :repository_name, :project_category_id, :description, :auth_token, :service
|
||||
:project_language_id, :clone_addr, :private, :is_mirror, :auth_username, :auth_password, :owner
|
||||
|
||||
validates :user_id, :name, :repository_name, :clone_addr, presence: true
|
||||
|
||||
@@ -45,6 +45,7 @@ class Gitea::Accelerator::MigrateService < Gitea::Accelerator::BaseService
|
||||
repo_name: params[:repository_name],
|
||||
auth_username: params[:auth_username],
|
||||
auth_password: Base64.decode64(params[:auth_password]),
|
||||
auth_token: params[:auth_token],
|
||||
mirror: ActiveModel::Type::Boolean.new.cast(params[:is_mirror])
|
||||
}
|
||||
end
|
||||
|
||||
@@ -55,6 +55,7 @@ class Projects::MigrateService < ApplicationService
|
||||
login: params[:auth_username],
|
||||
password: params[:auth_password],
|
||||
auth_token: params[:auth_token],
|
||||
service: params[:service],
|
||||
is_mirror: params[:is_mirror],
|
||||
source_clone_url: params[:source_clone_url]
|
||||
}
|
||||
|
||||
@@ -33,7 +33,8 @@ class Repositories::MigrateService < ApplicationService
|
||||
mirror: wrapper_mirror || false,
|
||||
auth_username: params[:login],
|
||||
auth_password: Base64.decode64(params[:password] || ""),
|
||||
auth_token: params[:auth_token]
|
||||
auth_token: params[:auth_token],
|
||||
service: params[:service] || 'git',
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user