Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REMOVE rpm stuff #632

Merged
merged 4 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES_NEXT_RELEASE
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Remove: RPM stuff
81 changes: 81 additions & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
2.11.0 (November 28th, 2023)

- Add: CORS_ENABLED env var (boolean) to enable the cors configuration (of config.js file) in your docker image (#608)
- Set Nodejs 14 as minimum version in packages.json (effectively removing Nodev12 from supported versions)
- Fix: the way in which list collection is done at MongoDB (ensureing nameOnly flag is boolean) so STH can support MongoDB 5.0+ versions
- Fix: TRUNCATION_EXPIRE_AFTER_SECONDS functionality (#606)

2.10.0 (November 2nd, 2022)

- Fix: healthcheck over sth exposed port
- Fix: Dockerfile to include initial packages upgrade
- Set Nodejs 12 as minimum version in packages.json (effectively removing Nodev8 and Nodev10 from supported versions)

2.9.0 (March 25th, 2022)

- Add: graceful shutdown listening to SIGTERM and SIGHUP signals (#576)
- Add: Docker healthcheck for STH API
- Add: config reconnectTries and reconnectInterval configuration (env vars DB_RECONNECT_TRIES and DB_RECONNECT_INTERVAL) to allow mongo driver reconnect (#559)
- Add: allow connect with mongo uri without auth
- Fix: return 500 when DB is not connected (#570)
- Fix: ensure permissions over temp directory (used by CSV generation) in docker container (issue re-introduced in 2.8.0)
- Fix: update logs about get raw and aggregated data (#556)
- Update codebase to use ES6
- Remove JSHint and jshint overrides
- Add esLint using standard tamia presets
- Replace var with let/const
- Fix or disable eslint errors
- Upgrade logops dep from 2.1.0 to 2.1.2 due to colors dependency corruption
- Upgrade: mongodb dependence from ~2.2.35 to ~3.6.12 (#567)
- Upgrade NodeJS version from 10.19.0 to 14-slim in Dockerfile

2.8.0 (May 27th, 2020)

- Fix: Filetype issue fixed for hLimit and hOffset (#539)
- Fix: Updated temporary csv filename for uniqueness (#532)
- Upgrade NodeJS version from 8.16.1 to 10.19.0 in Dockerfile due to Node 8 End-of-Life
- Make optional PM2 usage in docker entrypoint
- Add: MongoDB auth source configuration (env var DB_AUTH_SOURCE)

2.7.0 (November 11th, 2019)

- Add: NGSIv2 endpoints for the raw and aggregation API operations (#118)
- Add: CORS support (#500)
- Fix: check header response before use it (CSV response has no header)
- Fix: handler for reply a CSV: use new Hapi API (#513)
- Fix: Ensure permissions over temp directory (used by CSV generation) in docker container (#514)
- Upgrade NodeJS version from 8.16.0 to 8.16.1 in Dockerfile due to security issues

2.6.0 (June 4th, 2019)

- Upgrade NodeJS version from 8.12.0 to 8.16.0 in Dockerfile due to improve security
- Add: logging feature to count number of requests attended and number of requests processed with error (#310)
- Fix: race condition causes erroneous count to 0 in some cases (#493)

2.5.0 (December 19th, 2018)

- Set Nodejs 8.12.0 as minimum version in packages.json (effectively removing Nodev4 and Nodev6 as supported versions)
- Add: use NodeJS 8 in Dockerfile
- Add: use PM2 in Dockerfile
- Upgrade: hapi dependence from ~11.1.3 to ~16.7.0
- Upgrade: logops dependence from ~1.0.5 to 2.1.0
- Upgrade: joi dependence from ~5.1.0 to 14.0.6
- Upgrade: boom dependence from ~2.7.2 to 7.2.2
- Upgrade: json-csv dependence from ~1.2.0 to 1.5.0
- Upgrade: request development dependence from ~2.79.0 to 2.88.0
- Upgrade: mocha development depencence from ~3.2.0 to 5.2.0
- Remove: old unused development dependencies (chai, sinon, sinon-chai, grunt and grunt related module)

2.4.0 (August 16th, 2018)

- Upgrade lodash dependence to 4.17.5
- Upgrade mongodb dependence to 2.2.35
- Check & ensure hLimit<=lastN<=config.maxPageSize for raw data query. [#431]
- Fix: Content Disposition header encoding issue (#433)
- Add count to query and related fiware-total-count header [#428]
- Using precise dependencies (~=) in packages.json
- Upgrade hapi to 11.1.3

2.3.0 (October 18th, 2017)

- FEATURE update node version to 4.8.4
115 changes: 1 addition & 114 deletions doc/manuals/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
The STH component provides 3 alternatives for its installation:

1. Cloning the GitHub repository
2. Using a RPM package
3. Automatic deployment using Docker
2. Automatic deployment using Docker

## Cloning the GitHub repository

Expand All @@ -24,118 +23,6 @@ npm install

The STH component server is ready to be started as a Node application.

## Using a RPM package

In the next sections we detail the steps to follow to install, update and remove the STH component using a RPM package.

### Package generation

**Prerequisites:** To generate the RPM package from the STH component sources it is needed to have the rpm build tools
(`rpmbuild` executable), Node and the npm utilities, as well as an Internet connection to download the required Node
modules.

To generate the RPM package for the STH component, execute the following command from the root of the STH component:

```bash
./rpm/create-rpm.sh -v <version> -r <release>
```

If everything goes fine, a new RPM package will be created and stored in the following location:
`./rpm/RPMS/x86_64/fiware-sth-comet-<version>-<release>.x86_64.rpm`.

Execute the next command to get additional information about the RPM package creation script:

```bash
./rpm/create-rpm.sh -h
```

### Installation, upgrade and removal

**Prerequisites:** Node is needed to install the generated STH component RPM package.

To install or upgrade the STH component, execute:

```bash
sudo rpm -Uvh fiware-sth-comet-<version>-<release>.x86_64.rpm
```

After the installation, the following files and directories are created:

```text
/etc/init.d
└── sth

/etc/logrotate.d
└── logrotate-sth-daily

/var/log/sth

/var/run/sth

/opt/sth
├── conf
│ └── <empty> Here is where instances are configured
├── node_modules
│ └── <node modules directory structure and files>
├── package.json
└── src
└── <STH SW files>
```

To remove a previous STH component installation, execute:

```bash
sudo rpm -e fiware-sth-comet
```

### Configuration

STH is able to start multiple instances using the
[`sth`](https://github.com/telefonicaid/fiware-sth-comet/blob/master/rpm/SOURCES/etc/init.d/sth) service script by
adding and configuring certain files as detailed next.

To start multiple instances, one configuration file per instance has to be included in the `/opt/sth/conf` directory. It
is important to note that the default installation includes preconfigured instances.

It is important to change the `STH_PORT` value included in the configuration files to a value not used by other STH
instances/services. It is also a good practice to change the `LOG_FILE_NAME` value to avoid getting the logs from
several instances mixed.

The [`sth`](https://github.com/telefonicaid/fiware-sth-comet/blob/master/rpm/SOURCES/etc/init.d/sth) service script
includes the following operations:

- **start**: if no `<instance>` (see below) is provided, the script starts an instance per configuration file found in
the `/opt/sth/conf` directory matching the `sth_*.conf` template. If `<instance>` is provided, a configuration file
named `sth_<instance>.conf` is searched in the `/opt/sth/conf` directory and the corresponding instance is started.
- **stop**: if no `<instance>` (see below) is provided, the script stops all the instances by listing all pid files
under `/var/run/sth` matching the pattern `sth_*.pid`. If `<instance>` is provided, the scripts stops the instance
with the associated pid file `/var/run/sth/sth_<instance>.pid`
- **status**: The status operation shows information about one or more running instances following the same procedure
detailed in the `stop` operation.
- **restart**: The restart operation executes a `stop` operation followed by a `start` operation according to the
procedure detailed in those operations.

```bash
# start
sudo /sbin/service sth start [<instance>]
# stop
sudo /sbin/service sth stop [<instance>]
# status
sudo /sbin/service sth status [<instance>]
# restart
sudo /sbin/service sth restart [<instance>]
```

An example
[`sth_default.conf`](https://github.com/telefonicaid/fiware-sth-comet/blob/master/rpm/EXAMPLES/sth_default.conf) file
has been included in the component repository in GitHub to guide the STH instance configuration.

<!-- textlint-disable write-good -->

Last but not least, the STH process (a `node` process) runs the as `sth` user.

<!-- textlint-enable write-good -->

## Automatic deployment using Docker

To ease the testing and deployment of the STH component, there also exists Docker images hosted at the
Expand Down
2 changes: 1 addition & 1 deletion doc/manuals/running.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ To run the STH server, please execute the following command from the directory w
The STH component provides the user with 2 mechanisms to configure the component to the concrete needs of the user:

- Environment variables, which can be set assigning values to them or using the
[`sth_default.conf`](https://github.com/telefonicaid/fiware-sth-comet/blob/master/rpm/EXAMPLES/sth_default.conf)
[`sth_default.conf`](https://github.com/telefonicaid/fiware-sth-comet/blob/master/sth_default.conf)
file if a packaged version of the STH component is used.
- The [`config.js`](https://github.com/telefonicaid/fiware-sth-comet/blob/master/config.js) file located at the root
of the STH component code, a JSON formatted file including the configuration properties.
Expand Down
Loading
Loading