mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-20 06:36:21 +00:00
Merge branch 'issue-12919' of https://0xacab.org/sutty/sutty into 17.3.alpine.panel.sutty.nl
This commit is contained in:
commit
9b6005d7f4
3 changed files with 20 additions and 1 deletions
1
Gemfile
1
Gemfile
|
@ -73,6 +73,7 @@ gem 'redis-rails'
|
||||||
gem 'rollups', git: 'https://github.com/fauno/rollup.git', branch: 'update'
|
gem 'rollups', git: 'https://github.com/fauno/rollup.git', branch: 'update'
|
||||||
gem 'rubyzip'
|
gem 'rubyzip'
|
||||||
gem 'rugged'
|
gem 'rugged'
|
||||||
|
gem 'git_clone_url'
|
||||||
gem 'concurrent-ruby-ext'
|
gem 'concurrent-ruby-ext'
|
||||||
gem 'que'
|
gem 'que'
|
||||||
gem 'symbol-fstring', require: 'fstring/all'
|
gem 'symbol-fstring', require: 'fstring/all'
|
||||||
|
|
|
@ -211,6 +211,8 @@ GEM
|
||||||
activerecord (>= 4.0.0)
|
activerecord (>= 4.0.0)
|
||||||
get_process_mem (0.2.7)
|
get_process_mem (0.2.7)
|
||||||
ffi (~> 1.0)
|
ffi (~> 1.0)
|
||||||
|
git_clone_url (2.0.0)
|
||||||
|
uri-ssh_git (>= 2.0)
|
||||||
globalid (1.1.0)
|
globalid (1.1.0)
|
||||||
activesupport (>= 5.0)
|
activesupport (>= 5.0)
|
||||||
groupdate (6.2.1)
|
groupdate (6.2.1)
|
||||||
|
@ -541,6 +543,7 @@ GEM
|
||||||
unf_ext
|
unf_ext
|
||||||
unf_ext (0.0.8.2-x86_64-linux-musl)
|
unf_ext (0.0.8.2-x86_64-linux-musl)
|
||||||
unicode-display_width (1.8.0)
|
unicode-display_width (1.8.0)
|
||||||
|
uri-ssh_git (2.0.0)
|
||||||
validates_hostname (1.0.13)
|
validates_hostname (1.0.13)
|
||||||
activerecord (>= 3.0)
|
activerecord (>= 3.0)
|
||||||
activesupport (>= 3.0)
|
activesupport (>= 3.0)
|
||||||
|
@ -593,6 +596,7 @@ DEPENDENCIES
|
||||||
fast_jsonparser (~> 0.5.0)
|
fast_jsonparser (~> 0.5.0)
|
||||||
flamegraph
|
flamegraph
|
||||||
friendly_id
|
friendly_id
|
||||||
|
git_clone_url
|
||||||
hairtrigger
|
hairtrigger
|
||||||
haml-lint
|
haml-lint
|
||||||
hamlit-rails
|
hamlit-rails
|
||||||
|
|
|
@ -177,7 +177,21 @@ class Site
|
||||||
def credentials
|
def credentials
|
||||||
return unless File.exist? private_key
|
return unless File.exist? private_key
|
||||||
|
|
||||||
@credentials ||= Rugged::Credentials::SshKey.new username: 'git', publickey: public_key, privatekey: private_key
|
@credentials ||=
|
||||||
|
begin
|
||||||
|
username = parse_url(origin.url)&.user || 'git'
|
||||||
|
|
||||||
|
Rugged::Credentials::SshKey.new username: username, publickey: public_key, privatekey: private_key
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# @param :url [String]
|
||||||
|
# @return [URI, nil]
|
||||||
|
def parse_url(url)
|
||||||
|
GitCloneUrl.parse(url)
|
||||||
|
rescue URI::Error => e
|
||||||
|
ExceptionNotifier.notify_exception(e, data: { site: site.name, url: url })
|
||||||
|
nil
|
||||||
end
|
end
|
||||||
|
|
||||||
# @return [String]
|
# @return [String]
|
||||||
|
|
Loading…
Reference in a new issue