Skip to content

Latest commit

 

History

History
88 lines (57 loc) · 4.88 KB

Installation.md

File metadata and controls

88 lines (57 loc) · 4.88 KB

← README

Installation

Python

ACME requires Python 3.8 or newer. Install it with your favorite package manager.

You may consider to use a virtual environment manager like pyenv + virtualenv (see, for example, this tutorial).

Installation and First Setup

  1. Install the ACME CSE by cloning the repository, or by copying the whole distribution to a new directory.

     git clone https://github.com/ankraft/ACME-oneM2M-CSE.git
     cd ACME-oneM2M-CSE
    
  2. Either install the required packages by running the following command (recommended):

     python3 -m pip install -r requirements.txt
    

    OR install them individually:

     python3 -m pip install cbor2 flask flask-cors InquirerPy isodate paho-mqtt plotext rdflib requests rich tinydb
    
  3. Run the CSE for the first time.
    If no configuration file is found then an interactive configuration process is started. The configuration is saved to a configuration file. e.g. acme.ini by default.
     

  4. After terminating the CSE again you can edit that configuration file and add more settings if necessary. There are a lot of individual settings to configure here. Mostly, the defaults should be sufficient, but individual settings can be applied to each of the sections.
    See the Configuration documentation for further details, and the defaults configuration file acme.ini.default.

Running the CSE

You can start the CSE by simply running it from the command line:

python3 -m acme

Please refer to the Running documentation for more detailed instructions how to start and run the ACME CSE.


Certificates and Support for https

To enable https you have to set various settings [server.http.security] - HTTP Security Settings, and provide a certificate and a key file. One way to generate those files is the openssl tool that may already be installed on your OS. The following example shows how to generate a self-signed certificate:

openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -nodes -days 1000

This will generate the self-signed certificate and private key without password protection (-nodes), and stores them in the files cert.pem and key.pem respectively. openssl will prompt you with questions for Country Name etc, but you can just hit Enter and accept the defaults. The -days parameter affects the certificate's expiration date.

Please also consult the openssl manual for further instructions.

After you generated these files you can move them to a separate directory (for example you may create a new directory named cert in ACME's installation directory) and set the caCertificateFile and caPrivateKeyFile configuration parameters in the acme.ini configuration file under the [server.http.security] section accordingly.


Third-Party Components

The following third-party components are used by the ACME CSE.

Core CSE

  • The cbor2 package is used to parse and create CBOR serializations. MIT License
  • The CSE uses the Flask web framework to service http(s) requests. BSD 3-Clause License
  • flask-cors is a Flask extension for handling Cross Origin Resource Sharing (CORS), making cross-origin AJAX possible.
  • InquirerPy is a collection of common interactive command-line interfaces. MIT License
  • The isodate package is used to parse and handle ISO 8601 time, date, and duration. BSD License
  • The paho-mqtt library provides a client class which enables applications to connect to an MQTT broker. Eclipse Public License 1.0
  • The plotext library offers functions to plot graphs in the text console. MIT License
  • rdflib is a Python library for working with RDF. BSD 3-Clause License.
  • The CSE uses the Requests HTTP Library to send requests vi http. Apache2 License
  • The CSE uses the Rich text formatter library to format various terminal output. MIT License
  • Textual is a Rapid Application Development framework for to build textual user interfaces in Python. MIT License
  • To store resources the CSE uses the lightweight TinyDB document database. MIT License

Web UI Components

← README