Skip to content

Commit

Permalink
Merge branch 'ytti:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
clifcox authored Feb 28, 2025
2 parents 255f0c8 + 6894d06 commit 3606d59
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 9 deletions.
15 changes: 14 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
### Added
- model for Unifi / AirOS APs and some Unifi switches. Re: #3430 (@clifcox)

### Changed
- fortios: support for FortiADC (@electrocret)

### Fixed
- powerconnect: Mask the changing temperature issue for non-stacked switches. Fixes #2088 (@clifcox)


## [0.32.2 – 2025-02-27]
This patch release mainly fixes the docker building process, wich resulted in
0.32.1 not beeing built.

### Changed
- docker image: updated github CI to explicitly build tag versions (@robertcheramy)
- docker image: update rake build_container to match the tags of GitHub CI (@robertcheramy)
Expand All @@ -22,13 +33,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
- docker image: improve the documentation. Fixes #3336 (@robertcheramy)
- docker image: remove examples/podman-compose as this is better documented in docs/Docker.md (@robertcheramy)


## [0.32.1 – 2025-02-20]
This minor release fixes a javascript issue in oxidized-web, which is included
This patch release fixes a javascript issue in oxidized-web, which is included
in the Docker container of oxidized.

### Fixed
- powerconnect: Hide enable, and line secrets. Further Fixes #1212 (#clifcox)


## [0.32.0 – 2025-02-17]
This release fixes a security issue in oxidized-web, which is included in the
Docker container of oxidized. If you are not using the Docker container but
Expand Down
6 changes: 3 additions & 3 deletions lib/oxidized/model/fortios.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class FortiOS < Oxidized::Model

comment '# '

prompt /^([-\w.~]+(\s[(\w\-.)]+)?~?\s?[#>$]\s?)$/
prompt /^(\(\w\) )?([-\w.~]+(\s[(\w\-.)]+)?~?\s?[#>$]\s?)$/

# When a post-login-banner is enabled, you have to press "a" to log in
expect /^\(Press\s'a'\sto\saccept\):/ do |data, re|
Expand Down Expand Up @@ -39,11 +39,11 @@ class FortiOS < Oxidized::Model

cmd 'get system status' do |cfg|
@vdom_enabled = cfg.match /Virtual domain configuration: (enable|multiple)/
cfg.gsub! /(System time:).*/, '\\1 <stripped>'
cfg.gsub! /(System time:).*/i, '\\1 <stripped>'
cfg.gsub! /(Cluster (?:uptime|state change time):).*/, '\\1 <stripped>'
cfg.gsub! /(Current Time\s+:\s+)(.*)/, '\1<stripped>'
cfg.gsub! /(Uptime:\s+)(.*)/, '\1<stripped>\3'
cfg.gsub! /(Last reboot:\s+)(.*)/, '\1<stripped>\3'
cfg.gsub! /(Last reboot:\s+)(.*)/i, '\1<stripped>\3'
cfg.gsub! /(Disk Usage\s+:\s+)(.*)/, '\1<stripped>'
cfg.gsub! /(^\S+ (?:disk|DB):\s+)(.*)/, '\1<stripped>\3'
cfg.gsub! /(VM Registration:\s+)(.*)/, '\1<stripped>\3'
Expand Down
20 changes: 17 additions & 3 deletions lib/oxidized/model/powerconnect.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ class PowerConnect < Oxidized::Model

def clean(cfg)
out = []
skip_blocks = 0
len1 = len2 = skip_blocks = 0

cfg.each_line do |line|
# If this is a stackable switch we should skip this block of information
if line.match(/Up\sTime|Temperature|Power Suppl(ies|y)|Fans/i) && (@stackable == true)
Expand All @@ -73,9 +74,22 @@ def clean(cfg)
skip_blocks -= 1 if /\S/ !~ line
next
end
out << line.strip
line = line.strip
# If the temps were not removed by skipping blocks, then mask them out wih XXX
# The most recent set of dashes has the spacing we want to match
if (match = line.match(/^(---+ +)(---+ +)/))
one, two = match.captures
len1 = one.length
len2 = two.length
end
# This can only be a temperature, right? ;-)
if (match = line.match(/^(\d{1,2}) {3,}\d+ (.*)$/))
one, two = match.captures
line = one.to_s + (' ' * (len1 - one.length)) + "XXX" + (' ' * (len2 - 3)) + two.to_s
end
out << line
end
out = out.reject { |line| line[/Up\sTime/] }
out = out.reject { |line| line[/Up\sTime/] } # Filter out Up Time
out = comment out.join "\n"
out << "\n"
end
Expand Down
4 changes: 2 additions & 2 deletions lib/oxidized/version.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module Oxidized
VERSION = '0.32.1'.freeze
VERSION_FULL = '0.32.1'.freeze
VERSION = '0.32.2'.freeze
VERSION_FULL = '0.32.2'.freeze
def self.version_set
version_full = %x(git describe --tags).chop rescue ""
version = %x(git describe --tags --abbrev=0).chop rescue ""
Expand Down
7 changes: 7 additions & 0 deletions spec/model/data/fortios:generic:prompt.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
pass:
# FortiADC PR#3412
- '(M) redhat-lb-01 $ '
- '(P) test-adc-pri $ '
- '(S) test-adc-sec $ '
# FortiOS
- 'oxidized-Firewall123 # '

0 comments on commit 3606d59

Please sign in to comment.