ksylvan / docker-mail-server

Ansible playbooks to deploy a full featured mail server stack using Docker.
50 stars 11 forks source link

added opencart under store. to deployment #7

Closed ghost closed 6 years ago

ghost commented 6 years ago

here my attempt to add opencart under store.domain.tld - please review

ksylvan commented 6 years ago

I added some comments. Have you tested this?

You can do make save (save your current setup), then make reset

Then you can spin up a VPS, set up your control host's /etc/hosts to have something like:

test.dev mail.test.dev www.test.dev postfixadmin.test.dev webmail.test.dev spam.test.dev 123.45.67.89

(replace that IP with the real IP) and run make

Use test.dev as the domain and answer true for the "Use self-signed certs" question. Then you can try it out with browsing to www.test.dev

ksylvan commented 6 years ago

Hmmm... Look in your test server in /mnt/docker/nginx/logs/* and see if you can figure out why.

ksylvan commented 6 years ago

It also occurs to me that if you want the opencart container to show up as store.yourdomain.tld, then it does not actually conflict with the existing setup where www is either a standard nginx setup (with files and ~user settings, or a simple contact form) or wordpress.

So we'll need to re-work that logic a bit.

ksylvan commented 6 years ago

So we can probably just have a use_opencart variable and in that case we should add store.{{ domain_name }} to the set of hosts that are included in the SSL cert we generate from lets encrypt.

ghost commented 6 years ago

no logs.... ill push the changes... i do see that the bitnami cart came up, so ill ask is there a way on the server i can try to kickstart the nginx container and see if its going south for some reason ? i even tried a docker logs -f nginx ... which said it didnt exist

ls -al /mnt/docker/nginx/log/ total 8 drwxr-xr-x 2 991 991 4096 Nov 9 12:10 . drwxr-xr-x 5 991 991 4096 Nov 9 12:10 .. -rw-r--r-- 1 991 991 0 Nov 9 12:10 access.log

ghost commented 6 years ago

and logically i would simply like to add the opencart to the deployment, as i have other www pages for the primary website not based on wordpress either to go into www. While thinking about it i could also deploy quassel-core in a container, but ill deal with that down the road..... right now www web site and opencart is my target

ksylvan commented 6 years ago

Cleaned up the changes a bit. This still does not account for adding the "store.{{ domain_name }}" into the generated SSL cert, though.

ghost commented 6 years ago

ok seems to still work, however the cart at store.test.dev looks wrong, not displaying properly, however it does come up. everything else appears correct ill test with wordpress, with regular www files, make sure they all works properly, not sure what you mean by This still does not account for adding the "store.{{ domain_name }}" into the generated SSL cert, though.

ghost commented 6 years ago

ok these all appear to do the proper things in the proper order if selected / not selected..... Ive tested it everyway possible. the storefront still doesnt display right... i left it up if you want to take a peak 148.251.24.6 test.dev mail.test.dev www.test.dev postfixadmin.test.dev webmail.test.dev spam.test.dev store.test.dev

ksylvan commented 6 years ago

Looking at it now... I'm getting Connection Refused with that IP address.

ghost commented 6 years ago

hah i was messing with it so its restored now if you dint get a chance to see it..... its back up, i noticed when adding various web templates also when pushing them it will fail .... ? does it not just copy whats ever is in www/test.dev/files to the web space

ksylvan commented 6 years ago

I brought up my latest tweaks on your testing branch locally. When I visit store.test.dev, I see a weirdly formatted store page in google chrome. On the top right of the address bar, I see a little icon, "This page is trying to load scripts from unauthenticated sources" and then I click on the icon and click on "load unsafe scripts" to get a nicely formatted page.

Also needed to ensure that http and https both get proxy_passsed to the opencart container. Pull it and try again.

ksylvan commented 6 years ago

The last piece to polish this work is to automatically set up the SMTP settings for the opencart container. Reference: https://github.com/bitnami/bitnami-docker-opencart#smtp-configuration I think you can put mailserver as the SMTP host, and the mail setup already accepts relaying from any of the containers running in the local docker network.

ghost commented 6 years ago

ok this appears to work fine now any ideas about the web space issue failing when transferring some files ?? I think thats the last issue im seeing really......

ghost commented 6 years ago

changed: [mail.test.dev] => (item=./files/revolution/js/extensions/revolution.extension.migration.min.js) changed: [mail.test.dev] => (item=./files/revolution/js/extensions/revolution.extension.video.min.js) changed: [mail.test.dev] => (item=./files/revolution/js/extensions/revolution.extension.layeranimation.min.js) failed: [mail.test.dev] (item=./files/revolution/js/jquery.themepunch.tools.min.js) => {"changed": false, "failed": true, "item": "./files/revolution/js/jquery.themepunch.tools.min.js", "msg": "AnsibleUndefinedVariable: 'LT' is undefined"} changed: [mail.test.dev] => (item=./files/revolution/js/source/jquery.themepunch.revolution.js) failed: [mail.test.dev] (item=./files/revolution/js/source/jquery.themepunch.tools.min.js) => {"changed": false, "failed": true, "item": "./files/revolution/js/source/jquery.themepunch.tools.min.js", "msg": "AnsibleUndefinedVariable: 'LT' is undefined"} changed: [mail.test.dev] => (item=./files/revolution/js/source/jquery.themepunch.enablelog.js) changed: [mail.test.dev] => (item=./files/revolution/js/jquery.themepunch.enablelog.js) changed: [mail.test.dev] => (item=./files/revolution/js/jquery.themepunch.revolution.min.js) changed: [mail.test.dev] => (item=./files/revolution/fonts/pe-icon-7-stroke/css/pe-icon-7-stroke.css)

specifically this file....

ghost commented 6 years ago

changed: [mail.test.dev] => (item=./people/scottk/portfolio-item.html) changed: [mail.test.dev] => (item=./people/scottk/service-item.html)

RUNNING HANDLER [mailserver : restart nginx] ****

RUNNING HANDLER [mailserver : restart mailserver] ***

RUNNING HANDLER [mailserver : restart opencart] ***** to retry, use: --limit @/home/dingo/docker-mail-server-forked/mailserver.retry

PLAY RECAP ** mail.test.dev : ok=39 changed=10 unreachable=0 failed=1

ksylvan commented 6 years ago
(item=./files/revolution/js/extensions/revolution.extension.layeranimation.min.js)
failed: [mail.test.dev] (item=./files/revolution/js/jquery.themepunch.tools.min.js) => {"changed": false, "failed": true, "item": "./files/revolution/js/jquery.themepunch.tools.min.js", "msg": "AnsibleUndefinedVariable: 'LT' is undefined"}
changed: [mail.test.dev] => (item=./files/revolution/js/source/jquery.themepunch.revolution.js)
failed: [mail.test.dev] (item=./files/revolution/js/source/jquery.themepunch.tools.min.js) => {"changed": false, "failed": true, "item": "./files/revolution/js/source/jquery.themepunch.tools.min.js", "msg": "AnsibleUndefinedVariable: 'LT' is undefined"}

My guess is there’s something in those files that look like variables. Or maybe {{ something }} that the template module tries to substitute. Might need to fix the way files are copied or templated. My initial idea was that non binary files would get templated (so you could use variables like domain_name in the files) but that obviously might not work for JavaScript files.

ghost commented 6 years ago

maybe just copy **.js insttead of trying to manipulate them, right now i have to do it manually after i put a index.html in www/test.dev/files

im also looking at / optionally to populate the Unbound: recursive caching DNS resolver with DNSSEC support NSD : authoritative DNS server with DNSSEC support

which I also dont see being installed via the ansible run, however they exist now on the https://github.com/hardware/mailserver

ill look a tha after this pull request is completed and see if we can get those in the mix as well. probably also try to see if theres a way to manage them via the web

On Sun, Nov 12, 2017 at 11:02 AM, Kayvan Sylvan notifications@github.com wrote:

(item=./files/revolution/js/extensions/revolution.extension.layeranimation.min.js) failed: [mail.test.dev] (item=./files/revolution/js/jquery.themepunch.tools.min.js) => {"changed": false, "failed": true, "item": "./files/revolution/js/jquery.themepunch.tools.min.js", "msg": "AnsibleUndefinedVariable: 'LT' is undefined"} changed: [mail.test.dev] => (item=./files/revolution/js/source/jquery.themepunch.revolution.js) failed: [mail.test.dev] (item=./files/revolution/js/source/jquery.themepunch.tools.min.js) => {"changed": false, "failed": true, "item": "./files/revolution/js/source/jquery.themepunch.tools.min.js", "msg": "AnsibleUndefinedVariable: 'LT' is undefined"}

My guess is there’s something in those files that look like variables. Or maybe {{ something }} that the template module tries to substitute. Might need to fix the way files are copied or templated. My initial idea was that non binary files would get templated (so you could use variables like domain_name in the files) but that obviously might not work for JavaScript files.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ksylvan/docker-mail-server/pull/7#issuecomment-343725850, or mute the thread https://github.com/notifications/unsubscribe-auth/ABXFTu17DnfTfS4blUpeDWdTx42NpK-fks5s1sIigaJpZM4QYFfn .

ghost commented 6 years ago

i did find this so i guess i can look at integrating it into a container nginx/php/mysql and the pages http://www.lissyara.su/articles/freebsd/programms/nsdadmin/

On Sun, Nov 12, 2017 at 11:19 AM, Outback Dingo outbackdingo@gmail.com wrote:

maybe just copy **.js insttead of trying to manipulate them, right now i have to do it manually after i put a index.html in www/test.dev/files

im also looking at / optionally to populate the Unbound: recursive caching DNS resolver with DNSSEC support NSD : authoritative DNS server with DNSSEC support

which I also dont see being installed via the ansible run, however they exist now on the https://github.com/hardware/mailserver

ill look a tha after this pull request is completed and see if we can get those in the mix as well. probably also try to see if theres a way to manage them via the web

On Sun, Nov 12, 2017 at 11:02 AM, Kayvan Sylvan notifications@github.com wrote:

(item=./files/revolution/js/extensions/revolution.extension.layeranimation.min.js) failed: [mail.test.dev] (item=./files/revolution/js/jquery.themepunch.tools.min.js) => {"changed": false, "failed": true, "item": "./files/revolution/js/jquery.themepunch.tools.min.js", "msg": "AnsibleUndefinedVariable: 'LT' is undefined"} changed: [mail.test.dev] => (item=./files/revolution/js/source/jquery.themepunch.revolution.js) failed: [mail.test.dev] (item=./files/revolution/js/source/jquery.themepunch.tools.min.js) => {"changed": false, "failed": true, "item": "./files/revolution/js/source/jquery.themepunch.tools.min.js", "msg": "AnsibleUndefinedVariable: 'LT' is undefined"}

My guess is there’s something in those files that look like variables. Or maybe {{ something }} that the template module tries to substitute. Might need to fix the way files are copied or templated. My initial idea was that non binary files would get templated (so you could use variables like domain_name in the files) but that obviously might not work for JavaScript files.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ksylvan/docker-mail-server/pull/7#issuecomment-343725850, or mute the thread https://github.com/notifications/unsubscribe-auth/ABXFTu17DnfTfS4blUpeDWdTx42NpK-fks5s1sIigaJpZM4QYFfn .

ghost commented 6 years ago

wow too easy to deploy ... already up https://github.com/obi12341/docker-pdns

On Sun, Nov 12, 2017 at 11:26 AM, Outback Dingo outbackdingo@gmail.com wrote:

i did find this so i guess i can look at integrating it into a container nginx/php/mysql and the pages http://www.lissyara.su/ articles/freebsd/programms/nsdadmin/

On Sun, Nov 12, 2017 at 11:19 AM, Outback Dingo outbackdingo@gmail.com wrote:

maybe just copy **.js insttead of trying to manipulate them, right now i have to do it manually after i put a index.html in www/test.dev/files

im also looking at / optionally to populate the Unbound: recursive caching DNS resolver with DNSSEC support NSD : authoritative DNS server with DNSSEC support

which I also dont see being installed via the ansible run, however they exist now on the https://github.com/hardware/mailserver

ill look a tha after this pull request is completed and see if we can get those in the mix as well. probably also try to see if theres a way to manage them via the web

On Sun, Nov 12, 2017 at 11:02 AM, Kayvan Sylvan <notifications@github.com

wrote:

(item=./files/revolution/js/extensions/revolution.extension.layeranimation.min.js) failed: [mail.test.dev] (item=./files/revolution/js/jquery.themepunch.tools.min.js) => {"changed": false, "failed": true, "item": "./files/revolution/js/jquery.themepunch.tools.min.js", "msg": "AnsibleUndefinedVariable: 'LT' is undefined"} changed: [mail.test.dev] => (item=./files/revolution/js/source/jquery.themepunch.revolution.js) failed: [mail.test.dev] (item=./files/revolution/js/source/jquery.themepunch.tools.min.js) => {"changed": false, "failed": true, "item": "./files/revolution/js/source/jquery.themepunch.tools.min.js", "msg": "AnsibleUndefinedVariable: 'LT' is undefined"}

My guess is there’s something in those files that look like variables. Or maybe {{ something }} that the template module tries to substitute. Might need to fix the way files are copied or templated. My initial idea was that non binary files would get templated (so you could use variables like domain_name in the files) but that obviously might not work for JavaScript files.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ksylvan/docker-mail-server/pull/7#issuecomment-343725850, or mute the thread https://github.com/notifications/unsubscribe-auth/ABXFTu17DnfTfS4blUpeDWdTx42NpK-fks5s1sIigaJpZM4QYFfn .

ksylvan commented 6 years ago
maybe just copy **.js insttead of trying to manipulate them, right now i
have to do it manually after i put a index.html in www/test.dev/files

Please add an issue for me to take care of that.

ksylvan commented 6 years ago

Squashed and merged. Feel free to delete your testing branch, re-pull the main develop or master branch, and provide any additional feedback or fixes for the opencart setup. I added the SMTP settings.