-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from grahamgilbert/emails
Emails
- Loading branch information
Showing
11 changed files
with
208 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Using Docker | ||
|
||
## Basic usage | ||
|
||
``` bash | ||
docker run -d --name="Crypt" \ | ||
--restart="always" \ | ||
-v /somewhere/on/the/host:/home/docker/crypt/keyset \ | ||
-v /somewhere/else/on/the/host:/home/docker/crypt/crypt.db \ | ||
-p 8000:8000 \ | ||
macadmins/crypt-server | ||
``` | ||
|
||
The secrets are encrypted, with the encryption keys stored at ``/home/docker/crypt/keyset``. You should back this up as the keys are not recoverable without them. | ||
|
||
## Emails | ||
|
||
If you would like Crypt to send emails when keys are requested and approved, you should set the following environment variables: | ||
|
||
``` | ||
docker run -d --name="Crypt" \ | ||
--restart="always" \ | ||
-v /somewhere/on/the/host:/home/docker/crypt/keyset \ | ||
-v /somewhere/else/on/the/host:/home/docker/crypt/crypt.db \ | ||
-p 8000:8000 \ | ||
-e DOCKER_CRYPT_EMAIL_HOST='mail.yourdomain.com' \ | ||
-e DOCKER_CRYPT_EMAIL_PORT='25' \ | ||
-e DOCKER_CRYPT_EMAIL_USER='youruser' \ | ||
-e DOCKER_CRYPT_EMAIL_PASSWORD='yourpassword' \ | ||
-e DOCKER_CRYPT_HOST_NAME='https://crypt.myorg.com' \ | ||
macadmins/crypt-server | ||
``` | ||
|
||
If your SMTP server doesn't need a setting (username and password for example), you should omit it. The `DOCKER_CRYPT_HOST_NAME` setting should be the hostname of your server - this will be used to generate links in emails. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from datetime import datetime | ||
import asyncore | ||
from smtpd import SMTPServer | ||
|
||
class EmlServer(SMTPServer): | ||
no = 0 | ||
def process_message(self, peer, mailfrom, rcpttos, data): | ||
filename = '%s-%d.eml' % (datetime.now().strftime('%Y%m%d%H%M%S'), | ||
self.no) | ||
f = open(filename, 'w') | ||
f.write(data) | ||
f.close | ||
print '%s saved.' % filename | ||
self.no += 1 | ||
|
||
|
||
def run(): | ||
foo = EmlServer(('localhost', 25), None) | ||
try: | ||
asyncore.loop() | ||
except KeyboardInterrupt: | ||
pass | ||
|
||
|
||
if __name__ == '__main__': | ||
run() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.