Nextcloud with Letsencrypt using OMV and docker-compose - Q&A

    • Offizieller Beitrag

    It's just as easy. I was nervous when I bought a domain as I'd never done that sort of thing.


    Only thing different you have to do is create an A record and then just create CNAME's for each of your subdomains (I'm not sure on subfolder).. then redeploy swag to get a new key for the new subdomain.


    This is one reason why personally, I like using the "network mode" in my containers to attach them to swag. By doing that, it keeps me from having 1 big ass docker-compose/stack file with all my containers I need routed through swag. Also, if I need to adjust the stack of just one of my containers... I don't have to redeploy the entire stack, since almost all my containers are in their own stack.

  • Only thing different you have to do is create an A record and then just create CNAME's for each of your subdomains

    Well, when the time comes, I know who I'll be poking, :D

  • I do have one question.. as I've seen people make this mistake before... are you sure you're setting up Port Forwarding, and not Port Triggering?


    Only other times I've seen people really struggle with this, is when their router was in a DMZ.. which to my knowledge you can't fix unless you have access to the router facing the service.

    Exactly, I am really struggling with this, I think I really did well but for any reason this is not working properly


    I don't know how to upload pics here, I added some screenshots of my router configuration (Xiaomi in bridge mode) and also the port of the general configuration of the OMV. Did I miss anything? DMZ is deactivated in the router. Of course IP in port forwarding is OMV's IP.

    https://imgur.com/a/uVQT91f

    Could you please take a short look on this?

  • Exactly, I am really struggling with this, I think I really did well but for any reason this is not working properly


    I don't know how to upload pics here, I added some screenshots of my router configuration (Xiaomi in bridge mode) and also the port of the general configuration of the OMV. Did I miss anything? DMZ is deactivated in the router. Of course IP in port forwarding is OMV's IP.

    https://imgur.com/a/uVQT91f

    Could you please take a short look on this?

    That is your problem, change OMV port to 90 or other than 80

  • I don't think so. I'm on my way home but I'm pretty sure my router settings look exactly like his.


    I have OMV on port 80

    I remember a thread that you said you had port 90 (or 99 )

    When we where doing the subdomain.conf for OMV


    Thinking better, it won't conflict with SWAG, so probably doesn't matter.

    Unless some other container/yml on the same stack is using port 80


    Since Starbuck1973 issue doesn't relate to macom guide (I trust is the one you made) maybe it's better to follow this on a new/different thread so it won't mix infos for who ever reads this.

  • Exactly, I am really struggling with this, I think I really did well but for any reason this is not working properly

    .....

    Could you please take a short look on this?

    To post a picture, press PrtScr or Windows Key+Shift+S and select what you want to show.

    Then with the cursor here, just Ctrl+V


    Like this:


    Can you post this picture with the LAN IP visible?

    Don't worry, NOONE will be able to hack your router with that IP, ;)


    Then, confirm that it is the IP of the Host that runs SWAG:

    ip addr | grep 192.168

    • Offizieller Beitrag

    Actually it pretty closely conforms to macoms guide (the one I wrote before that, was more along the lines of TDL's video.. which was problematic). Only thing I changed was separating the swag stack and using network mode.


    Edit: oh, and I did change my OMV port to 99 (surprised you remembered that..lol) when I forwarded the OMV webUI through my domain... but I really just done that for proof of concept and didn't keep it very long. I find the webUI kinda useless from the Internet... If I need access to my server from the Internet, I use SSH (which I do via a wetty docker through my domain..lol)

  • Only thing I changed was separating the swag stack and using network mode.

    Ok, so if I understand correct, you have on the SWAG stack:

    Code
    networks:
      default:
        # Use a custom driver
        driver: custom-driver-1


    And on the rest of the stacks:

    Code
    networks:
      default:
        external: true
        name: my-pre-existing-network #<---- the name of the network from above
    • Offizieller Beitrag

    Ok, so if I understand correct, you have on the SWAG stack:

    Code
    networks:
      default:
        # Use a custom driver
        driver: custom-driver-1


    And on the rest of the stacks:

    Code
    networks:
      default:
        external: true
        name: my-pre-existing-network #<---- the name of the network from above

    Nope... example... my swag stack...


    Once I deploy swag, and successfully get a key for my domain, etc. I need to figure out the network mode docker assigned to the container. 99% of the time (unless you've made a ton of attempts at this).. it will be container-name_default. But I've had a few times where I've seen it different.


    You can do this by looking under Networks in Portainer, or with the following command


    Code
    docker inspect container_name | grep NetworkMode

    So in my case, as you see, swag was assigned the network of "swag_default".

    Code
    ken@openmediavault:~$ docker inspect swag | grep NetworkMode
                "NetworkMode": "swag_default",
    ken@openmediavault:~$ 

    Now, any containers I want to link through swag... I just add that network mode to the stack.... This allows me to keep my stacks separate from "swag" making individual stacks are easy to update and deploy w/o effecting anything else (if they were all in one huge stack or compose file)


    A couple of examples (note the network_mode in each of the stacks below under "container_name").



    Hopefully that makes sense.


    and that's it. Once they are all on swag's network.. it's just a matter of setting up their CNAME on my domain panel and then setting up their subdomain.conf in the swag configuration folder.


    Once that is done, restart the containers, and they'll be at https://subdomain.my-domain.xyz


    Hopefully that makes sense. It's honestly way easier than it sounds.

  • Hopefully that makes sense. It's honestly way easier than it sounds.

    I already had understood what you had done. ;)

    Just thought the network environment to be different, (as I wrote above, since that's how it's described on the docker-compose docs )


    With those examples, it's pretty much straight forward.

    And no need to edit subdomain.confs from app to LAN IP, :)


    Nice one.

    • Offizieller Beitrag

    EXACTLY!


    As for the network mode differences.. I think it's different for various versions of docker-compose. Virtually all of mine are 2.2.. so they "just work" the way I did it.


    And like you said, it's dead nuts simple. I change to the proxy-confs folder, copy some service.subdomain.conf.sample and drop the sample, and that's really all I have to do.

    • Offizieller Beitrag

    That's also partially why I'm so confused w/ th eother posters problem.. because I think he said he had other containers routing through swag w/o issue, but he couldn't get nextcloud to work. Then you were explaining about modifying the .conf files, etc...


    I'm sure what you were saying was right, That's just not stuff I've ever needed to do w/ this approach and thus why I was completely lost.. :)

  • he said he had other containers routing through swag w/o issue, but he couldn't get nextcloud to work.

    Yes, but kept (re)using old volumes with failed attempts on Nextcloud.

    So, too many errors.


    Starting from scratch has given a better picture of where it fails and how to solve the issues.

    Since I don't use the method you described, I told him/her to edit the conf (because I know it will work)


    After all is running and configured, it will be easy to modify the YMLs to use your method (if required).

    Then all it takes it to delete the modified confs, copy a new sample and restart SWAG.


    When I rotate home for Christmas, I'll take the plunge and switch (finally) my configuration.


    Only catch I'll have are the services running on a different Pi (hence, different host).

    I'll still need to have those confs edited by hand, :/

    • Offizieller Beitrag

    And that was really my main goal. Clearly people were still struggling with it (given this thread's been going on a couple years).. so I was trying to make it more or less "cut and paste simple".. other than the config.php there's really no files, etc. that have to be edited.. but you have to do that anyway.

  • "BOTH" (TCP/UDP).. and his is TCP only... would that be a reason this is failing?

    AFAIK, the http && https run on TCP only so it shouldn't be an issue.

    http protocol uses tcp or udp - Bing

    Zitat


    HTTPS can run over any reliable stream transport protocol. Normally that's TCP, but it could also be SCTP. It is NOT expected to run over UDP, which is an unreliable datagram protocol (in fact, while that's not its official name, that's a good way to remember what it is).



    Since you know what to do, you can test it by changing your forwards to just TCP and throws any error (almost certain, it will not).


    The same situation with wireguard for e.g, only requires UDP


    From memory, I believe I only have TCP forward at home but can't remember for sure, sorry

  • Soma


    I was looking at Starbuck1973 router settings (pic in post 944)... Only difference I can tell in his and mine.. is mine is "BOTH" (TCP/UDP).. and his is TCP only... would that be a reason this is failing?

    No need to try yourself. http(s) only use TCP.

    If you got help in the forum and want to give something back to the project click here (omv) or here (scroll down) (plugins) and write up your solution for others.

  • Starbuck1973


    As far as I understand, you are half way through:

    1. When opening the https://nexclould.xxx.yyy.zzz url from the outside, you get an encrypted page, only with a self signed cert. (click on the lock in the browser to verify)

    What do you get when you open the url http://nextcloud.xxx.yyy.zzz from outside your network in a browser? Are you redirected to an https url?


    Try executing curl -v -H "nextcloud.xxx.yyy.yyy" http://<the_ip_of_my_omv>:81 from inside your network and past the results.

    If you got help in the forum and want to give something back to the project click here (omv) or here (scroll down) (plugins) and write up your solution for others.

    • Offizieller Beitrag

    On networks, you can just create the network in the command line. For instance: docker network create swag-net and then in every container yml you want on that one network include network_mode: swag-net

    https://docs.docker.com/network/bridge/

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!