diff --git a/source/installation-guide/installation-guide.rst b/source/installation-guide/installation-guide.rst index 9c686ec..784558d 100644 --- a/source/installation-guide/installation-guide.rst +++ b/source/installation-guide/installation-guide.rst @@ -77,6 +77,9 @@ Steps iv. Chirpstack Gateway (UDP from gateways to Chirpstack): 1700 +7. For communicating with the chirpstack api, which is necessary for OS2IoT to work, it is necessary to create a api key on Chirpstack, which you must insert in the environment variable: :code:`CHIRPSTACK_API_KEY`. +Access the chirpstack page on http://localhost:8080, navigate to API Keys under Network Server in the sidebar, and create the api key. After this, you must create an .env file where you fill out the :code:`CHIRPSTACK_API_KEY` with the api key created in chirpstack. + Troubleshooting ^^^^^^^^^^^^^^^ @@ -264,6 +267,51 @@ OS2IoT-backend takes several environment variables as configuration, if these ar | CHIRPSTACK_PORT | Chirpstack port | :code:`8080` | +-------------------------------+------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+ +We recommend disabling the HTTP "Server" header in your responses, as it can reveal information that may expose your application to vulnerabilities. +The following example demonstrates how to disable the HTTP "Server" header when running in Kubernetes with an Istio setup. + +Create a new file named envoyfilter.yaml and place it in the helm/template directory. + +a. Add the following content to envoyfilter.yaml: + +.. code-block:: bash + + apiVersion: networking.istio.io/v1alpha3 + kind: EnvoyFilter + metadata: + name: ef-removeserver + namespace: {{ .Values.envoyFilter.namespace }} + spec: + configPatches: + - applyTo: NETWORK_FILTER + match: + listener: + filterChain: + filter: + name: "envoy.filters.network.http_connection_manager" + patch: + operation: MERGE + value: + typed_config: + "@type": "type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager" + server_header_transformation: PASS_THROUGH + - applyTo: ROUTE_CONFIGURATION + patch: + operation: MERGE + value: + response_headers_to_remove: + - "x-envoy-upstream-service-time" + - "server" + +2. In the values.yaml file for your backend Helm chart, add the following configuration: + +.. code-block:: bash + + # Add EnvoyFilter settings here + envoyFilter: + enabled: true # Set to 'false' to disable the filter + namespace: "istio-system" # The namespace where the EnvoyFilter should be applied + Logs levels """"""""""""""" Specifying a LOG_LEVEL makes sure that only logs with that level or higher are included. Using 'debug' or 'verbose' LOG_LEVEL in a production environment is not recommended. diff --git a/source/maintenance-guide/maintenance-guide.rst b/source/maintenance-guide/maintenance-guide.rst index df657f2..e2fa439 100644 --- a/source/maintenance-guide/maintenance-guide.rst +++ b/source/maintenance-guide/maintenance-guide.rst @@ -76,8 +76,8 @@ Setup developement To setup your dev environment please follow these instructions: 1. Get the solution from Github. Clone the OS2IoT-docker, OS2IoT-backend, and OS2IoT-frontend. -2. Install typescript and angular globally on your computer. - a. Angular 9 – install by open terminal and type :code:`npm install -g @angular/cli` +2. Install typescript and Angular globally on your computer. + a. Angular – Find the current Angular version in the package.json file, and install that Angular version by open terminal and type :code:`npm install -g @angular/cli@{{VERSION_NUMBER}}` b. Typescript – install by open terminal and type :code:`npm install -g typescript` 3. For OS2IoT-frontend install dependencies and start a. Navigate terminal to the OS2IoT-frontend folder and type :code:`npm install` diff --git a/source/programming-guidelines/programming-guidelines.rst b/source/programming-guidelines/programming-guidelines.rst index dfdae6a..a1cf981 100644 --- a/source/programming-guidelines/programming-guidelines.rst +++ b/source/programming-guidelines/programming-guidelines.rst @@ -27,9 +27,9 @@ Form and style - Each logical component is in its own file. -- Indentation is 4 spaces +- Indentation is 2 spaces -- Lines should be broken if they exceed 160 characters +- Lines should be broken if they exceed 120 characters - Only have one declaration pr. Line @@ -43,7 +43,7 @@ orchestration using docker. Front-end ^^^^^^^^^ -Angular 9 is used for the frontend. The file structure described in the +Angular is used for the frontend. The file structure described in the Angular documentation will be used. This can be seen here: https://angular.io/guide/file-structure @@ -112,7 +112,7 @@ SIG is used to weekly evaluate code-quality: https://www.softwareimprovementgrou Front-end – Programming standards --------------------------------- -The frontend code is written in TypeScript [2]_ (Angular 9). In the +The frontend code is written in TypeScript [2]_ (Angular). In the project ESLint [3]_ is setup to lint the code for preventable and/or syntax related errors. To keep code formatting consistent Prettier [4]_ is used to format the code. We try to follow the do’s and don’ts of TypeScript diff --git a/source/user-interface-guidelines/user-interface-guidelines.rst b/source/user-interface-guidelines/user-interface-guidelines.rst index da62773..90e5772 100644 --- a/source/user-interface-guidelines/user-interface-guidelines.rst +++ b/source/user-interface-guidelines/user-interface-guidelines.rst @@ -365,9 +365,8 @@ JavaScript ~~~~~~~~~~ In accordance with the Angular best practices TypeScript is used and -compiled to JavaScript. As of the date of writing this document the -newest version of Angular (9.1) uses TypeScript 3.8. This supports the -newest browsers in accordance with the agreement with the customer and +compiled to JavaScript. The current version of Angular and Typescript is found in the package.json file. +This supports the newest browsers in accordance with the agreement with the customer and thus this is used. .. _in-general-2: