zodern / meteor-up

Production Quality Meteor Deployment to Anywhere
http://meteor-up.com/
MIT License
1.27k stars 281 forks source link

mup proxy logs-le queries individual workers instead of proxy host #1203

Open edemaine opened 3 years ago

edemaine commented 3 years ago

On a configuration with multiple workers and a separate proxy server (but not using docker swarm), I find that mup proxy logs-le incorrectly checks mup-nginx-proxy-letsencrypt on individual containers instead of checking the proxy host:

$ mup proxy logs-le
[worker4.subdomain.subdomain.domain]Error: No such container: mup-nginx-proxy-letsencrypt
[worker2.subdomain.subdomain.domain]Error: No such container: mup-nginx-proxy-letsencrypt
[worker1.subdomain.subdomain.domain]Error: No such container: mup-nginx-proxy-letsencrypt
[worker3.subdomain.subdomain.domain]Error: No such container: mup-nginx-proxy-letsencrypt

mup proxy logs behaves correctly.

Incidentally, mup status also reports "Stopped", "Created at undefined", "Restarted undefined times", and "Available in app's docker container: false". Presumably because I'm not using a docker swarm.

Setup

Mup version (mup --version): 1.5.2-beta.7

Mup config

{
  "servers": {
    "proxy": {
      "host": "1.2.3.4",
      "username": "ubuntu",
      "pem": "~/.ssh/pem"
    },
    "worker1": {
      "host": "1.2.3.4",
      "username": "ubuntu",
      "pem": "~/.ssh/pem"
    },
    "worker2": {
      "host": "1.2.3.4",
      "username": "ubuntu",
      "pem": "~/.ssh/pem"
    },
    "worker3": {
      "host": "1.2.3.4",
      "username": "ubuntu",
      "pem": "~/.ssh/pem"
    },
    "worker4": {
      "host": "1.2.3.4",
      "username": "ubuntu",
      "pem": "~/.ssh/pem"
    }
  },
  "proxy": {
    "servers": {
      "proxy": {}
    },
    "domains": "subdomain.subdomain.host.com,subdomain.subdomain.host.com",
    "ssl": {
      "letsEncryptEmail": "email@domain.com",
      "forceSSL": true
    },
    "clientUploadLimit": "0",
    "nginxServerConfig": "../.proxy.config",
    "loadBalancing": true
  },
  "hooks": {
    "pre.deploy": {
      "localCommand": "npm install"
    }
  },
  "app": {
    "name": "my-app",
    "path": "/afs/csail/u/e/edemaine/Projects/cocreate",
    "servers": {
      "worker1": {
        "env": {
          "COCREATE_WORKER": "1"
        }
      },
      "worker2": {
        "env": {
          "COCREATE_WORKER": "2",
          "COCREATE_SKIP_UPGRADE_DB": "1"
        }
      },
      "worker3": {
        "env": {
          "COCREATE_WORKER": "3",
          "COCREATE_SKIP_UPGRADE_DB": "1"
        }
      },
      "worker4": {
        "env": {
          "COCREATE_WORKER": "4",
          "COCREATE_SKIP_UPGRADE_DB": "1"
        }
      }
    },
    "docker": {
      "image": "abernix/meteord:node-12-base",
      "stopAppDuringPrepareBundle": true,
      "imagePort": 3000
    },
    "buildOptions": {
      "serverOnly": true,
      "buildLocation": "/scratch/cocreate-build"
    },
    "env": {
      "ROOT_URL": "https://subdomain.subdomain.host.com",
      "MONGO_URL": "mongodb://subdomain.subdomain.host.com/cocreate",
      "NODE_OPTIONS": "--trace-warnings --max-old-space-size=1024",
      "VIRTUAL_HOST": "subdomain.subdomain.host.com,subdomain.subdomain.host.com",
      "HTTPS_METHOD": "redirect",
      "LETSENCRYPT_HOST": "subdomain.subdomain.host.com,subdomain.subdomain.host.com",
      "LETSENCRYPT_EMAIL": "email@domain.com",
      "PORT": 10506,
      "VIRTUAL_PORT": 3000,
      "HTTP_FORWARDED_COUNT": 1
    },
    "deployCheckWaitTime": 200,
    "type": "meteor"
  }
}