https://github.com/ryot4/nocloud-ds
A HTTP server for cloud-init NoCloud datasource
https://github.com/ryot4/nocloud-ds
cloud-init
Last synced: 6 months ago
JSON representation
A HTTP server for cloud-init NoCloud datasource
- Host: GitHub
- URL: https://github.com/ryot4/nocloud-ds
- Owner: ryot4
- License: mit
- Created: 2021-03-20T12:56:15.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2025-08-08T16:38:18.000Z (11 months ago)
- Last Synced: 2025-08-08T18:33:09.425Z (11 months ago)
- Topics: cloud-init
- Language: Go
- Homepage:
- Size: 13.7 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nocloud-ds
nocloud-ds is a HTTP server for [NoCloud datasource of cloud-init](https://cloudinit.readthedocs.io/en/latest/topics/datasources/nocloud.html).
It can serve different instance data based on client's IP address.
## Installation
### Binary releases (linux/amd64 only for now)
See the [releases page](https://github.com/ryot4/nocloud-ds/releases).
Download and extract the archive, and then put the binary into the directory listed in `$PATH`.
### Build from source
Make sure [Go distribution is installed](https://golang.org/doc/install), and then run `go install`.
$ go install github.com/ryot4/nocloud-ds@latest
## Usage
At first, prepare the datasource directory and instance data to serve.
You can serve different data for different clients by creating directories named after their IP addresses as in the following example.
datasource/
├── 192.168.1.23/ # Data for 192.168.1.23 (no vendor-data)
│ ├── meta-data
│ ├── user-data
│ └── network-config
├── meta-data # Data for other clients (no network-config)
├── user-data
└── vendor-data
Then, run `nocloud-ds`. You can specify the listen address and the path to the datasource directory.
$ nocloud-ds -l address:port -d /path/to/datasource
You can also pass parameters with environment variables.
$ NOCLOUD_DS_LISTEN_ADDRESS=address:port NOCLOUD_DS_DIR=/path/to/datasource nocloud-ds
## Running behind a reverse proxy
If `X-Forwarded-For` header is set in the request, the server uses the client address in the header to find instance data.