From b1596c557168357435aec8fe3fe0ba97176ae670 Mon Sep 17 00:00:00 2001 From: David Vargas Date: Fri, 2 Dec 2022 08:26:31 +0000 Subject: [PATCH] [U] . --- bin/lib/educatic.rb | 36 +++++++++++++++++++----------------- bin/services.yaml | 7 ++++++- bin/urls.rb | 2 +- todo/cambios-en-hetzner.txt | 21 +++++++-------------- 4 files changed, 33 insertions(+), 33 deletions(-) diff --git a/bin/lib/educatic.rb b/bin/lib/educatic.rb index 2c9c9f0..ce8e745 100644 --- a/bin/lib/educatic.rb +++ b/bin/lib/educatic.rb @@ -16,38 +16,40 @@ class Educatic output = [] todo = value['todo'] || [] - cmd = "host #{value['ip']}| grep #{value['hostname']}| wc -l" - counter = %x[#{cmd}].to_i - if counter.zero? - output << " Check this:" - output << " * hostname = #{value['hostname']}" - output << " * ip = #{value['ip']}" - end - if (value['hostname'].end_with? ".info" or value['hostname'].end_with? "clients.your-server.de") - todo << "Cambiar <#{value['hostname']}> el dominio @txs.es" - end - - if value['hostname'].start_with? "staticeducar.info" - todo << "Cambiar <#{value['hostname']}> el dominio @txs.es" - end + check_hostname(value, output: output, todo: todo) unless value['todo'].nil? - output << " TODO:" todo.each_with_index do |line, index| output << " #{index + 1}. #{line}" end end unless output.size.zero? - puts "==> #{key} [#{value['hetzner']}]" + puts "==> [Hetzner #{value['hetzner'].upcase}] #{key}" puts output.join("\n") end end end - def urls + def show_urls @services.each_pair do |key, value| puts "#{key.rjust(16)} : #{value['hostname']}" end end + + private + + def check_hostname(value, output:, todo:) + cmd = "host #{value['ip']}| grep #{value['hostname']}| wc -l" + counter = %x[#{cmd}].to_i + if counter.zero? + output << " Check this:" + output << " * hostname = #{value['hostname']}" + output << " * ip = #{value['ip']}" + end + + if (value['hostname'].end_with? ".info" or value['hostname'].end_with? "clients.your-server.de") + todo << "Cambiar <#{value['hostname']}> el dominio @txs.es" + end + end end diff --git a/bin/services.yaml b/bin/services.yaml index 72c6754..bee22b5 100644 --- a/bin/services.yaml +++ b/bin/services.yaml @@ -7,6 +7,7 @@ services: - Se propone eliminar la MV o... - Cambiar http por https nextcloud: + main: true hetzner: docus hostname: docs.txs.es ip: 78.47.40.72 @@ -88,14 +89,17 @@ services: encanarias: hetzner: social hostname: encanarias.info - ip: 78.47.122.22 + ip: 5.75.226.229 desc: Diaspora viejo. Red social + old: + ip: 78.47.122.22 bbbold: hetzner: ull hostname: static.19.113.69.159.clients.your-server.de ip: 159.69.113.19 desc: BBB bbb: + main: true hetzner: ull hostname: bbb.educar.encanarias.info ip: 49.12.216.60 @@ -107,6 +111,7 @@ services: todo: - Había que eliminar esta MV mattermost: + main: true hetzner: ull hostname: colabora.txs.es ip: 159.69.179.155 diff --git a/bin/urls.rb b/bin/urls.rb index 0863619..33004ee 100755 --- a/bin/urls.rb +++ b/bin/urls.rb @@ -3,4 +3,4 @@ require_relative "lib/educatic" filename = File.join(File.dirname(__FILE__), "services.yaml") -Educatic.new(filename).urls +Educatic.new(filename).show_urls diff --git a/todo/cambios-en-hetzner.txt b/todo/cambios-en-hetzner.txt index 8792cfd..fda4b69 100644 --- a/todo/cambios-en-hetzner.txt +++ b/todo/cambios-en-hetzner.txt @@ -1,27 +1,20 @@ -==> mini [docus] - TODO: +==> [Hetzner DOCUS] mini 1. Se propone eliminar la MV o... 2. Cambiar http por https 3. Cambiar el dominio @txs.es -==> editorcollab [docus] - TODO: +==> [Hetzner DOCUS] editorcollab 1. Se muestra la página por defecto de Apache2 2. No parece estar funcionando -==> mailu19 [txs] - TODO: +==> [Hetzner TXS] mailu19 1. Se propone eliminar la MV o... 2. Cambiar el dominio @txs.es -==> pixel [social] - TODO: +==> [Hetzner SOCIAL] pixel 1. Se propone eliminar esta MV -==> blogs [social] - TODO: +==> [Hetzner SOCIAL] blogs 1. Intento de montar -==> txs [social] - TODO: +==> [Hetzner SOCIAL] txs 1. Se propone eliminar la MV o... 2. Duda: Esto no parece ser Mastodon! 3. Cambiar el dominio @txs.es -==> cryptpad [ull] - TODO: +==> [Hetzner ULL] cryptpad 1. Había que eliminar esta MV