SPDX-License-Identifier: BSD-3-Clause-Clear
Copyright (c) 2019 Qualcomm Technologies, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer below) provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Neither the name of Qualcomm Technologies, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Device Registration Sub-System is a part of the Device Identification, Registration and Blocking (DIRBS) System. It is used to comply type approval of imported/exported devices.
DRS-API-Installation-Guide-1.0.0
DRS-SPA-Installation-Guide-1.0.0.pdf
DRS-Importer-User-Guide-1.0.0.pdf
DRS-Exporter-User-Guide-1.0.0.pdf
DRS-Authority-User-Guide-1.0.0.pdf
https://github.com/dirbs/Device-Registration-Subsystem-Frontend
This repository contains code for DRS part of the DIRBS. It contains
app/-- The DRS core server app, to be used as DRS Web Server including database models, apis and resourcesetc/-- Config files etc to be reside heremock/-- Sample data files etc which are used in app to be reside herescripts/-- Database migration, list generation scripts etctests/-- Unit test scripts and Data
Make sure you have installed docker and docker-compose. To install dev environment without docker follow here.
-
Clone the repository
-
Create a
drsuser with UID9001and change the ownership of the repo:sudo useradd -u 9001 -m -d /home/drs -s /bin/bash drs sudo chown -R 9001:9001 Device-Registration-Subsystem
-
Now build Dev Server using:
make -f docker/dev/Makefile
-
Build Postgres Server using:
make -f docker/postgres/Makefile
-
After the build process for both images is successful launch dev environment using docker-compose:
docker-compose -f docker/dev/devenv-with-local-db.yml run --rm --service-ports dev-shell
It will launch container for development server and for postgres (drs_db) and login you to the shell of the development server.
-
Now open another terminal and login into the postgres shell:
docker exec -it drs_db bash -
Checkout into the postgres shell:
gosu postgres psql
-
On the postgres shell, create a role
drswith login:CREATE ROLE drs WITH login; -
On the postgres shell, create database named
drs:CREATE database drs OWNER drs; -
Now switch to the server shell, and install database:
make install-db
After these steps are completed successfully, you can run test or start development server etc on the shell.
We follow Semantic Versioning for DRS.
To change the releases number simply edit app/metadata.py and bump the version number.
To clean the extra and un-necessary directories in the project:
make cleanTo clean the python compiled files from the project:
make clean-pycTo install a fresh database:
make install-dbTo Upgrade already installed database:
make upgrade-dbTo configure To create distribution files:
make distTo generate full registration list for DIRBS Core:
make genlist-fullTo generate delta registration list for DIRBS Core:
make genlist-deltaTo run unit and regression tests:
make testTo run code linting:
make lintTo generate languages:
pybabel extract -F babel.cfg -k _l -o messages.pot .
pybabel init -i messages.pot -d app/translations -l language-code
pybabel compile -d app/translationsInstall rabbitmq-server
$ sudo apt-get install rabbitmq-serverStart celery worker
$ celery -A app.celery worker --loglevel=info -B