Compare commits

..

197 commits

Author SHA1 Message Date
8287e73f6b Merge branch 'master' into 'master'
- Implement a complete cycle for buying a Matrix Chat Host

See merge request uncloud/uncloud!11
2021-07-19 16:36:11 +02:00
b7aa1c6971 - Added PricingPlan Model
- Implement a complete cycle for buying a Matrix Chat Host
- Refactor the Payement cycle and stripe related methods
2021-07-19 16:36:10 +02:00
Nico Schottelius
e205d8d07c Merge branch 'master' of code.ungleich.ch:uncloud/uncloud 2021-06-20 11:58:23 +02:00
Nico Schottelius
a463bcf7bd Late commits 2021-06-20 11:51:27 +02:00
Nico Schottelius
d872357dd1 Fix login -> move to bootstrap5 2021-05-25 20:22:18 +02:00
Nico Schottelius
485f08e25c Cleanup views 2021-05-25 19:55:33 +02:00
Nico Schottelius
745abc48ef Add balance if user is logged in 2021-05-25 19:55:13 +02:00
Nico Schottelius
49f52fd41d [bootstrap] update to bootstrap5 2021-02-13 18:50:28 +01:00
Nico Schottelius
c8ce7dbb40 do not touch local_settings.py on deploy 2021-01-17 15:54:16 +01:00
Nico Schottelius
a920887100 ++bridge update 2021-01-17 15:53:30 +01:00
Nico Schottelius
6b9b15e663 Add deploy.sh 2021-01-17 15:47:37 +01:00
Nico Schottelius
48ce21f833 integrate bootstrap 2021-01-01 13:25:52 +01:00
Nico Schottelius
6c15d2086e implement balance getting 2021-01-01 12:41:54 +01:00
Nico Schottelius
1b06d8ee03 [credit card] implement payment 2020-12-29 01:43:33 +01:00
Nico Schottelius
e225bf1cc0 implement credit card listing 2020-12-28 23:35:34 +01:00
Nico Schottelius
e2c4a19049 Less verbose 2020-12-26 14:48:10 +01:00
Nico Schottelius
74749bf07c fix templating 2020-12-26 14:45:28 +01:00
Nico Schottelius
93e5d39c7b moving vpn to direct configuration 2020-12-26 14:42:53 +01:00
Nico Schottelius
18d4c99571 [doc] workers need access to the database 2020-12-26 13:42:20 +01:00
Nico Schottelius
e51edab2f5 cleanup/in between commit 2020-12-26 11:22:51 +01:00
Nico Schottelius
f7c68b5ca5 Rename template 2020-12-25 17:33:01 +01:00
Nico Schottelius
6efedcb381 hackish way of registering works 2020-12-25 17:29:17 +01:00
Nico Schottelius
df4c0c3060 in between commit to update for cc tests 2020-12-25 10:31:42 +01:00
Nico Schottelius
8dd4b712fb [views] add index view for uncloud 2020-12-25 10:11:13 +01:00
Nico Schottelius
50a395c8ec sort requirements.txt 2020-12-25 10:10:57 +01:00
Nico Schottelius
663d72269a [wireguard] verify key length 2020-12-25 10:08:34 +01:00
Nico Schottelius
a0fbe2d6ed [wireguard] add unique constrain for keys in pool 2020-12-24 17:26:53 +01:00
Nico Schottelius
858aabb5ba Return value from validation 2020-12-20 22:03:43 +01:00
Nico Schottelius
ece2bca831 add new /sizes endpoint 2020-12-20 21:45:47 +01:00
Nico Schottelius
cdab685269 [vpn/doc] update docs 2020-12-20 19:37:12 +01:00
Nico Schottelius
689375a2fe Fix the config task 2020-12-20 19:17:03 +01:00
Nico Schottelius
8f83679c48 test cleaning tasks in a task fails:
[2020-12-20 18:01:50,264: WARNING/ForkPoolWorker-7] Pruning UncloudTask object (571ffc76-8b40-4cb6-9658-87030834bc6c)...
[2020-12-20 18:01:50,265: ERROR/ForkPoolWorker-7] Task uncloud.tasks.cleanup_tasks[f9fb1480-f122-41c9-bec1-3d6d0f92a22e] raised unexpected: RuntimeError('Never call result.get() within a task!\nSee http://docs.celeryq.org/en/latest/userguide/tasks.html#task-synchronous-subtasks\n')
Traceback (most recent call last):
  File "/home/nico/vcs/uncloud/venv/lib/python3.8/site-packages/celery/app/trace.py", line 405, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/home/nico/vcs/uncloud/venv/lib/python3.8/site-packages/celery/app/trace.py", line 697, in __protected_call__
    return self.run(*args, **kwargs)
  File "/home/nico/vcs/uncloud/uncloud/tasks.py", line 13, in cleanup_tasks
    print(res.get())
  File "/home/nico/vcs/uncloud/venv/lib/python3.8/site-packages/celery/result.py", line 209, in get
    assert_will_not_block()
  File "/home/nico/vcs/uncloud/venv/lib/python3.8/site-packages/celery/result.py", line 37, in assert_will_not_block
    raise RuntimeError(E_WOULDBLOCK)
RuntimeError: Never call result.get() within a task!
See http://docs.celeryq.org/en/latest/userguide/tasks.html#task-synchronous-subtasks
2020-12-20 19:01:37 +01:00
Nico Schottelius
5e870f04b1 ++celery/tasks 2020-12-20 18:36:46 +01:00
Nico Schottelius
63191c0a88 Remove $ that is not needed in python... 2020-12-20 13:24:55 +01:00
Nico Schottelius
03c0b34446 ++config vpn server 2020-12-20 13:00:36 +01:00
Nico Schottelius
1922a0d92d ++routing tests 2020-12-20 12:54:02 +01:00
Nico Schottelius
2e6c72c093 wireguard/celery fixes 2020-12-20 12:45:36 +01:00
Nico Schottelius
b3626369a2 --syntax error 2020-12-20 12:24:35 +01:00
Nico Schottelius
179baee96d fix celery task routes syntax error 2020-12-20 12:22:50 +01:00
Nico Schottelius
054886fd9c begin phasing in config of vpn via cdist 2020-12-20 12:20:54 +01:00
Nico Schottelius
e2b36c8bca celery test 2020-12-13 19:50:36 +01:00
Nico Schottelius
372fe800cd fill in template values for settings 2020-12-13 19:06:22 +01:00
Nico Schottelius
16f3adef93 [doc] ++requirements alpine 2020-12-13 18:56:47 +01:00
Nico Schottelius
2d62388eb1 phasing in celery
for configuring the vpn server
2020-12-13 18:34:43 +01:00
Nico Schottelius
aec79cba74 [vpn] include vpn server public key 2020-12-13 18:05:48 +01:00
Nico Schottelius
cd19c47fdb [vpn] implement creating vpns 2020-12-13 17:59:35 +01:00
Nico Schottelius
cf948b03a8 ++vpn network 2020-12-13 13:28:43 +01:00
Nico Schottelius
5716cae900 [vpn] add selector for size 2020-12-13 11:43:49 +01:00
Nico Schottelius
10d5a72c5a [refactor] cleaning up uncloud_net for Wireguardvpn 2020-12-13 11:38:41 +01:00
Nico Schottelius
074cffcbd7 Add selection for vpnnetworkreservations 2020-12-09 21:20:33 +01:00
Nico Schottelius
7f32d05cd4 begin phasing in vpn support [poc] 2020-12-09 20:22:33 +01:00
Nico Schottelius
0fd5ac18cd do not import pay->auth
Try to keep common things in the "uncloud" module
2020-12-06 11:53:37 +01:00
Nico Schottelius
ad0c2f1e9d Merge branch 'master' of code.ungleich.ch:uncloud/uncloud 2020-11-17 11:47:53 +01:00
Nico Schottelius
0b1c2cc168 Cleanup code so that *most* test work again
Still need to solve the downgrade test
2020-11-15 15:43:11 +01:00
4845ab1e39 Create account using api
Registration and change_email is backed by ldap
2020-11-14 14:50:43 +05:00
Nico Schottelius
ecc9e6f734 [reverseDNS] add basic logic 2020-10-25 22:43:34 +01:00
Nico Schottelius
20c7c86703 restructure to move uncloudnetwork into core 2020-10-25 21:00:30 +01:00
Nico Schottelius
8959bc6ad5 various updates 2020-10-25 13:52:36 +01:00
Nico Schottelius
0cd8a3a787 ++update ungleich_provider 2020-10-11 22:36:01 +02:00
Nico Schottelius
bbc7625550 phase in configuration - move address to base 2020-10-11 22:32:08 +02:00
Nico Schottelius
fe4e200dc0 Begin phasing in the uncloudprovider 2020-10-11 17:45:25 +02:00
Nico Schottelius
e03cdf214a update VAT importer 2020-10-08 19:54:04 +02:00
Nico Schottelius
50fd9e1f37 ++work 2020-10-07 00:54:56 +02:00
Nico Schottelius
2e74661702 Fix first test case / billing 2020-10-06 23:14:32 +02:00
Nico Schottelius
c26ff253de One step furter to allow saving of orders w/o explicit recurringperiod 2020-10-06 19:21:37 +02:00
Nico Schottelius
9623a77907 Updating for products/recurring periods 2020-10-06 18:53:13 +02:00
Nico Schottelius
c435639241 gitignore some tests 2020-10-06 16:13:03 +02:00
Nico Schottelius
992c7c551e Make recurring period a database model
- For easier handling (foreignkeys, many2many)
- For higher flexibility (users can define their own periods)
2020-10-06 15:46:22 +02:00
Nico Schottelius
58883765d7 [tests] back to 5 working tests! 2020-09-28 23:16:17 +02:00
Nico Schottelius
8d8c4d660c Can order a generic product now 2020-09-28 21:59:35 +02:00
Nico Schottelius
c32499199a Add JSON support for product description 2020-09-28 21:34:24 +02:00
Nico Schottelius
c6bacab35a Phasing out Product model
Signed-off-by: Nico Schottelius <nico@nico-notebook.schottelius.org>
2020-09-28 20:59:08 +02:00
Nico Schottelius
1aead50170 remove big mistake: orders from product
Signed-off-by: Nico Schottelius <nico@nico-notebook.schottelius.org>
2020-09-28 20:44:50 +02:00
Nico Schottelius
d8a7964fed Continue to refactor for shifting logic into the order 2020-09-09 00:35:55 +02:00
Nico Schottelius
077c665c53 ++update 2020-09-03 17:16:18 +02:00
Nico Schottelius
f7274fe967 Adding logic to order to find out whether its closed 2020-09-03 16:38:51 +02:00
Nico Schottelius
1c7d81762d begin splitting bill record creation function 2020-09-02 16:02:28 +02:00
Nico Schottelius
18f9a3848a Implement ending/replacing date logic 2020-08-27 22:00:54 +02:00
Nico Schottelius
9211894b23 implement basic logic for updating a recurring order
Signed-off-by: Nico Schottelius <nico@nico-notebook.schottelius.org>
2020-08-27 14:45:37 +02:00
Nico Schottelius
b8b15704a3 begin testing bill sums
Signed-off-by: Nico Schottelius <nico@nico-notebook.schottelius.org>
2020-08-25 21:53:25 +02:00
Nico Schottelius
ab412cb877 Test that creating products w/o correct billing address fails 2020-08-25 21:31:12 +02:00
Nico Schottelius
7b83efe995 [pay] make sample products more modular 2020-08-25 21:11:28 +02:00
Nico Schottelius
4d5ca58b2a [tests] cleanup old tests
Finally manage.py tests runs through
2020-08-25 20:40:33 +02:00
Nico Schottelius
f693dd3d18 ++notes 2020-08-09 21:10:43 +02:00
Nico Schottelius
5ceaaf7c90 bill cleanup, note next step 2020-08-09 14:52:42 +02:00
Nico Schottelius
2b29e300dd [product] migrate orders to ManyToManyField 2020-08-09 14:44:29 +02:00
Nico Schottelius
8df1d8dc7c begin refactor product to user orders instead of single order
Signed-off-by: Nico Schottelius <nico@nico-notebook.schottelius.org>
2020-08-09 14:38:10 +02:00
Nico Schottelius
ef02cb61fd Refine tests for bills, multiple bills 2020-08-09 12:34:25 +02:00
Nico Schottelius
70c450afc8 fix tests for Product()
Signed-off-by: Nico Schottelius <nico@nico-notebook.schottelius.org>
2020-08-09 11:44:22 +02:00
Nico Schottelius
0dd1093812 add sample products and improve testing for Product 2020-08-09 11:02:45 +02:00
Nico Schottelius
6a928a2b2a Fix tests for billing 2020-08-09 10:18:15 +02:00
Nico Schottelius
89519e48a9 Various updates 2020-08-09 10:14:49 +02:00
Nico Schottelius
e169b8c1d1 Implement the whole billing logic
The major part has been written!
2020-08-09 10:14:31 +02:00
Nico Schottelius
d7c0c40926 first bill generation works
Signed-off-by: Nico Schottelius <nico@nico-notebook.schottelius.org>
2020-08-09 00:37:27 +02:00
Nico Schottelius
fd39526350 Improve billing address testing 2020-08-08 23:02:24 +02:00
Nico Schottelius
78d1de9031 Remove orderrecord
Signed-off-by: Nico Schottelius <nico@nico-notebook.schottelius.org>
2020-08-08 22:37:00 +02:00
Nico Schottelius
db1a69561b pass first 2 bill tests
Signed-off-by: Nico Schottelius <nico@nico-notebook.schottelius.org>
2020-08-08 22:31:43 +02:00
Nico Schottelius
9bf0a99f6a uncloud pay cleanups
Signed-off-by: Nico Schottelius <nico@nico-notebook.schottelius.org>
2020-08-08 22:20:49 +02:00
Nico Schottelius
c9be8cc50b orders only have 1 price
Signed-off-by: Nico Schottelius <nico@nico-notebook.schottelius.org>
2020-08-08 21:54:44 +02:00
Nico Schottelius
8da6a1e19c update models/new django
Signed-off-by: Nico Schottelius <nico@nico-notebook.schottelius.org>
2020-08-08 21:54:07 +02:00
Nico Schottelius
ff8fdb76b1 ++ test 2020-08-08 19:30:25 +02:00
Nico Schottelius
9b00ef11fb ++stuff 2020-08-04 18:56:36 +02:00
Nico Schottelius
d2bd6ba200 [test] update for uncloud_net 2020-08-04 12:41:15 +02:00
Nico Schottelius
165dacb7bf update to use new JSONFIELD
Signed-off-by: Nico Schottelius <nico@nico-notebook.schottelius.org>
2020-08-04 12:01:44 +02:00
Nico Schottelius
ee79877a27 +migrations
Signed-off-by: Nico Schottelius <nico@nico-notebook.schottelius.org>
2020-08-04 11:40:34 +02:00
Nico Schottelius
2ce667e8c7 model changes
Signed-off-by: Nico Schottelius <nico@nico-notebook.schottelius.org>
2020-08-04 11:26:42 +02:00
Nico Schottelius
e563780142 Add some sample VMs 2020-08-02 00:55:07 +02:00
Nico Schottelius
66233a1ce5 [doc] more cleanup 2020-08-01 23:44:10 +02:00
Nico Schottelius
9d5d8657cb [doc] Move install and co. into the main documentation 2020-08-01 23:42:36 +02:00
Nico Schottelius
a091079677 in between commit
Signed-off-by: Nico Schottelius <nico@nico-notebook.schottelius.org>
2020-08-01 23:20:14 +02:00
Nico Schottelius
c9a941e290 [vm] add disks inlined to VMs 2020-08-01 18:48:51 +02:00
Nico Schottelius
f7b14bf507 cleanup migrations
Signed-off-by: Nico Schottelius <nico@nico-notebook.schottelius.org>
2020-08-01 18:38:38 +02:00
Nico Schottelius
ed40b21d16 [doc] begin describe replacing orders 2020-08-01 18:31:27 +02:00
Nico Schottelius
880e4d046b [vm] cleanup 2020-08-01 18:30:40 +02:00
Nico Schottelius
cbd5a08ae7 make price a real property of order
Signed-off-by: Nico Schottelius <nico@nico-notebook.schottelius.org>
2020-08-01 18:27:12 +02:00
Nico Schottelius
64780bfc6c [models] update / doc 2020-08-01 16:29:24 +02:00
Nico Schottelius
9c1b4ab275 [db] add migration for vmdiskproduct 2020-08-01 16:29:11 +02:00
Nico Schottelius
2771a7518a [doc] cleanup 2020-08-01 16:28:19 +02:00
Nico Schottelius
9b3493a661 [doc] integrate vpn into manual 2020-08-01 16:24:21 +02:00
Nico Schottelius
932ac06cea begin doc in views 2020-08-01 14:05:56 +02:00
Nico Schottelius
05a897db70 +whitespace 2020-08-01 14:05:50 +02:00
Nico Schottelius
011096f152 [bootstrap user] remove syntax errors 2020-08-01 14:05:36 +02:00
Nico Schottelius
55ba61e36b [urls] remove obsolete comment 2020-08-01 14:05:26 +02:00
Nico Schottelius
1265e23750 [doc] add bootstrap 2020-08-01 14:05:12 +02:00
Nico Schottelius
bc0c77a393 add sql migration for opennebula
Signed-off-by: Nico Schottelius <nico@nico-notebook.schottelius.org>
2020-08-01 14:03:22 +02:00
Nico Schottelius
bdba3bffe2 [opennebula] turn VM into a product 2020-08-01 14:02:54 +02:00
Nico Schottelius
3745a0e2b1 [doc] ignore generated files 2020-08-01 13:24:51 +02:00
Nico Schottelius
7ce28b0b60 Begin new uncloud manual 2020-08-01 13:07:44 +02:00
Nico Schottelius
662e706eab begin to fix bill view 2020-06-21 23:54:57 +02:00
Nico Schottelius
11de455d23 begin to add pdf view of bill into admin 2020-06-21 23:46:26 +02:00
Nico Schottelius
126d9da764 Use quantity instead of usage_count 2020-06-21 16:42:55 +02:00
Nico Schottelius
8a17ee6de5 Include BillRecords in the admin 2020-06-21 16:08:00 +02:00
Nico Schottelius
721472b416 Fix constraint to active = True 2020-06-21 14:45:05 +02:00
Nico Schottelius
424ceafbb8 Enhance make-admin to allow making superuser 2020-06-21 14:44:55 +02:00
Nico Schottelius
1e68539ed8 remove uuid primary key
Signed-off-by: Nico Schottelius <nico@nico-notebook.schottelius.org>
2020-06-21 14:35:12 +02:00
Nico Schottelius
3ef19610f3 add script to reset migrations
Signed-off-by: Nico Schottelius <nico@nico-notebook.schottelius.org>
2020-06-21 14:34:48 +02:00
Nico Schottelius
8decfe1b16 Phase in admin, remove uuid from bills 2020-06-21 13:46:54 +02:00
Nico Schottelius
662845128f ++ billing details 2020-06-20 23:47:26 +02:00
Nico Schottelius
95011c2058 Add readme for billing 2020-06-20 22:15:15 +02:00
Nico Schottelius
a3f3ca8cf9 in the middle of restructering 2020-05-24 13:45:03 +02:00
Nico Schottelius
5d1eaaf0af Add new models backup - before major refactoring 2020-05-24 12:46:11 +02:00
Nico Schottelius
bcd141730d convert recurring period into an integerfield
Signed-off-by: Nico Schottelius <nico@nico-notebook.schottelius.org>
2020-05-23 23:38:34 +02:00
Nico Schottelius
15535433e8 begin to change to day based differences
Signed-off-by: Nico Schottelius <nico@nico-notebook.schottelius.org>
2020-05-23 23:32:45 +02:00
Nico Schottelius
18b862c2e1 fix syntax errors 2020-05-23 23:08:59 +02:00
Nico Schottelius
b8652c921e Merge branch 'master' of code.ungleich.ch:uncloud/uncloud 2020-05-23 21:33:04 +02:00
Nico Schottelius
8bbcc5df5f ++dev 2020-05-23 21:32:56 +02:00
Nico Schottelius
0202f80a37 in between pay commit 2020-05-23 21:23:06 +02:00
Nico Schottelius
caedf874e4 [vpn] add tests 2020-05-20 21:00:08 +02:00
Nico Schottelius
f17f9060b0 [config] add path to chrome 2020-05-17 23:34:13 +02:00
Nico Schottelius
04fac71a85 Merge branch 'master' of code.ungleich.ch:uncloud/uncloud
Signed-off-by: Nico Schottelius <nico@nico-notebook.schottelius.org>
2020-05-17 22:38:49 +02:00
Nico Schottelius
ef76304bae + old stuff 2020-05-17 22:35:25 +02:00
Nico Schottelius
ec447e0dc4 Add support for primary address in user.
Closes #35

Fixes #35
2020-05-10 21:47:44 +02:00
Nico Schottelius
ca2065a94d gitignore for local settings 2020-05-10 14:37:20 +02:00
Nico Schottelius
dc7a465a8c Fix exception if first order does not have billing address 2020-05-10 14:22:09 +02:00
65440ab2ef Add depends_on relation on orders 2020-05-08 16:47:32 +02:00
d794b24c86 Make VM order-able again 2020-05-08 16:31:33 +02:00
df059fb00d Speed-up CI with pre-built image, add resources directory 2020-05-08 12:15:40 +02:00
67af7b5465 Add missing billnico migration 2020-05-08 11:43:01 +02:00
beb5bd7ee4 Fix existing uncloud_pay tests 2020-05-08 11:33:59 +02:00
9574d69f4c Move VAT rate CSV out of archive/ 2020-05-08 11:23:09 +02:00
74e2168529 Fix floating-point issue on bills (Fix #31) 2020-05-08 11:13:11 +02:00
444d6ded28 Move AMOUNT_* and COUNTRIES to uncloud_pay/init.py 2020-05-08 10:56:03 +02:00
cbba1f4169 Add admin bill generation endpoint 2020-05-08 10:42:04 +02:00
d47c94ba84 Implement non-destructive order updates 2020-05-08 10:07:44 +02:00
89e853b490 Add order termination logic 2020-05-08 09:31:46 +02:00
Nico Schottelius
1b97fc8fc7 Merge branch 'master' of code.ungleich.ch:uncloud/uncloud 2020-05-07 20:22:49 +02:00
Nico Schottelius
41a2f18453 In between commit 2020-05-07 20:22:42 +02:00
a086d46136 Allow bill download from admin bill endpoint 2020-05-07 15:45:04 +02:00
ae2bad5754 Generate bill PDFs from /my/bill 2020-05-07 15:38:49 +02:00
3874165189 Fix bill generation 2020-05-07 14:24:04 +02:00
56d98cbb55 Implement Orders/Bills permissions, unpaid bill views 2020-05-07 13:12:38 +02:00
718abab9d2 Add make-admin command to uncloud_auth 2020-05-07 12:45:06 +02:00
268e08c4db Adapt README for SQLite 2020-05-07 12:31:59 +02:00
b8ac99acb6 On more small commit to fix README formatting 2020-05-07 12:25:05 +02:00
221d98af4b Inline CI badges 2020-05-07 12:24:17 +02:00
ebd4e6fa1b Add fancy CI badges to README 2020-05-07 12:23:17 +02:00
b512d42058 Add devel environment setup instructions 2020-05-07 12:21:49 +02:00
1245c191c0 Adapt CI to new structure 2020-05-07 12:13:48 +02:00
95d43f002f Move django-based uncloud to top-level 2020-05-07 12:12:35 +02:00
0560063326 Add description field to Orders 2020-05-07 12:08:18 +02:00
db3c29d17e Fix admin order creation 2020-05-07 12:05:26 +02:00
892b2b6f13 Revert "Disable vat validator to get project back running"
This reverts commit 1cf20a2cb6.
2020-05-07 12:03:28 +02:00
Nico Schottelius
aa8ade4730 Add readme about identifiers 2020-05-05 16:01:47 +02:00
Nico Schottelius
594f1a9b69 +hacks 2020-05-05 15:19:50 +02:00
Nico Schottelius
e3b28354fe ++notes 2020-05-05 15:19:04 +02:00
Nico Schottelius
99a18232aa VMs now properly set their pricing 2020-05-02 23:44:20 +02:00
Nico Schottelius
c835c874d5 [BREAKING] make Order a stand-alone version
I think that while the idea of an Orderrecord is good, we might get
away / have a simpler implementation if we only use orders and
reference them where needed.

I saved the previous Order model for easy rollback, if my assumption
is wrong.
2020-05-02 22:48:05 +02:00
Nico Schottelius
028f1ebe6e Entry point /beta/vm/ works for creating VM + order 2020-05-02 22:03:34 +02:00
Nico Schottelius
9ef5309b91 +db migrations for pay/vm
Signed-off-by: Nico Schottelius <nico@nico-notebook.schottelius.org>
2020-05-02 21:21:29 +02:00
Nico Schottelius
4097c2ce13 BillingAddress: make mget_preferred_address a classmethod 2020-05-02 21:20:14 +02:00
Nico Schottelius
736fe27493 Add issues.org as a shortcut for registering issues 2020-05-02 20:45:19 +02:00
Nico Schottelius
7d708cfbb6 Fix empty vat number bug 2020-05-02 20:42:09 +02:00
Nico Schottelius
927fb20671 Versionise API and cleanups 2020-05-02 20:31:36 +02:00
Nico Schottelius
eea654a9f8 Phase in new beta/vm view for creating vms + orders + bills 2020-05-02 19:15:48 +02:00
Nico Schottelius
2cda6441f4 Refactor secret / local settings handling 2020-05-02 00:16:29 +02:00
Nico Schottelius
62d9ccbbef [vpn] begin to introduce save() method
The save() and delete() method will create/manage the orders
2020-04-27 18:25:44 +02:00
Nico Schottelius
1cf20a2cb6 Disable vat validator to get project back running 2020-04-27 18:25:27 +02:00
387 changed files with 11125 additions and 4025 deletions

3
.gitignore vendored
View file

@ -22,5 +22,6 @@ uncloud/version.py
build/
venv/
dist/
.history/
*.iso
*.sqlite3

View file

@ -4,7 +4,7 @@ stages:
run-tests:
stage: test
image: fedora:latest
image: code.ungleich.ch:5050/uncloud/uncloud/uncloud-ci:latest
services:
- postgres:latest
variables:
@ -12,11 +12,7 @@ run-tests:
DATABASE_USER: postgres
POSTGRES_HOST_AUTH_METHOD: trust
coverage: /^TOTAL.+?(\d+\%)$/
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

View file

@ -1,3 +1,70 @@
# 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 createsuperuser`
## Development setup
Install system dependencies:
* On Fedora, you will need the following packages: `python3-virtualenv python3-devel openldap-devel gcc chromium`
* sudo apt-get install libpq-dev python-dev libxml2-dev libxslt1-dev libldap2-dev libsasl2-dev libffi-dev
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.
```
### Run Background Job Queue
We use Django Q to handle the asynchronous code and Background Cron jobs
To start the workers make sure first that Redis or the Django Q broker is working and you can edit it's settings in the settings file.
```
./manage.py qcluster
```
### 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`

6
archive/issues.org Normal file
View file

@ -0,0 +1,6 @@
* Intro
This file lists issues that should be handled, are small and likely
not yet high prio.
* Issues
** TODO Register prefered address in User model
** TODO Allow to specify different recurring periods

View file

@ -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 ..."

View file

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 37 KiB

Some files were not shown because too many files have changed in this diff Show more