
Ask HN: Automate adding nginx and ufw allow rules via a restful API? - oneweekwonder
I feel this is a problem that should be solved somewhere already, without using something big like openstack.<p>eg. You can only connect to `myapp.com:443` and call `&#x2F;set&#x2F;ip-address` with a `auth` token in the header and ip in the body. This data get dumped into a sql table and a nginx and ufw allow rules update will take place, currently with a ugly py hack:<p>system.os(&#x27;ufw allow proto tcp from {} to any port 444&#x27;.format(ip))<p>system.os(&#x27;echo &quot;allow {}&quot; &gt;&gt; &#x2F;etc&#x2F;nginx&#x2F;sites-enabled&#x2F;include_allow.conf &amp;&amp; service nginx relead&#x27;.format(ip))<p>I will be running another nginx `server` listening on `port 444 ssl;` that will `include &#x2F;etc&#x2F;nginx&#x2F;sites-enabled&#x2F;include_allow.conf`<p>The idea, problem and current solution is introduced here:<p>https:&#x2F;&#x2F;gist.github.com&#x2F;Morabaraba&#x2F;06403358de009ede60e1d842c48100b7<p>I asked &#x2F;r&#x2F;flask(10 hours ago) as well:<p>https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;flask&#x2F;comments&#x2F;6cvo4j&#x2F;af_swagger_api_connexion_behind_nginxusing&#x2F;<p>Any insight or nudge in the right direction would be appreciated.
======
oneweekwonder
In a attempt to add a anchor to the links:

The idea, problem and current solution is introduced here:

[https://gist.github.com/Morabaraba/06403358de009ede60e1d842c...](https://gist.github.com/Morabaraba/06403358de009ede60e1d842c48100b7)

I asked /r/flask(10 hours ago) as well:

[https://www.reddit.com/r/flask/comments/6cvo4j/af_swagger_ap...](https://www.reddit.com/r/flask/comments/6cvo4j/af_swagger_api_connexion_behind_nginxusing/)

Any insight or nudge in the right direction would be appreciated.

