capsul.org webapp
4
fork

Configure Feed

Select the types of activity you want to include in your feed.

doc, detail page fixes + workaround for rocky

+123 -85
+29 -27
capsulflask/shell_scripts/get-guest-agent.sh
··· 15 15 16 16 qemuAgentCommandOutput="no-guest-agent-socket" 17 17 if virsh dumpxml "$vmname" | grep -q guest_agent ; then 18 - isAcpidRunning='{"execute": "guest-exec", "arguments":'"$pidof_command_json}" 19 - qemuAgentCommandOutput="$( { virsh qemu-agent-command "$vmname" --cmd "$isAcpidRunning" || printf '%s' 'no-qemu-guest-agent'; } | tr -d '\n' )" 20 - 18 + qemuAgentCommandOutput="$( { virsh qemu-agent-command "$vmname" --cmd '{"execute": "guest-info"}' || printf '%s' 'no-qemu-guest-agent'; } | tr -d '\n' )" 21 19 if [ "$qemuAgentCommandOutput" != "no-qemu-guest-agent" ] ; then 22 - # {"return":{"pid":2967}} 23 - pidInsideVm="$(echo "$qemuAgentCommandOutput" | jq -r '.return.pid')" 24 - qemuAgentCommandOutput="error" 25 - if echo "$pidInsideVm" | grep -vqE '^[0-9]+$'; then 26 - echo "pidInsideVm: $pidInsideVm WTF!!?!?" 27 - exit 1 28 - fi 29 - getStatusOfProcessInsideVm='{"execute": "guest-exec-status", "arguments":{"pid":'"$pidInsideVm"'}}' 30 - exited='false' 31 - tries=0 32 - while [ "$exited" = "false" ] && [ "$tries" -lt 10 ] ; do 33 - tries=$((tries+1)) 34 - sleep 0.1 35 - processStatusInfo="$( virsh qemu-agent-command "$vmname" --cmd "$getStatusOfProcessInsideVm" )" 36 - # {"return":{"exitcode":0,"out-data":"MTgwNAo=","exited":true}} 37 - exited="$(echo "$processStatusInfo" | jq -r '.return.exited')" 38 - if [ "$exited" = "true" ] ; then 39 - exitCode="$(echo "$processStatusInfo" | jq -r '.return.exitcode')" 40 - if [ "$exitCode" = "0" ] ; then 41 - qemuAgentCommandOutput="ok" 42 - else 43 - qemuAgentCommandOutput="no-acpid" 44 - fi 20 + isAcpidRunning='{"execute": "guest-exec", "arguments":'"$pidof_command_json}" 21 + qemuAgentCommandOutput="$( { virsh qemu-agent-command "$vmname" --cmd "$isAcpidRunning" || printf '%s' 'no-acpid'; } | tr -d '\n' )" 22 + if [ "$qemuAgentCommandOutput" != "no-acpid" ] ; then 23 + # {"return":{"pid":2967}} 24 + pidInsideVm="$(echo "$qemuAgentCommandOutput" | jq -r '.return.pid')" 25 + qemuAgentCommandOutput="error" 26 + if echo "$pidInsideVm" | grep -vqE '^[0-9]+$'; then 27 + echo "pidInsideVm: $pidInsideVm WTF!!?!?" 28 + exit 1 45 29 fi 46 - done 30 + getStatusOfProcessInsideVm='{"execute": "guest-exec-status", "arguments":{"pid":'"$pidInsideVm"'}}' 31 + exited='false' 32 + tries=0 33 + while [ "$exited" = "false" ] && [ "$tries" -lt 10 ] ; do 34 + tries=$((tries+1)) 35 + sleep 0.1 36 + processStatusInfo="$( virsh qemu-agent-command "$vmname" --cmd "$getStatusOfProcessInsideVm" )" 37 + # {"return":{"exitcode":0,"out-data":"MTgwNAo=","exited":true}} 38 + exited="$(echo "$processStatusInfo" | jq -r '.return.exited')" 39 + if [ "$exited" = "true" ] ; then 40 + exitCode="$(echo "$processStatusInfo" | jq -r '.return.exitcode')" 41 + if [ "$exitCode" = "0" ] ; then 42 + qemuAgentCommandOutput="ok" 43 + else 44 + qemuAgentCommandOutput="no-acpid" 45 + fi 46 + fi 47 + done 48 + fi 47 49 fi 48 50 fi 49 51
+6
capsulflask/spoke_model.py
··· 179 179 acpid = True 180 180 if result not in ['ok', 'no-acpid', 'no-qemu-guest-agent', 'no-guest-agent-socket']: 181 181 raise ValueError(result) 182 + 183 + # SELinux is enabled by default on rocky linux, and guest agent exec is disabled, which prevents us from detecting 184 + # the presence of acpid. So for rocky 9+, just assume that acpid is running... 185 + if 'rockylinux' in os_image_id and os_image_id != "rockylinux8": 186 + acpid = True 187 + 182 188 except: 183 189 current_app.logger.warning(f""" 184 190 failed to get-guest-agent {id} at {ipaddr}:
+1 -2
capsulflask/templates/capsul-detail.html
··· 142 142 <span id="dollars_per_month">${{ vm['dollars_per_month'] }}</span> 143 143 </div> 144 144 <div class="row justify-start"> 145 - <label class="align" for="ipv4">IPv4 Address</label> 146 - <span id="ipv4">{{ vm['ipv4'] }}</span> 145 + <label class="align" for="ipv4">IPv4 Address</label>nano /etc/sysconfig/qemu-ga<span id="ipv4">{{ vm['ipv4'] }}</span> 147 146 </div> 148 147 <div class="row justify-start"> 149 148 <label class="align" for="os_description">Operating System</label>
+78 -56
capsulflask/templates/changelog.html
··· 3 3 {% block title %}Changelog{% endblock %} 4 4 5 5 {% block content %} 6 - <div class="row full-margin"><h1>CHANGELOG</h1></div> 6 + <div class="row full-margin"> 7 + <h1>CHANGELOG</h1> 8 + </div> 7 9 {% endblock %} 8 10 {% block subcontent %} 9 11 <p> 10 - <ul> 11 - <li>2025-04-22: os updates</li> 12 + <ul> 13 + <li>2025-04-22: os updates + backup enabled by default 12 14 <ul> 13 15 <li>+Alpine Linux 3.21</li> 14 16 <li>+OpenBSD 7.1</li> 15 17 <li>+Rocky Linux 9</li> 16 18 <li>+Updated every other image</li> 19 + <li>Backup should now be enabled by default on all images except: 20 + <ul> 21 + <li>Guix</li> 22 + <li>OpenBSD</li> 23 + </ul> 24 + </li> 17 25 </ul> 26 + </li> 27 + <li>2025-04-21: BtcPay Server upgraded, bitcoin payments working again</li> 18 28 <li>2025-01-23: Backups are so back 19 29 <ul> 20 30 <li>Well, sort of.</li> 21 31 <li>Some assembly required: our VM images don't have all of the required bits and bobs installed by default.</li> 22 32 <li>For information on how to set up backups, see: <a href="/backup-instructions">backup instructions</a> </li> 23 - <li>While you should see a list of avaliable snapshots on the capsul detail page, restoring to a snapshot is still a manual effort on our part. Technically we create a new clone of the capsul from the existing snapshot. Contact support if you need to restore to a snapshot.</li> 33 + <li>While you should see a list of avaliable snapshots on the capsul detail page, restoring to a snapshot is still 34 + a manual effort on our part. Technically we create a new clone of the capsul from the existing snapshot. Contact 35 + support if you need to restore to a snapshot.</li> 24 36 </ul> 25 37 </li> 26 38 <li>2024-12-29: NixOS 24.11 Image 27 39 <ul> 28 - <li>Finally updated our NixOS image! Thanks to symys for help with this!</li> 40 + <li>Finally updated our NixOS image! Thanks to symys for help with this!</li> 29 41 </ul> 30 42 </li> 31 43 <li>2024-12-09: Add Bot Deterrent 32 44 <ul> 33 - <li>We had some issues with web form spam bots hurting our email server's reputation by sending login requests to people who did not ask for them.</li> 34 - <li>The Capsul login/registration page will now attempt to calculate a small Proof of Work using the <code>scrypt</code> hash function. 45 + <li>We had some issues with web form spam bots hurting our email server's reputation by sending login requests to 46 + people who did not ask for them.</li> 47 + <li>The Capsul login/registration page will now attempt to calculate a small Proof of Work using the 48 + <code>scrypt</code> hash function. 35 49 <ul> 36 50 <li>This is 100% optional, not required to log in.</li> 37 - <li>This uses WebWorkers and WebAssembly, so it will only work if your browser has those features turned on.</li> 38 - <li>This uses the <a href="https://git.sequentialread.com/forest/pow-bot-deterrent" target="_blank">💥PoW! Bot Deterrent</a> library.</li> 51 + <li>This uses WebWorkers and WebAssembly, so it will only work if your browser has those features turned on. 52 + </li> 53 + <li>This uses the <a href="https://git.sequentialread.com/forest/pow-bot-deterrent" target="_blank">💥PoW! Bot 54 + Deterrent</a> library.</li> 39 55 </ul> 40 56 </li> 41 57 <li>If you disabled JavaScript on your browser or otherwise submit the form without the PoW: 42 58 <ul> 43 59 <li>If you've logged in before, it will let you pass.</li> 44 - <li>If you're creating a new account, the system will ask you to send us an email. Once we recieve an email from the address you were trying to log in from, you will be allowed to proceed.</li> 60 + <li>If you're creating a new account, the system will ask you to send us an email. Once we recieve an email 61 + from the address you were trying to log in from, you will be allowed to proceed.</li> 45 62 </ul> 46 63 </li> 47 64 </ul> 48 65 </li> 49 66 <li>2024-12-06: Email deliverability now surfaces in the UI 50 67 <ul> 51 - <li>If your email server rejects emails from us for some reason, you should see an error message when trying to log in.</li> 68 + <li>If your email server rejects emails from us for some reason, you should see an error message when trying to 69 + log in.</li> 52 70 </ul> 53 71 </li> 54 72 <li>2024-02-11: EPIC emergency server migration 🤯 55 73 <ul> 56 74 <li>Baikal (our old server) could no longer handle the load, was constantly crashing</li> 57 75 <li>Rathouse (our NEW server) was already racked up and ready to go</li> 58 - <li>We wanted to wait until we could get Virtual Machine disk snapshots working on the new system before we migrated... but real life had other plans for us</li> 76 + <li>We wanted to wait until we could get Virtual Machine disk snapshots working on the new system before we 77 + migrated... but real life had other plans for us</li> 59 78 <li>We no longer have automatic backups. Sorry. We are working on it.</li> 60 79 <li>On the bright side, the new server is faster, has much more reliable disks, 61 80 and they are configured in a way that should give you better performance.</li> 62 81 <li>Capsul was fully down for about a day and a half.</li> 63 82 </ul> 64 - </li> 65 - <li>2022-07-18: Add NixOS support</li> 66 - <li>2022-02-11: Added the why-cant-i-add-ssh-key-to-existing-capsul page 67 - </li> 68 - <li>2022-02-09: Introduced a distinction between "short term" and "long term" capsuls 83 + </li> 84 + <li>2022-07-18: Add NixOS support</li> 85 + <li>2022-02-11: Added the why-cant-i-add-ssh-key-to-existing-capsul page 86 + </li> 87 + <li>2022-02-09: Introduced a distinction between "short term" and "long term" capsuls 69 88 <ul> 70 - <li>You can now create a capsul even if your account doesn't have the funds required to keep it running for a month</li> 89 + <li>You can now create a capsul even if your account doesn't have the funds required to keep it running for a 90 + month</li> 71 91 <li>Short term capsuls will be deleted without warning as soon as your account reaches $0</li> 72 - <li>As always, you will recieve multiple warning emails as your account runs out of funds before any long term capsuls will be deleted</li> 92 + <li>As always, you will recieve multiple warning emails as your account runs out of funds before any long term 93 + capsuls will be deleted</li> 73 94 </ul> 74 - </li> 75 - <li>2021-12-17: OpenBSD, Debian, Alpine Linux, Ubuntu and Arch Linux images were updated to the latest version 95 + </li> 96 + <li>2021-12-17: OpenBSD, Debian, Alpine Linux, Ubuntu and Arch Linux images were updated to the latest version 76 97 <ul> 77 98 <li><b>NEW!</b> Rocky Linux 8 image is avaliable to launch</li> 78 99 </ul> 79 - </li> 80 - <li>2021-12-16: The BTCPay server is ressurected with a brand new motherboard, and all blockchains are synced!</li> 81 - <li>2021-12-16: Baikal host operating system upgraded from Debian 10 (buster) to Debian 11 (bullseye) 100 + </li> 101 + <li>2021-12-16: The BTCPay server is ressurected with a brand new motherboard, and all blockchains are synced!</li> 102 + <li>2021-12-16: Baikal host operating system upgraded from Debian 10 (buster) to Debian 11 (bullseye) 82 103 <ul> 83 104 <li>This updated QEMU to the point where the virtio-blk storage driver supports trim/discard operations, 84 105 which should save us disk space while improving capsul storage performance</li> 85 106 </ul> 86 - </li> 87 - <li>2021-12-10: On premesis Baikal maintenance at CyberWurx in Atlanta, Georgia 88 - <ul> 89 - <li> 107 + </li> 108 + <li>2021-12-10: On premesis Baikal maintenance at CyberWurx in Atlanta, Georgia 109 + <ul> 110 + <li> 90 111 <a href="https://picopublish.sequentialread.com/files/silly-nvme-bracket.jpeg"> 91 - Finally installed our last NVME drive with help from a flexible ADT-link PCI-e adapter and a cursed 3d-printed bracket 112 + Finally installed our last NVME drive with help from a flexible ADT-link PCI-e adapter and a cursed 3d-printed 113 + bracket 92 114 </a> 93 115 <ul> 94 116 <li>Full redundancy achieved on our disks! Now disks can fail without impacting currently running capsuls</li> ··· 99 121 Replaced SSDs that were wearing out 100 122 </a> 101 123 <ul> 102 - <li>Disk redundancy was tested & validated by ripping a disk out while the server is running</li> 103 - </ul> 124 + <li>Disk redundancy was tested & validated by ripping a disk out while the server is running</li> 125 + </ul> 104 126 </li> 105 - </ul> 106 - </li> 107 - <li>2021-08-28: The BTCPay server randomly died and stopped booting. Cryptocurrency payments were disabled</li> 108 - <li>2021-03-21: Baikal host machine recieved regular operating system updates and had additional RAM installed</li> 109 - <li>2021-02-17: Added support for capsul states: starting, running, stopped, etc</li> 110 - <li>2021-02-16: Web Application downtime to deploy initial multi-host support</li> 111 - <li>2021-01-19: Add Alpine Linux 3.13 support</li> 112 - <li>2021-01-14: Add Guix System 1.2.0 support, thanks to jgart, ryanprior, and raghavgururajan</li> 113 - <li>2020-10-29: Add OpenBSD 6.8 and Alpine 3.12 support, remove previous versions</li> 114 - <li>2020-10-23: Automate VM build system (backend)</li> 115 - <li>2020-10-22: Re-worked FAQ, added more supporting docs</li> 116 - <li>2020-05-16: Beta version of new Capsul web application</li> 117 - <li>2020-05-04: Simplified payment page</li> 118 - <li>2020-04-26: Support link added</li> 119 - <li>2020-04-17: OpenBSD support added</li> 120 - <li>2020-03-25: Network limits made public</li> 121 - <li>2020-03-22: Alpine support added</li> 122 - <li>2020-03-10: Capsul site goes live</li> 123 - <li>2020-03-10: CVM name changed to Capsul</li> 124 - <li>2020-03-07: CVM goes live</li> 125 - <li>2020-02-26: Re-prepping docs</li> 126 - <li>2020-01-31: Prepping docs</li> 127 - <li>2020-01-30: Baikal ownership transferred to Cyberia Computer Club</li> 128 - </ul> 127 + </ul> 128 + </li> 129 + <li>2021-08-28: The BTCPay server randomly died and stopped booting. Cryptocurrency payments were disabled</li> 130 + <li>2021-03-21: Baikal host machine recieved regular operating system updates and had additional RAM installed</li> 131 + <li>2021-02-17: Added support for capsul states: starting, running, stopped, etc</li> 132 + <li>2021-02-16: Web Application downtime to deploy initial multi-host support</li> 133 + <li>2021-01-19: Add Alpine Linux 3.13 support</li> 134 + <li>2021-01-14: Add Guix System 1.2.0 support, thanks to jgart, ryanprior, and raghavgururajan</li> 135 + <li>2020-10-29: Add OpenBSD 6.8 and Alpine 3.12 support, remove previous versions</li> 136 + <li>2020-10-23: Automate VM build system (backend)</li> 137 + <li>2020-10-22: Re-worked FAQ, added more supporting docs</li> 138 + <li>2020-05-16: Beta version of new Capsul web application</li> 139 + <li>2020-05-04: Simplified payment page</li> 140 + <li>2020-04-26: Support link added</li> 141 + <li>2020-04-17: OpenBSD support added</li> 142 + <li>2020-03-25: Network limits made public</li> 143 + <li>2020-03-22: Alpine support added</li> 144 + <li>2020-03-10: Capsul site goes live</li> 145 + <li>2020-03-10: CVM name changed to Capsul</li> 146 + <li>2020-03-07: CVM goes live</li> 147 + <li>2020-02-26: Re-prepping docs</li> 148 + <li>2020-01-31: Prepping docs</li> 149 + <li>2020-01-30: Baikal ownership transferred to Cyberia Computer Club</li> 150 + </ul> 129 151 </p> 130 152 {% endblock %} 131 153 132 - {% block pagesource %}/templates/changelog.html{% endblock %} 154 + {% block pagesource %}/templates/changelog.html{% endblock %}
+9
docs/deployment.md
··· 24 24 ``` 25 25 #cloud-config 26 26 preserve_hostname: true 27 + packages: 28 + - qemu-guest-agent 29 + - acpid 30 + runcmd: 31 + - [ 'systemctl', 'daemon-reload' ] 32 + - [ 'systemctl', 'enable', 'qemu-guest-agent' ] 33 + - [ 'systemctl', 'enable', 'acpid' ] 34 + - [ 'systemctl', 'start', '--no-block', 'qemu-guest-agent' ] 35 + - [ 'systemctl', 'start', '--no-block', 'acpid' ] 27 36 users: 28 37 - name: cyberian 29 38 groups: wheel