Configure Gitea commit signing with SSH key
This commit is contained in:
@@ -26,6 +26,13 @@ user "git" do
|
||||
home "/home/git"
|
||||
end
|
||||
|
||||
directory '/home/git/.ssh' do
|
||||
owner 'git'
|
||||
group 'git'
|
||||
mode '0700'
|
||||
recursive true
|
||||
end
|
||||
|
||||
directory working_directory do
|
||||
owner "git"
|
||||
group "git"
|
||||
@@ -100,6 +107,16 @@ config_variables = {
|
||||
s3_bucket: gitea_data_bag_item["s3_bucket"]
|
||||
}
|
||||
|
||||
bash "Generate git ed25519 keypair" do
|
||||
user "git"
|
||||
group "git"
|
||||
cwd git_home_directory
|
||||
code <<-EOH
|
||||
ssh-keygen -t ed25519 -f #{git_home_directory}/.ssh/id_ed25519
|
||||
EOH
|
||||
creates "#{git_home_directory}/.ssh/id_ed25519"
|
||||
end
|
||||
|
||||
template "#{config_directory}/app.ini" do
|
||||
source "app.ini.erb"
|
||||
owner "git"
|
||||
|
||||
Reference in New Issue
Block a user