diff --git a/test/educatic.rb b/test/educatic.rb new file mode 100644 index 0000000..9453ed6 --- /dev/null +++ b/test/educatic.rb @@ -0,0 +1,39 @@ +#!/usr/bin/env ruby + +require "yaml" +require "colorize" + +class Educatic + attr_reader :settings + + def initialize(filename) + @settings = YAML.load(File.read(filename)) + @services = settings["services"] + end + + def check_services + @services.each_pair do |key, value| + # puts "==> #{key} [#{value['hetzner']}] #{value['desc']}".colorize(:white) + puts "==> #{key} [#{value['hetzner']}]".colorize(:white) + cmd = "host #{value['ip']}| grep #{value['hostname']}| wc -l" + counter = %x[#{cmd}].to_i + if counter.zero? + puts " Check this:" + puts " * hostname = #{value['hostname']}" + puts " * ip = #{value['ip']}" + end + unless value['todo'].nil? + puts " TODO:" + value['todo'].each_with_index do |line, index| + puts " #{index + 1}. #{line}" + end + end + end + end + + def urls + @services.each_pair do |key, value| + puts "#{key.rjust(16)} : #{value['hostname']}" + end + end +end diff --git a/test/services.rb b/test/services.rb index d3a7018..0abfe70 100755 --- a/test/services.rb +++ b/test/services.rb @@ -1,25 +1,6 @@ #!/usr/bin/env ruby -require "yaml" -require "colorize" +require_relative "educatic" filename = File.join(File.dirname(__FILE__), "services.yaml") -settings = YAML.load(File.read(filename)) - -services = settings["services"] -services.each_pair do |key, value| - puts "==> #{key} [#{value['hetzner']}] ".colorize(:white) - cmd = "host #{value['ip']}| grep #{value['hostname']}| wc -l" - counter = %x[#{cmd}].to_i - if counter.zero? - puts " Check this:" - puts " * hostname = #{value['hostname']}" - puts " * ip = #{value['ip']}" - end - unless value['todo'].nil? - puts " TODO:" - value['todo'].each_with_index do |line, index| - puts " #{index + 1}. #{line}" - end - end -end +Educatic.new(filename).check_services diff --git a/test/services.yaml b/test/services.yaml index 3506047..bdfe2e2 100644 --- a/test/services.yaml +++ b/test/services.yaml @@ -1,15 +1,16 @@ services: mini: - todo: - - Eliminar la MV - - ¿Es el correo electrónico? hetzner: docus hostname: editor.educar.encanarias.info ip: 78.46.183.113 + todo: + - Se propone eliminar la MV o... + - Cambiar dominio a nextcloud: hetzner: docus hostname: docs.txs.es ip: 78.47.40.72 + desc: Nextcloud features: - Documentos en la nube - OpenCollectives (Cuadernos) @@ -17,16 +18,20 @@ services: hetzner: docus hostname: editor.educatic.txs.es ip: 78.47.204.43 + desc: Collabora features: - Documentos en la nube - Collabora - mailu19: todo: - - No tiene nombre DNS asignado a la IP - - Cambiar el dominio @txs.es + - Se muestra la página por defecto de Apache2 + - No parece estar funcionando + mailu19: hetzner: txs hostname: static.18.144.90.157.clients.your-server.de ip: 157.90.144.18 + todo: + - Se propone eliminar la MV o... + - Cambiar a <*.txs.es> jekyll-www: state: revise hetzner: txs @@ -36,10 +41,12 @@ services: hetzner: txs hostname: acceso.txs.es ip: 138.201.157.15 + desc: Keycloak. Control de acceso correo: hetzner: txs hostname: correo.txs.es ip: 88.99.189.54 + desc: Correo git: hetzner: txs hostname: git.txs.es @@ -48,13 +55,70 @@ services: hetzner: social hostname: pixel.txs.es ip: 116.202.29.80 + todo: + - Se propone eliminar esta MV blogs: hetzner: social hostname: blogs.txs.es ip: 49.12.44.141 + todo: + - Intento de montar tuvideo2: hetzner: social hostname: tuvideo.encanarias.info ip: 116.203.254.222 + desc: Peertube todo: - - Cambiar nombre dominio a @txs.es + - Cambiar dominio de a + micanal: + hetzner: social + hostname: micanal.encanarias.info + ip: 188.34.188.55 + desc: Peertubte + todo: + - Cambiar dominio de a + txs: + hetzner: social + hostname: static.192.237.46.78.clients.your-server.de + ip: 78.46.237.192 + desc: Mastodon? + todo: + - Se propone eliminar la MV o... + - Cambiar a <*.txs.es> + - "Duda: Esto no parece ser Mastodon!" + xmpp.txs.es: + hetzner: social + hostname: xmpp.txs.es + ip: 49.12.73.150 + desc: ejabberd + encanarias: + hetzner: social + hostname: encanarias.info + ip: 78.47.122.22 + desc: Diaspora viejo. Red social + todo: + - Dominio antiguo + bbbold: + hetzner: ull + hostname: static.19.113.69.159.clients.your-server.de + ip: 159.69.113.19 + desc: BBB + todo: + - Cambiar a <*.txs.es> + bbb: + hetzner: ull + hostname: bbb.educar.encanarias.info + ip: 49.12.216.60 + desc: BBB + todo: + - Dominio antiguo + cryptpad: + hetzner: ull + hostname: cryptpad.txs.es + ip: 157.90.246.5 + todo: + - Había que eliminar esta MV + mattermost: + hetzner: ull + hostname: colabora.txs.es + ip: 159.69.179.155 diff --git a/test/urls.rb b/test/urls.rb new file mode 100755 index 0000000..a102631 --- /dev/null +++ b/test/urls.rb @@ -0,0 +1,6 @@ +#!/usr/bin/env ruby + +require_relative "educatic" + +filename = File.join(File.dirname(__FILE__), "services.yaml") +Educatic.new(filename).urls