Development setup

Table of contents

This guide will walk you through running nocloud for development purposes.

Create a directory for nocloud projects and enter it.

mkdir nocloud
cd nocloud

Install dependencies

Install the following programs and Python packages, preferably using your distribution’s package manager (e.g. apt, pacman, dnf, apk).

Programs: entr esbuild git go make npm sassc

Check the minimum supported go version in davd/go.mod.

Python packages: aiohttp jinja2 markupsafe quart werkzeug

Check the recommended versions of the Python pacakges in core/pyproject.toml.

For example, to install all dependencies using Alpine Package Keeper (apk):

apk add entr esbuild git go make npm sassc py3-aiohttp py3-jinja2 py3-markupsafe py3-quart py3-werkzeug

Get the code

git clone https://codeberg.org/nocloud/davd.git
git clone --recursive https://codeberg.org/nocloud/core.git
git clone https://codeberg.org/nocloud/meta.git
git clone https://codeberg.org/nocloud/files.git

Build davd and assets

export NOCLOUD_CORE_PATH="$(pwd)/core"
make -C core
make -C davd
make -C meta
make -C files

Configure nocloud

Create the data directory.

mkdir data

Download the development config file and save it as config-dev.toml in the nocloud directory.

Generate the session secret key and add it to the config file. The following command will generate the key and replace it in config-dev.toml.

sed -i 's/^secret_key\s*=.*/secret_key = "'$(tr -c -d 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567' < /dev/random | head -c 52)'"/' config-dev.toml

Create a user

davd/nocloudctl -config config-dev.toml user-create myuser

Run nocloud

Download the run script and save it as run-dev.sh in the nocloud directory.

Run the script. This script must always be run from the nocloud directory.

sh run-dev.sh

Browse to http://localhost:5000

Log in with username myuser and the same password you entered in nocloudctl user-create.