edgee-cloud / edgee

The full-stack edge platform for your edge oriented applications.
https://www.edgee.cloud
Apache License 2.0
37 stars 6 forks source link

Auto-generate `edgee.toml` Config File on First Launch #47

Open SachaMorard opened 2 months ago

SachaMorard commented 2 months ago

Is your feature request related to a problem? Please describe.

Currently, if a user launches ./edgee without an existing edgee.toml (or edgee.yaml) configuration file, the system exits without guidance. This can be confusing for new users. Instead, we should prompt the user to generate a default configuration file (edgee.toml), guiding them through the setup process interactively.

Proposed Solution

When ./edgee is launched and no configuration file is detected, the application should prompt the user with a series of questions, enabling them to easily set up their basic configuration. After gathering the necessary inputs, the system should auto-generate the edgee.toml file with the following structure:

[log]
level = "info"

[http]
address = "0.0.0.0:80"
force_https = false

[https]
address = "0.0.0.0:443"
cert = "certs/fullchain.pem"
key = "certs/privkey.pem"

[[routing]]
domain = "demo.edgee.dev"

[[routing.backends]]
name = "demo"
default = true
address = "demo-edgee.vercel.app"
enable_ssl = true

Requirements:

Benefits:

Additional Context:

This prompt-based config generation will ensure that users can get started quickly and will be especially useful for those unfamiliar with Edgee’s configuration syntax. The system should also create the config file in the current directory where ./edgee is launched.

spantheslayer commented 1 month ago

Hi @SachaMorard , I started working on this issue.