Migrate Gitea SSH stream to openresty
This commit is contained in:
@@ -3,16 +3,15 @@
|
||||
# Recipe:: nginx_ssh
|
||||
#
|
||||
|
||||
template "#{node['nginx']['dir']}/streams-available/ssh" do
|
||||
source "nginx_conf_ssh.erb"
|
||||
owner 'www-data'
|
||||
mode 0640
|
||||
variables domain: domain,
|
||||
upstream_host: upstream_ip_address
|
||||
|
||||
notifies :reload, 'service[nginx]', :delayed
|
||||
begin
|
||||
upstream_ip_address = search(:node, "role:gitea").first["knife_zero"]["host"]
|
||||
rescue
|
||||
Chef::Log.warn('No server with "gitea" role. Stopping here.')
|
||||
return
|
||||
end
|
||||
|
||||
nginx_stream "ssh" do
|
||||
openresty_stream "ssh" do
|
||||
template "nginx_conf_ssh.erb"
|
||||
variables upstream_host: upstream_ip_address
|
||||
action :enable
|
||||
end
|
||||
|
||||
@@ -3,6 +3,6 @@ upstream _gitea_ssh {
|
||||
}
|
||||
|
||||
server {
|
||||
listen 148.251.83.201:22;
|
||||
listen <%= "#{node['openresty']['listen_ip']}:" if node['openresty']['listen_ip'] %>22;
|
||||
proxy_pass _gitea_ssh;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user