Migrate Gitea SSH stream to openresty
This commit is contained in:
parent
27bdc1f60d
commit
438ee4ace0
@ -47,6 +47,7 @@
|
|||||||
"kosmos_drone::nginx",
|
"kosmos_drone::nginx",
|
||||||
"kosmos_garage::nginx_web",
|
"kosmos_garage::nginx_web",
|
||||||
"kosmos_gitea::nginx",
|
"kosmos_gitea::nginx",
|
||||||
|
"kosmos_gitea::nginx_ssh",
|
||||||
"kosmos_rsk::nginx_testnet",
|
"kosmos_rsk::nginx_testnet",
|
||||||
"kosmos_rsk::nginx_mainnet",
|
"kosmos_rsk::nginx_mainnet",
|
||||||
"kosmos_website",
|
"kosmos_website",
|
||||||
|
@ -102,7 +102,6 @@
|
|||||||
"role[base]",
|
"role[base]",
|
||||||
"role[kvm_host]",
|
"role[kvm_host]",
|
||||||
"role[nginx_proxy]",
|
"role[nginx_proxy]",
|
||||||
"kosmos_gitea::nginx_ssh",
|
|
||||||
"role[zerotier_controller]"
|
"role[zerotier_controller]"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -31,6 +31,7 @@ production_run_list = %w(
|
|||||||
kosmos_drone::nginx
|
kosmos_drone::nginx
|
||||||
kosmos_garage::nginx_web
|
kosmos_garage::nginx_web
|
||||||
kosmos_gitea::nginx
|
kosmos_gitea::nginx
|
||||||
|
kosmos_gitea::nginx_ssh
|
||||||
kosmos_rsk::nginx_testnet
|
kosmos_rsk::nginx_testnet
|
||||||
kosmos_rsk::nginx_mainnet
|
kosmos_rsk::nginx_mainnet
|
||||||
kosmos_website::default
|
kosmos_website::default
|
||||||
|
@ -3,16 +3,15 @@
|
|||||||
# Recipe:: nginx_ssh
|
# Recipe:: nginx_ssh
|
||||||
#
|
#
|
||||||
|
|
||||||
template "#{node['nginx']['dir']}/streams-available/ssh" do
|
begin
|
||||||
source "nginx_conf_ssh.erb"
|
upstream_ip_address = search(:node, "role:gitea").first["knife_zero"]["host"]
|
||||||
owner 'www-data'
|
rescue
|
||||||
mode 0640
|
Chef::Log.warn('No server with "gitea" role. Stopping here.')
|
||||||
variables domain: domain,
|
return
|
||||||
upstream_host: upstream_ip_address
|
|
||||||
|
|
||||||
notifies :reload, 'service[nginx]', :delayed
|
|
||||||
end
|
end
|
||||||
|
|
||||||
nginx_stream "ssh" do
|
openresty_stream "ssh" do
|
||||||
|
template "nginx_conf_ssh.erb"
|
||||||
|
variables upstream_host: upstream_ip_address
|
||||||
action :enable
|
action :enable
|
||||||
end
|
end
|
||||||
|
@ -3,6 +3,6 @@ upstream _gitea_ssh {
|
|||||||
}
|
}
|
||||||
|
|
||||||
server {
|
server {
|
||||||
listen 148.251.83.201:22;
|
listen <%= "#{node['openresty']['listen_ip']}:" if node['openresty']['listen_ip'] %>22;
|
||||||
proxy_pass _gitea_ssh;
|
proxy_pass _gitea_ssh;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user