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
  • Brite
  • 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 - Status | Demo | Docs | Install
  1. Cloudron Forum
  2. Discuss
  3. CloudronManifest: Configurable Environment Variable?

CloudronManifest: Configurable Environment Variable?

Scheduled Pinned Locked Moved Discuss
6 Posts 3 Posters 2.5k Views 3 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.
  • M Offline
    M Offline
    marbetschar
    wrote on last edited by
    #1

    How can we add a configurable environment variable to the CloudronManifest.json? Similar to the ones already present for TCP Ports, but to allow arbitrary values.

    My use case is: I'd love to create a proxy app which forwards all traffic to another Cloudron app to provide a beautiful, front facing url to the end customer.

    Let's say I have installed Mautic at marketing.domain.tld and I create a custom landing page within the Mautic app. This will be reachable via marketing.domain.tld/my-landing-page. Now I'd love to install a proxy app which runs on my-landing-page.com and proxies all requests to a configurable url (in this case to marketing.domain.tld/my-landing-page.

    It would be awesome to be able to configure the proxy url from the app configuration ui and pass it's value as environment variable.

    1 Reply Last reply
    1
    • mehdiM Offline
      mehdiM Offline
      mehdi
      App Dev
      wrote on last edited by
      #2

      I'd love to see this feature too! Sadly, there is no way to do such a thing yet.

      Two possible workarounds for your problem:

      • Create a basic admin interface under /admin or something, that would allow you to configure your proxy
      • Assume that someone who configures a proxy is at ease with a command line, and just have a config file under /app/data that the user can configure with the webterminal
      1 Reply Last reply
      0
      • M Offline
        M Offline
        marbetschar
        wrote on last edited by marbetschar
        #3

        I created an initial package which allows a create a apache2.conf:
        https://git.cloudron.io/mandelkind/proxy-app

        Now I've installed it at proxy.domain.tld and configured it as follows:

        <VirtualHost *:80>
            ProxyPreserveHost On
            SSLProxyEngine on
        
            # Servers to proxy the connection, or;
            # List of application servers:
            # Usage:
            # ProxyPass / http://[IP Addr.]:[port]/
            # ProxyPassReverse / http://[IP Addr.]:[port]/
            # Example: 
            ProxyPass / https://marketing.domain.tld/testseite/
            ProxyPassReverse / https://marketing.domain.tld/testseite/
        </VirtualHost>
        

        If I now start the app and try to open https://proxy.domain.tld in the browser, it just loads for an infinite amount of time - seems like there is some sort of infinite loop somewhere.

        Does anybody know whats wrong with my setup?

        1 Reply Last reply
        0
        • M Offline
          M Offline
          marbetschar
          wrote on last edited by marbetschar
          #4

          This is what I get as console output, after letting it run for a looooong time:

          14:53:10 [main] [Mon May 14 12:53:10.366258 2018] [core:notice] [pid 1] AH00094: Command line: '/usr/sbin/apache2 -D FOREGROUND'
          
          
          
          
          14:53:27 [main] [Mon May 14 12:53:27.312102 2018] [mpm_prefork:error] [pid 1] AH00161: server reached MaxRequestWorkers setting, consider raising the MaxRequestWorkers setting
          14:58:16 [main] [Mon May 14 12:58:16.990018 2018] [proxy_http:error] [pid 10] (70007)The timeout specified has expired: [client 172.18.0.1:56316] AH01102: error reading status line from remote server marketing.domain.tld:443
          14:58:16 [main] [Mon May 14 12:58:16.991921 2018] [proxy:error] [pid 10] [client 172.18.0.1:56316] AH00898: Error reading from remote server returned by /
          14:58:17 [main] [Mon May 14 12:58:17.019803 2018] [proxy_http:error] [pid 11] (70007)The timeout specified has expired: [client 172.18.0.1:56338] AH01102: error reading status line from remote server marketing.domain.tld:443
          14:58:17 [main] [Mon May 14 12:58:17.025742 2018] [proxy:error] [pid 11] [client 172.18.0.1:56338] AH00898: Error reading from remote server returned by /testseite/
          14:58:17 [main] [Mon May 14 12:58:17.034610 2018] [proxy_http:error] [pid 12] (70007)The timeout specified has expired: [client 172.18.0.1:56348] AH01102: error reading status line from remote server marketing.domain.tld:443
          14:58:17 [main] [Mon May 14 12:58:17.036525 2018] [proxy:error] [pid 12] [client 172.18.0.1:56348] AH00898: Error reading from remote server returned by /testseite/testseite/
          14:58:17 [main] [Mon May 14 12:58:17.048372 2018] [proxy_http:error] [pid 13] (70007)The timeout specified has expired: [client 172.18.0.1:56356] AH01102: error reading status line from remote server marketing.domain.tld:443
          14:58:17 [main] [Mon May 14 12:58:17.049827 2018] [proxy:error] [pid 13] [client 172.18.0.1:56356] AH00898: Error reading from remote server returned by /testseite/testseite/testseite/
          14:58:17 [main] [Mon May 14 12:58:17.063919 2018] [proxy_http:error] [pid 14] (70007)The timeout specified has expired: [client 172.18.0.1:56362] AH01102: error reading status line from remote server marketing.domain.tld:443
          14:58:17 [main] [Mon May 14 12:58:17.065509 2018] [proxy:error] [pid 14] [client 172.18.0.1:56362] AH00898: Error reading from remote server returned by /testseite/testseite/testseite/testseite/
          14:58:17 [main] [Mon May 14 12:58:17.510359 2018] [proxy_http:error] [pid 15] (70007)The timeout specified has expired: [client 172.18.0.1:56368] AH01102: error reading status line from remote server marketing.domain.tld:443
          14:58:17 [main] [Mon May 14 12:58:17.511644 2018] [proxy:error] [pid 15] [client 172.18.0.1:56368] AH00898: Error reading from remote server returned by /testseite/testseite/testseite/testseite/testseite/
          14:58:18 [main] [Mon May 14 12:58:18.527941 2018] [proxy_http:error] [pid 16] (70007)The timeout specified has expired: [client 172.18.0.1:56378] AH01102: error reading status line from remote server marketing.domain.tld:443
          14:58:18 [main] [Mon May 14 12:58:18.529377 2018] [proxy_http:error] [pid 17] (70007)The timeout specified has expired: [client 172.18.0.1:56384] AH01102: error reading status line from remote server marketing.domain.tld:443
          14:58:18 [main] [Mon May 14 12:58:18.529762 2018] [proxy:error] [pid 16] [client 172.18.0.1:56378] AH00898: Error reading from remote server returned by /testseite/testseite/testseite/testseite/testseite/testseite/
          
          1 Reply Last reply
          0
          • girishG Offline
            girishG Offline
            girish
            Staff
            wrote on last edited by
            #5

            Are you able to curl the mautic URL from your proxy app?

            M 1 Reply Last reply
            0
            • girishG girish

              Are you able to curl the mautic URL from your proxy app?

              M Offline
              M Offline
              marbetschar
              wrote on last edited by
              #6

              @girish thanks for getting back on this. Had to playing around with the apache2 configuration and was finally able to figure out a way that works. To make a long story short: ProxyPreserveHost lead to a infinite loop. As soon as I removed it, things started working.

              I've put together the final app here, maybe this is of use for someone else:
              https://git.cloudron.io/mandelkind/proxy-app

              Given the fact that I had to play around quite a bit, maybe we should add this to the app store as well? As a helper app, like the LAMP one.

              1 Reply Last reply
              0
              • jamesJ james marked this topic as a regular topic on

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              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