要想在GitLab Runner中使用非https方式进行注册,您可以按照以下步骤进行操作:
/etc/gitlab/gitlab.rb,将以下行添加到文件底部:gitlab_rails['registry_api_url'] = 'http://gitlab.example.com'
gitlab_rails['registry_key_path'] = "/etc/gitlab/registry.key"
gitlab_rails['registry_key'] = File.read(gitlab_rails['registry_key_path']).chomp
在上面的代码中,将http://gitlab.example.com替换为您的GitLab服务器的非https地址。
sudo gitlab-ctl reconfigure
sudo gitlab-runner register \
--non-interactive \
--url "http://gitlab.example.com" \
--registration-token "YOUR_REGISTRATION_TOKEN" \
--executor "shell" \
--description "My Runner" \
--tag-list "linux,xenial,ubuntu,docker" \
--run-untagged="true" \
--locked="false" \
--access-level="not_protected"
在上面的命令中,将http://gitlab.example.com替换为您的GitLab服务器的非https地址,将YOUR_REGISTRATION_TOKEN替换为您的GitLab Runner注册令牌。
请注意,使用非https进行注册存在一些安全风险,因为通信将以明文方式传输。因此,强烈建议在生产环境中使用https进行GitLab Runner的注册。