Make AMIVAPI Stateless Again (MASA)
Created by: NotSpecial
I'm a little bit annoyed that we still require local files because of the mailing lists, which complicates deployment e.g. with docker swarm or other container solutions, since we somehow need to to share this data between replicas of the API.
Talking to @temparus
I realized that this is furthermore redundant since those files need to
be copied to the mail server over ssh periodically anyways.
Which leads me to the following idea:
Why not use ssh
to directly create/remove the files on the mailserver?
In the config, we can accept username and password (instead of a local path as currently done) and using a subprocess we can easily call ssh to write the file, e.g. like this
Pros:
- Make API instances stateless, simplify deployment
- Immediate Update on Mail Server, not just after another script copies the lists
Cons:
- Slightly longer response time since the file needs to be written over ssh first?
Opinions?
Edit: We could also just use ssh keys, of course