1 Commits

Author SHA1 Message Date
161b78be97 Configure Gitea commit signing with SSH key 2026-02-13 17:29:23 +04:00
2 changed files with 16 additions and 5 deletions

View File

@@ -19,6 +19,17 @@ jwt_secret = gitea_data_bag_item["jwt_secret"]
internal_token = gitea_data_bag_item["internal_token"] internal_token = gitea_data_bag_item["internal_token"]
secret_key = gitea_data_bag_item["secret_key"] secret_key = gitea_data_bag_item["secret_key"]
apt_repository "git-core-ppa" do
uri "http://ppa.launchpad.net/git-core/ppa/ubuntu"
components ["main"]
key "E1DF1F24"
action :add
only_if do
node['platform'] == 'ubuntu' &&
Gem::Version.new(node['platform_version']) < Gem::Version.new('22.04')
end
end
package "git" package "git"
user "git" do user "git" do
@@ -26,10 +37,10 @@ user "git" do
home "/home/git" home "/home/git"
end end
directory '/home/git/.ssh' do directory "/home/git/.ssh" do
owner 'git' owner "git"
group 'git' group "git"
mode '0700' mode "0700"
recursive true recursive true
end end

View File

@@ -33,7 +33,7 @@ DISABLE_DOWNLOAD_SOURCE_ARCHIVES = true
[repository.signing] [repository.signing]
SIGNING_KEY = <%= @git_home_directory %>/.ssh/id_ed25519.pub SIGNING_KEY = <%= @git_home_directory %>/.ssh/id_ed25519.pub
SIGNING_NAME = Gitea SIGNING_NAME = Gitea
SIGNING_EMAIL = <%= @email %> SIGNING_EMAIL = git@<%= @domain %>
SIGNING_FORMAT = ssh SIGNING_FORMAT = ssh
INITIAL_COMMIT = always INITIAL_COMMIT = always
CRUD_ACTIONS = always CRUD_ACTIONS = always