Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/glesys/one-click-installers


https://github.com/glesys/one-click-installers

Last synced: 3 days ago
JSON representation

Awesome Lists containing this project

README

        

# GleSYS One-Click Installers [![License: CC0-1.0](https://img.shields.io/badge/License-CC0%201.0-lightgrey.svg)](http://creativecommons.org/publicdomain/zero/1.0/)
> The scripts that powers the one-click installers on GleSYS Cloud (cloud.glesys.com).

## Example

To use a one click installer you need to have access to a project in
GleSYS Cloud. Create a user at https://cloud.glesys.com and have the
information at hand.

When interacting with the API you need to have an API key, this can
either be generated in GleSYS Cloud or you use a temporary obtained
via a login command. Remember to supply the time based one time
password (TOTP) token for 2 factor login protection.

A login request

```shell
curl -X POST --header "content-type: application/json" --data-binary "{
\"username\": \"[email protected]\",
\"password\": \"theSecretSauce\",
\"otp\": \"123456\"
}" https://api.glesys.com/user/login
```

And the response looks something like this

```json
{
"response": {
"status": {
"code": 200,
"timestamp": "2023-08-18T10:10:08+02:00",
"text": "OK"
},
"login": {
"username": "[email protected]",
"apikey": "133bba632da64102b84d4e0d8-883ebdbf-944542f7-93a14555298963865a0afa73",
"accounts": [
{
"account": "cl12345",
"description": null,
"roles": [
"FullAccess"
]
}
],
"customers": [
{
"customernumber": "12345",
"description": null,
"roles": [
"Owner"
]
}
]
},
"debug": {
"input": {
"username": "[email protected]",
"password": "theSecretSauce",
"otp": "123456"
}
}
}
}
```

Take the `apikey` field and use that together with the project key to
form a base64 encoded authorization string, note that the project +
apikey string must not be new line terminated (the -n flag to echo
below).

```shell
authstring=$(echo -n "cl12345:133bba632da64102b84d4e0d8-883ebdbf-944542f7-93a14555298963865a0afa73" | base64)
curl -X POST \
--header "content-type: application/json" \
--header "authorization: Basic $authstring" \
--data-binary "{
\"cloudconfig\": \"runcmd: \\n - wget https://raw.githubusercontent.com/glesys/one-click-installers/master/rancher/install-rancher.sh \\n - chmod +x install-rancher.sh \\n\"
}" https://api.glesys.com/server/previewcloudconfig
```

The `previewcloudconfig` endpoint is used to validate the script input
and won't launch a server based of the command. Use `server/create`
for that. An [expanded example on using cloud config](https://github.com/glesys/api-docs/wiki/Using-cloud-config-to-configure-you-KVM-server) when creating a
server can be found at the API documentation wiki.

## Guidelines

1. The one-click installer should be placed in a folder which is named after a rundown of what it does. Eg. `wordpress-nginx-mariadb`.
2. The folder should include a `cloud-config.yaml`, which should include the cloud-init code. And a `README.md`, which should include a summary of what it does.
3. Include other license information in your `cloud-config.yaml` if the global license isn't applicable for your contribution (see License section below).
4. When your cloud-init is merged, it still has to be integrated in the GleSYS Cloud interface. This doesn't happen automatically.

## Contributing

1. Fork it ()
2. Create your feature branch (`git checkout -b feature/fooBar`)
3. Commit your changes (`git commit -am 'Add some fooBar'`)
4. Push to the branch (`git push origin feature/fooBar`)
5. Create a new Pull Request

## License

GleSYS one click installers is open sourced software licensed under the [CC0 1.0 Universal](https://creativecommons.org/publicdomain/zero/1.0/deed.en). Separate one-click installers may use other licenses and if so, they should be visible in their `cloud-config.yaml`.