oxidized 0.32.1 → 0.33.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/.github/ISSUE_TEMPLATE/bug_report.md +42 -0
  3. data/.github/ISSUE_TEMPLATE/feature_request.md +22 -0
  4. data/.github/ISSUE_TEMPLATE/support-request.md +36 -0
  5. data/.github/workflows/publishdocker.yml +35 -16
  6. data/.gitignore +1 -0
  7. data/.rubocop.yml +0 -2
  8. data/.rubocop_todo.yml +5 -31
  9. data/CHANGELOG.md +54 -2
  10. data/CONTRIBUTING.md +10 -7
  11. data/Dockerfile +37 -64
  12. data/README.md +4 -95
  13. data/Rakefile +8 -9
  14. data/docs/Configuration.md +139 -27
  15. data/docs/Docker.md +240 -0
  16. data/docs/Issues.md +17 -0
  17. data/docs/Model-Notes/EatonNetwork.md +18 -0
  18. data/docs/Model-Notes/HPEAruba.md +3 -2
  19. data/docs/Release.md +5 -3
  20. data/docs/Supported-OS-Types.md +3 -0
  21. data/docs/Troubleshooting.md +6 -1
  22. data/extra/rest_client.rb +1 -1
  23. data/lib/oxidized/config/vars.rb +18 -14
  24. data/lib/oxidized/config.rb +3 -1
  25. data/lib/oxidized/core.rb +26 -5
  26. data/lib/oxidized/input/http.rb +1 -1
  27. data/lib/oxidized/model/aos7.rb +3 -0
  28. data/lib/oxidized/model/eatonnetwork.rb +65 -0
  29. data/lib/oxidized/model/fortios.rb +3 -3
  30. data/lib/oxidized/model/ingate.rb +47 -0
  31. data/lib/oxidized/model/ios.rb +1 -0
  32. data/lib/oxidized/model/netgear.rb +6 -0
  33. data/lib/oxidized/model/powerconnect.rb +31 -10
  34. data/lib/oxidized/model/srosmd.rb +1 -1
  35. data/lib/oxidized/model/unifiap.rb +142 -0
  36. data/lib/oxidized/output/git.rb +82 -32
  37. data/lib/oxidized/output/gitcrypt.rb +3 -0
  38. data/lib/oxidized/version.rb +6 -4
  39. data/lib/oxidized/worker.rb +2 -5
  40. data/lib/refinements.rb +2 -0
  41. data/oxidized.gemspec +5 -6
  42. metadata +30 -30
  43. data/examples/podman-compose/Makefile +0 -103
  44. data/examples/podman-compose/README.md +0 -94
  45. data/examples/podman-compose/docker-compose.yml +0 -30
  46. data/examples/podman-compose/gitserver/.gitignore +0 -1
  47. data/examples/podman-compose/gitserver/Dockerfile +0 -14
  48. data/examples/podman-compose/model-simulation/Dockerfile-model +0 -13
  49. data/examples/podman-compose/model-simulation/asternos.sh +0 -36
  50. data/examples/podman-compose/oxidized-config/.gitignore +0 -10
  51. data/examples/podman-compose/oxidized-config/config +0 -46
  52. data/examples/podman-compose/oxidized-config/config_csv-file +0 -46
  53. data/examples/podman-compose/oxidized-config/config_csv-gitserver +0 -56
  54. data/examples/podman-compose/oxidized-config/router.db +0 -1
  55. data/examples/podman-compose/oxidized-ssh/.gitignore +0 -1
  56. data/examples/podman-compose/oxidized-ssh/README.md +0 -14
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a0ef1ef47a42a57f4d0b01e6a0201a604c9ff722c6b1f0452fa97d2352f0c55b
4
- data.tar.gz: 15717e0e5f7344a0449054d66c412bf77a8710e59e3db003195dd3bd2eb21ee3
3
+ metadata.gz: 140d9918c8f356fb866500593ccfdbc0b0ade3c031e44153e7be7c6277869a3e
4
+ data.tar.gz: 4d56807c0167af119671e7535ec89df076c0a91cc6f965b2ed966957c4a7c860
5
5
  SHA512:
6
- metadata.gz: 401435f585a12c13a81fd3c7a30f7190a83cf9d0a39fb417b9c80342a8dc78a0d570dac53f060fb54aed039989f579a113d4040e21405c81c25760d6a9720a4a
7
- data.tar.gz: ed46c959fccbbbabdd60aecdb2a517b2262f956cb184eee34bb85558a88805c25e743d45d45d3d7a90847f8132d7a4f891c00ff95c7cb32c873a4108029102bf
6
+ metadata.gz: 8c3b76b96bd7718bccfe34a74823528e842af98cc930da843e60267c5d874cedfd7c91fe7fd821079ccb97b680054a7f31d260813479054e21c237651735b211
7
+ data.tar.gz: 2a2c9e98d51c5a0db06636c2c769aa4342badc6a3ed665ade1fafa84552732c2aa4fab82df7824a3488c16850185891b8de6a09a01bd6becdfddc95770d320c5
@@ -0,0 +1,42 @@
1
+ ---
2
+ name: Bug report
3
+ about: Create a report to help us improve oxidized
4
+ title: ''
5
+ labels: bug
6
+ assignees: ''
7
+
8
+ ---
9
+ <!-- Check the box [X] -->
10
+ - [ ] I have read and understood [docs/Issues.md](https://github.com/ytti/oxidized/blob/master/docs/Issues.md).
11
+
12
+ **Describe the bug**
13
+ A clear and concise description of what the bug is.
14
+
15
+ **To Reproduce**
16
+ Steps to reproduce the behavior:
17
+ 1. Configure '...'
18
+ 2. Use model '....'
19
+ 3. Run '....'
20
+ 4. See error
21
+
22
+ **Expected behavior**
23
+ A clear and concise description of what you expected to happen.
24
+
25
+ **Configuration**
26
+ ```
27
+ If applicable, publish your configuration.
28
+ ```
29
+
30
+ **Logs**
31
+ ```
32
+ If applicable, add logs to help explain your problem.
33
+ ```
34
+
35
+ **Running environment (please complete the following information):**
36
+ <!-- complete the following information and add further details if needed -->
37
+ - OS: [e.g. Debian Bookworm, official container version xxx, ...]
38
+ - oxidized version: [e.g. 0.32.2]
39
+ - oxidized-web version: [e.g. 0.15.1, if applicable]
40
+
41
+ **Additional context**
42
+ Add any other context about the problem here.
@@ -0,0 +1,22 @@
1
+ ---
2
+ name: Feature request
3
+ about: Suggest an idea for this project
4
+ title: ''
5
+ labels: feature request
6
+ assignees: ''
7
+
8
+ ---
9
+ <!-- Check the box [X] -->
10
+ - [ ] I have read and understood [docs/Issues.md](https://github.com/ytti/oxidized/blob/master/docs/Issues.md).
11
+
12
+ **Is your feature request related to a problem? Please describe.**
13
+ A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
14
+
15
+ **Describe the solution you'd like**
16
+ A clear and concise description of what you want to happen.
17
+
18
+ **Describe alternatives you've considered**
19
+ A clear and concise description of any alternative solutions or features you've considered.
20
+
21
+ **Additional context**
22
+ Add any other context about the feature request here.
@@ -0,0 +1,36 @@
1
+ ---
2
+ name: Support request
3
+ about: Ask for help
4
+ title: ''
5
+ labels: question
6
+ assignees: ''
7
+
8
+ ---
9
+ <!-- Check the box [X] -->
10
+ - [ ] I have read and understood [docs/Issues.md](https://github.com/ytti/oxidized/blob/master/docs/Issues.md).
11
+
12
+ **Describe the problem**
13
+ A clear and concise description of what your problem is.
14
+
15
+ **Expected behavior**
16
+ A clear and concise description of what you expected to happen.
17
+
18
+ **Configuration**
19
+ ```
20
+ If applicable, publish your configuration.
21
+ ```
22
+
23
+ **Logs**
24
+ ```
25
+ If applicable, add logs to help explain your problem.
26
+ ```
27
+
28
+ **Running environment (please complete the following information):**
29
+ <!-- complete the following information and add further details if needed -->
30
+ - OS: [e.g. Debian Bookworm, official container version xxx, ...]
31
+ - oxidized version: [e.g. 0.32.2]
32
+ - oxidized-web version: [e.g. 0.15.1, if applicable]
33
+
34
+ **Additional context**
35
+ Add any other context about the problem here.
36
+
@@ -2,24 +2,43 @@ name: Publish Docker
2
2
  on:
3
3
  push:
4
4
  branches: [ "master" ]
5
+ tags: [ "[0-9]+.[0-9]+.[0-9]+" ]
6
+
5
7
  jobs:
6
8
  build:
7
9
  if: github.repository_owner == 'ytti'
8
10
  runs-on: ubuntu-latest
9
11
  steps:
10
- - uses: actions/checkout@master
11
- with:
12
- fetch-depth: 0
13
- - name: Get Release Version
14
- id: get_version
15
- run: echo "release-version=$(git describe --tags)" >> $GITHUB_OUTPUT
16
- - name: Set up Docker Buildx
17
- uses: docker/setup-buildx-action@v3
18
- - name: Publish to Registry
19
- uses: elgohr/Publish-Docker-Github-Action@v5
20
- with:
21
- name: oxidized/oxidized
22
- username: ${{ secrets.DOCKER_USERNAME }}
23
- password: ${{ secrets.DOCKER_PASSWORD }}
24
- tags: "latest,${{ steps.get_version.outputs.release-version }}"
25
- platforms: linux/amd64,linux/arm64
12
+
13
+ - name: Define tags
14
+ id: meta
15
+ uses: docker/metadata-action@v5
16
+ with:
17
+ images: |
18
+ oxidized/oxidized
19
+ tags: |
20
+ type=semver,pattern={{version}}
21
+ type=sha,prefix=master-
22
+ flavor: |
23
+ latest=true
24
+
25
+ - name: Login to Docker Hub
26
+ uses: docker/login-action@v3
27
+ with:
28
+ username: ${{ secrets.DOCKER_USERNAME }}
29
+ password: ${{ secrets.DOCKER_PASSWORD }}
30
+
31
+ - name: Set up QEMU
32
+ uses: docker/setup-qemu-action@v3
33
+
34
+ - name: Set up Docker Buildx
35
+ uses: docker/setup-buildx-action@v3
36
+
37
+ - name: Build and push
38
+ uses: docker/build-push-action@v6
39
+ with:
40
+ platforms: linux/amd64,linux/arm64
41
+ push: true
42
+ tags: ${{ steps.meta.outputs.tags }}
43
+ build-args: |
44
+ BUILDKIT_CONTEXT_KEEP_GIT_DIR=true
data/.gitignore CHANGED
@@ -52,3 +52,4 @@ build-iPhoneSimulator/
52
52
 
53
53
  # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
54
54
  .rvmrc
55
+ /.rake_tasks~
data/.rubocop.yml CHANGED
@@ -3,8 +3,6 @@ inherit_from: .rubocop_todo.yml
3
3
  plugins:
4
4
  - rubocop-rake
5
5
  - rubocop-minitest
6
-
7
- require:
8
6
  - rubocop-sequel
9
7
 
10
8
  AllCops:
data/.rubocop_todo.yml CHANGED
@@ -1,57 +1,31 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2025-02-17 10:13:53 UTC using RuboCop version 1.72.1.
3
+ # on 2025-03-26 12:52:00 UTC using RuboCop version 1.74.0.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
- # Offense count: 30
9
+ # Offense count: 33
10
10
  # Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes, Max.
11
11
  Metrics/AbcSize:
12
12
  Enabled: false
13
13
 
14
- # Offense count: 17
14
+ # Offense count: 19
15
15
  # Configuration parameters: AllowedMethods, AllowedPatterns.
16
16
  Metrics/CyclomaticComplexity:
17
17
  Max: 12
18
18
 
19
- # Offense count: 14
19
+ # Offense count: 16
20
20
  # Configuration parameters: AllowedMethods, AllowedPatterns.
21
21
  Metrics/PerceivedComplexity:
22
22
  Max: 12
23
23
 
24
- # Offense count: 1
25
- Naming/ConstantName:
26
- Exclude:
27
- - 'extra/rest_client.rb'
28
-
29
- # Offense count: 1
30
- # This cop supports unsafe autocorrection (--autocorrect-all).
31
- # Configuration parameters: EnforcedStyleForLeadingUnderscores.
32
- # SupportedStylesForLeadingUnderscores: disallowed, required, optional
33
- Naming/MemoizedInstanceVariableName:
34
- Exclude:
35
- - 'lib/refinements.rb'
36
-
37
24
  # Offense count: 2
38
25
  Rake/DuplicateTask:
39
26
  Exclude:
40
27
  - 'Rakefile'
41
28
 
42
- # Offense count: 1
43
- Security/Eval:
44
- Exclude:
45
- - 'Rakefile'
46
-
47
- # Offense count: 1
48
- # This cop supports unsafe autocorrection (--autocorrect-all).
49
- # Configuration parameters: EnforcedStyle.
50
- # SupportedStyles: nested, compact
51
- Style/ClassAndModuleChildren:
52
- Exclude:
53
- - 'lib/oxidized/config/vars.rb'
54
-
55
29
  # Offense count: 2
56
30
  Style/ClassVars:
57
31
  Exclude:
@@ -77,7 +51,7 @@ Style/OpenStructUse:
77
51
  Style/SlicingWithRange:
78
52
  Enabled: false
79
53
 
80
- # Offense count: 94
54
+ # Offense count: 99
81
55
  # This cop supports unsafe autocorrection (--autocorrect-all).
82
56
  # Configuration parameters: Mode.
83
57
  Style/StringConcatenation:
data/CHANGELOG.md CHANGED
@@ -4,8 +4,60 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
6
6
 
7
- ## [0.32.0 2025-02-20]
8
- This minor release fixes a javascript issue in oxidized-web, which is included
7
+ ## [0.33.0 - 2025-03-26]
8
+ This release changes the way to configure oxidized-web. The old `rest`
9
+ configuration is still supported but deprecated. The new configuration works
10
+ with oxidized-web 0.16.0 or later.
11
+ See [docs/Configuration.md](/docs/Configuration.md#oxidized-web-RESTful-API-and-web-interface).
12
+
13
+ The docker container includes
14
+ [security fixes to ruby-rake](https://ubuntu.com/security/notices/USN-7366-1),
15
+ so be sure to update to the latest version.
16
+
17
+ ### Added
18
+ - unifiap: new model for Unifi APs, switches, and AirOS APs (@clifcox)
19
+ - github: Issue templates for bugs, feature requests and support requests (@robertcheramy)
20
+ - model for Ingate Operating System (@thanegill)
21
+ - model for Easton Gigabit Network Card (@thanegill)
22
+
23
+ ### Changed
24
+ - fortios: support for FortiADC (@electrocret)
25
+ - output/git: cache commit log to improve performance of oxidized-web. Fixes #3121 (@robertcheramy)
26
+ - input/http: digest auth handles special characters in passwords by itself (no need to url encode them manually) (@einglasvollkakao)
27
+ - changed the configuration for oxidized-web from rest: to extensions.oxidized-web (@robertcheramy)
28
+ - netgear: add pager-handler workaround, fixes: #2394 and #3341 (@candlerb, @syn-bit)
29
+ - Output#version (git/gitcrypt) returns a Time object in its hash for more flexibility in oxidized-web (@robertcheramy)
30
+ - ios: hide secret key of aaa radius (@martinberg, @robertcheramy)
31
+ - container: update to phusion/baseimage:noble-1.0.1 (@robertcheramy)
32
+
33
+ ### Fixed
34
+ - powerconnect: Mask the changing temperature issue for non-stacked switches. Fixes #2088 (@clifcox)
35
+ - Fix frozen string literals (@robertcheramy)
36
+ - powerconnect: Cleanup login/logout logic. Fixes #3437 (@clifcox)
37
+ - aos7: remove extra lines occuring when `show hardware-info` runs slow (@rouven0)
38
+ - srosmd: add ignore regex for 64-bit system uptime (@emiliaaah)
39
+ - removed some rubocop warnings (@robertcheramy)
40
+
41
+ ## [0.32.2 – 2025-02-27]
42
+ This patch release mainly fixes the docker building process, wich resulted in
43
+ 0.32.1 not beeing built.
44
+
45
+ ### Changed
46
+ - docker image: updated github CI to explicitly build tag versions (@robertcheramy)
47
+ - docker image: update rake build_container to match the tags of GitHub CI (@robertcheramy)
48
+
49
+ ### Fixed
50
+ - powerconnect: restore last line of command output, and remove spurious CR characters. Fixes #2692 (@clifcox)
51
+ - powerconnect: Remove undesirable inserted blank lines during pagination. Fixes #3413 (@clifcox)
52
+ - docker image: remove ubuntu user introduced in noble. Fixes #3336 (@robertcheramy)
53
+ - docker image: correct rights under /home/oxidized. Fixes #3336 (@robertcheramy)
54
+ - docker image: revert the use of GEM_HOME. Fixes #3331 (@robertcheramy)
55
+ - docker image: improve the documentation. Fixes #3336 (@robertcheramy)
56
+ - docker image: remove examples/podman-compose as this is better documented in docs/Docker.md (@robertcheramy)
57
+
58
+
59
+ ## [0.32.1 – 2025-02-20]
60
+ This patch release fixes a javascript issue in oxidized-web, which is included
9
61
  in the Docker container of oxidized.
10
62
 
11
63
  ### Fixed
data/CONTRIBUTING.md CHANGED
@@ -1,6 +1,15 @@
1
1
  # Oxidized - Contributing Guide
2
2
  You can contribute to [Oxidized](https://github.com/ytti/oxidized/) in many ways, and first of all we'd like to thank you for taking your time to improve this great project!
3
3
 
4
+ > ## Legal Notice
5
+ > When submitting content to this project, you must agree that you have authored 100%
6
+ > of the content, that you have the necessary rights to the content and that the
7
+ > content you contribute may be provided under the project license.
8
+ >
9
+ > If you are employed, you probably need the permission from your employer to
10
+ > contribute to open source projects.
11
+
12
+
4
13
  ## Contribute as a user
5
14
  A great place for users to get involved is the [GitHub issues](https://github.com/ytti/oxidized/issues).
6
15
  Through the issues, you can interact with maintainers and other users. You can open an issue
@@ -9,13 +18,6 @@ if you need help, but you can also help other users by reviewing their issues an
9
18
  Before writing an issue, please read our documentation on
10
19
  [how to write good issues](/docs/Issues.md).
11
20
 
12
- > ## Legal Notice
13
- > When submitting content to this project, you must agree that you have authored 100%
14
- > of the content, that you have the necessary rights to the content and that the
15
- > content you contribute may be provided under the project license.
16
- >
17
- > If you are employed, you probably need the permission from your employer to
18
- > contribute to open source projects.
19
21
 
20
22
  ## Contribute some content
21
23
  Content contributions are always welcome. You do not need to be a maintainer for this.
@@ -25,6 +27,7 @@ enhancements :-)
25
27
  Contributions can be submitted through pull requests in github. For a full explanation how to
26
28
  contribute some content, see [How to contribute content](#how-to-contribute-content).
27
29
 
30
+
28
31
  ## Help Needed
29
32
 
30
33
  As things stand right now, `oxidized` is maintained by a few people. A great
data/Dockerfile CHANGED
@@ -1,61 +1,27 @@
1
- ###################
2
- # Stage 1: Prebuild to save space in the final image.
3
-
4
- FROM docker.io/phusion/baseimage:noble-1.0.0 AS prebuilder
5
-
6
- # install necessary packages for building gems
7
- RUN apt-get update && apt-get install -y \
8
- build-essential \
9
- git \
10
- ruby-dev \
11
- && rm -rf /var/lib/apt/lists/*
12
-
13
- # create bundle directory
14
- RUN mkdir -p /usr/local/bundle
15
- ENV GEM_HOME=/usr/local/bundle
16
-
17
- ###################
18
- # Install the x25519 gem
19
- RUN gem install x25519 --no-document
20
-
21
-
22
- ###################
23
- # build oxidized
24
- COPY . /tmp/oxidized/
25
- WORKDIR /tmp/oxidized
26
-
27
- # docker automated build gets shallow copy, but non-shallow copy cannot be unshallowed
28
- RUN git fetch --unshallow || true
29
-
30
- # Remove any older gems of oxidized if they exist
31
- RUN rm pkg/* || true
32
-
33
- # Ensure rugged is built with ssh support
34
- RUN rake build
35
-
36
-
37
- ###################
38
- # Stage2: build an oxidized container from phusion/baseimage-docker and install x25519 from stage1
39
- FROM docker.io/phusion/baseimage:noble-1.0.0
1
+ FROM docker.io/phusion/baseimage:noble-1.0.1
40
2
 
41
3
  ENV DEBIAN_FRONTEND=noninteractive
42
4
 
43
5
  ##### Place "static" commands at the beginning to optimize image size and build speed
6
+ # remove default ubuntu user
7
+ RUN userdel -r ubuntu
8
+
44
9
  # add non-privileged user
45
10
  ARG UID=30000
46
11
  ARG GID=$UID
47
12
  RUN groupadd -g "${GID}" -r oxidized && useradd -u "${UID}" -r -m -d /home/oxidized -g oxidized oxidized
48
13
 
49
- # link config for msmtp for easier use.
50
- RUN ln -s /home/oxidized/.config/oxidized/.msmtprc /home/oxidized/
51
-
52
- # create parent directory & touch required file
53
- RUN mkdir -p /home/oxidized/.config/oxidized/
54
- RUN touch /home/oxidized/.config/oxidized/.msmtprc
55
14
 
56
- # setup the access to the file
57
- RUN chmod 600 /home/oxidized/.msmtprc
58
- RUN chown oxidized:oxidized /home/oxidized/.msmtprc
15
+ ##### MSMTP - Sending emails
16
+ # link config for msmtp for easier use.
17
+ # /home/oxidized/.msmtprc is a symbolic link to /home/oxidized/.config/oxidized/.msmtprc
18
+ # Create the files as the user oxidized
19
+ RUN mkdir -p /home/oxidized/.config/oxidized/ && \
20
+ chmod -R ug=rwX,o= /home/oxidized/.config/ && \
21
+ touch /home/oxidized/.config/oxidized/.msmtprc && \
22
+ chmod -R u=rw,go= /home/oxidized/.config/oxidized/.msmtprc && \
23
+ ln -s /home/oxidized/.config/oxidized/.msmtprc /home/oxidized/ && \
24
+ chown -R oxidized:oxidized /home/oxidized/.config /home/oxidized/.msmtprc
59
25
 
60
26
  # add runit services
61
27
  COPY extra/oxidized.runit /etc/service/oxidized/run
@@ -63,10 +29,10 @@ COPY extra/auto-reload-config.runit /etc/service/auto-reload-config/run
63
29
  COPY extra/update-ca-certificates.runit /etc/service/update-ca-certificates/run
64
30
 
65
31
  # set up dependencies for the build process
66
- RUN apt-get -yq update \
67
- && apt-get -yq upgrade \
68
- && apt-get -yq --no-install-recommends install ruby \
69
- # Build process of oxidized from git (beloww)
32
+ RUN apt-get -qy update \
33
+ && apt-get -qy upgrade \
34
+ && apt-get -qy --no-install-recommends install ruby \
35
+ # Build process of oxidized from git (below)
70
36
  git \
71
37
  # Allow git send-email from docker image
72
38
  git-email libmailtools-perl \
@@ -90,13 +56,6 @@ RUN apt-get -yq update \
90
56
  && apt-get clean \
91
57
  && rm -rf /var/lib/apt/lists/*
92
58
 
93
- # copy the compiled gem from the builder stage
94
- COPY --from=prebuilder /usr/local/bundle /usr/local/bundle
95
-
96
- # Set environment variables for bundler
97
- ENV GEM_HOME="/usr/local/bundle"
98
- ENV PATH="$GEM_HOME/bin:$PATH"
99
-
100
59
  # gems not available in ubuntu noble
101
60
  RUN gem install --no-document \
102
61
  # dependencies for hooks
@@ -106,11 +65,25 @@ RUN gem install --no-document \
106
65
  # Net scp is needed in Version >= 4.1.0, which is not available in ubuntu
107
66
  net-scp
108
67
 
109
- # install oxidized from prebuilder
110
- # The Dockerfile ist version-independent, so use oxidized-*.gem to cach the gem
111
- RUN mkdir -p /tmp/oxidized
112
- COPY --from=prebuilder /tmp/oxidized/pkg/oxidized-*.gem /tmp/oxidized/
113
- RUN gem install /tmp/oxidized/oxidized-*.gem
68
+ # Prepare the build of oxidized, copy our workig directory in the container
69
+ COPY . /tmp/oxidized/
70
+ WORKDIR /tmp/oxidized
71
+
72
+ # Install gems which needs a build environment
73
+ RUN apt-get -qy update && \
74
+ apt-get -qy install --no-install-recommends \
75
+ build-essential git ruby-dev && \
76
+ ##### X25519 (a.k.a. Curve25519) Elliptic Curve Diffie-Hellman
77
+ gem install x25519 && \
78
+ ##### build & install oxidized from the working repository
79
+ # docker automated build gets shallow copy, but non-shallow copy cannot be unshallowed
80
+ git fetch --unshallow || true && \
81
+ rake install && \
82
+ # remove the packages we do not need.
83
+ apt-get -qy remove build-essential git ruby-dev && \
84
+ apt-get -qy autoremove && \
85
+ apt-get clean && \
86
+ rm -rf /var/lib/apt/lists/*
114
87
 
115
88
  # install oxidized-web
116
89
  RUN gem install oxidized-web --no-document
data/README.md CHANGED
@@ -1,9 +1,6 @@
1
1
  # Oxidized
2
2
 
3
3
  [![Build Status](https://github.com/ytti/oxidized/actions/workflows/ruby.yml/badge.svg)](https://github.com/ytti/oxidized/actions/workflows/ruby.yml)
4
- [![codecov.io](https://codecov.io/gh/ytti/oxidized/coverage.svg?branch=master)](https://codecov.io/gh/ytti/oxidized?branch=master)
5
- [![Codacy Badge](https://api.codacy.com/project/badge/Grade/5a90cb22db6a4d5ea23ad0dfb53fe03a)](https://www.codacy.com/app/ytti/oxidized?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=ytti/oxidized&amp;utm_campaign=Badge_Grade)
6
- [![Code Climate](https://codeclimate.com/github/ytti/oxidized/badges/gpa.svg)](https://codeclimate.com/github/ytti/oxidized)
7
4
  [![Gem Version](https://badge.fury.io/rb/oxidized.svg)](http://badge.fury.io/rb/oxidized)
8
5
  [![Join the chat at https://gitter.im/oxidized/Lobby](https://badges.gitter.im/oxidized/Lobby.svg)](https://gitter.im/oxidized/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
9
6
 
@@ -14,7 +11,7 @@ It is light and extensible and supports over 130 operating system types.
14
11
  Feature highlights:
15
12
 
16
13
  * Automatically adds/removes threads to meet configured retrieval interval
17
- * Restful API to a move node immediately to head-of-queue (GET/POST /node/next/[NODE])
14
+ * Restful API to a move node immediately to head-of-queue (GET/PUT /node/next/[NODE])
18
15
  * Syslog udp+file example to catch config change events (IOS/JunOS) and trigger a config fetch
19
16
  * Will signal which IOS/JunOS user made the change, can then be used by output modules (via POST)
20
17
  * The `git` output module uses this info - 'git blame' will show who changed each line
@@ -37,8 +34,7 @@ Check out the [Oxidized TREX 2014 presentation](http://youtu.be/kBQ_CTUuqeU?t=3h
37
34
  * [CentOS, Oracle Linux, Red Hat Linux](#centos-oracle-linux-red-hat-linux)
38
35
  * [FreeBSD](#freebsd)
39
36
  * [Build from Git](#build-from-git)
40
- * [Docker](#running-with-docker)
41
- * [Podman-Compose](#running-with-podman-compose)
37
+ * [Docker & Podman](docs/Docker.md)
42
38
  * [Installing Ruby 2.3 using RVM](#installing-ruby-23-using-rvm)
43
39
  3. [Initial Configuration](#configuration)
44
40
  4. [Configuration](docs/Configuration.md)
@@ -155,95 +151,8 @@ gem install bundler
155
151
  rake install
156
152
  ```
157
153
 
158
- ### Running with Docker
159
-
160
- Currently, Docker Hub automatically builds the master branch for linux/amd64 and linux/arm64 platforms as [oxidized/oxidized](https://hub.docker.com/r/oxidized/oxidized/), you can make use of this container or build your own.
161
-
162
- To build your own, clone git repo:
163
-
164
- ```shell
165
- git clone https://github.com/ytti/oxidized
166
- ```
167
-
168
- Then, build the container locally (requires docker 17.05.0-ce or higher):
169
-
170
- ```shell
171
- docker build -q -t oxidized/oxidized:latest oxidized/
172
- ```
173
-
174
- Once you've built the container (or chosen to make use of the automatically built container in Docker Hub, which will be downloaded for you by docker on the first `run` command had you not built it), proceed as follows:
175
-
176
- Create a configuration directory in the host system:
177
-
178
- ```shell
179
- mkdir /etc/oxidized
180
- ```
181
-
182
- Run the container for the first time to initialize the config:
183
-
184
- _Note: this step in only required for creating the Oxidized configuration file and can be skipped if you already have one._
185
-
186
- ```shell
187
- docker run --rm -v /etc/oxidized:/home/oxidized/.config/oxidized -p 8888:8888/tcp --user oxidized -t oxidized/oxidized:latest oxidized
188
- ```
189
-
190
- If the RESTful API and Web Interface are enabled, on the docker host running the container
191
- edit `/etc/oxidized/config` and modify `rest: 127.0.0.1:8888` to `rest: 0.0.0.0:8888`. This will bind port 8888 to all interfaces, and expose the port so that it could be accessed externally. [(Issue #445)](https://github.com/ytti/oxidized/issues/445)
192
-
193
- Alternatively, you can use docker-compose to launch the oxidized container:
194
-
195
- ```yaml
196
- # docker-compose.yml
197
- # docker-compose file example for oxidized that will start along with docker daemon
198
- ---
199
- version: "3"
200
- services:
201
- oxidized:
202
- restart: always
203
- image: oxidized/oxidized:latest
204
- ports:
205
- - 8888:8888/tcp
206
- environment:
207
- CONFIG_RELOAD_INTERVAL: 600
208
- volumes:
209
- - config:/home/oxidized/.config/oxidized/
210
- volumes:
211
- config:
212
- ```
213
-
214
- Create the `/etc/oxidized/router.db` (see [CSV Source](docs/Sources.md#source-csv) for further info):
215
-
216
- ```shell
217
- vim /etc/oxidized/router.db
218
- ```
219
-
220
- Run container again to start oxidized with your configuration:
221
-
222
- ```shell
223
- docker run -v /etc/oxidized:/home/oxidized/.config/oxidized -p 8888:8888/tcp -t oxidized/oxidized:latest
224
- oxidized[1]: Oxidized starting, running as pid 1
225
- oxidized[1]: Loaded 1 nodes
226
- Puma 2.13.4 starting...
227
- * Min threads: 0, max threads: 16
228
- * Environment: development
229
- * Listening on tcp://0.0.0.0:8888
230
- ```
231
-
232
- If you want to have the config automatically reloaded (e.g. when using a http source that changes):
233
-
234
- ```shell
235
- docker run -v /etc/oxidized:/home/oxidized/.config/oxidized -p 8888:8888/tcp -e CONFIG_RELOAD_INTERVAL=3600 -t oxidized/oxidized:latest
236
- ```
237
-
238
- If you need to use an internal CA (e.g. to connect to an private github instance):
239
-
240
- ```shell
241
- docker run -v /etc/oxidized:/home/oxidized/.config/oxidized -v /path/to/MY-CA.crt:/usr/local/share/ca-certificates/MY-CA.crt -p 8888:8888/tcp -e UPDATE_CA_CERTIFICATES=true -t oxidized/oxidized:latest
242
- ```
243
-
244
- ### Running with podman-compose
245
- Under [examples/podman-compose](examples/podman-compose), you will find a complete
246
- example of how to integrate the container into a docker-compose.yml file.
154
+ ### Running with Docker or Podman
155
+ See [docs/Docker.md](docs/Docker.md)
247
156
 
248
157
  ### Installing Ruby 2.3 using RVM
249
158
 
data/Rakefile CHANGED
@@ -2,7 +2,7 @@ require 'bundler/gem_tasks'
2
2
  require 'rake/testtask'
3
3
  require_relative 'lib/oxidized/version'
4
4
 
5
- gemspec = eval(File.read(Dir['*.gemspec'].first))
5
+ gemspec = Gem::Specification.load(Dir['*.gemspec'].first)
6
6
  gemfile = [gemspec.name, gemspec.version].join('-') + '.gem'
7
7
 
8
8
  # Integrate Rubocop if available
@@ -41,11 +41,6 @@ task :version_set do
41
41
  Bundler::GemHelper.instance.gemspec.version = Oxidized::VERSION
42
42
  end
43
43
 
44
- # desc 'Install gem'
45
- # task install: :build do
46
- # system "sudo -Es sh -c \'umask 022; gem install gems/#{gemfile}\'"
47
- # end
48
-
49
44
  desc 'Remove gems'
50
45
  task :clean do
51
46
  FileUtils.rm_rf 'pkg'
@@ -95,15 +90,19 @@ end
95
90
 
96
91
  desc 'Build the container image with docker or podman'
97
92
  task :build_container do
93
+ branch_name = %x(git rev-parse --abbrev-ref HEAD).chop
94
+ sha_hash = %x(git rev-parse --short HEAD).chop
95
+ image_tag = "#{branch_name}-#{sha_hash}"
96
+
98
97
  # Prefer podman if available as it runs rootless
99
98
  if command_available?('podman')
100
- sh 'podman build -t oxidized:`git describe --tags` -t oxidized:latest .'
99
+ sh "podman build -t oxidized:#{image_tag} -t oxidized:latest ."
101
100
  elsif command_available?('docker')
102
101
  if docker_needs_root?
103
102
  puts 'docker needs root to build the image. Using sudo...'
104
- sh 'sudo docker build -t oxidized:`git describe --tags` -t oxidized:latest .'
103
+ sh "sudo docker build -t oxidized:#{image_tag} -t oxidized:latest ."
105
104
  else
106
- sh 'docker build -t oxidized:`git describe --tags` -t oxidized:latest .'
105
+ sh "docker build -t oxidized:#{image_tag} -t oxidized:latest ."
107
106
  end
108
107
  else
109
108
  puts 'You need Podman or Docker to build the container image.'