diff --git a/.gitignore b/.gitignore index cbb171f..ab6a151 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,4 @@ venv/ dist/ *.iso +*.sqlite3 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index afdc4a1..33c1c06 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -15,8 +15,6 @@ run-tests: before_script: - dnf install -y python3-devel python3-pip python3-coverage libpq-devel openldap-devel gcc chromium script: - - cd uncloud_django_based/uncloud - pip install -r requirements.txt - - cp uncloud/secrets_sample.py uncloud/secrets.py - coverage run --source='.' ./manage.py test - coverage report diff --git a/README.md b/README.md index 0e32f57..8c53654 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,62 @@ -# ucloud +# Uncloud -Checkout https://ungleich.ch/ucloud/ for the documentation of ucloud. +Cloud management platform, the ungleich way. + + +[![pipeline status](https://code.ungleich.ch/uncloud/uncloud/badges/master/pipeline.svg)](https://code.ungleich.ch/uncloud/uncloud/commits/master) +[![coverage report](https://code.ungleich.ch/uncloud/uncloud/badges/master/coverage.svg)](https://code.ungleich.ch/uncloud/uncloud/commits/master) + +## Useful commands + +* `./manage.py import-vat-rates path/to/csv` +* `./manage.py make-admin username` + +## Development setup + +Install system dependencies: + +* On Fedora, you will need the following packages: `python3-virtualenv python3-devel openldap-devel gcc chromium` + +NOTE: you will need to configure a LDAP server and credentials for authentication. See `uncloud/settings.py`. + +``` +# Initialize virtualenv. +» virtualenv .venv +Using base prefix '/usr' +New python executable in /home/fnux/Workspace/ungleich/uncloud/uncloud/.venv/bin/python3 +Also creating executable in /home/fnux/Workspace/ungleich/uncloud/uncloud/.venv/bin/python +Installing setuptools, pip, wheel... +done. + +# Enter virtualenv. +» source .venv/bin/activate + +# Install dependencies. +» pip install -r requirements.txt +[...] + +# Run migrations. +» ./manage.py migrate +Operations to perform: + Apply all migrations: admin, auth, contenttypes, opennebula, sessions, uncloud_auth, uncloud_net, uncloud_pay, uncloud_service, uncloud_vm +Running migrations: + [...] + +# Run webserver. +» ./manage.py runserver +Watching for file changes with StatReloader +Performing system checks... + +System check identified no issues (0 silenced). +May 07, 2020 - 10:17:08 +Django version 3.0.6, using settings 'uncloud.settings' +Starting development server at http://127.0.0.1:8000/ +Quit the server with CONTROL-C. +``` + +### Note on PGSQL + +If you want to use Postgres: + +* Install on configure PGSQL on your base system. +* OR use a container! `podman run --rm -p 5432:5432 -e POSTGRES_HOST_AUTH_METHOD=trust -it postgres:latest` diff --git a/issues.org b/archive/issues.org similarity index 100% rename from issues.org rename to archive/issues.org diff --git a/uncloud_django_based/abk-hacks.py b/archive/uncloud_django_based/hacks/abk-hacks.py similarity index 100% rename from uncloud_django_based/abk-hacks.py rename to archive/uncloud_django_based/hacks/abk-hacks.py diff --git a/uncloud_django_based/abkhack/opennebula_hacks.py b/archive/uncloud_django_based/hacks/abkhack/opennebula_hacks.py similarity index 100% rename from uncloud_django_based/abkhack/opennebula_hacks.py rename to archive/uncloud_django_based/hacks/abkhack/opennebula_hacks.py diff --git a/archive/uncloud_django_based/hacks/command-wrapper.sh b/archive/uncloud_django_based/hacks/command-wrapper.sh new file mode 100644 index 0000000..d6ddd13 --- /dev/null +++ b/archive/uncloud_django_based/hacks/command-wrapper.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +dbhost=$1; shift + +ssh -L5432:localhost:5432 "$dbhost" & + +python manage.py "$@" + + + +# command only needs to be active while manage command is running + +# -T no pseudo terminal + + +# alternatively: commands output shell code + +# ssh uncloud@dbhost "python manage.py --hostname xxx ..." diff --git a/uncloud_django_based/meow-payv1/README.md b/archive/uncloud_django_based/meow-payv1/README.md similarity index 100% rename from uncloud_django_based/meow-payv1/README.md rename to archive/uncloud_django_based/meow-payv1/README.md diff --git a/uncloud_django_based/meow-payv1/config.py b/archive/uncloud_django_based/meow-payv1/config.py similarity index 100% rename from uncloud_django_based/meow-payv1/config.py rename to archive/uncloud_django_based/meow-payv1/config.py diff --git a/uncloud_django_based/meow-payv1/hack-a-vpn.py b/archive/uncloud_django_based/meow-payv1/hack-a-vpn.py similarity index 100% rename from uncloud_django_based/meow-payv1/hack-a-vpn.py rename to archive/uncloud_django_based/meow-payv1/hack-a-vpn.py diff --git a/uncloud_django_based/meow-payv1/helper.py b/archive/uncloud_django_based/meow-payv1/helper.py similarity index 100% rename from uncloud_django_based/meow-payv1/helper.py rename to archive/uncloud_django_based/meow-payv1/helper.py diff --git a/uncloud_django_based/meow-payv1/products/ipv6-only-django.json b/archive/uncloud_django_based/meow-payv1/products/ipv6-only-django.json similarity index 100% rename from uncloud_django_based/meow-payv1/products/ipv6-only-django.json rename to archive/uncloud_django_based/meow-payv1/products/ipv6-only-django.json diff --git a/uncloud_django_based/meow-payv1/products/ipv6-only-vm.json b/archive/uncloud_django_based/meow-payv1/products/ipv6-only-vm.json similarity index 100% rename from uncloud_django_based/meow-payv1/products/ipv6-only-vm.json rename to archive/uncloud_django_based/meow-payv1/products/ipv6-only-vm.json diff --git a/uncloud_django_based/meow-payv1/products/ipv6-only-vpn.json b/archive/uncloud_django_based/meow-payv1/products/ipv6-only-vpn.json similarity index 100% rename from uncloud_django_based/meow-payv1/products/ipv6-only-vpn.json rename to archive/uncloud_django_based/meow-payv1/products/ipv6-only-vpn.json diff --git a/uncloud_django_based/meow-payv1/products/ipv6box.json b/archive/uncloud_django_based/meow-payv1/products/ipv6box.json similarity index 100% rename from uncloud_django_based/meow-payv1/products/ipv6box.json rename to archive/uncloud_django_based/meow-payv1/products/ipv6box.json diff --git a/uncloud_django_based/meow-payv1/products/membership.json b/archive/uncloud_django_based/meow-payv1/products/membership.json similarity index 100% rename from uncloud_django_based/meow-payv1/products/membership.json rename to archive/uncloud_django_based/meow-payv1/products/membership.json diff --git a/uncloud_django_based/meow-payv1/requirements.txt b/archive/uncloud_django_based/meow-payv1/requirements.txt similarity index 100% rename from uncloud_django_based/meow-payv1/requirements.txt rename to archive/uncloud_django_based/meow-payv1/requirements.txt diff --git a/uncloud_django_based/meow-payv1/sample-pay.conf b/archive/uncloud_django_based/meow-payv1/sample-pay.conf similarity index 100% rename from uncloud_django_based/meow-payv1/sample-pay.conf rename to archive/uncloud_django_based/meow-payv1/sample-pay.conf diff --git a/uncloud_django_based/meow-payv1/schemas.py b/archive/uncloud_django_based/meow-payv1/schemas.py similarity index 100% rename from uncloud_django_based/meow-payv1/schemas.py rename to archive/uncloud_django_based/meow-payv1/schemas.py diff --git a/uncloud_django_based/meow-payv1/stripe_hack.py b/archive/uncloud_django_based/meow-payv1/stripe_hack.py similarity index 100% rename from uncloud_django_based/meow-payv1/stripe_hack.py rename to archive/uncloud_django_based/meow-payv1/stripe_hack.py diff --git a/uncloud_django_based/meow-payv1/stripe_utils.py b/archive/uncloud_django_based/meow-payv1/stripe_utils.py similarity index 100% rename from uncloud_django_based/meow-payv1/stripe_utils.py rename to archive/uncloud_django_based/meow-payv1/stripe_utils.py diff --git a/uncloud_django_based/meow-payv1/ucloud_pay.py b/archive/uncloud_django_based/meow-payv1/ucloud_pay.py similarity index 100% rename from uncloud_django_based/meow-payv1/ucloud_pay.py rename to archive/uncloud_django_based/meow-payv1/ucloud_pay.py diff --git a/uncloud_django_based/notes-abk.md b/archive/uncloud_django_based/notes-abk.md similarity index 100% rename from uncloud_django_based/notes-abk.md rename to archive/uncloud_django_based/notes-abk.md diff --git a/uncloud_django_based/notes-nico.org b/archive/uncloud_django_based/notes-nico.org similarity index 100% rename from uncloud_django_based/notes-nico.org rename to archive/uncloud_django_based/notes-nico.org diff --git a/uncloud_django_based/plan.org b/archive/uncloud_django_based/plan.org similarity index 100% rename from uncloud_django_based/plan.org rename to archive/uncloud_django_based/plan.org diff --git a/uncloud_django_based/uncloud/.gitignore b/archive/uncloud_django_based/uncloud/.gitignore similarity index 100% rename from uncloud_django_based/uncloud/.gitignore rename to archive/uncloud_django_based/uncloud/.gitignore diff --git a/uncloud_django_based/vat_rates.csv b/archive/uncloud_django_based/vat_rates.csv similarity index 100% rename from uncloud_django_based/vat_rates.csv rename to archive/uncloud_django_based/vat_rates.csv diff --git a/uncloud_etcd_based/bin/gen-version b/archive/uncloud_etcd_based/bin/gen-version similarity index 100% rename from uncloud_etcd_based/bin/gen-version rename to archive/uncloud_etcd_based/bin/gen-version diff --git a/uncloud_etcd_based/bin/uncloud b/archive/uncloud_etcd_based/bin/uncloud similarity index 100% rename from uncloud_etcd_based/bin/uncloud rename to archive/uncloud_etcd_based/bin/uncloud diff --git a/uncloud_etcd_based/bin/uncloud-run-reinstall b/archive/uncloud_etcd_based/bin/uncloud-run-reinstall similarity index 100% rename from uncloud_etcd_based/bin/uncloud-run-reinstall rename to archive/uncloud_etcd_based/bin/uncloud-run-reinstall diff --git a/uncloud_etcd_based/conf/uncloud.conf b/archive/uncloud_etcd_based/conf/uncloud.conf similarity index 100% rename from uncloud_etcd_based/conf/uncloud.conf rename to archive/uncloud_etcd_based/conf/uncloud.conf diff --git a/uncloud_etcd_based/docs/Makefile b/archive/uncloud_etcd_based/docs/Makefile similarity index 100% rename from uncloud_etcd_based/docs/Makefile rename to archive/uncloud_etcd_based/docs/Makefile diff --git a/uncloud_etcd_based/docs/README.md b/archive/uncloud_etcd_based/docs/README.md similarity index 100% rename from uncloud_etcd_based/docs/README.md rename to archive/uncloud_etcd_based/docs/README.md diff --git a/uncloud_django_based/uncloud/opennebula/__init__.py b/archive/uncloud_etcd_based/docs/__init__.py similarity index 100% rename from uncloud_django_based/uncloud/opennebula/__init__.py rename to archive/uncloud_etcd_based/docs/__init__.py diff --git a/uncloud_django_based/uncloud/opennebula/migrations/__init__.py b/archive/uncloud_etcd_based/docs/source/__init__.py similarity index 100% rename from uncloud_django_based/uncloud/opennebula/migrations/__init__.py rename to archive/uncloud_etcd_based/docs/source/__init__.py diff --git a/uncloud_etcd_based/docs/source/admin-guide.rst b/archive/uncloud_etcd_based/docs/source/admin-guide.rst similarity index 100% rename from uncloud_etcd_based/docs/source/admin-guide.rst rename to archive/uncloud_etcd_based/docs/source/admin-guide.rst diff --git a/uncloud_etcd_based/docs/source/conf.py b/archive/uncloud_etcd_based/docs/source/conf.py similarity index 100% rename from uncloud_etcd_based/docs/source/conf.py rename to archive/uncloud_etcd_based/docs/source/conf.py diff --git a/uncloud_etcd_based/docs/source/diagram-code/ucloud b/archive/uncloud_etcd_based/docs/source/diagram-code/ucloud similarity index 100% rename from uncloud_etcd_based/docs/source/diagram-code/ucloud rename to archive/uncloud_etcd_based/docs/source/diagram-code/ucloud diff --git a/uncloud_etcd_based/docs/source/hacking.rst b/archive/uncloud_etcd_based/docs/source/hacking.rst similarity index 100% rename from uncloud_etcd_based/docs/source/hacking.rst rename to archive/uncloud_etcd_based/docs/source/hacking.rst diff --git a/uncloud_etcd_based/docs/source/images/ucloud.svg b/archive/uncloud_etcd_based/docs/source/images/ucloud.svg similarity index 100% rename from uncloud_etcd_based/docs/source/images/ucloud.svg rename to archive/uncloud_etcd_based/docs/source/images/ucloud.svg diff --git a/uncloud_etcd_based/docs/source/index.rst b/archive/uncloud_etcd_based/docs/source/index.rst similarity index 100% rename from uncloud_etcd_based/docs/source/index.rst rename to archive/uncloud_etcd_based/docs/source/index.rst diff --git a/uncloud_etcd_based/docs/source/introduction.rst b/archive/uncloud_etcd_based/docs/source/introduction.rst similarity index 100% rename from uncloud_etcd_based/docs/source/introduction.rst rename to archive/uncloud_etcd_based/docs/source/introduction.rst diff --git a/uncloud_etcd_based/docs/source/misc/todo.rst b/archive/uncloud_etcd_based/docs/source/misc/todo.rst similarity index 100% rename from uncloud_etcd_based/docs/source/misc/todo.rst rename to archive/uncloud_etcd_based/docs/source/misc/todo.rst diff --git a/uncloud_etcd_based/docs/source/setup-install.rst b/archive/uncloud_etcd_based/docs/source/setup-install.rst similarity index 100% rename from uncloud_etcd_based/docs/source/setup-install.rst rename to archive/uncloud_etcd_based/docs/source/setup-install.rst diff --git a/uncloud_etcd_based/docs/source/theory/summary.rst b/archive/uncloud_etcd_based/docs/source/theory/summary.rst similarity index 100% rename from uncloud_etcd_based/docs/source/theory/summary.rst rename to archive/uncloud_etcd_based/docs/source/theory/summary.rst diff --git a/uncloud_etcd_based/docs/source/troubleshooting.rst b/archive/uncloud_etcd_based/docs/source/troubleshooting.rst similarity index 100% rename from uncloud_etcd_based/docs/source/troubleshooting.rst rename to archive/uncloud_etcd_based/docs/source/troubleshooting.rst diff --git a/uncloud_etcd_based/docs/source/user-guide.rst b/archive/uncloud_etcd_based/docs/source/user-guide.rst similarity index 100% rename from uncloud_etcd_based/docs/source/user-guide.rst rename to archive/uncloud_etcd_based/docs/source/user-guide.rst diff --git a/uncloud_etcd_based/docs/source/user-guide/how-to-create-an-os-image-for-ucloud.rst b/archive/uncloud_etcd_based/docs/source/user-guide/how-to-create-an-os-image-for-ucloud.rst similarity index 100% rename from uncloud_etcd_based/docs/source/user-guide/how-to-create-an-os-image-for-ucloud.rst rename to archive/uncloud_etcd_based/docs/source/user-guide/how-to-create-an-os-image-for-ucloud.rst diff --git a/uncloud_etcd_based/docs/source/vm-images.rst b/archive/uncloud_etcd_based/docs/source/vm-images.rst similarity index 100% rename from uncloud_etcd_based/docs/source/vm-images.rst rename to archive/uncloud_etcd_based/docs/source/vm-images.rst diff --git a/uncloud_etcd_based/scripts/uncloud b/archive/uncloud_etcd_based/scripts/uncloud similarity index 100% rename from uncloud_etcd_based/scripts/uncloud rename to archive/uncloud_etcd_based/scripts/uncloud diff --git a/uncloud_etcd_based/setup.py b/archive/uncloud_etcd_based/setup.py similarity index 100% rename from uncloud_etcd_based/setup.py rename to archive/uncloud_etcd_based/setup.py diff --git a/uncloud_django_based/uncloud/uncloud_auth/__init__.py b/archive/uncloud_etcd_based/test/__init__.py similarity index 100% rename from uncloud_django_based/uncloud/uncloud_auth/__init__.py rename to archive/uncloud_etcd_based/test/__init__.py diff --git a/uncloud_etcd_based/test/test_mac_local.py b/archive/uncloud_etcd_based/test/test_mac_local.py similarity index 100% rename from uncloud_etcd_based/test/test_mac_local.py rename to archive/uncloud_etcd_based/test/test_mac_local.py diff --git a/uncloud_etcd_based/uncloud/__init__.py b/archive/uncloud_etcd_based/uncloud/__init__.py similarity index 100% rename from uncloud_etcd_based/uncloud/__init__.py rename to archive/uncloud_etcd_based/uncloud/__init__.py diff --git a/uncloud_etcd_based/uncloud/api/README.md b/archive/uncloud_etcd_based/uncloud/api/README.md similarity index 100% rename from uncloud_etcd_based/uncloud/api/README.md rename to archive/uncloud_etcd_based/uncloud/api/README.md diff --git a/uncloud_etcd_based/uncloud/api/__init__.py b/archive/uncloud_etcd_based/uncloud/api/__init__.py similarity index 100% rename from uncloud_etcd_based/uncloud/api/__init__.py rename to archive/uncloud_etcd_based/uncloud/api/__init__.py diff --git a/uncloud_etcd_based/uncloud/api/common_fields.py b/archive/uncloud_etcd_based/uncloud/api/common_fields.py similarity index 100% rename from uncloud_etcd_based/uncloud/api/common_fields.py rename to archive/uncloud_etcd_based/uncloud/api/common_fields.py diff --git a/uncloud_etcd_based/uncloud/api/create_image_store.py b/archive/uncloud_etcd_based/uncloud/api/create_image_store.py similarity index 100% rename from uncloud_etcd_based/uncloud/api/create_image_store.py rename to archive/uncloud_etcd_based/uncloud/api/create_image_store.py diff --git a/uncloud_etcd_based/uncloud/api/helper.py b/archive/uncloud_etcd_based/uncloud/api/helper.py similarity index 100% rename from uncloud_etcd_based/uncloud/api/helper.py rename to archive/uncloud_etcd_based/uncloud/api/helper.py diff --git a/uncloud_etcd_based/uncloud/api/main.py b/archive/uncloud_etcd_based/uncloud/api/main.py similarity index 100% rename from uncloud_etcd_based/uncloud/api/main.py rename to archive/uncloud_etcd_based/uncloud/api/main.py diff --git a/uncloud_etcd_based/uncloud/api/schemas.py b/archive/uncloud_etcd_based/uncloud/api/schemas.py similarity index 100% rename from uncloud_etcd_based/uncloud/api/schemas.py rename to archive/uncloud_etcd_based/uncloud/api/schemas.py diff --git a/uncloud_django_based/uncloud/uncloud_auth/migrations/__init__.py b/archive/uncloud_etcd_based/uncloud/cli/__init__.py similarity index 100% rename from uncloud_django_based/uncloud/uncloud_auth/migrations/__init__.py rename to archive/uncloud_etcd_based/uncloud/cli/__init__.py diff --git a/uncloud_etcd_based/uncloud/cli/helper.py b/archive/uncloud_etcd_based/uncloud/cli/helper.py similarity index 100% rename from uncloud_etcd_based/uncloud/cli/helper.py rename to archive/uncloud_etcd_based/uncloud/cli/helper.py diff --git a/uncloud_etcd_based/uncloud/cli/host.py b/archive/uncloud_etcd_based/uncloud/cli/host.py similarity index 100% rename from uncloud_etcd_based/uncloud/cli/host.py rename to archive/uncloud_etcd_based/uncloud/cli/host.py diff --git a/uncloud_etcd_based/uncloud/cli/image.py b/archive/uncloud_etcd_based/uncloud/cli/image.py similarity index 100% rename from uncloud_etcd_based/uncloud/cli/image.py rename to archive/uncloud_etcd_based/uncloud/cli/image.py diff --git a/uncloud_etcd_based/uncloud/cli/main.py b/archive/uncloud_etcd_based/uncloud/cli/main.py similarity index 100% rename from uncloud_etcd_based/uncloud/cli/main.py rename to archive/uncloud_etcd_based/uncloud/cli/main.py diff --git a/uncloud_etcd_based/uncloud/cli/network.py b/archive/uncloud_etcd_based/uncloud/cli/network.py similarity index 100% rename from uncloud_etcd_based/uncloud/cli/network.py rename to archive/uncloud_etcd_based/uncloud/cli/network.py diff --git a/uncloud_etcd_based/uncloud/cli/user.py b/archive/uncloud_etcd_based/uncloud/cli/user.py similarity index 100% rename from uncloud_etcd_based/uncloud/cli/user.py rename to archive/uncloud_etcd_based/uncloud/cli/user.py diff --git a/uncloud_etcd_based/uncloud/cli/vm.py b/archive/uncloud_etcd_based/uncloud/cli/vm.py similarity index 100% rename from uncloud_etcd_based/uncloud/cli/vm.py rename to archive/uncloud_etcd_based/uncloud/cli/vm.py diff --git a/uncloud_django_based/uncloud/uncloud_net/__init__.py b/archive/uncloud_etcd_based/uncloud/client/__init__.py similarity index 100% rename from uncloud_django_based/uncloud/uncloud_net/__init__.py rename to archive/uncloud_etcd_based/uncloud/client/__init__.py diff --git a/uncloud_etcd_based/uncloud/client/main.py b/archive/uncloud_etcd_based/uncloud/client/main.py similarity index 100% rename from uncloud_etcd_based/uncloud/client/main.py rename to archive/uncloud_etcd_based/uncloud/client/main.py diff --git a/uncloud_etcd_based/uncloud/common/__init__.py b/archive/uncloud_etcd_based/uncloud/common/__init__.py similarity index 100% rename from uncloud_etcd_based/uncloud/common/__init__.py rename to archive/uncloud_etcd_based/uncloud/common/__init__.py diff --git a/uncloud_etcd_based/uncloud/common/classes.py b/archive/uncloud_etcd_based/uncloud/common/classes.py similarity index 100% rename from uncloud_etcd_based/uncloud/common/classes.py rename to archive/uncloud_etcd_based/uncloud/common/classes.py diff --git a/uncloud_etcd_based/uncloud/common/cli.py b/archive/uncloud_etcd_based/uncloud/common/cli.py similarity index 100% rename from uncloud_etcd_based/uncloud/common/cli.py rename to archive/uncloud_etcd_based/uncloud/common/cli.py diff --git a/uncloud_etcd_based/uncloud/common/counters.py b/archive/uncloud_etcd_based/uncloud/common/counters.py similarity index 100% rename from uncloud_etcd_based/uncloud/common/counters.py rename to archive/uncloud_etcd_based/uncloud/common/counters.py diff --git a/uncloud_etcd_based/uncloud/common/etcd_wrapper.py b/archive/uncloud_etcd_based/uncloud/common/etcd_wrapper.py similarity index 100% rename from uncloud_etcd_based/uncloud/common/etcd_wrapper.py rename to archive/uncloud_etcd_based/uncloud/common/etcd_wrapper.py diff --git a/uncloud_etcd_based/uncloud/common/host.py b/archive/uncloud_etcd_based/uncloud/common/host.py similarity index 100% rename from uncloud_etcd_based/uncloud/common/host.py rename to archive/uncloud_etcd_based/uncloud/common/host.py diff --git a/uncloud_etcd_based/uncloud/common/network.py b/archive/uncloud_etcd_based/uncloud/common/network.py similarity index 100% rename from uncloud_etcd_based/uncloud/common/network.py rename to archive/uncloud_etcd_based/uncloud/common/network.py diff --git a/uncloud_etcd_based/uncloud/common/parser.py b/archive/uncloud_etcd_based/uncloud/common/parser.py similarity index 100% rename from uncloud_etcd_based/uncloud/common/parser.py rename to archive/uncloud_etcd_based/uncloud/common/parser.py diff --git a/uncloud_etcd_based/uncloud/common/request.py b/archive/uncloud_etcd_based/uncloud/common/request.py similarity index 100% rename from uncloud_etcd_based/uncloud/common/request.py rename to archive/uncloud_etcd_based/uncloud/common/request.py diff --git a/uncloud_etcd_based/uncloud/common/schemas.py b/archive/uncloud_etcd_based/uncloud/common/schemas.py similarity index 100% rename from uncloud_etcd_based/uncloud/common/schemas.py rename to archive/uncloud_etcd_based/uncloud/common/schemas.py diff --git a/uncloud_etcd_based/uncloud/common/settings.py b/archive/uncloud_etcd_based/uncloud/common/settings.py similarity index 100% rename from uncloud_etcd_based/uncloud/common/settings.py rename to archive/uncloud_etcd_based/uncloud/common/settings.py diff --git a/uncloud_etcd_based/uncloud/common/shared.py b/archive/uncloud_etcd_based/uncloud/common/shared.py similarity index 100% rename from uncloud_etcd_based/uncloud/common/shared.py rename to archive/uncloud_etcd_based/uncloud/common/shared.py diff --git a/uncloud_etcd_based/uncloud/common/storage_handlers.py b/archive/uncloud_etcd_based/uncloud/common/storage_handlers.py similarity index 100% rename from uncloud_etcd_based/uncloud/common/storage_handlers.py rename to archive/uncloud_etcd_based/uncloud/common/storage_handlers.py diff --git a/uncloud_etcd_based/uncloud/common/vm.py b/archive/uncloud_etcd_based/uncloud/common/vm.py similarity index 100% rename from uncloud_etcd_based/uncloud/common/vm.py rename to archive/uncloud_etcd_based/uncloud/common/vm.py diff --git a/uncloud_django_based/uncloud/uncloud_net/migrations/__init__.py b/archive/uncloud_etcd_based/uncloud/configure/__init__.py similarity index 100% rename from uncloud_django_based/uncloud/uncloud_net/migrations/__init__.py rename to archive/uncloud_etcd_based/uncloud/configure/__init__.py diff --git a/uncloud_etcd_based/uncloud/configure/main.py b/archive/uncloud_etcd_based/uncloud/configure/main.py similarity index 100% rename from uncloud_etcd_based/uncloud/configure/main.py rename to archive/uncloud_etcd_based/uncloud/configure/main.py diff --git a/uncloud_etcd_based/uncloud/filescanner/__init__.py b/archive/uncloud_etcd_based/uncloud/filescanner/__init__.py similarity index 100% rename from uncloud_etcd_based/uncloud/filescanner/__init__.py rename to archive/uncloud_etcd_based/uncloud/filescanner/__init__.py diff --git a/uncloud_etcd_based/uncloud/filescanner/main.py b/archive/uncloud_etcd_based/uncloud/filescanner/main.py similarity index 100% rename from uncloud_etcd_based/uncloud/filescanner/main.py rename to archive/uncloud_etcd_based/uncloud/filescanner/main.py diff --git a/uncloud_etcd_based/uncloud/hack/README.org b/archive/uncloud_etcd_based/uncloud/hack/README.org similarity index 100% rename from uncloud_etcd_based/uncloud/hack/README.org rename to archive/uncloud_etcd_based/uncloud/hack/README.org diff --git a/uncloud_etcd_based/uncloud/hack/__init__.py b/archive/uncloud_etcd_based/uncloud/hack/__init__.py similarity index 100% rename from uncloud_etcd_based/uncloud/hack/__init__.py rename to archive/uncloud_etcd_based/uncloud/hack/__init__.py diff --git a/uncloud_etcd_based/uncloud/hack/conf.d/ucloud-host b/archive/uncloud_etcd_based/uncloud/hack/conf.d/ucloud-host similarity index 100% rename from uncloud_etcd_based/uncloud/hack/conf.d/ucloud-host rename to archive/uncloud_etcd_based/uncloud/hack/conf.d/ucloud-host diff --git a/uncloud_etcd_based/uncloud/hack/config.py b/archive/uncloud_etcd_based/uncloud/hack/config.py similarity index 100% rename from uncloud_etcd_based/uncloud/hack/config.py rename to archive/uncloud_etcd_based/uncloud/hack/config.py diff --git a/uncloud_etcd_based/uncloud/hack/db.py b/archive/uncloud_etcd_based/uncloud/hack/db.py similarity index 100% rename from uncloud_etcd_based/uncloud/hack/db.py rename to archive/uncloud_etcd_based/uncloud/hack/db.py diff --git a/uncloud_etcd_based/uncloud/hack/hackcloud/.gitignore b/archive/uncloud_etcd_based/uncloud/hack/hackcloud/.gitignore similarity index 100% rename from uncloud_etcd_based/uncloud/hack/hackcloud/.gitignore rename to archive/uncloud_etcd_based/uncloud/hack/hackcloud/.gitignore diff --git a/uncloud_etcd_based/uncloud/hack/hackcloud/__init__.py b/archive/uncloud_etcd_based/uncloud/hack/hackcloud/__init__.py similarity index 100% rename from uncloud_etcd_based/uncloud/hack/hackcloud/__init__.py rename to archive/uncloud_etcd_based/uncloud/hack/hackcloud/__init__.py diff --git a/uncloud_etcd_based/uncloud/hack/hackcloud/etcd-client.sh b/archive/uncloud_etcd_based/uncloud/hack/hackcloud/etcd-client.sh similarity index 100% rename from uncloud_etcd_based/uncloud/hack/hackcloud/etcd-client.sh rename to archive/uncloud_etcd_based/uncloud/hack/hackcloud/etcd-client.sh diff --git a/uncloud_etcd_based/uncloud/hack/hackcloud/ifdown.sh b/archive/uncloud_etcd_based/uncloud/hack/hackcloud/ifdown.sh similarity index 100% rename from uncloud_etcd_based/uncloud/hack/hackcloud/ifdown.sh rename to archive/uncloud_etcd_based/uncloud/hack/hackcloud/ifdown.sh diff --git a/uncloud_etcd_based/uncloud/hack/hackcloud/ifup.sh b/archive/uncloud_etcd_based/uncloud/hack/hackcloud/ifup.sh similarity index 100% rename from uncloud_etcd_based/uncloud/hack/hackcloud/ifup.sh rename to archive/uncloud_etcd_based/uncloud/hack/hackcloud/ifup.sh diff --git a/uncloud_etcd_based/uncloud/hack/hackcloud/mac-last b/archive/uncloud_etcd_based/uncloud/hack/hackcloud/mac-last similarity index 100% rename from uncloud_etcd_based/uncloud/hack/hackcloud/mac-last rename to archive/uncloud_etcd_based/uncloud/hack/hackcloud/mac-last diff --git a/uncloud_etcd_based/uncloud/hack/hackcloud/mac-prefix b/archive/uncloud_etcd_based/uncloud/hack/hackcloud/mac-prefix similarity index 100% rename from uncloud_etcd_based/uncloud/hack/hackcloud/mac-prefix rename to archive/uncloud_etcd_based/uncloud/hack/hackcloud/mac-prefix diff --git a/uncloud_etcd_based/uncloud/hack/hackcloud/net.sh b/archive/uncloud_etcd_based/uncloud/hack/hackcloud/net.sh similarity index 100% rename from uncloud_etcd_based/uncloud/hack/hackcloud/net.sh rename to archive/uncloud_etcd_based/uncloud/hack/hackcloud/net.sh diff --git a/uncloud_etcd_based/uncloud/hack/hackcloud/nftrules b/archive/uncloud_etcd_based/uncloud/hack/hackcloud/nftrules similarity index 100% rename from uncloud_etcd_based/uncloud/hack/hackcloud/nftrules rename to archive/uncloud_etcd_based/uncloud/hack/hackcloud/nftrules diff --git a/uncloud_etcd_based/uncloud/hack/hackcloud/radvd.conf b/archive/uncloud_etcd_based/uncloud/hack/hackcloud/radvd.conf similarity index 100% rename from uncloud_etcd_based/uncloud/hack/hackcloud/radvd.conf rename to archive/uncloud_etcd_based/uncloud/hack/hackcloud/radvd.conf diff --git a/uncloud_etcd_based/uncloud/hack/hackcloud/radvd.sh b/archive/uncloud_etcd_based/uncloud/hack/hackcloud/radvd.sh similarity index 100% rename from uncloud_etcd_based/uncloud/hack/hackcloud/radvd.sh rename to archive/uncloud_etcd_based/uncloud/hack/hackcloud/radvd.sh diff --git a/uncloud_etcd_based/uncloud/hack/hackcloud/vm.sh b/archive/uncloud_etcd_based/uncloud/hack/hackcloud/vm.sh similarity index 100% rename from uncloud_etcd_based/uncloud/hack/hackcloud/vm.sh rename to archive/uncloud_etcd_based/uncloud/hack/hackcloud/vm.sh diff --git a/uncloud_etcd_based/uncloud/hack/host.py b/archive/uncloud_etcd_based/uncloud/hack/host.py similarity index 100% rename from uncloud_etcd_based/uncloud/hack/host.py rename to archive/uncloud_etcd_based/uncloud/hack/host.py diff --git a/uncloud_etcd_based/uncloud/hack/mac.py b/archive/uncloud_etcd_based/uncloud/hack/mac.py similarity index 100% rename from uncloud_etcd_based/uncloud/hack/mac.py rename to archive/uncloud_etcd_based/uncloud/hack/mac.py diff --git a/uncloud_etcd_based/uncloud/hack/main.py b/archive/uncloud_etcd_based/uncloud/hack/main.py similarity index 100% rename from uncloud_etcd_based/uncloud/hack/main.py rename to archive/uncloud_etcd_based/uncloud/hack/main.py diff --git a/uncloud_etcd_based/uncloud/hack/net.py b/archive/uncloud_etcd_based/uncloud/hack/net.py similarity index 100% rename from uncloud_etcd_based/uncloud/hack/net.py rename to archive/uncloud_etcd_based/uncloud/hack/net.py diff --git a/uncloud_etcd_based/uncloud/hack/nftables.conf b/archive/uncloud_etcd_based/uncloud/hack/nftables.conf similarity index 100% rename from uncloud_etcd_based/uncloud/hack/nftables.conf rename to archive/uncloud_etcd_based/uncloud/hack/nftables.conf diff --git a/uncloud_etcd_based/uncloud/hack/product.py b/archive/uncloud_etcd_based/uncloud/hack/product.py similarity index 100% rename from uncloud_etcd_based/uncloud/hack/product.py rename to archive/uncloud_etcd_based/uncloud/hack/product.py diff --git a/uncloud_etcd_based/uncloud/hack/rc-scripts/ucloud-api b/archive/uncloud_etcd_based/uncloud/hack/rc-scripts/ucloud-api similarity index 100% rename from uncloud_etcd_based/uncloud/hack/rc-scripts/ucloud-api rename to archive/uncloud_etcd_based/uncloud/hack/rc-scripts/ucloud-api diff --git a/uncloud_etcd_based/uncloud/hack/rc-scripts/ucloud-host b/archive/uncloud_etcd_based/uncloud/hack/rc-scripts/ucloud-host similarity index 100% rename from uncloud_etcd_based/uncloud/hack/rc-scripts/ucloud-host rename to archive/uncloud_etcd_based/uncloud/hack/rc-scripts/ucloud-host diff --git a/uncloud_etcd_based/uncloud/hack/rc-scripts/ucloud-metadata b/archive/uncloud_etcd_based/uncloud/hack/rc-scripts/ucloud-metadata similarity index 100% rename from uncloud_etcd_based/uncloud/hack/rc-scripts/ucloud-metadata rename to archive/uncloud_etcd_based/uncloud/hack/rc-scripts/ucloud-metadata diff --git a/uncloud_etcd_based/uncloud/hack/rc-scripts/ucloud-scheduler b/archive/uncloud_etcd_based/uncloud/hack/rc-scripts/ucloud-scheduler similarity index 100% rename from uncloud_etcd_based/uncloud/hack/rc-scripts/ucloud-scheduler rename to archive/uncloud_etcd_based/uncloud/hack/rc-scripts/ucloud-scheduler diff --git a/uncloud_etcd_based/uncloud/hack/uncloud-hack-init-host b/archive/uncloud_etcd_based/uncloud/hack/uncloud-hack-init-host similarity index 100% rename from uncloud_etcd_based/uncloud/hack/uncloud-hack-init-host rename to archive/uncloud_etcd_based/uncloud/hack/uncloud-hack-init-host diff --git a/uncloud_etcd_based/uncloud/hack/uncloud-run-vm b/archive/uncloud_etcd_based/uncloud/hack/uncloud-run-vm similarity index 100% rename from uncloud_etcd_based/uncloud/hack/uncloud-run-vm rename to archive/uncloud_etcd_based/uncloud/hack/uncloud-run-vm diff --git a/uncloud_etcd_based/uncloud/hack/vm.py b/archive/uncloud_etcd_based/uncloud/hack/vm.py similarity index 100% rename from uncloud_etcd_based/uncloud/hack/vm.py rename to archive/uncloud_etcd_based/uncloud/hack/vm.py diff --git a/uncloud_etcd_based/uncloud/host/__init__.py b/archive/uncloud_etcd_based/uncloud/host/__init__.py similarity index 100% rename from uncloud_etcd_based/uncloud/host/__init__.py rename to archive/uncloud_etcd_based/uncloud/host/__init__.py diff --git a/uncloud_etcd_based/uncloud/host/main.py b/archive/uncloud_etcd_based/uncloud/host/main.py similarity index 100% rename from uncloud_etcd_based/uncloud/host/main.py rename to archive/uncloud_etcd_based/uncloud/host/main.py diff --git a/uncloud_etcd_based/uncloud/host/virtualmachine.py b/archive/uncloud_etcd_based/uncloud/host/virtualmachine.py similarity index 100% rename from uncloud_etcd_based/uncloud/host/virtualmachine.py rename to archive/uncloud_etcd_based/uncloud/host/virtualmachine.py diff --git a/uncloud_etcd_based/uncloud/imagescanner/__init__.py b/archive/uncloud_etcd_based/uncloud/imagescanner/__init__.py similarity index 100% rename from uncloud_etcd_based/uncloud/imagescanner/__init__.py rename to archive/uncloud_etcd_based/uncloud/imagescanner/__init__.py diff --git a/uncloud_etcd_based/uncloud/imagescanner/main.py b/archive/uncloud_etcd_based/uncloud/imagescanner/main.py similarity index 100% rename from uncloud_etcd_based/uncloud/imagescanner/main.py rename to archive/uncloud_etcd_based/uncloud/imagescanner/main.py diff --git a/uncloud_etcd_based/uncloud/metadata/__init__.py b/archive/uncloud_etcd_based/uncloud/metadata/__init__.py similarity index 100% rename from uncloud_etcd_based/uncloud/metadata/__init__.py rename to archive/uncloud_etcd_based/uncloud/metadata/__init__.py diff --git a/uncloud_etcd_based/uncloud/metadata/main.py b/archive/uncloud_etcd_based/uncloud/metadata/main.py similarity index 100% rename from uncloud_etcd_based/uncloud/metadata/main.py rename to archive/uncloud_etcd_based/uncloud/metadata/main.py diff --git a/uncloud_etcd_based/uncloud/network/README b/archive/uncloud_etcd_based/uncloud/network/README similarity index 100% rename from uncloud_etcd_based/uncloud/network/README rename to archive/uncloud_etcd_based/uncloud/network/README diff --git a/uncloud_django_based/uncloud/uncloud_pay/__init__.py b/archive/uncloud_etcd_based/uncloud/network/__init__.py similarity index 100% rename from uncloud_django_based/uncloud/uncloud_pay/__init__.py rename to archive/uncloud_etcd_based/uncloud/network/__init__.py diff --git a/uncloud_etcd_based/uncloud/network/create-bridge.sh b/archive/uncloud_etcd_based/uncloud/network/create-bridge.sh similarity index 100% rename from uncloud_etcd_based/uncloud/network/create-bridge.sh rename to archive/uncloud_etcd_based/uncloud/network/create-bridge.sh diff --git a/uncloud_etcd_based/uncloud/network/create-tap.sh b/archive/uncloud_etcd_based/uncloud/network/create-tap.sh similarity index 100% rename from uncloud_etcd_based/uncloud/network/create-tap.sh rename to archive/uncloud_etcd_based/uncloud/network/create-tap.sh diff --git a/uncloud_etcd_based/uncloud/network/create-vxlan.sh b/archive/uncloud_etcd_based/uncloud/network/create-vxlan.sh similarity index 100% rename from uncloud_etcd_based/uncloud/network/create-vxlan.sh rename to archive/uncloud_etcd_based/uncloud/network/create-vxlan.sh diff --git a/uncloud_etcd_based/uncloud/network/radvd-template.conf b/archive/uncloud_etcd_based/uncloud/network/radvd-template.conf similarity index 100% rename from uncloud_etcd_based/uncloud/network/radvd-template.conf rename to archive/uncloud_etcd_based/uncloud/network/radvd-template.conf diff --git a/uncloud_etcd_based/uncloud/oneshot/__init__.py b/archive/uncloud_etcd_based/uncloud/oneshot/__init__.py similarity index 100% rename from uncloud_etcd_based/uncloud/oneshot/__init__.py rename to archive/uncloud_etcd_based/uncloud/oneshot/__init__.py diff --git a/uncloud_etcd_based/uncloud/oneshot/main.py b/archive/uncloud_etcd_based/uncloud/oneshot/main.py similarity index 100% rename from uncloud_etcd_based/uncloud/oneshot/main.py rename to archive/uncloud_etcd_based/uncloud/oneshot/main.py diff --git a/uncloud_etcd_based/uncloud/oneshot/virtualmachine.py b/archive/uncloud_etcd_based/uncloud/oneshot/virtualmachine.py similarity index 100% rename from uncloud_etcd_based/uncloud/oneshot/virtualmachine.py rename to archive/uncloud_etcd_based/uncloud/oneshot/virtualmachine.py diff --git a/uncloud_etcd_based/uncloud/scheduler/__init__.py b/archive/uncloud_etcd_based/uncloud/scheduler/__init__.py similarity index 100% rename from uncloud_etcd_based/uncloud/scheduler/__init__.py rename to archive/uncloud_etcd_based/uncloud/scheduler/__init__.py diff --git a/uncloud_etcd_based/uncloud/scheduler/helper.py b/archive/uncloud_etcd_based/uncloud/scheduler/helper.py similarity index 100% rename from uncloud_etcd_based/uncloud/scheduler/helper.py rename to archive/uncloud_etcd_based/uncloud/scheduler/helper.py diff --git a/uncloud_etcd_based/uncloud/scheduler/main.py b/archive/uncloud_etcd_based/uncloud/scheduler/main.py similarity index 100% rename from uncloud_etcd_based/uncloud/scheduler/main.py rename to archive/uncloud_etcd_based/uncloud/scheduler/main.py diff --git a/uncloud_django_based/uncloud/uncloud_pay/migrations/__init__.py b/archive/uncloud_etcd_based/uncloud/scheduler/tests/__init__.py similarity index 100% rename from uncloud_django_based/uncloud/uncloud_pay/migrations/__init__.py rename to archive/uncloud_etcd_based/uncloud/scheduler/tests/__init__.py diff --git a/uncloud_etcd_based/uncloud/scheduler/tests/test_basics.py b/archive/uncloud_etcd_based/uncloud/scheduler/tests/test_basics.py similarity index 100% rename from uncloud_etcd_based/uncloud/scheduler/tests/test_basics.py rename to archive/uncloud_etcd_based/uncloud/scheduler/tests/test_basics.py diff --git a/uncloud_etcd_based/uncloud/scheduler/tests/test_dead_host_mechanism.py b/archive/uncloud_etcd_based/uncloud/scheduler/tests/test_dead_host_mechanism.py similarity index 100% rename from uncloud_etcd_based/uncloud/scheduler/tests/test_dead_host_mechanism.py rename to archive/uncloud_etcd_based/uncloud/scheduler/tests/test_dead_host_mechanism.py diff --git a/uncloud_etcd_based/uncloud/version.py b/archive/uncloud_etcd_based/uncloud/version.py similarity index 100% rename from uncloud_etcd_based/uncloud/version.py rename to archive/uncloud_etcd_based/uncloud/version.py diff --git a/uncloud_etcd_based/uncloud/vmm/__init__.py b/archive/uncloud_etcd_based/uncloud/vmm/__init__.py similarity index 100% rename from uncloud_etcd_based/uncloud/vmm/__init__.py rename to archive/uncloud_etcd_based/uncloud/vmm/__init__.py diff --git a/uncloud_django_based/uncloud/doc/README-how-to-configure-remote-uncloud-clients.org b/doc/README-how-to-configure-remote-uncloud-clients.org similarity index 80% rename from uncloud_django_based/uncloud/doc/README-how-to-configure-remote-uncloud-clients.org rename to doc/README-how-to-configure-remote-uncloud-clients.org index 7217e1f..b48886b 100644 --- a/uncloud_django_based/uncloud/doc/README-how-to-configure-remote-uncloud-clients.org +++ b/doc/README-how-to-configure-remote-uncloud-clients.org @@ -10,6 +10,7 @@ | SSH -L tunnel | All nodes can use [::1]:5432 | SSH setup can be fragile | | ssh djangohost manage.py | All DB ops locally | Code is only executed on django host | | https + token | Rest alike / consistent access | Code is only executed on django host | +| from_django | Everything is on the django host | main host can become bottleneck | ** remote vs. local Django code execution - If manage.py is executed locally (= on the client), it can check/modify local configs @@ -19,3 +20,9 @@ - Remote execution (= on the primary django host) can acess the db via unix socket - However remote execution cannot check local state +** from_django + - might reuse existing methods like celery + - reduces the amount of things to be installed on the client to + almost zero + - follows the opennebula model + - has a single point of failurebin diff --git a/doc/README-identifiers.org b/doc/README-identifiers.org new file mode 100644 index 0000000..3dbb4b5 --- /dev/null +++ b/doc/README-identifiers.org @@ -0,0 +1,29 @@ +* Identifiers +** Problem description + Identifiers can be integers, strings or other objects. They should + be unique. +** Approach 1: integers + Integers are somewhat easy to remember, but also include + predictable growth, which might allow access to guessed hacking + (obivously proper permissions should prevent this). +** Approach 2: random uuids + UUIDs are 128 bit integers. Python supports uuid.uuid4() for random + uuids. +** Approach 3: IPv6 addresses + uncloud heavily depends on IPv6 in the first place. uncloud could + use a /48 to identify all objects. Objects that have IPv6 addresses + on their own, don't need to draw from the system /48. +*** Possible Subnetworks + Assuming uncloud uses a /48 to represent all resources. + + | Network | Name | Description | + |-----------------+-----------------+----------------------------------------------| + | 2001:db8::/48 | uncloud network | All identifiers drawn from here | + | 2001:db8:1::/64 | VM network | Every VM has an IPv6 address in this network | + | 2001:db8:2::/64 | Bill network | Every bill has an IPv6 address | + | 2001:db8:3::/64 | Order network | Every order has an IPv6 address | + | 2001:db8:5::/64 | Product network | Every product (?) has an IPv6 address | + | 2001:db8:4::/64 | Disk network | Every disk is identified | + +*** Tests + [15:47:37] black3.place6:~# rbd create -s 10G ssd/2a0a:e5c0:1::8 diff --git a/uncloud_django_based/uncloud/doc/README-object-relations.md b/doc/README-object-relations.md similarity index 100% rename from uncloud_django_based/uncloud/doc/README-object-relations.md rename to doc/README-object-relations.md diff --git a/uncloud_django_based/uncloud/doc/README-postgresql.org b/doc/README-postgresql.org similarity index 100% rename from uncloud_django_based/uncloud/doc/README-postgresql.org rename to doc/README-postgresql.org diff --git a/uncloud_django_based/uncloud/doc/README-products.md b/doc/README-products.md similarity index 100% rename from uncloud_django_based/uncloud/doc/README-products.md rename to doc/README-products.md diff --git a/uncloud_django_based/uncloud/doc/README-vpn.org b/doc/README-vpn.org similarity index 100% rename from uncloud_django_based/uncloud/doc/README-vpn.org rename to doc/README-vpn.org diff --git a/uncloud_django_based/uncloud/doc/README.md b/doc/README.md similarity index 100% rename from uncloud_django_based/uncloud/doc/README.md rename to doc/README.md diff --git a/uncloud_django_based/uncloud/manage.py b/manage.py similarity index 100% rename from uncloud_django_based/uncloud/manage.py rename to manage.py diff --git a/uncloud_django_based/uncloud/models.dot b/models.dot similarity index 100% rename from uncloud_django_based/uncloud/models.dot rename to models.dot diff --git a/uncloud_django_based/uncloud/models.png b/models.png similarity index 100% rename from uncloud_django_based/uncloud/models.png rename to models.png diff --git a/uncloud_django_based/uncloud/uncloud_service/__init__.py b/opennebula/__init__.py similarity index 100% rename from uncloud_django_based/uncloud/uncloud_service/__init__.py rename to opennebula/__init__.py diff --git a/uncloud_django_based/uncloud/opennebula/admin.py b/opennebula/admin.py similarity index 100% rename from uncloud_django_based/uncloud/opennebula/admin.py rename to opennebula/admin.py diff --git a/uncloud_django_based/uncloud/opennebula/apps.py b/opennebula/apps.py similarity index 100% rename from uncloud_django_based/uncloud/opennebula/apps.py rename to opennebula/apps.py diff --git a/uncloud_django_based/uncloud/opennebula/management/commands/opennebula-synchosts.py b/opennebula/management/commands/opennebula-synchosts.py similarity index 100% rename from uncloud_django_based/uncloud/opennebula/management/commands/opennebula-synchosts.py rename to opennebula/management/commands/opennebula-synchosts.py diff --git a/uncloud_django_based/uncloud/opennebula/management/commands/opennebula-syncvms.py b/opennebula/management/commands/opennebula-syncvms.py similarity index 100% rename from uncloud_django_based/uncloud/opennebula/management/commands/opennebula-syncvms.py rename to opennebula/management/commands/opennebula-syncvms.py diff --git a/uncloud_django_based/uncloud/opennebula/management/commands/opennebula-to-uncloud.py b/opennebula/management/commands/opennebula-to-uncloud.py similarity index 100% rename from uncloud_django_based/uncloud/opennebula/management/commands/opennebula-to-uncloud.py rename to opennebula/management/commands/opennebula-to-uncloud.py diff --git a/uncloud_django_based/uncloud/opennebula/migrations/0001_initial.py b/opennebula/migrations/0001_initial.py similarity index 100% rename from uncloud_django_based/uncloud/opennebula/migrations/0001_initial.py rename to opennebula/migrations/0001_initial.py diff --git a/uncloud_django_based/uncloud/opennebula/migrations/0002_auto_20200225_1335.py b/opennebula/migrations/0002_auto_20200225_1335.py similarity index 100% rename from uncloud_django_based/uncloud/opennebula/migrations/0002_auto_20200225_1335.py rename to opennebula/migrations/0002_auto_20200225_1335.py diff --git a/uncloud_django_based/uncloud/opennebula/migrations/0003_auto_20200225_1428.py b/opennebula/migrations/0003_auto_20200225_1428.py similarity index 100% rename from uncloud_django_based/uncloud/opennebula/migrations/0003_auto_20200225_1428.py rename to opennebula/migrations/0003_auto_20200225_1428.py diff --git a/uncloud_django_based/uncloud/opennebula/migrations/0004_auto_20200225_1816.py b/opennebula/migrations/0004_auto_20200225_1816.py similarity index 100% rename from uncloud_django_based/uncloud/opennebula/migrations/0004_auto_20200225_1816.py rename to opennebula/migrations/0004_auto_20200225_1816.py diff --git a/uncloud_django_based/uncloud/uncloud_service/migrations/__init__.py b/opennebula/migrations/__init__.py similarity index 100% rename from uncloud_django_based/uncloud/uncloud_service/migrations/__init__.py rename to opennebula/migrations/__init__.py diff --git a/uncloud_django_based/uncloud/opennebula/models.py b/opennebula/models.py similarity index 100% rename from uncloud_django_based/uncloud/opennebula/models.py rename to opennebula/models.py diff --git a/uncloud_django_based/uncloud/opennebula/serializers.py b/opennebula/serializers.py similarity index 100% rename from uncloud_django_based/uncloud/opennebula/serializers.py rename to opennebula/serializers.py diff --git a/uncloud_django_based/uncloud/opennebula/tests.py b/opennebula/tests.py similarity index 100% rename from uncloud_django_based/uncloud/opennebula/tests.py rename to opennebula/tests.py diff --git a/uncloud_django_based/uncloud/opennebula/views.py b/opennebula/views.py similarity index 100% rename from uncloud_django_based/uncloud/opennebula/views.py rename to opennebula/views.py diff --git a/uncloud_django_based/uncloud/requirements.txt b/requirements.txt similarity index 100% rename from uncloud_django_based/uncloud/requirements.txt rename to requirements.txt diff --git a/uncloud_django_based/uncloud/uncloud/.gitignore b/uncloud/.gitignore similarity index 100% rename from uncloud_django_based/uncloud/uncloud/.gitignore rename to uncloud/.gitignore diff --git a/uncloud_django_based/uncloud/uncloud/__init__.py b/uncloud/__init__.py similarity index 100% rename from uncloud_django_based/uncloud/uncloud/__init__.py rename to uncloud/__init__.py diff --git a/uncloud_django_based/uncloud/uncloud/asgi.py b/uncloud/asgi.py similarity index 100% rename from uncloud_django_based/uncloud/uncloud/asgi.py rename to uncloud/asgi.py diff --git a/uncloud_django_based/uncloud/uncloud/management/commands/uncloud.py b/uncloud/management/commands/uncloud.py similarity index 100% rename from uncloud_django_based/uncloud/uncloud/management/commands/uncloud.py rename to uncloud/management/commands/uncloud.py diff --git a/uncloud_django_based/uncloud/uncloud/models.py b/uncloud/models.py similarity index 100% rename from uncloud_django_based/uncloud/uncloud/models.py rename to uncloud/models.py diff --git a/uncloud_django_based/uncloud/uncloud/settings.py b/uncloud/settings.py similarity index 100% rename from uncloud_django_based/uncloud/uncloud/settings.py rename to uncloud/settings.py diff --git a/uncloud_django_based/uncloud/uncloud/urls.py b/uncloud/urls.py similarity index 98% rename from uncloud_django_based/uncloud/uncloud/urls.py rename to uncloud/urls.py index 05b1f0f..b20f136 100644 --- a/uncloud_django_based/uncloud/uncloud/urls.py +++ b/uncloud/urls.py @@ -81,7 +81,6 @@ urlpatterns = [ path('', include(router.urls)), # web/ = stuff to view in the browser - path('web/pdf/', payviews.MyPDFView.as_view(), name='pdf'), path('api-auth/', include('rest_framework.urls', namespace='rest_framework')), # for login to REST API path('openapi', get_schema_view( title="uncloud", diff --git a/uncloud_django_based/uncloud/uncloud/wsgi.py b/uncloud/wsgi.py similarity index 100% rename from uncloud_django_based/uncloud/uncloud/wsgi.py rename to uncloud/wsgi.py diff --git a/uncloud_django_based/uncloud/uncloud_storage/__init__.py b/uncloud_auth/__init__.py similarity index 100% rename from uncloud_django_based/uncloud/uncloud_storage/__init__.py rename to uncloud_auth/__init__.py diff --git a/uncloud_django_based/uncloud/uncloud_auth/admin.py b/uncloud_auth/admin.py similarity index 100% rename from uncloud_django_based/uncloud/uncloud_auth/admin.py rename to uncloud_auth/admin.py diff --git a/uncloud_django_based/uncloud/uncloud_auth/apps.py b/uncloud_auth/apps.py similarity index 100% rename from uncloud_django_based/uncloud/uncloud_auth/apps.py rename to uncloud_auth/apps.py diff --git a/uncloud_auth/management/commands/make-admin.py b/uncloud_auth/management/commands/make-admin.py new file mode 100644 index 0000000..b750bc3 --- /dev/null +++ b/uncloud_auth/management/commands/make-admin.py @@ -0,0 +1,16 @@ +from django.core.management.base import BaseCommand +from django.contrib.auth import get_user_model +import sys + +class Command(BaseCommand): + help = 'Give Admin rights to existing user' + + def add_arguments(self, parser): + parser.add_argument('username', type=str) + + def handle(self, *args, **options): + user = get_user_model().objects.get(username=options['username']) + user.is_staff = True + user.save() + + print("{} is now admin.".format(user.username)) diff --git a/uncloud_django_based/uncloud/uncloud_auth/migrations/0001_initial.py b/uncloud_auth/migrations/0001_initial.py similarity index 100% rename from uncloud_django_based/uncloud/uncloud_auth/migrations/0001_initial.py rename to uncloud_auth/migrations/0001_initial.py diff --git a/uncloud_django_based/uncloud/uncloud_auth/migrations/0002_auto_20200318_1343.py b/uncloud_auth/migrations/0002_auto_20200318_1343.py similarity index 100% rename from uncloud_django_based/uncloud/uncloud_auth/migrations/0002_auto_20200318_1343.py rename to uncloud_auth/migrations/0002_auto_20200318_1343.py diff --git a/uncloud_django_based/uncloud/uncloud_auth/migrations/0003_auto_20200318_1345.py b/uncloud_auth/migrations/0003_auto_20200318_1345.py similarity index 100% rename from uncloud_django_based/uncloud/uncloud_auth/migrations/0003_auto_20200318_1345.py rename to uncloud_auth/migrations/0003_auto_20200318_1345.py diff --git a/uncloud_django_based/uncloud/uncloud_vm/__init__.py b/uncloud_auth/migrations/__init__.py similarity index 100% rename from uncloud_django_based/uncloud/uncloud_vm/__init__.py rename to uncloud_auth/migrations/__init__.py diff --git a/uncloud_django_based/uncloud/uncloud_auth/models.py b/uncloud_auth/models.py similarity index 100% rename from uncloud_django_based/uncloud/uncloud_auth/models.py rename to uncloud_auth/models.py diff --git a/uncloud_django_based/uncloud/uncloud_auth/serializers.py b/uncloud_auth/serializers.py similarity index 100% rename from uncloud_django_based/uncloud/uncloud_auth/serializers.py rename to uncloud_auth/serializers.py diff --git a/uncloud_django_based/uncloud/uncloud_auth/views.py b/uncloud_auth/views.py similarity index 100% rename from uncloud_django_based/uncloud/uncloud_auth/views.py rename to uncloud_auth/views.py diff --git a/uncloud_django_based/uncloud/uncloud_vm/migrations/__init__.py b/uncloud_net/__init__.py similarity index 100% rename from uncloud_django_based/uncloud/uncloud_vm/migrations/__init__.py rename to uncloud_net/__init__.py diff --git a/uncloud_django_based/uncloud/uncloud_net/admin.py b/uncloud_net/admin.py similarity index 100% rename from uncloud_django_based/uncloud/uncloud_net/admin.py rename to uncloud_net/admin.py diff --git a/uncloud_django_based/uncloud/uncloud_net/apps.py b/uncloud_net/apps.py similarity index 100% rename from uncloud_django_based/uncloud/uncloud_net/apps.py rename to uncloud_net/apps.py diff --git a/uncloud_django_based/uncloud/uncloud_net/management/commands/vpn.py b/uncloud_net/management/commands/vpn.py similarity index 100% rename from uncloud_django_based/uncloud/uncloud_net/management/commands/vpn.py rename to uncloud_net/management/commands/vpn.py diff --git a/uncloud_django_based/uncloud/uncloud_net/migrations/0001_initial.py b/uncloud_net/migrations/0001_initial.py similarity index 100% rename from uncloud_django_based/uncloud/uncloud_net/migrations/0001_initial.py rename to uncloud_net/migrations/0001_initial.py diff --git a/uncloud_django_based/uncloud/uncloud_net/migrations/0002_auto_20200409_1225.py b/uncloud_net/migrations/0002_auto_20200409_1225.py similarity index 100% rename from uncloud_django_based/uncloud/uncloud_net/migrations/0002_auto_20200409_1225.py rename to uncloud_net/migrations/0002_auto_20200409_1225.py diff --git a/uncloud_django_based/uncloud/uncloud_net/migrations/0003_auto_20200417_0551.py b/uncloud_net/migrations/0003_auto_20200417_0551.py similarity index 100% rename from uncloud_django_based/uncloud/uncloud_net/migrations/0003_auto_20200417_0551.py rename to uncloud_net/migrations/0003_auto_20200417_0551.py diff --git a/uncloud_etcd_based/docs/__init__.py b/uncloud_net/migrations/__init__.py similarity index 100% rename from uncloud_etcd_based/docs/__init__.py rename to uncloud_net/migrations/__init__.py diff --git a/uncloud_django_based/uncloud/uncloud_net/models.py b/uncloud_net/models.py similarity index 100% rename from uncloud_django_based/uncloud/uncloud_net/models.py rename to uncloud_net/models.py diff --git a/uncloud_django_based/uncloud/uncloud_net/serializers.py b/uncloud_net/serializers.py similarity index 100% rename from uncloud_django_based/uncloud/uncloud_net/serializers.py rename to uncloud_net/serializers.py diff --git a/uncloud_django_based/uncloud/uncloud_net/tests.py b/uncloud_net/tests.py similarity index 100% rename from uncloud_django_based/uncloud/uncloud_net/tests.py rename to uncloud_net/tests.py diff --git a/uncloud_django_based/uncloud/uncloud_net/views.py b/uncloud_net/views.py similarity index 100% rename from uncloud_django_based/uncloud/uncloud_net/views.py rename to uncloud_net/views.py diff --git a/uncloud_etcd_based/docs/source/__init__.py b/uncloud_pay/__init__.py similarity index 100% rename from uncloud_etcd_based/docs/source/__init__.py rename to uncloud_pay/__init__.py diff --git a/uncloud_django_based/uncloud/uncloud_pay/admin.py b/uncloud_pay/admin.py similarity index 100% rename from uncloud_django_based/uncloud/uncloud_pay/admin.py rename to uncloud_pay/admin.py diff --git a/uncloud_django_based/uncloud/uncloud_pay/apps.py b/uncloud_pay/apps.py similarity index 100% rename from uncloud_django_based/uncloud/uncloud_pay/apps.py rename to uncloud_pay/apps.py diff --git a/uncloud_django_based/uncloud/uncloud_pay/helpers.py b/uncloud_pay/helpers.py similarity index 100% rename from uncloud_django_based/uncloud/uncloud_pay/helpers.py rename to uncloud_pay/helpers.py diff --git a/uncloud_django_based/uncloud/uncloud_pay/management/commands/charge-negative-balance.py b/uncloud_pay/management/commands/charge-negative-balance.py similarity index 100% rename from uncloud_django_based/uncloud/uncloud_pay/management/commands/charge-negative-balance.py rename to uncloud_pay/management/commands/charge-negative-balance.py diff --git a/uncloud_django_based/uncloud/uncloud_pay/management/commands/generate-bills.py b/uncloud_pay/management/commands/generate-bills.py similarity index 100% rename from uncloud_django_based/uncloud/uncloud_pay/management/commands/generate-bills.py rename to uncloud_pay/management/commands/generate-bills.py diff --git a/uncloud_django_based/uncloud/uncloud_pay/management/commands/handle-overdue-bills.py b/uncloud_pay/management/commands/handle-overdue-bills.py similarity index 100% rename from uncloud_django_based/uncloud/uncloud_pay/management/commands/handle-overdue-bills.py rename to uncloud_pay/management/commands/handle-overdue-bills.py diff --git a/uncloud_django_based/uncloud/uncloud_pay/management/commands/import-vat-rates.py b/uncloud_pay/management/commands/import-vat-rates.py similarity index 100% rename from uncloud_django_based/uncloud/uncloud_pay/management/commands/import-vat-rates.py rename to uncloud_pay/management/commands/import-vat-rates.py diff --git a/uncloud_django_based/uncloud/uncloud_pay/migrations/0001_initial.py b/uncloud_pay/migrations/0001_initial.py similarity index 100% rename from uncloud_django_based/uncloud/uncloud_pay/migrations/0001_initial.py rename to uncloud_pay/migrations/0001_initial.py diff --git a/uncloud_django_based/uncloud/uncloud_pay/migrations/0002_auto_20200305_1524.py b/uncloud_pay/migrations/0002_auto_20200305_1524.py similarity index 100% rename from uncloud_django_based/uncloud/uncloud_pay/migrations/0002_auto_20200305_1524.py rename to uncloud_pay/migrations/0002_auto_20200305_1524.py diff --git a/uncloud_django_based/uncloud/uncloud_pay/migrations/0003_auto_20200305_1354.py b/uncloud_pay/migrations/0003_auto_20200305_1354.py similarity index 100% rename from uncloud_django_based/uncloud/uncloud_pay/migrations/0003_auto_20200305_1354.py rename to uncloud_pay/migrations/0003_auto_20200305_1354.py diff --git a/uncloud_django_based/uncloud/uncloud_pay/migrations/0004_auto_20200409_1225.py b/uncloud_pay/migrations/0004_auto_20200409_1225.py similarity index 100% rename from uncloud_django_based/uncloud/uncloud_pay/migrations/0004_auto_20200409_1225.py rename to uncloud_pay/migrations/0004_auto_20200409_1225.py diff --git a/uncloud_django_based/uncloud/uncloud_pay/migrations/0005_auto_20200413_0924.py b/uncloud_pay/migrations/0005_auto_20200413_0924.py similarity index 100% rename from uncloud_django_based/uncloud/uncloud_pay/migrations/0005_auto_20200413_0924.py rename to uncloud_pay/migrations/0005_auto_20200413_0924.py diff --git a/uncloud_django_based/uncloud/uncloud_pay/migrations/0006_auto_20200415_1003.py b/uncloud_pay/migrations/0006_auto_20200415_1003.py similarity index 100% rename from uncloud_django_based/uncloud/uncloud_pay/migrations/0006_auto_20200415_1003.py rename to uncloud_pay/migrations/0006_auto_20200415_1003.py diff --git a/uncloud_django_based/uncloud/uncloud_pay/migrations/0006_billingaddress.py b/uncloud_pay/migrations/0006_billingaddress.py similarity index 100% rename from uncloud_django_based/uncloud/uncloud_pay/migrations/0006_billingaddress.py rename to uncloud_pay/migrations/0006_billingaddress.py diff --git a/uncloud_django_based/uncloud/uncloud_pay/migrations/0007_auto_20200418_0737.py b/uncloud_pay/migrations/0007_auto_20200418_0737.py similarity index 100% rename from uncloud_django_based/uncloud/uncloud_pay/migrations/0007_auto_20200418_0737.py rename to uncloud_pay/migrations/0007_auto_20200418_0737.py diff --git a/uncloud_django_based/uncloud/uncloud_pay/migrations/0008_auto_20200502_1921.py b/uncloud_pay/migrations/0008_auto_20200502_1921.py similarity index 100% rename from uncloud_django_based/uncloud/uncloud_pay/migrations/0008_auto_20200502_1921.py rename to uncloud_pay/migrations/0008_auto_20200502_1921.py diff --git a/uncloud_django_based/uncloud/uncloud_pay/migrations/0009_auto_20200502_2047.py b/uncloud_pay/migrations/0009_auto_20200502_2047.py similarity index 100% rename from uncloud_django_based/uncloud/uncloud_pay/migrations/0009_auto_20200502_2047.py rename to uncloud_pay/migrations/0009_auto_20200502_2047.py diff --git a/uncloud_pay/migrations/0010_order_description.py b/uncloud_pay/migrations/0010_order_description.py new file mode 100644 index 0000000..2613bff --- /dev/null +++ b/uncloud_pay/migrations/0010_order_description.py @@ -0,0 +1,19 @@ +# Generated by Django 3.0.6 on 2020-05-07 10:07 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('uncloud_pay', '0009_auto_20200502_2047'), + ] + + operations = [ + migrations.AddField( + model_name='order', + name='description', + field=models.TextField(default=''), + preserve_default=False, + ), + ] diff --git a/uncloud_pay/migrations/0011_billingaddress_organization.py b/uncloud_pay/migrations/0011_billingaddress_organization.py new file mode 100644 index 0000000..ac36eee --- /dev/null +++ b/uncloud_pay/migrations/0011_billingaddress_organization.py @@ -0,0 +1,19 @@ +# Generated by Django 3.0.6 on 2020-05-07 13:07 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('uncloud_pay', '0010_order_description'), + ] + + operations = [ + migrations.AddField( + model_name='billingaddress', + name='organization', + field=models.CharField(default='', max_length=100), + preserve_default=False, + ), + ] diff --git a/uncloud_etcd_based/test/__init__.py b/uncloud_pay/migrations/__init__.py similarity index 100% rename from uncloud_etcd_based/test/__init__.py rename to uncloud_pay/migrations/__init__.py diff --git a/uncloud_django_based/uncloud/uncloud_pay/models.py b/uncloud_pay/models.py similarity index 98% rename from uncloud_django_based/uncloud/uncloud_pay/models.py rename to uncloud_pay/models.py index 82ba3ee..82005c9 100644 --- a/uncloud_django_based/uncloud/uncloud_pay/models.py +++ b/uncloud_pay/models.py @@ -444,6 +444,7 @@ class BillingAddress(models.Model): uuid = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) owner = models.ForeignKey(get_user_model(), on_delete=models.CASCADE) + organization = models.CharField(max_length=100) name = models.CharField(max_length=100) street = models.CharField(max_length=100) city = models.CharField(max_length=50) @@ -533,9 +534,8 @@ class Bill(models.Model): bill_records = [] orders = Order.objects.filter(bill=self) for order in orders: - for order_record in order.records: - bill_record = BillRecord(self, order_record) - bill_records.append(bill_record) + bill_record = BillRecord(self, order) + bill_records.append(bill_record) return bill_records @@ -722,18 +722,18 @@ class Bill(models.Model): class BillRecord(): """ - Entry of a bill, dynamically generated from order records. + Entry of a bill, dynamically generated from an order. """ - def __init__(self, bill, order_record): + def __init__(self, bill, order): self.bill = bill - self.order = order_record.order - self.recurring_price = order_record.recurring_price - self.recurring_period = order_record.recurring_period - self.description = order_record.description + self.order = order + self.recurring_price = order.recurring_price + self.recurring_period = order.recurring_period + self.description = order.description if self.order.starting_date >= self.bill.starting_date: - self.one_time_price = order_record.one_time_price + self.one_time_price = order.one_time_price else: self.one_time_price = 0 @@ -791,7 +791,7 @@ class BillRecord(): return 0 else: raise Exception('Unsupported recurring period: {}.'. - format(record.recurring_period)) + format(self.order.recurring_period)) @property def vat_rate(self): @@ -820,6 +820,7 @@ class Order(models.Model): on_delete=models.CASCADE, editable=False) billing_address = models.ForeignKey(BillingAddress, on_delete=models.CASCADE) + description = models.TextField() # TODO: enforce ending_date - starting_date to be larger than recurring_period. creation_date = models.DateTimeField(auto_now_add=True) diff --git a/uncloud_django_based/uncloud/uncloud_pay/serializers.py b/uncloud_pay/serializers.py similarity index 68% rename from uncloud_django_based/uncloud/uncloud_pay/serializers.py rename to uncloud_pay/serializers.py index 1b5db24..1d7dcdd 100644 --- a/uncloud_django_based/uncloud/uncloud_pay/serializers.py +++ b/uncloud_pay/serializers.py @@ -1,5 +1,6 @@ from django.contrib.auth import get_user_model from rest_framework import serializers +from uncloud_auth.serializers import UserSerializer from .models import * ### @@ -41,11 +42,36 @@ class OrderRecordSerializer(serializers.ModelSerializer): class OrderSerializer(serializers.ModelSerializer): - records = OrderRecordSerializer(many=True, read_only=True) + owner = serializers.PrimaryKeyRelatedField(queryset=get_user_model().objects.all()) + + def __init__(self, *args, **kwargs): + # Don't pass the 'fields' arg up to the superclass + admin = kwargs.pop('admin', None) + + # Instantiate the superclass normally + super(OrderSerializer, self).__init__(*args, **kwargs) + + # Only allows owner in admin mode. + if not admin: + self.fields.pop('owner') + + def create(self, validated_data): + billing_address = BillingAddress.get_preferred_address_for(validated_data["owner"]) + instance = Order(billing_address=billing_address, **validated_data) + instance.save() + + return instance + + def validate_owner(self, value): + if BillingAddress.get_preferred_address_for(value) == None: + raise serializers.ValidationError("Owner does not have a valid billing address.") + + return value + class Meta: model = Order - fields = ['uuid', 'creation_date', 'starting_date', 'ending_date', - 'bill', 'recurring_period', 'records', 'recurring_price', 'one_time_price'] + fields = ['uuid', 'owner', 'description', 'creation_date', 'starting_date', 'ending_date', + 'bill', 'recurring_period', 'recurring_price', 'one_time_price'] ### @@ -69,7 +95,7 @@ class BillRecordSerializer(serializers.Serializer): class BillingAddressSerializer(serializers.ModelSerializer): class Meta: model = BillingAddress - fields = ['uuid', 'name', 'street', 'city', 'postal_code', 'country', 'vat_number'] + fields = ['uuid', 'organization', 'name', 'street', 'city', 'postal_code', 'country', 'vat_number'] class BillSerializer(serializers.ModelSerializer): billing_address = BillingAddressSerializer(read_only=True) @@ -77,7 +103,7 @@ class BillSerializer(serializers.ModelSerializer): class Meta: model = Bill - fields = ['reference', 'owner', 'amount', 'vat_amount', 'total', + fields = ['uuid', 'reference', 'owner', 'amount', 'vat_amount', 'total', 'due_date', 'creation_date', 'starting_date', 'ending_date', 'records', 'final', 'billing_address'] diff --git a/uncloud_django_based/uncloud/uncloud_pay/stripe.py b/uncloud_pay/stripe.py similarity index 100% rename from uncloud_django_based/uncloud/uncloud_pay/stripe.py rename to uncloud_pay/stripe.py diff --git a/uncloud_django_based/uncloud/uncloud_pay/templates/bill.html b/uncloud_pay/templates/bill.html.j2 similarity index 96% rename from uncloud_django_based/uncloud/uncloud_pay/templates/bill.html rename to uncloud_pay/templates/bill.html.j2 index 8f6c217..0ea7089 100644 --- a/uncloud_django_based/uncloud/uncloud_pay/templates/bill.html +++ b/uncloud_pay/templates/bill.html.j2 @@ -26,7 +26,7 @@ - Bill name + {{ bill.reference }} | {{ bill.uuid }}