diff --git a/README.md b/README.md index 877c5c6..aeb8918 100644 --- a/README.md +++ b/README.md @@ -2,15 +2,26 @@ A swarm of dreams. -## Proof Of Concept +## first.py -- [x] List apps from an `app.json` (points to https://git.autonomic.zone/compose-stacks) -- [x] Clone selected app template and parse configuration for inputs (env vars and secrets) -- [ ] Generate a form so those values can be filled out and allow it to be saved -- [ ] Save the form inputs to a `db.json` -- [ ] Deploy an applicaiton to a local swarm (assumes access to local docker socket) -- [ ] Create an "edit app" page where the `db.json` is re-called and can be updated -- [ ] Make sure re-deploy works (taking care of updating secret and app versions) +Ideas contained within... + +- List apps from an `app.json` (points to https://git.autonomic.zone/compose-stacks) +- Clone selected app template and parse configuration for inputs (env vars and secrets) +- Generate a form so those values can be filled out and allow it to be saved +- Save the form inputs to a `db.json` (as a start) +- Deploy an applicaiton to a local swarm (assumes access to local docker socket) +- Create an "edit app" page where the `db.json` is re-called and can be updated +- Make sure re-deploy works (taking care of updating secret and app versions) + +## second.py + +More ideas... + +- Don't try to be smart with the auto-generation, hard-code everything. We + maintain the app template (`compose.yml`) and this code anyway, so we just + need to be aware of each other and keep in sync. This would optimise for + trust and collaboration and not "smart" code. ### Development diff --git a/second.py b/second.py new file mode 100644 index 0000000..2aadaf2 --- /dev/null +++ b/second.py @@ -0,0 +1,28 @@ +"""Less flashy version. Mord hard-coding.""" + +from pathlib import Path + +from flask import Flask, render_template +from ruamel.yaml import YAML + +app = Flask(__name__) + +# Note(decentral1se): load from env vars at some point +app.secret_key = b'_5#y2L"F4Q8z\n\xec]/' + +yaml = YAML() + +# Note(decentral1se): paths needs to change dependening +# on deployment mode ./data in dev, /data in production +DATA_DIR = Path("./data") + +STATIC_DIR = Path(app.root_path).absolute() / "static" + + +@app.route("/") +def home(): + pass + + +if __name__ == "__main__": + app.run(debug=True, host="0.0.0.0")