Compare commits

...

2 Commits

Author SHA1 Message Date
Râu Cao
438ee4ace0
Migrate Gitea SSH stream to openresty 2023-07-30 12:35:21 +02:00
Râu Cao
27bdc1f60d
Update openresty cookbook 2023-07-30 12:34:21 +02:00
6 changed files with 12 additions and 12 deletions

View File

@ -47,6 +47,7 @@
"kosmos_drone::nginx",
"kosmos_garage::nginx_web",
"kosmos_gitea::nginx",
"kosmos_gitea::nginx_ssh",
"kosmos_rsk::nginx_testnet",
"kosmos_rsk::nginx_mainnet",
"kosmos_website",

View File

@ -102,7 +102,6 @@
"role[base]",
"role[kvm_host]",
"role[nginx_proxy]",
"kosmos_gitea::nginx_ssh",
"role[zerotier_controller]"
]
}

View File

@ -31,6 +31,7 @@ production_run_list = %w(
kosmos_drone::nginx
kosmos_garage::nginx_web
kosmos_gitea::nginx
kosmos_gitea::nginx_ssh
kosmos_rsk::nginx_testnet
kosmos_rsk::nginx_mainnet
kosmos_website::default

View File

@ -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

View File

@ -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;
}

@ -1 +1 @@
Subproject commit d031d59fdecff4ee23457d32e8f658c22aa21773
Subproject commit fd3e5b06abaeac5a12a1f82dc830536b3f8e62d7