diff --git a/LICENSE b/LICENSE index ca7a6c2..20105d7 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2019 Monogramm +Copyright (c) 2020 Monogramm Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index a99489a..bbe2107 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ -# autodiscover-email-settings +# ![Autodiscover](icon.svg) Autodiscover Email Settings [![Build Status](https://travis-ci.org/Monogramm/autodiscover-email-settings.svg)](https://travis-ci.org/Monogramm/autodiscover-email-settings) -[![Codacy Badge](https://api.codacy.com/project/badge/Grade/f471992f0aa348b791c9ed17ccea344d)](https://www.codacy.com/gh/Monogramm/autodiscover-email-settings?utm_source=github.com&utm_medium=referral&utm_content=Monogramm/autodiscover-email-settings&utm_campaign=Badge_Grade) +[![Codacy Badge](https://api.codacy.com/project/badge/Grade/f471992f0aa348b791c9ed17ccea344d)](https://www.codacy.com/gh/Monogramm/autodiscover-email-settings?utm_source=github.com&utm_medium=referral&utm_content=Monogramm/autodiscover-email-settings&utm_campaign=Badge_Grade) [![Docker Pulls](https://img.shields.io/docker/pulls/monogramm/autodiscover-email-settings.svg)](https://hub.docker.com/r/monogramm/autodiscover-email-settings/) [![](https://images.microbadger.com/badges/version/monogramm/autodiscover-email-settings.svg)](https://microbadger.com/images/monogramm/autodiscover-email-settings) [![Docker layers](https://images.microbadger.com/badges/image/monogramm/autodiscover-email-settings.svg)](https://microbadger.com/images/monogramm/autodiscover-email-settings) @@ -12,7 +12,7 @@ It provides IMAP/SMTP/LDAP Autodiscover capabilities on Microsoft Outlook/Apple **A simple support page is also available at the root of the autodiscover domain.** -### DNS settings +## DNS settings autoconfig IN A {{$AUTODISCOVER_IP}} autodiscover IN A {{$AUTODISCOVER_IP}} @@ -39,12 +39,12 @@ Replace above variables with data according to this table * * * -### Usage +## Usage [traefik](https://github.com/containous/traefik) can proxy your containers on docker, on docker swarm, and on a wide range of orchestrators. You can also achieve this with another proxy like [Nginx](https://www.nginx.com/) for instance. -#### docker +### docker ```yaml version: '2' @@ -79,7 +79,7 @@ services: - "traefik.frontend.rule=Host:autoconfig.example.com,autodiscover.example.com" ``` -#### docker swarm +### docker swarm ```yaml version: '3' @@ -116,19 +116,19 @@ services: - "traefik.frontend.rule=Host:autoconfig.example.com,autodiscover.example.com" ``` -### Credits +## Credits Inspired from , but without the few restrictions mentioned in the original project notes and with a simple support page to allow manual setup and iOS profile download. The original project was inspired from , but with instead of to allow a much lighter ([![](https://images.microbadger.com/badges/image/weboaks/autodiscover-email-settings.svg)](https://microbadger.com/images/weboaks/autodiscover-email-settings)) image based of node on alpine instead of apache on debian ([![](https://images.microbadger.com/badges/image/jsmitsnl/docker-email-autodiscover.svg)](https://microbadger.com/images/jsmitsnl/docker-email-autodiscover)) -### Notes +## Notes The above autoconfiguration methods assume the following: - If username does not contain `@`, full email address will be generated based on domain settings -### Links +## Links - Mozilla [Autoconfig configuration](https://developer.mozilla.org/en-US/docs/Mozilla/Thunderbird/Autoconfiguration/FileFormat/HowTo) @@ -140,6 +140,6 @@ The above autoconfiguration methods assume the following: - [Bootstrap](https://getbootstrap.com/), [jQuery](https://jquery.com/) and [Popper.js](https://popper.js.org/) used for default support page -### License +## License This project is distributed under the [MIT License](LICENSE) diff --git a/icon.svg b/icon.svg new file mode 100644 index 0000000..bb03c41 --- /dev/null +++ b/icon.svg @@ -0,0 +1,85 @@ + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + diff --git a/index.js b/index.js index c73da60..e20178a 100644 --- a/index.js +++ b/index.js @@ -1,4 +1,4 @@ -'use strict'; +"use strict"; const path = require("path"); const app = require("koa")(); @@ -40,7 +40,7 @@ function *autodiscover() { email = ""; username = ""; domain = settings.domain; - } else if ( ~email.indexOf("@") ) { + } else if ( ~email.content.indexOf("@") ) { email = email.content; username = email.split("@")[0]; domain = email.split("@")[1]; @@ -88,7 +88,7 @@ router.get("/email.mobileconfig", function *autoconfig() { let username; let domain; - if (~email.indexOf("@") ) { + if ( ~email.indexOf("@") ) { username = email.split("@")[0]; domain = email.split("@")[1]; } else { @@ -122,6 +122,10 @@ router.get("/", function *index() { yield this.render("index.html"); }); +router.get("/favicon.ico", function *icon() { + yield this.render("favicon.ico"); +}); + app.context.render = swig({ root: path.join(__dirname, "views"), autoescape: true, diff --git a/package.json b/package.json index 1a357fb..7b6026a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "autodiscover-email-settings", - "version": "1.2.2", + "version": "1.3.0", "description": "Provides IMAP/SMTP/LDAP Autodiscover capabilities on Microsoft Outlook/Apple Mail, Autoconfig capabilities for Thunderbird, and Configuration Profiles for iOS/Apple Mail.", "main": "index.js", "scripts": { diff --git a/views/favicon.ico b/views/favicon.ico new file mode 100644 index 0000000..fb34dda Binary files /dev/null and b/views/favicon.ico differ diff --git a/views/index.html b/views/index.html index 45fd1ca..c5a282b 100644 --- a/views/index.html +++ b/views/index.html @@ -10,9 +10,12 @@ {{info.name}} + + - +