Unattended install?
-
@potemkin_ai This would be an interesting bit - I believe there are imagines on DigitalOcean that can do a basic unattended.
From what you describe, I think the ability to do an "answer-file" type scenario would be best (like how Windows does unattended OOBE installers):
./cloudron-setup --answer-file=unattended.yaml
the syntax could be something like:
basic_settings: default_user: "Admin" default_pass: "password" install_domain: "my.example.com" branding: name: "Cloudron Install" footer: "Cloudron Footer" first_domain: name: "example.com" zone_name: "example.com" ssl_provider: "lets_encrypt" dns_provider: "digitalocean" dns_token: "somethingsomething" matrix_location: "" mastodon_location: "" backups: provider: "digitalocean_spaces" location: "cloudron-backups/backup" endpoint: "https://abc123.digitaloceanspaces.com" format: "tgz" secret_key: "password" run_at: "mon,wed,fri@23:00" retention: "1month" settings: cloudron_account: email: "username@example.com" time_zone: "America/New York" language: "english"
-
Great you brought this up. We had a few attempts for this in the past, mostly around cloud-init scripts, but due to lack of ongoing customer interest, we never really followed through with this. So currently there is no support for such setup configs, but due to the Cloudron REST api one has to fallback to custom scripts for the moment.
-
A while ago, we wrote https://git.cloudron.io/cloudron/cloudron-sysadmin which is basically an unattended install. That script most likely won't work / is obsolete.
If there's interest, I can write a quick doc on how to write this script. It's really just a bunch of API calls to automate everything. Fee free to automate in the language of your choice.
-
@robi We also tinkered with automating it in cloudron.io, but that requires the user to give us ssh access to the server (atleast, for the duration of deployment) to setup stuff.
Would that be interesting? Login to Cloudron.io, add an IP address and some deployment parameters and it will go deploy. Underneath, it's probably only web-ifying the deploy script.
-
@girish I don't really like the idea of sharing my SSH key to anyone; nor I like the fact I need to SSH to the new server, but it's really not that much a problem.
As @nebulon mentioned, I would rather prefer to call it through cloud-init, but every provider is different in this regards, so it sounds like a headache.
I also feel that Cloudron is more for SMB, mostly for small business - and I doubt small business would install hundres of Cloudrons - please, correct me if I'm wrong (I would be also happy for you to be wrong!).
-
@potemkin_ai yes, there is no use case to deploy 100s of cloudrons. For the big providers, we have 1-click images but those don't require automation of the configuration.
-
@brutalbirdie thank you very much, appreciate that!
The need is not big enough, at least not for now, let me revert back to you, if it will appear to be so -
@BrutalBirdie thank you again for your offer.
I'm not yet familiar with CloudRon API and I'm considering creating a manage / hosted solution with cloudron at it's heart - could you probably help me by pointing out some ready to use scripts or like Insomnia pre-sets, for a quick-start? -
@potemkin_ai not really.
Best way to get started would be install postman and import the api and just play around.
https://docs.cloudron.io/api.html -
@potemkin_ai
Another thing that is also very useful for understanding how to use the api, or find out any missing things in the doc.
You can open your browser debugger network tab and click any button in the cloudron dashboard and click a button.
Then you can see the API calls. Also useful for copy-paste API JSON bodys.Example Question you could ask your self - How do I disable an app auto backup?
Then you could copy the
POST
as cURL and see you self:curl 'https://my.DOMAIN.TLD/api/v1/apps/0c81e720-ab79-414e-9e6d-dbdbbaab6e30/configure/automatic_backup' -X POST -H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:103.0) Gecko/20100101 Firefox/103.0' -H 'Accept: application/json, text/plain, */*' -H 'Accept-Language: en,en-US;q=0.7,de;q=0.3' -H 'Accept-Encoding: gzip, deflate, br' -H 'Referer: https://my.DOMAIN.TLD/' -H 'Authorization: Bearer REDACTED' -H 'Content-Type: application/json;charset=utf-8' -H 'Origin: https://my.DOMAIN.TLD' -H 'Connection: keep-alive' -H 'Sec-Fetch-Dest: empty' -H 'Sec-Fetch-Mode: cors' -H 'Sec-Fetch-Site: same-origin' -H 'TE: trailers' --data-raw '{"enable":false}'
The last part
--data-raw
is the body, if you switch thefalse
totrue
and send this the auto backup for the app is enabled again.Doc to that API call: https://docs.cloudron.io/api.html#tag/Apps/paths/~1apps~1{appid}~1configure~1automatic_backup/post
But now you also know a way to figure it out yourself.
-
@BrutalBirdie thank you very much!!
-