oxidized 0.32.1 → 0.34.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 (127) hide show
  1. checksums.yaml +4 -4
  2. data/.github/ISSUE_TEMPLATE/bug_report.md +45 -0
  3. data/.github/ISSUE_TEMPLATE/feature_request.md +22 -0
  4. data/.github/ISSUE_TEMPLATE/support-request.md +39 -0
  5. data/.github/workflows/publishdocker.yml +35 -16
  6. data/.github/workflows/ruby.yml +4 -2
  7. data/.gitignore +2 -0
  8. data/.rubocop.yml +29 -8
  9. data/.rubocop_todo.yml +1 -60
  10. data/CHANGELOG.md +103 -2
  11. data/CONTRIBUTING.md +20 -10
  12. data/Dockerfile +37 -64
  13. data/README.md +47 -141
  14. data/Rakefile +9 -11
  15. data/docs/Configuration.md +236 -27
  16. data/docs/DeviceSimulation.md +19 -7
  17. data/docs/Docker.md +245 -0
  18. data/docs/Issues.md +27 -1
  19. data/docs/Model-Notes/EatonNetwork.md +18 -0
  20. data/docs/Model-Notes/HPEAruba.md +3 -2
  21. data/docs/ModelUnitTests.md +35 -25
  22. data/docs/Outputs.md +83 -2
  23. data/docs/Release.md +34 -24
  24. data/docs/Supported-OS-Types.md +7 -0
  25. data/docs/Troubleshooting.md +4 -13
  26. data/extra/device2yaml.rb +24 -9
  27. data/extra/rest_client.rb +3 -2
  28. data/extra/syslog.rb +8 -3
  29. data/lib/oxidized/cli.rb +7 -3
  30. data/lib/oxidized/config/vars.rb +22 -14
  31. data/lib/oxidized/config.rb +3 -2
  32. data/lib/oxidized/core.rb +30 -8
  33. data/lib/oxidized/hook/ciscosparkdiff.rb +11 -9
  34. data/lib/oxidized/hook/exec.rb +5 -4
  35. data/lib/oxidized/hook/githubrepo.rb +23 -17
  36. data/lib/oxidized/hook/noophook.rb +2 -2
  37. data/lib/oxidized/hook/slackdiff.rb +9 -8
  38. data/lib/oxidized/hook/xmppdiff.rb +9 -9
  39. data/lib/oxidized/hook.rb +10 -8
  40. data/lib/oxidized/input/cli.rb +8 -3
  41. data/lib/oxidized/input/exec.rb +1 -1
  42. data/lib/oxidized/input/ftp.rb +2 -2
  43. data/lib/oxidized/input/http.rb +6 -6
  44. data/lib/oxidized/input/input.rb +1 -0
  45. data/lib/oxidized/input/scp.rb +2 -2
  46. data/lib/oxidized/input/ssh.rb +21 -14
  47. data/lib/oxidized/input/telnet.rb +3 -3
  48. data/lib/oxidized/input/tftp.rb +1 -1
  49. data/lib/oxidized/job.rb +7 -4
  50. data/lib/oxidized/logger.rb +51 -0
  51. data/lib/oxidized/model/acos.rb +1 -0
  52. data/lib/oxidized/model/aos7.rb +9 -0
  53. data/lib/oxidized/model/aoscx.rb +2 -0
  54. data/lib/oxidized/model/aosw.rb +22 -17
  55. data/lib/oxidized/model/aricentiss.rb +2 -2
  56. data/lib/oxidized/model/asa.rb +3 -3
  57. data/lib/oxidized/model/awplus.rb +13 -10
  58. data/lib/oxidized/model/eatonnetwork.rb +65 -0
  59. data/lib/oxidized/model/edgecos.rb +2 -1
  60. data/lib/oxidized/model/edgeos.rb +7 -6
  61. data/lib/oxidized/model/edgeswitch.rb +3 -1
  62. data/lib/oxidized/model/efos.rb +41 -0
  63. data/lib/oxidized/model/eltex.rb +1 -1
  64. data/lib/oxidized/model/fabricos.rb +1 -1
  65. data/lib/oxidized/model/fastiron.rb +3 -1
  66. data/lib/oxidized/model/firelinuxos.rb +12 -3
  67. data/lib/oxidized/model/fortios.rb +5 -4
  68. data/lib/oxidized/model/gaiaos.rb +4 -4
  69. data/lib/oxidized/model/ingate.rb +47 -0
  70. data/lib/oxidized/model/ios.rb +16 -5
  71. data/lib/oxidized/model/ironware.rb +1 -1
  72. data/lib/oxidized/model/junos.rb +4 -0
  73. data/lib/oxidized/model/linksyssrw.rb +3 -3
  74. data/lib/oxidized/model/mlnxos.rb +14 -7
  75. data/lib/oxidized/model/model.rb +4 -3
  76. data/lib/oxidized/model/netgear.rb +8 -0
  77. data/lib/oxidized/model/nsxdfw.rb +2 -1
  78. data/lib/oxidized/model/nsxfirewall.rb +2 -1
  79. data/lib/oxidized/model/nxos.rb +2 -2
  80. data/lib/oxidized/model/openwrt.rb +6 -6
  81. data/lib/oxidized/model/powerconnect.rb +31 -10
  82. data/lib/oxidized/model/procurve.rb +3 -1
  83. data/lib/oxidized/model/qtech.rb +3 -1
  84. data/lib/oxidized/model/quantaos.rb +8 -6
  85. data/lib/oxidized/model/routeros.rb +3 -2
  86. data/lib/oxidized/model/saos10.rb +38 -0
  87. data/lib/oxidized/model/sixwind.rb +28 -0
  88. data/lib/oxidized/model/sonicos.rb +1 -1
  89. data/lib/oxidized/model/srosmd.rb +1 -1
  90. data/lib/oxidized/model/supermicro.rb +1 -1
  91. data/lib/oxidized/model/timos.rb +1 -1
  92. data/lib/oxidized/model/tmos.rb +1 -0
  93. data/lib/oxidized/model/tnsr.rb +53 -0
  94. data/lib/oxidized/model/trango.rb +3 -1
  95. data/lib/oxidized/model/unifiap.rb +144 -0
  96. data/lib/oxidized/model/vrp.rb +3 -1
  97. data/lib/oxidized/model/xos.rb +3 -1
  98. data/lib/oxidized/model/zhoneolt.rb +3 -1
  99. data/lib/oxidized/model/zynos.rb +3 -3
  100. data/lib/oxidized/node.rb +44 -27
  101. data/lib/oxidized/nodes.rb +8 -4
  102. data/lib/oxidized/output/file.rb +28 -0
  103. data/lib/oxidized/output/git.rb +148 -41
  104. data/lib/oxidized/output/gitcrypt.rb +18 -13
  105. data/lib/oxidized/output/http.rb +5 -4
  106. data/lib/oxidized/output/output.rb +14 -0
  107. data/lib/oxidized/source/http.rb +4 -2
  108. data/lib/oxidized/version.rb +6 -4
  109. data/lib/oxidized/worker.rb +13 -13
  110. data/lib/oxidized.rb +3 -24
  111. data/lib/refinements.rb +2 -0
  112. data/oxidized.gemspec +10 -8
  113. metadata +74 -41
  114. data/examples/podman-compose/Makefile +0 -103
  115. data/examples/podman-compose/README.md +0 -94
  116. data/examples/podman-compose/docker-compose.yml +0 -30
  117. data/examples/podman-compose/gitserver/.gitignore +0 -1
  118. data/examples/podman-compose/gitserver/Dockerfile +0 -14
  119. data/examples/podman-compose/model-simulation/Dockerfile-model +0 -13
  120. data/examples/podman-compose/model-simulation/asternos.sh +0 -36
  121. data/examples/podman-compose/oxidized-config/.gitignore +0 -10
  122. data/examples/podman-compose/oxidized-config/config +0 -46
  123. data/examples/podman-compose/oxidized-config/config_csv-file +0 -46
  124. data/examples/podman-compose/oxidized-config/config_csv-gitserver +0 -56
  125. data/examples/podman-compose/oxidized-config/router.db +0 -1
  126. data/examples/podman-compose/oxidized-ssh/.gitignore +0 -1
  127. data/examples/podman-compose/oxidized-ssh/README.md +0 -14
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.2
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 and git-tools in the container
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 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 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&utm_medium=referral&utm_content=ytti/oxidized&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
@@ -34,12 +31,10 @@ Check out the [Oxidized TREX 2014 presentation](http://youtu.be/kBQ_CTUuqeU?t=3h
34
31
  1. [Supported OS Types](docs/Supported-OS-Types.md)
35
32
  2. [Installation](#installation)
36
33
  * [Debian and Ubuntu](#debian-and-ubuntu)
37
- * [CentOS, Oracle Linux, Red Hat Linux](#centos-oracle-linux-red-hat-linux)
34
+ * [Rocky Linux, Red Hat Enterprise Linux](#rocky-linux-red-hat-enterprise-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)
42
- * [Installing Ruby 2.3 using RVM](#installing-ruby-23-using-rvm)
37
+ * [Docker & Podman](docs/Docker.md)
43
38
  3. [Initial Configuration](#configuration)
44
39
  4. [Configuration](docs/Configuration.md)
45
40
  * [Debugging](docs/Configuration.md#debugging)
@@ -89,185 +84,96 @@ add-apt-repository universe
89
84
  Install the dependencies:
90
85
 
91
86
  ```shell
92
- apt-get install ruby ruby-dev libsqlite3-dev libssl-dev pkg-config cmake libssh2-1-dev libicu-dev zlib1g-dev g++ libyaml-dev
87
+ apt install ruby ruby-dev libsqlite3-dev libssl-dev pkg-config cmake libssh2-1-dev libicu-dev zlib1g-dev g++ libyaml-dev
93
88
  ```
94
89
 
95
- Finally, install the gems:
90
+ Finally, install Oxidized:
96
91
 
97
92
  ```shell
98
93
  gem install oxidized
99
- gem install oxidized-script oxidized-web # If you don't install oxidized-web, ensure "rest" is removed from your Oxidized config.
100
94
  ```
101
95
 
102
- ### CentOS, Oracle Linux, Red Hat Linux
103
-
104
- On CentOS 6 and 7 / RHEL 6 and 7, begin by installing Ruby 3.1 via RVM by following the instructions:
105
-
106
- Make sure you dont have any leftover ruby:
107
- ```yum erase ruby```
108
-
109
- Then, install gpg key and rvm
110
-
111
- ```shell
112
- sudo gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
113
- curl -sSL https://get.rvm.io | bash -s stable
114
- source /etc/profile.d/rvm.sh
115
- rvm requirements run
116
- rvm install 3.1
117
- rvm use 3.1
118
- ```
119
-
120
- Install oxidized requirements:
121
- ```yum install make cmake which sqlite-devel openssl-devel libssh2-devel gcc libicu-devel gcc-c++```
122
-
123
- Install the gems:
124
- ```gem install oxidized oxidized-web```
125
-
126
- You need to wrap the gem and reference the wrap in the systemctl service file:
127
- ```rvm wrapper oxidized```
128
-
129
- You can see where the wrapped gem is via
130
- ```rvm wrapper show oxidized```
131
- Use that path in the oxidized.service file, restart the systemctl daemon, run oxidized by hand once, edit config file, start service.
132
-
133
- ### FreeBSD
134
-
135
- [Use RVM to install Ruby v2.3](#installing-ruby-23-using-rvm), then install all required packages and gems:
136
-
96
+ You can also install one or both of the optional gems. They are not required
97
+ to run Oxidized:
137
98
  ```shell
138
- pkg install cmake pkgconf
139
- gem install oxidized
140
- gem install oxidized-script oxidized-web
141
- ```
142
-
143
- Oxidized is also available via [FreeBSD ports](https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=203374):
144
-
145
- ```shell
146
- pkg install rubygem-oxidized rubygem-oxidized-script rubygem-oxidized-web
147
- ```
148
-
149
- ### Build from Git
150
-
151
- ```shell
152
- git clone https://github.com/ytti/oxidized.git
153
- cd oxidized/
154
- gem install bundler
155
- rake install
99
+ gem install oxidized-web # Web interface and rest API
100
+ gem install oxidized-script # Script-based input/output extensions
156
101
  ```
157
102
 
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:
103
+ ### Rocky Linux, Red Hat Enterprise Linux
104
+ These instructions has been verified on Rocky Linux 9.3 and Fedora.
163
105
 
106
+ On Rocky Linux 9, you need to install/enable EPEL, CRB and Ruby 3.1:
164
107
  ```shell
165
- git clone https://github.com/ytti/oxidized
108
+ dnf install epel-release
109
+ dnf config-manager --set-enabled crb
110
+ dnf module enable ruby:3.1
166
111
  ```
167
112
 
168
- Then, build the container locally (requires docker 17.05.0-ce or higher):
169
-
113
+ Then you need the required packages for oxidized:
170
114
  ```shell
171
- docker build -q -t oxidized/oxidized:latest oxidized/
115
+ dnf -y install ruby ruby-devel sqlite-devel openssl-devel pkgconf-pkg-config cmake libssh-devel libicu-devel zlib-devel gcc-c++ libyaml-devel which
172
116
  ```
173
117
 
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:
118
+ Finally, install Oxidized:
177
119
 
178
120
  ```shell
179
- mkdir /etc/oxidized
121
+ gem install oxidized
180
122
  ```
181
123
 
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
-
124
+ You can also install one or both of the optional gems. They are not required
125
+ to run Oxidized:
186
126
  ```shell
187
- docker run --rm -v /etc/oxidized:/home/oxidized/.config/oxidized -p 8888:8888/tcp --user oxidized -t oxidized/oxidized:latest oxidized
127
+ gem install oxidized-web # Web interface and rest API
128
+ gem install oxidized-script # Script-based input/output extensions
188
129
  ```
189
130
 
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):
131
+ ### FreeBSD
132
+ These installation instructions have been tested on FreeBSD 14.2, but
133
+ oxidized itself has not been tested on it.
215
134
 
135
+ First install ruby and rubyXX-gems (Find out the name of the package with `pkg search gems`):
216
136
  ```shell
217
- vim /etc/oxidized/router.db
137
+ pkg instal ruby
138
+ pkg instal ruby32-gems
218
139
  ```
219
140
 
220
- Run container again to start oxidized with your configuration:
221
-
141
+ Then install the dependencies of oxidized an oxidized-web:
222
142
  ```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
143
+ pkg install ruby ruby-gems git sqlite3 libssh2 cmake pkgconf gmake
144
+ pkg install libyaml icu # Dependencies for oxidized-web
230
145
  ```
231
146
 
232
- If you want to have the config automatically reloaded (e.g. when using a http source that changes):
147
+ Finally, install Oxidized:
233
148
 
234
149
  ```shell
235
- docker run -v /etc/oxidized:/home/oxidized/.config/oxidized -p 8888:8888/tcp -e CONFIG_RELOAD_INTERVAL=3600 -t oxidized/oxidized:latest
150
+ gem install oxidized
236
151
  ```
237
152
 
238
- If you need to use an internal CA (e.g. to connect to an private github instance):
239
-
153
+ You can also install one or both of the optional gems. They are not required
154
+ to run Oxidized:
240
155
  ```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
156
+ gem install oxidized-web # Web interface and rest API
157
+ gem install oxidized-script # Script-based input/output extensions
242
158
  ```
243
159
 
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.
247
-
248
- ### Installing Ruby 2.3 using RVM
249
-
250
- Install Ruby 2.3 build dependencies
160
+ Oxidized is also available via [FreeBSD ports](https://ports.freebsd.org/cgi/ports.cgi?query=oxidized):
251
161
 
252
162
  ```shell
253
- yum install curl gcc-c++ patch readline readline-devel zlib zlib-devel
254
- yum install libyaml-devel libffi-devel openssl-devel make cmake
255
- yum install bzip2 autoconf automake libtool bison iconv-devel libssh2-devel libicu-devel
163
+ pkg install rubygem-oxidized rubygem-oxidized-script rubygem-oxidized-web
256
164
  ```
257
165
 
258
- Install RVM
166
+ ### Build from Git
259
167
 
260
168
  ```shell
261
- curl -L get.rvm.io | bash -s stable
169
+ git clone https://github.com/ytti/oxidized.git
170
+ cd oxidized/
171
+ gem install bundler
172
+ rake install
262
173
  ```
263
174
 
264
- Setup RVM environment and compile and install Ruby 2.3 and set it as default
265
-
266
- ```shell
267
- source /etc/profile.d/rvm.sh
268
- rvm install 2.3
269
- rvm use --default 2.3
270
- ```
175
+ ### Running with Docker or Podman
176
+ See [docs/Docker.md](docs/Docker.md)
271
177
 
272
178
  ## Configuration
273
179
 
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
@@ -10,7 +10,6 @@ begin
10
10
  require 'rubocop/rake_task'
11
11
 
12
12
  RuboCop::RakeTask.new
13
- task(:default).prerequisites << task(:rubocop)
14
13
  rescue LoadError
15
14
  task :rubocop do
16
15
  puts 'Install rubocop to run its rake tasks'
@@ -41,11 +40,6 @@ task :version_set do
41
40
  Bundler::GemHelper.instance.gemspec.version = Oxidized::VERSION
42
41
  end
43
42
 
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
43
  desc 'Remove gems'
50
44
  task :clean do
51
45
  FileUtils.rm_rf 'pkg'
@@ -95,15 +89,19 @@ end
95
89
 
96
90
  desc 'Build the container image with docker or podman'
97
91
  task :build_container do
92
+ branch_name = %x(git rev-parse --abbrev-ref HEAD).chop.gsub '/', '_'
93
+ sha_hash = %x(git rev-parse --short HEAD).chop
94
+ image_tag = "#{branch_name}-#{sha_hash}"
95
+
98
96
  # Prefer podman if available as it runs rootless
99
97
  if command_available?('podman')
100
- sh 'podman build -t oxidized:`git describe --tags` -t oxidized:latest .'
98
+ sh "podman build -t oxidized:#{image_tag} -t oxidized:latest ."
101
99
  elsif command_available?('docker')
102
100
  if docker_needs_root?
103
101
  puts 'docker needs root to build the image. Using sudo...'
104
- sh 'sudo docker build -t oxidized:`git describe --tags` -t oxidized:latest .'
102
+ sh "sudo docker build -t oxidized:#{image_tag} -t oxidized:latest ."
105
103
  else
106
- sh 'docker build -t oxidized:`git describe --tags` -t oxidized:latest .'
104
+ sh "docker build -t oxidized:#{image_tag} -t oxidized:latest ."
107
105
  end
108
106
  else
109
107
  puts 'You need Podman or Docker to build the container image.'
@@ -111,4 +109,4 @@ task :build_container do
111
109
  end
112
110
  end
113
111
 
114
- task default: :test
112
+ task default: %i[rubocop test]