forked from uncloud/uncloud
[doc] more cleanup
This commit is contained in:
parent
9d5d8657cb
commit
66233a1ce5
1 changed files with 58 additions and 60 deletions
|
@ -71,33 +71,6 @@ python manage.py migrate
|
||||||
#+BEGIN_SRC sh
|
#+BEGIN_SRC sh
|
||||||
http --auth nicocustomer:$(pass ldap/nicocustomer) localhost:8000/api/
|
http --auth nicocustomer:$(pass ldap/nicocustomer) localhost:8000/api/
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
* Using uncloud products
|
|
||||||
** VPN
|
|
||||||
*** Creating a VPN pool
|
|
||||||
|
|
||||||
#+BEGIN_SRC sh
|
|
||||||
http -a uncloudadmin:$(pass uncloudadmin) https://localhost:8000/v1/admin/vpnpool/ \
|
|
||||||
network=2a0a:e5c1:200:: network_size=40 subnetwork_size=48 \
|
|
||||||
vpn_hostname=vpn-2a0ae5c1200.ungleich.ch wireguard_private_key=$(wg genkey)
|
|
||||||
#+END_SRC
|
|
||||||
|
|
||||||
This will create the VPNPool 2a0a:e5c1:200::/40 from which /48
|
|
||||||
networks will be used for clients.
|
|
||||||
|
|
||||||
VPNPools can only be managed by staff.
|
|
||||||
|
|
||||||
*** Managing VPNNetworks
|
|
||||||
|
|
||||||
To request a network as a client, use the following call:
|
|
||||||
|
|
||||||
#+BEGIN_SRC sh
|
|
||||||
http -a user:$(pass user) https://localhost:8000/v1/net/vpn/ \
|
|
||||||
network_size=48 \
|
|
||||||
wireguard_public_key=$(wg genkey | tee privatekey | wg pubkey)
|
|
||||||
```
|
|
||||||
|
|
||||||
VPNNetworks can be managed by all authenticated users.
|
|
||||||
|
|
||||||
* Database
|
* Database
|
||||||
** uncloud clients access the data base from a variety of outside hosts
|
** uncloud clients access the data base from a variety of outside hosts
|
||||||
** So the postgresql data base needs to be remotely accessible
|
** So the postgresql data base needs to be remotely accessible
|
||||||
|
@ -110,35 +83,7 @@ VPNNetworks can be managed by all authenticated users.
|
||||||
|
|
||||||
* URLs
|
* URLs
|
||||||
- api/ - the rest API
|
- api/ - the rest API
|
||||||
* Models
|
* uncloud Products
|
||||||
** Bill
|
|
||||||
Bills are summarising usage in a specific timeframe. Bills usually
|
|
||||||
spawn one month.
|
|
||||||
** BillRecord
|
|
||||||
Bill records are used to model the usage of one order during the
|
|
||||||
timeframe.
|
|
||||||
** Order
|
|
||||||
Orders register the intent of a user to buy something. They might
|
|
||||||
refer to a product. (???)
|
|
||||||
Order register the one time price and the recurring price. These
|
|
||||||
fields should be treated as immutable. If they need to be modified,
|
|
||||||
a new order that replaces the current order should be created.
|
|
||||||
*** Replacing orders
|
|
||||||
If an order is updated, a new order is created and points to the
|
|
||||||
old order. The old order stops one second before the new order
|
|
||||||
starts.
|
|
||||||
|
|
||||||
If a order has been replaced can be seen by its replaced_by count:
|
|
||||||
#+BEGIN_SRC sh
|
|
||||||
>>> Order.objects.get(id=1).replaced_by.count()
|
|
||||||
1
|
|
||||||
#+END_SRC
|
|
||||||
|
|
||||||
** Product and Product Children
|
|
||||||
- A product describes something a user can buy
|
|
||||||
- A product inherits from the uncloud_pay.models.Product model to
|
|
||||||
get basic attributes
|
|
||||||
* Products
|
|
||||||
** VPN
|
** VPN
|
||||||
*** How to add a new VPN Host
|
*** How to add a new VPN Host
|
||||||
**** Install wireguard to the host
|
**** Install wireguard to the host
|
||||||
|
@ -174,9 +119,66 @@ VPNNetworks can be managed by all authenticated users.
|
||||||
vpn_hostname=vpn-2a0ae5c1200.ungleich.ch wireguard_private_key=$(wg
|
vpn_hostname=vpn-2a0ae5c1200.ungleich.ch wireguard_private_key=$(wg
|
||||||
genkey)
|
genkey)
|
||||||
**** Creating a new vpn network
|
**** Creating a new vpn network
|
||||||
|
** VPN
|
||||||
|
*** Creating a VPN pool
|
||||||
|
|
||||||
|
#+BEGIN_SRC sh
|
||||||
|
http -a uncloudadmin:$(pass uncloudadmin) https://localhost:8000/v1/admin/vpnpool/ \
|
||||||
|
network=2a0a:e5c1:200:: network_size=40 subnetwork_size=48 \
|
||||||
|
vpn_hostname=vpn-2a0ae5c1200.ungleich.ch wireguard_private_key=$(wg genkey)
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
This will create the VPNPool 2a0a:e5c1:200::/40 from which /48
|
||||||
|
networks will be used for clients.
|
||||||
|
|
||||||
|
VPNPools can only be managed by staff.
|
||||||
|
|
||||||
|
*** Managing VPNNetworks
|
||||||
|
|
||||||
|
To request a network as a client, use the following call:
|
||||||
|
|
||||||
|
#+BEGIN_SRC sh
|
||||||
|
http -a user:$(pass user) https://localhost:8000/v1/net/vpn/ \
|
||||||
|
network_size=48 \
|
||||||
|
wireguard_public_key=$(wg genkey | tee privatekey | wg pubkey)
|
||||||
|
```
|
||||||
|
|
||||||
|
VPNNetworks can be managed by all authenticated users.
|
||||||
|
|
||||||
* Developer Handbook
|
* Developer Handbook
|
||||||
The following section describe decisions / architecture of
|
The following section describe decisions / architecture of
|
||||||
uncloud. These chapters are intended to be read by developers.
|
uncloud. These chapters are intended to be read by developers.
|
||||||
|
** Documentation
|
||||||
|
This documentation is written in org-mode. To compile it to
|
||||||
|
html/pdf, just open emacs and press *C-c C-e l p*.
|
||||||
|
** Models
|
||||||
|
*** Bill
|
||||||
|
Bills are summarising usage in a specific timeframe. Bills usually
|
||||||
|
spawn one month.
|
||||||
|
*** BillRecord
|
||||||
|
Bill records are used to model the usage of one order during the
|
||||||
|
timeframe.
|
||||||
|
*** Order
|
||||||
|
Orders register the intent of a user to buy something. They might
|
||||||
|
refer to a product. (???)
|
||||||
|
Order register the one time price and the recurring price. These
|
||||||
|
fields should be treated as immutable. If they need to be modified,
|
||||||
|
a new order that replaces the current order should be created.
|
||||||
|
**** Replacing orders
|
||||||
|
If an order is updated, a new order is created and points to the
|
||||||
|
old order. The old order stops one second before the new order
|
||||||
|
starts.
|
||||||
|
|
||||||
|
If a order has been replaced can be seen by its replaced_by count:
|
||||||
|
#+BEGIN_SRC sh
|
||||||
|
>>> Order.objects.get(id=1).replaced_by.count()
|
||||||
|
1
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
*** Product and Product Children
|
||||||
|
- A product describes something a user can buy
|
||||||
|
- A product inherits from the uncloud_pay.models.Product model to
|
||||||
|
get basic attributes
|
||||||
** Identifiers
|
** Identifiers
|
||||||
*** Problem description
|
*** Problem description
|
||||||
Identifiers can be integers, strings or other objects. They should
|
Identifiers can be integers, strings or other objects. They should
|
||||||
|
@ -209,7 +211,3 @@ VPNNetworks can be managed by all authenticated users.
|
||||||
|
|
||||||
*** Decision
|
*** Decision
|
||||||
We use integers, because they are easy.
|
We use integers, because they are easy.
|
||||||
|
|
||||||
** Documentation
|
|
||||||
This documentation is written in org-mode. To compile it to
|
|
||||||
html/pdf, just open emacs and press *C-c C-e l p*.
|
|
||||||
|
|
Loading…
Reference in a new issue