Commit Graph

377 Commits

Author SHA1 Message Date
8634cda388 templates: Display IPv6 addresses on the capsul detail page
Some checks failed
continuous-integration/drone/pr Build is failing
2021-08-04 19:53:06 +00:00
5f868de9cc Merge pull request 'Support dualstack ipv6 in the controller layer' (#10) from mirsal/capsul-flask:ipv6 into yolocolo
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #10

You Obviously Love Owls
2021-08-04 21:08:11 +02:00
d238bc9551 cosmetics: Remove trailing whitespace
Some checks failed
continuous-integration/drone/pr Build is failing
2021-08-04 15:35:41 +00:00
17c915c1bf Support dualstack ipv6 in the console controller
This commit updates the console controller logic and
a few bits in the model in order to support multiple
address families (ipv4 and ipv6)
2021-08-04 15:35:41 +00:00
8a6d558402 Retrieve IPv6 addresses from VMs
This commit allows the model to fetch IPv6 addresses from running VMs
and populate VirtualMachine objects with the value if it was retrieved
successfully
2021-08-04 15:35:41 +00:00
3wc
ff4e63339f Merge branch 'master' into yolocolo
All checks were successful
continuous-integration/drone/push Build is passing
2021-08-04 12:19:57 +02:00
7b16606b16 Merge pull request 'shell_scripts: Fix reporting of VM IP addresses' (#9) from mirsal/capsul-flask:ipv6 into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #9
2021-08-04 12:13:44 +02:00
d9f3e68278 shell_scripts: Fix reporting of VM IP addresses
Some checks failed
continuous-integration/drone/pr Build is failing
The shell script which gets informations from libvirt incorrectly
matches virsh output lines which contain VMs' public IPv4 addresses.
It doesn't work when there are multiple address families which breaks
reporting of IPv4 address when a VM also has an IPv6 address and virsh
happen to output that one first.

This commit changes it to explicitely match the first ipv4 address instead.
2021-08-04 00:56:55 +00:00
3wc
bcd1190f50 Fix API 🙈
All checks were successful
continuous-integration/drone/push Build is passing
2021-07-29 11:36:58 +02:00
3wc
6963e22933 Merge branch 'publicapi' into yolocolo 2021-07-29 11:16:54 +02:00
3wc
816be36a52 Revert unthemed template changes, tweak theme 2021-07-29 11:11:51 +02:00
3wc
d6f2f6d0bf Merge branch 'master' into yolocolo 2021-07-29 09:47:31 +02:00
3wc
cffa40c0e3 Fix up API
All checks were successful
continuous-integration/drone/push Build is passing
2021-07-23 23:28:06 +02:00
3wc
6dbae94bd6 Fix typo
All checks were successful
continuous-integration/drone/push Build is passing
2021-07-23 18:08:05 +02:00
3wc
42edcd1c33 Updates for upstream IP handling 2021-07-23 18:07:37 +02:00
3wc
b27d5b3c5b Add basic "create" API..
.. using server-side API tokens
2021-07-23 18:07:35 +02:00
72c04d8495 Docker image, & local development docker-compose.yml (#2)
All checks were successful
continuous-integration/drone/push Build is passing
Adds:
- a Docker image, which can be used in both development and production
- a `docker-compose.yml` file for local development (could probably be adapted for production deployments)

Testing:
- `git checkout docker`
- `docker-compose up`
- pray 🙏
- go to http://localhost:5000

## App architecture

I added the ability to load secret config variables (`HUB_TOKEN`, `STRIPE_SECRET_KEY` etc) from files, to support [Docker Secrets](https://docs.docker.com/engine/swarm/secrets/) natively. The code should probably log an error if a specified `HUB_TOKEN_FILE` doesn't exist instead of failing silently..

## Docker architecture

This uses a multi-stage build to reduce the size of the final image -- having pipenv install to a predefined virtualenv, and then copying that over.

The compose file doesn't include a definition for a cron runner service, and I haven't tested running one yet. Here be dragons!

You can rebuild the image locally using `docker-compose build`, but this isn't required for changes to the app code, only if you edit the `Dockerfile`, or want to publish your image for use on a swarm server (in which case you will need to edit the image name to put in your own Docker hub credentials).

Currently, the image is rebuilt (should set up auto-tagging..) and published with every push to this 3wordchant/capsul-flask fork.

Reviewed-on: #2
Co-authored-by: 3wordchant <3wordchant@noreply.git.autonomic.zone>
Co-committed-by: 3wordchant <3wordchant@noreply.git.autonomic.zone>
2021-07-22 01:18:10 +02:00
5bb76173dd Add custom themes, THEME setting, basic "yolocolo" theme (#7)
Specify `THEME=yourtheme`, add some HTML files in `capsulflask/theme/yourtheme` 👌

We probably want to reduce copypasta in the current `yolocolo` theme by using template inheritance, at some point.

Reviewed-on: #7
Co-authored-by: 3wordchant <3wordchant@noreply.git.autonomic.zone>
Co-committed-by: 3wordchant <3wordchant@noreply.git.autonomic.zone>
2021-07-22 01:15:39 +02:00
3wc
cfb323bf60 Merge branch 'yc-templates' into yolocolo
All checks were successful
continuous-integration/drone/push Build is passing
2021-07-22 01:03:02 +02:00
3wc
8c7197f118 Merge branch 'docker' into yolocolo 2021-07-22 01:02:34 +02:00
3wc
fb83f52162 Merge branch 'master' into yolocolo 2021-07-22 00:57:01 +02:00
3wc
982556a2c5 Tag with current branch, instead of latest
Some checks reported errors
continuous-integration/drone/pr Build was killed
continuous-integration/drone/push Build is passing
2021-07-22 00:28:33 +02:00
3wc
13646e64da Make docker-compose file less demanding
Some checks failed
continuous-integration/drone/pr Build is failing
continuous-integration/drone/push Build is passing
2021-07-21 23:50:47 +02:00
3wc
67149f437a Changes from @decentral1se code review 2021-07-21 23:50:47 +02:00
3wc
308ac05fe6 Add openssh-cient to Dockerfile for ssh-keyscan 2021-07-21 23:50:47 +02:00
3wc
c378c2b287 STRIPE_SECRET_KEY not STRIPE_PUBLISHABLE_KEY 2021-07-21 23:50:47 +02:00
3wc
5367822747 Load secrets from files if _FILE vars are set 2021-07-21 23:50:47 +02:00
3wc
e295b4420c Docker updates for libvirtd 2021-07-21 23:50:47 +02:00
3wc
e4180b8306 Use Flask server in development 2021-07-21 23:50:47 +02:00
3wc
5cd5126039 Multi-stage build oh my! 2021-07-21 23:50:47 +02:00
3wc
f8e9ab2482 Initial attempt at Docker 2021-07-21 23:50:47 +02:00
8c0c613392 Merge remote-tracking branch 'threewordchant/master' 2021-07-21 16:47:46 -05:00
50ee1144f9 Merge remote-tracking branch 'threewordchant/master' 2021-07-21 16:46:50 -05:00
3wc
c4ba5ea197 Merge branch 'master' of ssh://git.autonomic.zone:2222/3wordchant/capsul-flask 2021-07-21 23:46:37 +02:00
08eb38dc57 correctly enforce affordable_vm_sizes post form submission 2021-07-21 16:45:53 -05:00
3wc
33f4551cf4 Merge branch 'docs-reshuffle' 2021-07-21 23:44:42 +02:00
3wc
0fa7fb28b5 Split README up into separate files, plus:
* forest's ReadMe docs changes
* add Configuration-type-stuff that lives in the database
2021-07-21 23:43:44 +02:00
be6e72028c define BTCPAY_ENABLED based on URL and btcpay key, pass it explicitly 2021-07-21 23:43:44 +02:00
3wc
bf7487f4f0 Don't load /btcpay if BTCPAY_PRIVATE_KEY un-set 2021-07-21 23:43:44 +02:00
3wc
8b0ce0ba71 Hide the BTCPay link if BTCPAY_PRIVATE_KEY un-set 2021-07-21 23:43:44 +02:00
3wc
bca570882e Add load_config_vars context processor..
..to allow accessing config variables in the templates.

This removes the need for adding config variables manually to template
contexts.
2021-07-21 23:43:44 +02:00
f3ae9aae23 remove class="small" from pricing table cuz normal size fits fine 2021-07-21 23:43:44 +02:00
3wc
827ca4a50b Auto-generate the pricing table from the database 2021-07-21 23:43:44 +02:00
3wc
487a1ac0a3 Revert accidental change to main images 2021-07-21 23:30:14 +02:00
f999adaf71 Add VMs to the database even with HUB_MODE=mock (#6)
https://todo.cyberia.club/~cyberia/services/83

Co-authored-by: 3wc <3wc.cyberia@doesthisthing.work>
Co-authored-by: forest <forest.n.johnson@gmail.com>
Reviewed-on: #6
Co-authored-by: 3wordchant <3wordchant@noreply.git.autonomic.zone>
Co-committed-by: 3wordchant <3wordchant@noreply.git.autonomic.zone>
2021-07-21 23:26:10 +02:00
3wc
71344fbf4d Merge branch 'yc-templates' into yolocolo 2021-07-21 22:49:17 +02:00
3wc
6f3ecf991d Custom theme fixes 2021-07-21 22:48:54 +02:00
3wc
40aa3bccd3 Load YOLOCOLO templates from a "theme" folder..
..configurable using the THEME env var.

Defaults to normal Capsul theme.
2021-07-21 22:24:25 +02:00
3wc
bcc3f20b27 Tweak table style 2021-07-21 22:12:13 +02:00
3wc
8bd3971545 Improve form styling 2021-07-21 22:12:13 +02:00