Waldur HomePort is a web-based client for the Waldur MasterMind. It uses yarn for dependency management and Vite as module bundler.
Update system and install basic dependencies. Example for Linux Ubuntu:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install git wget
Install Node LTS and yarn:
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash
source ~/.bashrc
nvm install --lts
npm install -g yarn
Clone project and go to its folder:
git clone <repository-url>
cd waldur-homeport
Install dependencies via yarn:
yarn
PS. If you see errors related to fsevents on OS X, the workaround is: yarn cache clean && yarn upgrade && yarn
.
Run application: yarn start
.
Server will listen on //localhost:8001
If your REST API runs on different host or port, specify API_URL environment variable.
VITE_API_URL=http://127.0.0.1:8000/ yarn dev
Use Waldur MasterMind for backend.
Also you should install django-cors-headers from pip in order to add CORS headers:
pip install django-cors-headers
Then you should update waldur_core/server/settings.py
and add the following
lines at the end of the file:
INSTALLED_APPS += ('corsheaders',)
MIDDLEWARE = ('corsheaders.middleware.CorsMiddleware',) + MIDDLEWARE
CORS_ORIGIN_ALLOW_ALL = True
CORS_EXPOSE_HEADERS = (
'x-result-count',
'Link',
'x-impersonated-user-uuid',
)
# enable support for impersonation headers
from corsheaders.defaults import default_headers
CORS_ALLOW_HEADERS = (
*default_headers,
"X-Impersonated-User-Uuid",
)