Installation
A production setup should involve an Apache/mod_wsgi installation and a RDBMS backend. The noclouddotnet server itself is deployed as a wheel and should be installed onto the host along with apache and mod_wsgi.
An example Apache configuration:
#
# This file is part of NoCloud.Net.
#
# Copyright (C) 2022 Last Bastion Network Pty Ltd
#
# NoCloud.Net is free software: you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation, either version 3 of the License, or (at your option) any later version.
#
# NoCloud.Net is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# NoCloud.Net. If not, see <https://www.gnu.org/licenses/>.
#
Listen 5000
<VirtualHost *:5000>
ServerName nocloud.last-bastion.net
DocumentRoot /var/www/html
# TODO - you need these as env vars within systemd/init of Apache
SetEnv FLASK_APP noclouddotnet
SetEnv FLASK_ENV production
SetEnv NOCLOUDNET_SETTINGS /path/to/settings.yaml
WSGIDaemonProcess nocloudnet display-name=%{GROUP} user=apache group=apache threads=5 request-timeout=30
WSGIScriptAlias / /usr/lib/python3.8/site-packages/noclouddotnet/app.wsgi
<Directory /usr/lib/python3.8/site-packages/noclouddotnet>
WSGIProcessGroup nocloudnet
WSGIApplicationGroup %{GLOBAL}
#Order deny,allow
#Allow from all
Require all granted
</Directory>
</VirtualHost>
The noclouddotnet application uses Dynaconf for configuration: thereare many ways to set/override variables. An example config is:
---
#
# This file is part of NoCloud.Net.
#
# Copyright (C) 2022 Last Bastion Network Pty Ltd
#
# NoCloud.Net is free software: you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation, either version 3 of the License, or (at your option) any later version.
#
# NoCloud.Net is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# NoCloud.Net. If not, see <https://www.gnu.org/licenses/>.
#
default:
DEBUG: false
VENDOR_DATA: ''
USER_DATA: ''
SQLALCHEMY_TRACK_MODIFICATIONS: false
DOMAIN: last-bastion.net
INSTANCE_TYPE: mymachinetype
# stevedore noclouddotnet.instanceid namespace value...
INSTANCEID: reversedns
development:
DEBUG: true
SECRET_KEY: dev
SQLALCHEMY_DATABASE_URI: 'sqlite:///nocloud.net.db'
test:
DEBUG: true
SQLALCHEMY_DATABASE_URI: 'sqlite:///:memory:'
production:
SQLALCHEMY_DATABASE_URI: 'postgresql://user:password@localhost/nocloud'
SECRET_KEY: prod
In order to create a/the RDBMS as per your configuration; you may need to do something along the lines of the following:
database setup
export FLASK_APP=noclouddotnet.app
export FLASK_ENV=production
export NOCLOUD_DOT_NET_SETTINGS=<path to settings.yaml>
flask createdb