main
David Vargas 2022-11-25 14:17:56 +00:00
parent eb2f50c025
commit 9e44b71410
4 changed files with 118 additions and 28 deletions

39
test/educatic.rb Normal file
View File

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

View File

@ -1,25 +1,6 @@
#!/usr/bin/env ruby #!/usr/bin/env ruby
require "yaml" require_relative "educatic"
require "colorize"
filename = File.join(File.dirname(__FILE__), "services.yaml") filename = File.join(File.dirname(__FILE__), "services.yaml")
settings = YAML.load(File.read(filename)) Educatic.new(filename).check_services
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

View File

@ -1,15 +1,16 @@
services: services:
mini: mini:
todo:
- Eliminar la MV
- ¿Es el correo electrónico?
hetzner: docus hetzner: docus
hostname: editor.educar.encanarias.info hostname: editor.educar.encanarias.info
ip: 78.46.183.113 ip: 78.46.183.113
todo:
- Se propone eliminar la MV o...
- Cambiar dominio <encanarias.info> a <txs.es>
nextcloud: nextcloud:
hetzner: docus hetzner: docus
hostname: docs.txs.es hostname: docs.txs.es
ip: 78.47.40.72 ip: 78.47.40.72
desc: Nextcloud
features: features:
- Documentos en la nube - Documentos en la nube
- OpenCollectives (Cuadernos) - OpenCollectives (Cuadernos)
@ -17,16 +18,20 @@ services:
hetzner: docus hetzner: docus
hostname: editor.educatic.txs.es hostname: editor.educatic.txs.es
ip: 78.47.204.43 ip: 78.47.204.43
desc: Collabora
features: features:
- Documentos en la nube - Documentos en la nube
- Collabora - Collabora
mailu19:
todo: todo:
- No tiene nombre DNS asignado a la IP - Se muestra la página por defecto de Apache2
- Cambiar el dominio @txs.es - No parece estar funcionando
mailu19:
hetzner: txs hetzner: txs
hostname: static.18.144.90.157.clients.your-server.de hostname: static.18.144.90.157.clients.your-server.de
ip: 157.90.144.18 ip: 157.90.144.18
todo:
- Se propone eliminar la MV o...
- Cambiar <default hostname> a <*.txs.es>
jekyll-www: jekyll-www:
state: revise state: revise
hetzner: txs hetzner: txs
@ -36,10 +41,12 @@ services:
hetzner: txs hetzner: txs
hostname: acceso.txs.es hostname: acceso.txs.es
ip: 138.201.157.15 ip: 138.201.157.15
desc: Keycloak. Control de acceso
correo: correo:
hetzner: txs hetzner: txs
hostname: correo.txs.es hostname: correo.txs.es
ip: 88.99.189.54 ip: 88.99.189.54
desc: Correo
git: git:
hetzner: txs hetzner: txs
hostname: git.txs.es hostname: git.txs.es
@ -48,13 +55,70 @@ services:
hetzner: social hetzner: social
hostname: pixel.txs.es hostname: pixel.txs.es
ip: 116.202.29.80 ip: 116.202.29.80
todo:
- Se propone eliminar esta MV
blogs: blogs:
hetzner: social hetzner: social
hostname: blogs.txs.es hostname: blogs.txs.es
ip: 49.12.44.141 ip: 49.12.44.141
todo:
- Intento de montar <diaspora>
tuvideo2: tuvideo2:
hetzner: social hetzner: social
hostname: tuvideo.encanarias.info hostname: tuvideo.encanarias.info
ip: 116.203.254.222 ip: 116.203.254.222
desc: Peertube
todo: todo:
- Cambiar nombre dominio a @txs.es - Cambiar dominio de <encanarias.info> a <txs.es>
micanal:
hetzner: social
hostname: micanal.encanarias.info
ip: 188.34.188.55
desc: Peertubte
todo:
- Cambiar dominio de <encanarias.info> a <txs.es>
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 <default hostname> 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 <encanarias.info>
bbbold:
hetzner: ull
hostname: static.19.113.69.159.clients.your-server.de
ip: 159.69.113.19
desc: BBB
todo:
- Cambiar <default hostname> a <*.txs.es>
bbb:
hetzner: ull
hostname: bbb.educar.encanarias.info
ip: 49.12.216.60
desc: BBB
todo:
- Dominio antiguo <encanarias.info>
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

6
test/urls.rb Executable file
View File

@ -0,0 +1,6 @@
#!/usr/bin/env ruby
require_relative "educatic"
filename = File.join(File.dirname(__FILE__), "services.yaml")
Educatic.new(filename).urls