Qt Automotive Suite Deployment Server Installation

Set up the Server in a Virtual Environment

Before you install the dependencies in the Python virtual environment, you need to install the libffi-dev, python-pkg-resources, python-dev and libssl-dev packages. Then, prepare the virtual environment:

virtualenv -p python2.7 ./venv
./venv/bin/pip install -r requirements.txt

Make sure to adapt the APPSTORE_* settings in appstore/settings.py to your environment, before you run the server.

One setting group to note is category icon resizing and decolorization settings. They are: ICON_SIZE_X, ICON_SIZE_Y, and ICON_DECOLOR. ICON_DECOLOR is False by default, and it regulates stripping the category icon of color and alpha channel and the subsequent application of the same image as an alpha channel instead.

ICON_SIZE_X and ICON_SIZE_Y are the maximum icon sizes, icons are scaled in such a way, as not to exceed this size, while keeping the aspect ratio of the icon. Default values are 50x50, so you should be aware that any uploaded icon will be limited to this size, unless the server is reconfigured.

Since package downloads are done through temporary files, you need to setup a cron-job to remove these temporary files periodically. The cron-job should be triggered every settings.APPSTORE_DOWNLOAD_EXPIRY/2 minutes; it needs to run:

./manage.py expire-downloads

Activate the Python Virtual Environment

Before you run manage.py, source the activation script on the console where you will be using it.

. ./venv/bin/activate

This activation is done once per session only:

Prepare Your Databases on the Server

Before you run the server, first, you need to prepare the databases. Also, you need to create an administrative user.

./manage.py makemigrations
./manage.py migrate
./manage.py createsuperuser

Make sure that the server has a user added for Neptune 3 UI's Downloads App. Currently the username and password are hardcoded in apps/com.pelagicore.downloads/stores/ServerConfig.qml:78.

Start the Server

To start the server, run the following command in your terminal:

./manage.py runserver 0.0.0.0:8080

This command starts the server on port 8080, and is reachable by anyone. You can replace the listening address with another one that suits your use case.

Maintain the Server

  • Clean up the downloads directory:
    ./manage.py expire-downloads

    This command removes all files from the downloads directory, that are older than settings.APPSTORE_DOWNLOAD_EXPIRY minutes. Ideally, this command should be run via a cron-job.

  • Manually verify a package for upload:
    ./manage.py verify-upload-package <pkg.appkg>

    This command verifies if <pkg.appkg> is a valid package that can be uploaded to the Downloads app.

  • Manually add a store signature to a package:
    ./manage.py store-sign-package <in.appkg> <out.appkg> [device id]

    This command first verifies the <in.appkg>. If this verification succeeds, <in.appkg> is copied over to <out.appkg> and a store signature is added. The optional [device id] parameter locks the generated package to the device with this ID.

© 2020 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.