This repository has been archived by the owner on Nov 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Maigret Aurélien
committed
May 9, 2020
1 parent
3ba5f7a
commit 9dc5c41
Showing
5 changed files
with
1,203 additions
and
152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
const { program } = require('commander') | ||
const pkg = require('../package.json') | ||
const proxyToGce = require('../proxy-to-gce') | ||
const server = require('../server') | ||
|
||
program | ||
.version(pkg.version) | ||
.name('gce') | ||
|
||
program | ||
.command('server <configDirectories...>') | ||
.description('Run GCE server') | ||
.option('-s, --ssl <gceHost>', 'enable SSL, and set GCE host/domain', null) | ||
.option('-g, --gce-server-port <port>', 'GCE server port', /^[0-9]+$/, 6730) | ||
.option('-l, --gce-lb-port <port>', 'GCE Load-Balancer port', /^[0-9]+$/, 6731) | ||
.action(function (configDirectories, cmd) { | ||
server({ | ||
serverPort: +cmd.gceServerPort, | ||
loadBalancerPort: +cmd.gceLbPort, | ||
ssl: cmd.ssl, | ||
configDirectories | ||
}) | ||
}) | ||
|
||
program | ||
.command('proxy-to-gce') | ||
.description('Create a proxy to GCE on port 443') | ||
.option('-l, --gce-lb-port <port>', 'GCE Load-Balancer port', /^[0-9]+$/, 6731) | ||
.option('-m, --manager-port <port>', 'proxy manager port', /^[0-9]+$/, 6732) | ||
.option('-p, --proxy-port <port>', 'proxy port', /^[0-9]+$/, 443) | ||
.option('-s, --manager-stop-path <path>', 'manager path to stop proxy', 'stop-proxy-to-gce') | ||
.action(function (cmd) { | ||
proxyToGce({ | ||
gceSecurePort: +cmd.gceLbPort, | ||
managerPort: +cmd.managerPort, | ||
proxyPort: +cmd.proxyPort, | ||
managerStopPath: cmd.managerStopPath | ||
}) | ||
}) | ||
|
||
program.parse() |
Oops, something went wrong.