Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. WordPress (Developer)
  3. Cloudron Plugin for Wordpress

Cloudron Plugin for Wordpress

Scheduled Pinned Locked Moved WordPress (Developer)
24 Posts 5 Posters 1.1k Views 5 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • nebulonN nebulon

    Hm to take a step back, if you imagine the app being configured from the platform side with say 3 domains. Then those 3 domains are listed in the app's environment variables. Now if those are reconfigured, we would restart the app. Wouldn't that mean that adding multisite to the current WordPress app is rather trivial by simply putting the necessary migration steps into the start.sh like we do for many other settings?

    This together with likely some flag in the CloudronManifest.json, if the app support multiple domains, just to avoid wrong configuration for other apps.

    I have not used multisite WordPress, so I might be totally missing the point.

    LonkleL Offline
    LonkleL Offline
    Lonkle
    wrote on last edited by
    #5

    @nebulon I agree with exactly what you said. But, what I didn't think was possible was - how do you "tell" Cloudron that the app reconfigured something if that reconfiguration is within the app itself. My answer was "well, I'll add a plugin and ping the Cloudron API / ask Cloudron to restart the app where it'll pick up the new configuration".

    Is there another way for Cloudron to know something important changed (requiring an app restart where start.sh will pick up the new config and set it up correctly) when a change happens solely inside the app (in this case, changing or adding subdomains). Sorry, I'm very new to both Docker and Cloudron as of this month (but 10 years of experience with Wordpress which was why my initial solution was a plugin but I prefer start.sh changes solely if possible).

    The WP-CRON Cloudron script would need to be edited as well, but that's on Cloudron's side as well and I'll make those changes if Multisite decides to get supported officially.

    1 Reply Last reply
    0
    • nebulonN Away
      nebulonN Away
      nebulon
      Staff
      wrote on last edited by
      #6

      Well if you would configure new domains for an app to be reachable, the platform needs to do other things already like adjusting the reverse proxy settings, setting up DNS if needed, getting an SSL certificate, ... so the platform in such a case can simply assume the app needs to be restarted and trigger just that.

      LonkleL 1 Reply Last reply
      0
      • girishG Offline
        girishG Offline
        girish
        Staff
        wrote on last edited by
        #7

        At a high level, if we inject a comma separated domain list variable named CLOUDRON_APP_DOMAINS here, is that all that is needed for the app? @Lonk What changes are needed in the WordPress managed or unmanaged app, if such an env var is provided to the start.sh ?

        LonkleL 1 Reply Last reply
        0
        • nebulonN nebulon

          Well if you would configure new domains for an app to be reachable, the platform needs to do other things already like adjusting the reverse proxy settings, setting up DNS if needed, getting an SSL certificate, ... so the platform in such a case can simply assume the app needs to be restarted and trigger just that.

          LonkleL Offline
          LonkleL Offline
          Lonkle
          wrote on last edited by Lonkle
          #8

          @nebulon Yes yes - that's why I needed to use the Cloudron API, but if this can all be done from the Cloudron side, I'd do it. So, tell me, how does Cloudron know that a user changed or added a domain from within Wordpress itself?

          My CPanel for Wordpress plugin, for example, sent out a CPanel API call if any domain was added or changed (from within Wordpress, of course) so that CPanel would do all the stuff it needed to do to route it it to the Wordpress installation.

          girishG 1 Reply Last reply
          0
          • girishG girish

            At a high level, if we inject a comma separated domain list variable named CLOUDRON_APP_DOMAINS here, is that all that is needed for the app? @Lonk What changes are needed in the WordPress managed or unmanaged app, if such an env var is provided to the start.sh ?

            LonkleL Offline
            LonkleL Offline
            Lonkle
            wrote on last edited by Lonkle
            #9

            @girish Well, at the highest level, yes. But box's reverseproxy.js would need to take into account the new comma-delimited Docker CLOUDRON environment domain variable, right?

            Funny, those same CLOUDRON environment variables are where I store all my debug variables for containers while I've been working on my OpenVPN Client.

            girishG 1 Reply Last reply
            0
            • LonkleL Lonkle

              @girish Well, at the highest level, yes. But box's reverseproxy.js would need to take into account the new comma-delimited Docker CLOUDRON environment domain variable, right?

              Funny, those same CLOUDRON environment variables are where I store all my debug variables for containers while I've been working on my OpenVPN Client.

              girishG Offline
              girishG Offline
              girish
              Staff
              wrote on last edited by
              #10

              @Lonk Yes, the reverse proxy parts have to be fixed. There is a subdomains table right now, where we track the domains of an app. It's either the 'primary' or 'redirect' type. When 'primary', the reverseproxy serves up the app. When 'redirect', the reverseproxy will do a 301 redirect to primary domain.

              If you can tell me roughly if this env var is all that is needed from the app's point of view for multi-domain support, I can provide a quick untested patch for you to try.

              LonkleL 1 Reply Last reply
              0
              • LonkleL Lonkle

                @nebulon Yes yes - that's why I needed to use the Cloudron API, but if this can all be done from the Cloudron side, I'd do it. So, tell me, how does Cloudron know that a user changed or added a domain from within Wordpress itself?

                My CPanel for Wordpress plugin, for example, sent out a CPanel API call if any domain was added or changed (from within Wordpress, of course) so that CPanel would do all the stuff it needed to do to route it it to the Wordpress installation.

                girishG Offline
                girishG Offline
                girish
                Staff
                wrote on last edited by
                #11

                @Lonk said in Cloudron Plugin for Wordpress:

                So, tell me, how does Cloudron know that a user changed or added a domain from within Wordpress itself?

                It won't. Currently, configuration changes happen only one way - From Cloudron to the app. Changes made directly inside the app will break configuration. This means that if you want to add 3-4 domains to a WP multi-site install, then you have to add it in the Cloudron UI somewhere (possibly in Location view).

                So, just to be in sync with the folow:

                1. User goes to Location view of WordPress app. And adds some domains. We will probably allow a user to add more than 1 domain only if the CloudronManifest of the app has some flag say "multiDomain". This is because most apps don't support more than 1 domain. This seems very WP specific at this point (which is fine).
                2. Cloudron will configure reverse proxy
                3. Cloudron will restart the app with CLOUDRON_APP_DOMAINS env var set
                4. start.sh of the app does some magic
                LonkleL 1 Reply Last reply
                1
                • girishG girish

                  @Lonk Yes, the reverse proxy parts have to be fixed. There is a subdomains table right now, where we track the domains of an app. It's either the 'primary' or 'redirect' type. When 'primary', the reverseproxy serves up the app. When 'redirect', the reverseproxy will do a 301 redirect to primary domain.

                  If you can tell me roughly if this env var is all that is needed from the app's point of view for multi-domain support, I can provide a quick untested patch for you to try.

                  LonkleL Offline
                  LonkleL Offline
                  Lonkle
                  wrote on last edited by Lonkle
                  #12

                  Yes, the reverse proxy parts have to be fixed. There is a subdomains table right now, where we track the domains of an app. It's either the 'primary' or 'redirect' type. When 'primary', the reverseproxy serves up the app. When 'redirect', the reverseproxy will do a 301 redirect to primary domain.

                  If you can tell me roughly if this env var is all that is needed from the app's point of view for multi-domain support, I can provide a quick untested patch for you to try.

                  @girish I'm sorry, but that wouldn't do it because of the reverseproxy.js would have to write them as all "primary" domain config (not the redirection function in reverseproxy.js but the primary one) when that would be a hack, the real solution for box is a new domain type, "alias", and have the reverse proxy treat them the same as a primary...okay, I know that was the same thing, but one of them makes the code more readable.

                  girishG 1 Reply Last reply
                  0
                  • LonkleL Lonkle

                    Yes, the reverse proxy parts have to be fixed. There is a subdomains table right now, where we track the domains of an app. It's either the 'primary' or 'redirect' type. When 'primary', the reverseproxy serves up the app. When 'redirect', the reverseproxy will do a 301 redirect to primary domain.

                    If you can tell me roughly if this env var is all that is needed from the app's point of view for multi-domain support, I can provide a quick untested patch for you to try.

                    @girish I'm sorry, but that wouldn't do it because of the reverseproxy.js would have to write them as all "primary" domain config (not the redirection function in reverseproxy.js but the primary one) when that would be a hack, the real solution for box is a new domain type, "alias", and have the reverse proxy treat them the same as a primary...okay, I know that was the same thing, but one of them makes the code more readable.

                    girishG Offline
                    girishG Offline
                    girish
                    Staff
                    wrote on last edited by
                    #13

                    @Lonk said in Cloudron Plugin for Wordpress:

                    the real solution for box is a new domain type, "alias",

                    Yes, exactly. +1. It's better than my idea to re-use 'primary' 🙂

                    LonkleL 1 Reply Last reply
                    1
                    • girishG girish

                      @Lonk said in Cloudron Plugin for Wordpress:

                      the real solution for box is a new domain type, "alias",

                      Yes, exactly. +1. It's better than my idea to re-use 'primary' 🙂

                      LonkleL Offline
                      LonkleL Offline
                      Lonkle
                      wrote on last edited by
                      #14

                      @girish Your idea to re-use primary would work though. It's just, after living my life in docker.js and reverseproxy.js for the past 3 days. I'd be remiss not to suggest a more readable way to code the same solution.

                      1 Reply Last reply
                      0
                      • girishG girish

                        @Lonk said in Cloudron Plugin for Wordpress:

                        So, tell me, how does Cloudron know that a user changed or added a domain from within Wordpress itself?

                        It won't. Currently, configuration changes happen only one way - From Cloudron to the app. Changes made directly inside the app will break configuration. This means that if you want to add 3-4 domains to a WP multi-site install, then you have to add it in the Cloudron UI somewhere (possibly in Location view).

                        So, just to be in sync with the folow:

                        1. User goes to Location view of WordPress app. And adds some domains. We will probably allow a user to add more than 1 domain only if the CloudronManifest of the app has some flag say "multiDomain". This is because most apps don't support more than 1 domain. This seems very WP specific at this point (which is fine).
                        2. Cloudron will configure reverse proxy
                        3. Cloudron will restart the app with CLOUDRON_APP_DOMAINS env var set
                        4. start.sh of the app does some magic
                        LonkleL Offline
                        LonkleL Offline
                        Lonkle
                        wrote on last edited by Lonkle
                        #15

                        @girish said in Cloudron Plugin for Wordpress:

                        So, just to be in sync with the folow:

                        User goes to Location view of WordPress app. And adds some domains. We will probably allow a user to add more than 1 domain only if the CloudronManifest of the app has some flag say "multiDomain". This is because most apps don't support more than 1 domain. This seems very WP specific at this point (which is fine).
                        Cloudron will configure reverse proxy
                        Cloudron will restart the app with CLOUDRON_APP_DOMAINS env var set
                        start.sh of the app does some magic

                        That would be the exact flow.

                        It won't. Currently, configuration changes happen only one way - From Cloudron to the app. Changes made directly inside the app will break configuration. This means that if you want to add 3-4 domains to a WP multi-site install, then you have to add it in the Cloudron UI somewhere (possibly in Location view).

                        That's why I figured I needed to build my "Cloudron for Wordpress" plugin anyway just as I did for my "CPanel for Wordpress" (what I've used before starting with Cloudron now). I'll post it here, but I'd suggest it be pre-installed and activated by start.sh for if and when a site is converted into a Multisite. It can even be hidden from the user's view if need be. But I'll post it publicly on the Wordpress Repository so people can install it if they decide to convert their single site into a multisite on Cloudron (just makes the experience more seamless - the domains changed / added directly in Wordpress will sync with the Cloudron domain "aliases"). But it won't be necessary, a user will just have to add the alias in Cloudron (just like they have to do right now in CPanel without my plugin) and after that add the sub-site in Wordpress.

                        1 Reply Last reply
                        0
                        • LonkleL Offline
                          LonkleL Offline
                          Lonkle
                          wrote on last edited by Lonkle
                          #16

                          Either way, I will be making your minute-ly WP CRON script (which apparently runs in it's own container for some Docker-y reason) detect if the installation is a single or multisite and it will trigger the WP CRONs accordingly (all of the subsite triggers or just the single site trigger).

                          girishG 1 Reply Last reply
                          0
                          • LonkleL Lonkle

                            Either way, I will be making your minute-ly WP CRON script (which apparently runs in it's own container for some Docker-y reason) detect if the installation is a single or multisite and it will trigger the WP CRONs accordingly (all of the subsite triggers or just the single site trigger).

                            girishG Offline
                            girishG Offline
                            girish
                            Staff
                            wrote on last edited by
                            #17

                            @Lonk That will be perfect. Ideally, we only have 1 app for both single site and multi-site.

                            LonkleL 1 Reply Last reply
                            0
                            • girishG girish

                              @Lonk That will be perfect. Ideally, we only have 1 app for both single site and multi-site.

                              LonkleL Offline
                              LonkleL Offline
                              Lonkle
                              wrote on last edited by Lonkle
                              #18

                              @girish Awesome, when I'm done with the OpenVPN Client app. I'll provide you guys with:

                              • An updated WP-CRON script that takes multisite into account and does extra if it's enabled.
                              • A "Cloudron for Wordpress" plugin that keeps domains in sync between Cloudron and Wordpress (so you can make changes from either in-app or Cloudron and everything is seamless).
                              • If you haven't already made it, a new start.sh script to account for the new domain "aliases" in Cloudron and anything else Multisite related.

                              PS. This does not mean I've given up on my fight for webhooks to be built into your API, it's just most things can be done without them. 😂

                              1 Reply Last reply
                              0
                              • jdaviescoatesJ Offline
                                jdaviescoatesJ Offline
                                jdaviescoates
                                wrote on last edited by
                                #19

                                I haven't really followed on the developer speak in this thread, but it'd be great if WordPress Multisite were fully compatible with Cloudron! 😄

                                I use Cloudron with Gandi & Hetzner

                                LonkleL 1 Reply Last reply
                                0
                                • jdaviescoatesJ jdaviescoates

                                  I haven't really followed on the developer speak in this thread, but it'd be great if WordPress Multisite were fully compatible with Cloudron! 😄

                                  LonkleL Offline
                                  LonkleL Offline
                                  Lonkle
                                  wrote on last edited by
                                  #20

                                  @jdaviescoates Upvote the feature request, my man (https://forum.cloudron.io/topic/3190/official-multisite-support-for-the-wordpress-app-managed-and-unmanaged?_=1601578395450)! ☺️

                                  Also, do you guys think Multisite support should be only in the "Unmanaged" Wordpress installation for now. Maybe when we guarantee it's stability we trickle it down to "Managed"?

                                  The only difference between the two app packages is automatic WP major updates with "Managed" and then having SFTP access with "Unmanaged", correct?

                                  d19dotcaD 1 Reply Last reply
                                  1
                                  • LonkleL Lonkle

                                    @jdaviescoates Upvote the feature request, my man (https://forum.cloudron.io/topic/3190/official-multisite-support-for-the-wordpress-app-managed-and-unmanaged?_=1601578395450)! ☺️

                                    Also, do you guys think Multisite support should be only in the "Unmanaged" Wordpress installation for now. Maybe when we guarantee it's stability we trickle it down to "Managed"?

                                    The only difference between the two app packages is automatic WP major updates with "Managed" and then having SFTP access with "Unmanaged", correct?

                                    d19dotcaD Offline
                                    d19dotcaD Offline
                                    d19dotca
                                    wrote on last edited by
                                    #21

                                    @Lonk said in Cloudron Plugin for Wordpress:

                                    The only difference between the two app packages is automatic WP major updates with "Managed" and then having SFTP access with "Unmanaged", correct?

                                    And LDAP support for Managed and not present for Unmanaged. But yes, I think that's about the only differences between them.

                                    --
                                    Dustin Dauncey
                                    www.d19.ca

                                    LonkleL 1 Reply Last reply
                                    1
                                    • d19dotcaD d19dotca

                                      @Lonk said in Cloudron Plugin for Wordpress:

                                      The only difference between the two app packages is automatic WP major updates with "Managed" and then having SFTP access with "Unmanaged", correct?

                                      And LDAP support for Managed and not present for Unmanaged. But yes, I think that's about the only differences between them.

                                      LonkleL Offline
                                      LonkleL Offline
                                      Lonkle
                                      wrote on last edited by
                                      #22

                                      @d19dotca Interesting, I almost one to say that they should be one App Store offering with those choices (SFTP, Managed updates, LDAP). Cause as a new user I find Unmanaged and Managed Wordpress to be kind of confusing. I thought until today that Managed didn’t have plugins. 😂

                                      d19dotcaD 1 Reply Last reply
                                      1
                                      • LonkleL Lonkle

                                        @d19dotca Interesting, I almost one to say that they should be one App Store offering with those choices (SFTP, Managed updates, LDAP). Cause as a new user I find Unmanaged and Managed Wordpress to be kind of confusing. I thought until today that Managed didn’t have plugins. 😂

                                        d19dotcaD Offline
                                        d19dotcaD Offline
                                        d19dotca
                                        wrote on last edited by
                                        #23

                                        @Lonk I agree. Personally I think there should just be one WordPress app on the Cloudron App Store, would make it easier on most people I think (including the developers), but I can also understand why they made the decision for two different routes too.

                                        One can always host Wordpress in the LAMP app stack on Cloudron but unfortunately the LAMP apps don’t allow LDAP tie-ins (which is something I’d really like to see since SSO is one of the selling points to Cloudron after all.)

                                        Definitely room for improvement in the way some apps are packaged, IMO, but it’s honestly all such amazing work they’re doing (especially when it’s basically just two people running the show!) and I’m always happy to contribute in some small ways along with many others who are way more talented and been able to contribute a lot more than I have. 🙂

                                        But we digress, lol. Back to the main topic... 😉

                                        --
                                        Dustin Dauncey
                                        www.d19.ca

                                        LonkleL 1 Reply Last reply
                                        2
                                        • d19dotcaD d19dotca

                                          @Lonk I agree. Personally I think there should just be one WordPress app on the Cloudron App Store, would make it easier on most people I think (including the developers), but I can also understand why they made the decision for two different routes too.

                                          One can always host Wordpress in the LAMP app stack on Cloudron but unfortunately the LAMP apps don’t allow LDAP tie-ins (which is something I’d really like to see since SSO is one of the selling points to Cloudron after all.)

                                          Definitely room for improvement in the way some apps are packaged, IMO, but it’s honestly all such amazing work they’re doing (especially when it’s basically just two people running the show!) and I’m always happy to contribute in some small ways along with many others who are way more talented and been able to contribute a lot more than I have. 🙂

                                          But we digress, lol. Back to the main topic... 😉

                                          LonkleL Offline
                                          LonkleL Offline
                                          Lonkle
                                          wrote on last edited by
                                          #24

                                          @d19dotca Thanks for your input. I happen to feel the same way about this as I do about the LAMP app. In the store, just let me choose my PHP version and only have one LAMP app. I think this method has a better conveyance for new users of Cloudron. But, admittedly, this is harder work than having them separate - but it's food for thought for the developers.

                                          1 Reply Last reply
                                          1
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • Bookmarks
                                          • Search