Coder Social home page Coder Social logo

caprover-cli's Introduction

CapRover CLI

Command Line Interface for CapRover.

CapRover is a modern automated app deployment & web server manager.

  • Deploy apps in your own space
  • Secure your services over HTTPS for FREE
  • Scale in seconds
  • Focus on your apps! Not the bells and whistles just to run your apps!

Fore more information see CapRover.com

Always refer to the documentation bundled in CLI as it is the most updated one. You can view the help by caprover --help or caprover deploy --help or etc.

Getting started

This guide assumes that you have started CapRover on a linux server and setup your DNS (see CapRover Setup).

You can use this CLI tool to perform initial CapRover server setup, and to deploy your apps.

Before anything, install the CLI tool using npm:

npm install -g caprover

Usage

You can use the CLI by typing caprover in your console.

The CLI has several commands, if invoked without a command it display the usage summary:

Usage: caprover [options] [command]

CLI tool for CapRover. See CapRover.com for more details.

Options:
  -V, --version                output the version number
  -h, --help                   output usage information

Commands:
  serversetup|setup [options]  Performs necessary actions to prepare CapRover on your server.
  login [options]              Login to a CapRover machine. You can be logged in to multiple machines simultaneously.
  list|ls                      List all CapRover machines currently logged in.
  logout [options]             Logout from a CapRover machine and clear auth info.
  deploy [options]             Deploy your app to a specific CapRover machine. You'll be prompted for missing parameters.
  api [options]                Call a generic API on a specific CapRover machine. Use carefully only if you really know what you are doing!

Commands

Almost all commands require some data to work. Data for commands can be provided from different sources:

  • Enviroment variables: using variables names specified in command help (note that variable must be exported, or you have to define it inline before the cli command, eg: ENV_VAR=value caprover command);
  • Configuration file: JSON or YAML, specifing the file name with an option or its environment variable (usually -c, --configFile and CAPROVER_CONFIG_FILE), command options names define the keys of the configuration file;
  • Command options: using command options flags directly on the command line;
  • Input prompt: for those data that is not provided from other sources, but needed for the command to work, you'll be prompted to input them during command execution.

If the same data is provided from different sources, the priority order reflects the above list (the following ones overwrite the previous ones), except for input prompt that is used only if that data is not provided from others sources.

View help for a command to know more details to that command, by running:

caprover [command] --help

Server Setup

The very first thing you need to do is to setup your CapRover server. You can either do this by visiting HTTP://IP_ADDRESS_OF_SERVER:3000 in your browser, or the recommended way which is the command line tool.
Simply run:

caprover serversetup

Follow the steps as instructed: enter IP address of server and the root domain to be used with this CapRover instance. If you don't know what CapRover root domain is, please visit CapRover.com for documentation. This is a very crucial step.
After that, you'll be asked to change your CapRover server password, and to enter your email address. This should be a valid email address as it will be used in your SSL certificates.
After HTTPS is enabled, you'll be asked to enter a name for this CapRover machine, to store auth credential locally. And... Your are done! Go to Deploy section below to read more about app deployment.

For automation purposes, you can provide necessary data before to be prompted for them, for example using a config file like:

{
  "caproverIP": "123.123.123.123",
  "caproverPassword": "captain42",
  "caproverRootDomain": "root.domain.com",
  "newPassword": "rAnDoMpAsSwOrD",
  "certificateEmail": "[email protected]",
  "caproverName": "my-machine-123-123-123-123"
}

And then running:

caprover serversetup -c /path/to/config.json

Note: you can also use either YAML or JSON.

Login

If you've done the "Server Setup" process through the command line, you can skip "Login" step because your auth credential are automatically stored in the last step of setup.

This command does login to your CapRover server and store your auth credential locally.
It is recommended that at this point you have already set up HTTPS. Login over insecure, plain HTTP is not recommended.

To login to your CapRover server, simply run the following command and answer the questions:

caprover login

If operation finishes successfully, you will be prompted with a success message.

Note: you can be logged in to several CapRover servers at the same time; this is particularly useful if you have separate staging and production servers.

For automation purposes, you can provide necessary data before to be prompted for them, for example using a config file like:

{
  "caproverUrl": "captain.root.domain.com",
  "caproverPassword": "captain42",
  "caproverName": "testing-1"
}

And then running:

caprover login -c /path/to/config.json 

Note: you can also use either YAML or JSON.

Deploy

Use this command to deploy your application. Deploy via caprover CLI supports 4 deployments methods: captain-definition file, Dockerfile, tar file, and image name (see Captain Definition File for more info).

Simply run the following command and answers questions:

caprover deploy

You will then see your application being uploaded, after that, your application getting built.

Note: based on your deployment method, the build process could take multiple minutes, please be patient!

For automation purposes, you can provide necessary data before to be prompted for them, for example directly on the command line by running:

caprover deploy -n machine-name -a app-name -b branchName

Note: you must be logged in to "machine-name".

This can be useful if you want to integrate to CI/CD pipelines.

See command help to know more details and deployments methods.

List

Use this command to see a list of CapRover machines you are currently logged in to.
Run the following command:

caprover list

Logout

Use this command to logout from a CapRover machine and clear auth info.
Run the following command and choose a CapRover machine:

caprover logout

API

Use this command to call a generic API on a CapRover machine, specifying API path, method (GET or POST), and data. There is no official document for the API commands at this point as it is subject to change at any point. But you can use ApiManager.ts as a starting point.

caprover api

For automation purposes, you can provide necessary data before to be prompted for them, for example using a config file like:

{
  "caproverName": "server-1",
  "path": "/user/apps/appDefinitions/unusedImages",
  "method": "GET",
  "data": {
    "mostRecentLimit": "3"
  }
}

And then running (using environment variable for config file value):

CAPROVER_CONFIG_FILE='/path/to/config.json' caprover api -o output.json

Note: use carefully only if you really know what you are doing!

caprover-cli's People

Contributors

david-szabo97 avatar dependabot[bot] avatar devnixs avatar drmrbrewer avatar etienne-dldc avatar flomaetschke avatar githubsaturn avatar gnuns avatar hazzard17h avatar horacehylee avatar hugoblanc avatar hugojosefson avatar iamrommel avatar ilijanl avatar juanfrnz avatar mathiasm74 avatar miyagui avatar ngoyal16 avatar pcantaluppi avatar polotto avatar roelvan avatar sanconley avatar sidharthv96 avatar tbroadley avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

caprover-cli's Issues

serversetup needs to run twice for a recycled server

Full discussion thread here: #55 (comment)

Steps to repro:

  • Create a brand new server
  • Install CapRover on the server
  • Run caprover serversetup on your local machine and setup your server
  • At this point the server is working fine and you can deploy apps if you choose too
  • Now remove CapRover from the server completely.
  • Run caprover logout on your local machine to clean the local data
  • Reinstall CapRover on the server again.
  • Try setting up your server by running caprover serversetup on your local machine
  • At this point, you should observe the issue and get the 404 error.

Add option to skip logging build status during deploy

As far as I can tell by skimming the source, running caprover deploy with only a Dockerfile in my repo will upload my application and then build my Docker image on my caprover instance. The build logs that are being printed are from the remote server and not from the environment my caprover deploy command is running from. Am I right?

If that's the case, I'd propose a flag that lets me skip the part where I'm seeing the build logs. If the flag is set, the deploy command could just exit after uploading the application. For people that test and deploy their application in a CI environment that is billed by the minute this would save time and thus money. What do you think?

Error Code: 1107 Message: Verification Failed.

Hi
I had an old site using caprover, I updated it and pushed to it, however I couldn't get the new version to work, so I started again on a new server, and updated the DNS to the new IP address. I have waited 12 hours so far and I still get Error code: 1107
I am able to access the my-ip:3000

any help would be really great
I have set up Caprover on Digital Ocean as per the installation in instructions and waited for the DNS to propogate.
Screen Shot 2020-04-15 at 8 50 46 am
Screen Shot 2020-04-15 at 8 51 56 am
Screen Shot 2020-04-15 at 9 37 13 am

deployment

Hello
I got a problem when trying to deploy : i got this error :
Preparing deployment to CapRover...

"git" command not found: CapRover needs "git" to create tar file from your branch source files.
Run "caprover deploy --help" to know more deployment options... (e.g. tar file or image name)

error Command failed with exit code 1.

and it is of course a git repo
anybody can help me please ?

arrow keys not working after caprover deploy

I have followed the getting started and there seem to be a bug.

on the terminal I type : caprover deploy

? select the CapRover machine name you want to deploy to: captain-01
Ensuring authentication...
? select the app name you want to deploy to:
> -- CANCEL --

At this point I cant move the arrows anymore and cant type anything. The only thing which works is the key enter which cancels the process.

Node Version: v10.16.0
OS: Windows 10

Create an app using only the CLI

When using caprover deploy it only gives you the option use an already existing app.

I propse a new prompt is added while deploying to create an app right from the CLI, it would make the entire process much less troublesome and faster.

error while building rails app

Happened while building a rails app.
App is a fork of the diowa/icare project.

Contents of captain-definition file are
{ "schemaVersion": 2, "templateId": "ruby-rack/2.6.0" }

It appeared initially that I had to make an app in the web interface and then go back to the cli and do
caprover login
caprover deploy asked me the basic questions and began building.
My password was fine then this happened.
The blocked out highlight in the image is MYIPADDRESS:443
screen shot 2019-02-08 at 1 08 49 am

Scratching my head on this one.

If you application logs show that your application is running, the most common case is that your application is binding to a custom port, not port 80. For example, CouchDB runs at port 5984. In this case, go to app's settings on CapRover, go to HTTP Settings, then select 5984 as the "Container Port".

puma.rb is set to bind the app on port 3000 but I'm not sure whether this means it's deploying the development or production version.

screen shot 2019-02-08 at 1 17 42 am

Or possible issue could be that on Heroku this app needs these add ons additionally?
screen shot 2019-02-08 at 1 18 53 am

Exit command after finshing

When I run the "caprover setup" command with the -c flag and when it finishes I have to press enter to exit. It would be nicer if it exited automatically, especially that I'm using it in an automated script and I can't know when it finshes

Using deploy -d without defaults doesn't work first time

If I run caprover deploy -d for an app which hasn't yet been deployed (i.e. no defaults yet), it helpfully starts asking me how I want to deal with it... first choose the machine, then choose what branch. If I hit Enter for the "branch" question, the deploy process just quits back to the command line without getting to the next question. I have to run deploy again, which starts back at the first question but this time asks me all questions and then continues OK with the deploy. Minor issue, but would be nice to fix.

How to use authenticate for repository that requires docker login?

I am trying to integrate the caprover deploy --imageName command into my CI/CD workflow.

However, I am getting the following message:

Deploy failed!
Error: (HTTP code 404) unexpected - pull access denied for xx/repox, repository does not exist or may require 'docker login': denied: requested access to the resource is denied

I already logged in using the docker login command.

Please assist.

Thanks,
Jake

[Suggestion] If there is no captain-definition but a Dockerfile, simply use that

Just a minor thing I came across since I'm up to running almost 10 projects with CapRover and keep finding myself just copy-pasting that essentially empty captain-definition file. Which made me wonder whether that might not be a relatively common use case.

(I don't use dockerfileLines because I like syntax highlighting and automatic indentation.)

Deploy command with--default argument

When running the deploy command with --default on a newly created app, the cli throws an error

"xxxxxx app not exist on this CapRover machine."

Where xxxxx is a previously deleted app of a different name.

Removing the --default argument solves it.

Using deploy -d with incorrect password

Prior to v2 I was able to run caprover deploy -d in the knowledge that if the CapRover machine password is no longer valid then I would be prompted for the current password and then the process would continue. Now, it just seems to bail out without a prompt:

Something bad happened: cannot deploy myapp at myserver.
Password is incorrect.

I prefer the previous behaviour... seems more user friendly just to be able to enter the password rather than having to go through the deploy process again without relying on defaults.

View app logs from cli

Option to check app logs from cli would be great.
Because for some reason web panel doesn't always work.

CLI receives a 405 in CI environment

Hello there, I've been trying to deploy my app with CircleCI and this CLI. Basically this command doesn't work:

caprover deploy -h $DOMAIN -p $PASSWORD -b master -a $APPNAME

it throws

#!/bin/bash -eo pipefail
caprover deploy -h $DOMAIN -p $PASSWORD -b master -a $APPNAME

Preparing deployment to Captain...

(node:71) UnhandledPromiseRejectionWarning: StatusCodeError: 405 - ""
at new StatusCodeError (/usr/local/lib/node_modules/caprover/node_modules/request-promise-core/lib/errors.js:32:15)
at Request.plumbing.callback (/usr/local/lib/node_modules/caprover/node_modules/request-promise-core/lib/plumbing.js:104:33)
at Request.RP$callback [as _callback] (/usr/local/lib/node_modules/caprover/node_modules/request-promise-core/lib/plumbing.js:46:31)
at Request.self.callback (/usr/local/lib/node_modules/caprover/node_modules/request/request.js:185:22)
at Request.emit (events.js:198:13)
at Request. (/usr/local/lib/node_modules/caprover/node_modules/request/request.js:1161:10)
at Request.emit (events.js:198:13)
at IncomingMessage. (/usr/local/lib/node_modules/caprover/node_modules/request/request.js:1083:12)
at Object.onceWrapper (events.js:286:20)
at IncomingMessage.emit (events.js:203:15)
at endReadableNT (_stream_readable.js:1129:12)
at process._tickCallback (internal/process/next_tick.js:63:19)
(node:71) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:71) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

I'm not sure if this is a bug or if I am doing something wrong

login options

I'd like to be able to captainduckduck login as part of a script I run to set up a new server (* edit... see below). Is it possible to supply command-line options to login to specify all the required information without prompting? If not, would that be something that could be added in future?

This is actually for deploying an IDE app, with captainduckduck installed inside the IDE container. Maybe it's enough that I can just persist the ~/.config folder of the IDE app between deploys (using a persistent directory), so that at least the server info and captain machine name is remembered... I don't mind having just to enter a fresh password the first time I do a captainduckduck deploy after re-deploying the IDE app... I just don't want to have to have to re-enter all captain machine details again.

EDIT: I have tried persisting the ~/.config folder, and confirm that it works as intended. Probably that's better than starting from scratch and auto-logging in after re-deploying, because you retain all the various captain defaults, from previous deploys, that have been built up over time.

Failed deploy exits with code 0, causing CI to succeed

script:
    - npm i caprover -g
    - caprover deploy -h "$CAPROVER_PRODUCTION_HOST" -p "$CAPROVER_PRODUCTION_PASS" -i "$DOCKER_REGISTRY/image-name:${CI_COMMIT_SHA:0:8}" -a image-name

image

Even though the deploy fails, caprover-cli exits with code 0. So CI reports success.

Create a docker image

Maybe it could be useful to have an official Docker image. Especially with CI, it would be easier to define a step that use this image to deploy app to our caprover server.

Thanks

running caprover outputs syntax error

caprover -h
/usr/local/lib/node_modules/caprover/built/utils/StdOutUtil.js:12
printGreenMessage(message, exit = false) {
^
SyntaxError: Unexpected token =
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:374:25)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)
at Object. (/usr/local/lib/node_modules/caprover/built/commands/caprover.js:7:22)
at Module._compile (module.js:410:26)
at Object.Module._extensions..js (module.js:417:10)


UPDATE - This issue was fixed. Error was due to old Nodejs install
Node version is v4.2.6. Don't know why I never noticed that before.
I had initially ran sudo apt install nodejs npm on ubuntu but that installed v4.2.6 of node.
Here's what I ran to fix it

Assuming you are on a fresh install
sudo apt remove npm nodejs
sudo apt autoclean

Get the curl script to download NVM here
Follow on screen instructions or restart shell instance and then
nvm install --lts
nvm alias default node
nvm install-latest-npm
npm i -g caprover
caprover -h to verify

Use the CLI without git

It would be nice to use the CLI without git. Right now I get the error
You are not in a git root directory: this command will only deploys the current directory.

Can't it just tar up the current folder and upload it to my server without git ?

Server setup fails on Enabling SSL with 404

I have a server running the caprover docker container and an root domain like captain.api.my.domainname.com with an A record *.captain.api.my.domainname.com pointing to my server.
I can access the dashboard and login.

Whenever I'm trying to run caprover serversetup it fails on "Enabling SSL" with Error: StatusCodeError: 404 - "<!doctype html>\n<html>\n\n<head>...

So basically the html output of the default page. What am I doing wrong? DNS is properly propagated.

Create new app via API call: what is "detached"? plus other questions...

I'm trying to create a new app via the CLI (or rather in a script), and see that I need to use a custom api call, as explained here and here.

When looking here for the right parameters to pass, I think it is the registerNewApp() method that is relevant. But what does the detached query string part mean?

What I have so far is:

CAPROVER_PWD="notmypassword"
CAPROVER_ROOT_DOMAIN="myserver.domain.com"
CAPROVER_API_PATH="/user/apps/appDefinitions/register"
CAPROVER_API_METHOD="POST"
CAPROVER_APP_NAME="mynewapp"
CAPROVER_API_DATA="{\"appName\":\"${CAPROVER_APP_NAME}\",\"hasPersistentData\":true}"
caprover api --caproverUrl "https://captain.${CAPROVER_ROOT_DOMAIN}" --caproverPassword "${CAPROVER_PWD}" --path "${CAPROVER_API_PATH}" --method "${CAPROVER_API_METHOD}" --data "${CAPROVER_API_DATA}"

Is the above correct so far, and does the path need to include ?detached=1?

The app I am trying to create has persistent data... I'm specifying that already above via the data argument.

But the app also needs:

  • custom port mapping (server 8080, container 8080)
  • env vars
  • possibly custom persistent directory mappings (possibly not)
  • Websocket Support enabled

How do I set those up via the caprover api call?

DNS Record Issue

I have created A record on my server like server.domain.com but when i try to run run caprover serversetup it show error like

Double check your DNS, if everything looks correct note that DNS changes take up to 24 hours to work properly. Check with your Domain Provider.

Error Code: 1107 Message: Verification Failed.

However i am able to ping the server.domain.com and it resolving don't know why it creating this issue..

Can't set envVars via CLI

Hi all,
using the web GUI it is possible to set container env vars both on creation (at least for one-click-apps) and in 'app configs' tab. Both of those will send a JSON to /user/apps/appDefinitions/update with:

{
...
"envVars": [
    {
      "key": "some-env-key",
      "value": "some-env-value"
    }
  ]
}

When I try to do the same with CLI:

caprover api -t "/user/apps/appDefinitions/update" -m POST -d "{\"appName\":\"mysql\",\"instanceCount\":1,\"captainDefinitionRelativeFilePath\":\"./captain-definition\",\"notExposeAsWebApp\":true,\"volumes\":[{\"volumeName\":\"mysql-data\",\"containerPath\":\"/var/lib/mysql\"}],\"ports\":[],\"envVars\":[{\"key\":\"MYSQL_ROOT_PASSWORD\",\"value\":\"asdf1234\"}]}"

no environment variable is set. Any idea how to set env vars from CLI?

Have to enter branch name twice in caprover cli

What is the problem?
Everytime I run caprover deploy I have to enter the cli asks for branch name twice. It's not a blocker or anything, just a small annoyance.

Steps to reproduce the problem:
Run caprover deploy. When asked to enter the branch name, I have to 'enter' twice. Doesn't matter if I type out the branch name or accept the default.
caprover-cli

Answers to the following questions where applicable:
Windows 10, Node 10.13.0, happens in cmd and powershell.

Deploy not-yet-existing app

Hey guys!

How can I deploy a new app via CLI that did not exist yet? The docs at https://caprover.com/docs/cli-commands.html describe to use -a, but this does lead to {appname} app not exist on this CapRover machine.. Do I really have to create a dummy app just to let it be overwritten?

Additional Info:

deploy command: caprover deploy

captain-definition: { "schemaVersion": 2, "dockerfilePath": "./Dockerfile" }

Add --image options for deploy command

As discussed here we could had the possibility to deploy directly a new image by specifying the new tag in the deploy command.

The proposed solution:

caprover deploy -h https://captain.root.domain.com -p password -a app-name --image private.registry.com/username/new-image:version

It would call the endpoint /api/v2/user/apps/appData/your-app-name-here with the correct payload.

Let me knows when it will be available in a version I can test, I will write a tutorial to build a new image, test it and deploy it to Caprover with CircleCI

Improvement: sort app names in cli

Is your feature request related to a problem? Please describe.
When deploying with caprover deploy, in the step where you select the app name to deploy to, the apps are sorted in the order the were added to the caprover instance (at least, that's what it looks like). Once you have more than a few apps this becomes annoying, as it's illogical where to find your app. Especially once you get to more than 6 apps, as the cli only displays 6 at a time (why?) Also, the web interface sorts alphabetically by default I think, so it would make sense if the cli showed apps in the same order.

Describe the solution you'd like
I'd like the cli to:

  • show more than 6 apps at a time
  • show the apps ordered alphabetically

Freezes on ensuring authentication when machine name provided from command line

If I just run caprover deploy, caprover deploy -a THE_APP, or caprover deploy -a THE_APP -p THE_PASSWORD I can step through the interactive prompts just fine*.

If I include the machine name it just does the following. I've let it set for 20+ minutes. It usually takes less than 5 for a deploy.

This is on Windows 10 with Powershell or cmd.

⪫ caprover deploy -a THE_APP -n THE_MACHINE -p THE_PASSWORD

------------
CapRover CLI has recently been refactored. Please report potential bugs here: https://github.com/caprover/caprover-cli/issues
------------


Preparing deployment to CapRover...

**** Protip ****
You seem to have deployed THE_APP from this directory in the past, use --default flag to avoid having to re-enter the information.

**** Warning ****
No captain-definition was found in main directory: unless you have specified a special path for your captain-definition, this build will fail!

Ensuring authentication...

* Except for the fact that I always have to press enter twice after accepting the warning that uncommited and gitignored files will not be pushed. If I only press it once, it looks like the script has frozen.

"serversetup" CLI command fails if https is already enabled and forced

This happened when calling "captainduckduck serversetup" after the server has already been configured through the web interface. Although the readme.md for app-cli mentions that You can either do this by visiting `HTTP://IP_ADDRESS_OF_SERVER:3000` in your browser, or the recommended way which is the command line tool this is easy to overlook and calling "captainduckduck serversetup" after the web UI has already been used should at least fail gracefully.

$ captainduckduck serversetup
 
Setup your Captain server
 
? Have you already installed Captain on your server by running the following line:
mkdir /captain && docker run -v /var/run/docker.sock:/var/run/docker.sock dockersaturn/captainduckduck ? Yes
? Enter IP address of your captain server: (123.123.123.123) 138.168.61.155

✖ Login...
Something bad happened. Cannot connect to "http://138.168.61.155:3000/api/v1/login"
{
  "statusCode": 302,
  "body": "Found. Redirecting to https://138.168.61.155:3000/api/v1/login",
  "headers": {
    "x-powered-by": "Express",
    "location": "https://138.168.61.155:3000/api/v1/login",
    "vary": "Accept",
    "content-type": "text/plain; charset=utf-8",
    "content-length": "61",
    "date": "Thu, 22 Mar 2018 12:10:06 GMT",
    "connection": "close"
  },
  "request": {
    "uri": {
      "protocol": "http:",
      "slashes": true,
      "auth": null,
      "host": "138.168.61.155:3000",
      "port": "3000",
      "hostname": "138.168.61.155",
      "hash": null,
      "search": null,
      "query": null,
      "pathname": "/api/v1/login",
      "path": "/api/v1/login",
      "href": "http://138.168.61.155:3000/api/v1/login"
    },
    "method": "POST",
    "headers": {
      "x-namespace": "captain",
      "x-captain-auth": null,
      "content-type": "application/x-www-form-urlencoded",
      "content-length": 18
    }
  }
}`

Cannot find hash of last commit

Using caprover cli 2.0.0

When trying to deploy on windows, I'm getting an error:

`The system cannot find the path specified.

Cannot find hash of last commit on branch "master".`

Fixed in PR #25

Error: Wrapped: Verification Failed for captain.renamed-domain.com

After upgrading from verison 1.6.0 to 1.6.1 caprover did not recover.

I tried reinstalling with caprover 1.6.0 and 1.6.1 both do no longer work. It seems the certbot stuff is broken?

I found the other two issues about the Verification Failed problem, but both have no solution.

Interestingly the server running docker is hosted by hetzner, too.

Any help would be nice!

root@Ubuntu-1804-bionic-64-minimal ~ # docker logs 314

> [email protected] start /usr/src/app
> node ./bin/www

Captain Starting ...
February 10th 2020, 8:40:11.129 am    Emptying generated and temp folders.
February 10th 2020, 8:40:11.138 am    Ensuring directories are available on host. Started.
February 10th 2020, 8:40:11.241 am    Ensuring directories are available on host. Finished.
February 10th 2020, 8:40:11.248 am    Network captain-overlay-network is already attached to service: captain-captain
February 10th 2020, 8:40:11.256 am    captain-captain (service) has already been connected to secret: captain-salt
February 10th 2020, 8:40:11.266 am    Copying fake certificates...
February 10th 2020, 8:40:11.271 am    Setting up NGINX conf file...
February 10th 2020, 8:40:11.274 am    Locking NGINX configuration reloading...
February 10th 2020, 8:40:11.296 am    SUCCESS: UNLocking NGINX configuration reloading...
February 10th 2020, 8:40:11.299 am    Captain Nginx is already running..
February 10th 2020, 8:40:11.302 am    Updating NGINX service...
February 10th 2020, 8:40:11.349 am    Waiting for 5 seconds for nginx reload to take into effect
February 10th 2020, 8:40:16.352 am    NGINX is fully set up and working...
February 10th 2020, 8:40:16.354 am    Migration not needed, skipping.
February 10th 2020, 8:40:16.359 am    Captain Certbot is already running..
February 10th 2020, 8:40:16.363 am    Updating Certbot service...
February 10th 2020, 8:40:16.461 am    executeCommand Container: captain-certbot certbot certificates --non-interactive
February 10th 2020, 8:40:18.629 am    **** Captain is initialized and ready to serve you! ****
February 10th 2020, 8:40:19.638 am    Error: Wrapped: Verification Failed for captain.renamed-domain.com
Error: Wrapped: Verification Failed for captain.renamed-domain.com
    at errorize (/usr/src/app/built/utils/Logger.js:9:16)
    at Function.e (/usr/src/app/built/utils/Logger.js:31:19)
    at Request._callback (/usr/src/app/built/user/system/DomainResolveChecker.js:61:32)
    at self.callback (/usr/src/app/node_modules/request/request.js:185:22)
    at Request.emit (events.js:198:13)
    at Request.onRequestError (/usr/src/app/node_modules/request/request.js:881:8)
    at ClientRequest.emit (events.js:198:13)
    at Socket.socketErrorListener (_http_client.js:392:9)
    at Socket.emit (events.js:198:13)
    at emitErrorNT (internal/streams/destroy.js:91:8)
February 10th 2020, 8:40:19.639 am    Error: Wrapped: Error        Error: connect ECONNREFUSED 123.123.123.123:80
Error: Wrapped: Error        Error: connect ECONNREFUSED 123.123.123.123:80
    at errorize (/usr/src/app/built/utils/Logger.js:9:16)
    at Function.e (/usr/src/app/built/utils/Logger.js:31:19)
    at Request._callback (/usr/src/app/built/user/system/DomainResolveChecker.js:62:32)
    at self.callback (/usr/src/app/node_modules/request/request.js:185:22)
    at Request.emit (events.js:198:13)
    at Request.onRequestError (/usr/src/app/node_modules/request/request.js:881:8)
    at ClientRequest.emit (events.js:198:13)
    at Socket.socketErrorListener (_http_client.js:392:9)
    at Socket.emit (events.js:198:13)
    at emitErrorNT (internal/streams/destroy.js:91:8)
February 10th 2020, 8:40:19.639 am    Error: Wrapped: body         undefined
Error: Wrapped: body         undefined
    at errorize (/usr/src/app/built/utils/Logger.js:9:16)
    at Function.e (/usr/src/app/built/utils/Logger.js:31:19)
    at Request._callback (/usr/src/app/built/user/system/DomainResolveChecker.js:63:32)
    at self.callback (/usr/src/app/node_modules/request/request.js:185:22)
    at Request.emit (events.js:198:13)
    at Request.onRequestError (/usr/src/app/node_modules/request/request.js:881:8)
    at ClientRequest.emit (events.js:198:13)
    at Socket.socketErrorListener (_http_client.js:392:9)
    at Socket.emit (events.js:198:13)
    at emitErrorNT (internal/streams/destroy.js:91:8)
February 10th 2020, 8:40:19.639 am    Error: Wrapped: randomUuid   3d1b2ad4-aeb1-46e4-b8d2-d6d029484b2e
Error: Wrapped: randomUuid   3d1b2ad4-aeb1-46e4-b8d2-d6d029484b2e
    at errorize (/usr/src/app/built/utils/Logger.js:9:16)
    at Function.e (/usr/src/app/built/utils/Logger.js:31:19)
    at Request._callback (/usr/src/app/built/user/system/DomainResolveChecker.js:64:32)
    at self.callback (/usr/src/app/node_modules/request/request.js:185:22)
    at Request.emit (events.js:198:13)
    at Request.onRequestError (/usr/src/app/node_modules/request/request.js:881:8)
    at ClientRequest.emit (events.js:198:13)
    at Socket.socketErrorListener (_http_client.js:392:9)
    at Socket.emit (events.js:198:13)
    at emitErrorNT (internal/streams/destroy.js:91:8)
February 10th 2020, 8:40:19.640 am    Captain health check failed: #0 at captain.renamed-domain.com
February 10th 2020, 8:40:19.640 am    NGINX health check failed: #0
February 10th 2020, 8:40:40.653 am    Error: Wrapped: Verification Failed for captain.renamed-domain.com
Error: Wrapped: Verification Failed for captain.renamed-domain.com
    at errorize (/usr/src/app/built/utils/Logger.js:9:16)
    at Function.e (/usr/src/app/built/utils/Logger.js:31:19)
    at Request._callback (/usr/src/app/built/user/system/DomainResolveChecker.js:61:32)
    at self.callback (/usr/src/app/node_modules/request/request.js:185:22)
    at Request.emit (events.js:198:13)
    at Request.onRequestError (/usr/src/app/node_modules/request/request.js:881:8)
    at ClientRequest.emit (events.js:198:13)
    at Socket.socketErrorListener (_http_client.js:392:9)
    at Socket.emit (events.js:198:13)
    at emitErrorNT (internal/streams/destroy.js:91:8)
February 10th 2020, 8:40:40.654 am    Error: Wrapped: Error        Error: connect ECONNREFUSED 123.123.123.123:80
Error: Wrapped: Error        Error: connect ECONNREFUSED 123.123.123.123:80
    at errorize (/usr/src/app/built/utils/Logger.js:9:16)
    at Function.e (/usr/src/app/built/utils/Logger.js:31:19)
    at Request._callback (/usr/src/app/built/user/system/DomainResolveChecker.js:62:32)
    at self.callback (/usr/src/app/node_modules/request/request.js:185:22)
    at Request.emit (events.js:198:13)
    at Request.onRequestError (/usr/src/app/node_modules/request/request.js:881:8)
    at ClientRequest.emit (events.js:198:13)
    at Socket.socketErrorListener (_http_client.js:392:9)
    at Socket.emit (events.js:198:13)
    at emitErrorNT (internal/streams/destroy.js:91:8)
February 10th 2020, 8:40:40.654 am    Error: Wrapped: body         undefined
Error: Wrapped: body         undefined
    at errorize (/usr/src/app/built/utils/Logger.js:9:16)
    at Function.e (/usr/src/app/built/utils/Logger.js:31:19)
    at Request._callback (/usr/src/app/built/user/system/DomainResolveChecker.js:63:32)
    at self.callback (/usr/src/app/node_modules/request/request.js:185:22)
    at Request.emit (events.js:198:13)
    at Request.onRequestError (/usr/src/app/node_modules/request/request.js:881:8)
    at ClientRequest.emit (events.js:198:13)
    at Socket.socketErrorListener (_http_client.js:392:9)
    at Socket.emit (events.js:198:13)
    at emitErrorNT (internal/streams/destroy.js:91:8)
February 10th 2020, 8:40:40.654 am    Error: Wrapped: randomUuid   cb905508-1e5d-4f1b-b598-f3c1bd1b9b00
Error: Wrapped: randomUuid   cb905508-1e5d-4f1b-b598-f3c1bd1b9b00
    at errorize (/usr/src/app/built/utils/Logger.js:9:16)
    at Function.e (/usr/src/app/built/utils/Logger.js:31:19)
    at Request._callback (/usr/src/app/built/user/system/DomainResolveChecker.js:64:32)
    at self.callback (/usr/src/app/node_modules/request/request.js:185:22)
    at Request.emit (events.js:198:13)
    at Request.onRequestError (/usr/src/app/node_modules/request/request.js:881:8)
    at ClientRequest.emit (events.js:198:13)
    at Socket.socketErrorListener (_http_client.js:392:9)
    at Socket.emit (events.js:198:13)
    at emitErrorNT (internal/streams/destroy.js:91:8)
February 10th 2020, 8:40:40.655 am    Captain health check failed: #1 at captain.renamed-domain.com
February 10th 2020, 8:40:40.655 am    NGINX health check failed: #1
February 10th 2020, 8:41:01.719 am    Error: Wrapped: Verification Failed for captain.renamed-domain.com
Error: Wrapped: Verification Failed for captain.renamed-domain.com
    at errorize (/usr/src/app/built/utils/Logger.js:9:16)
    at Function.e (/usr/src/app/built/utils/Logger.js:31:19)
    at Request._callback (/usr/src/app/built/user/system/DomainResolveChecker.js:61:32)
    at self.callback (/usr/src/app/node_modules/request/request.js:185:22)
    at Request.emit (events.js:198:13)
    at Request.onRequestError (/usr/src/app/node_modules/request/request.js:881:8)
    at ClientRequest.emit (events.js:198:13)
    at Socket.socketErrorListener (_http_client.js:392:9)
    at Socket.emit (events.js:198:13)
    at emitErrorNT (internal/streams/destroy.js:91:8)
February 10th 2020, 8:41:01.720 am    Error: Wrapped: Error        Error: connect ECONNREFUSED 123.123.123.123:80
Error: Wrapped: Error        Error: connect ECONNREFUSED 123.123.123.123:80
    at errorize (/usr/src/app/built/utils/Logger.js:9:16)
    at Function.e (/usr/src/app/built/utils/Logger.js:31:19)
    at Request._callback (/usr/src/app/built/user/system/DomainResolveChecker.js:62:32)
    at self.callback (/usr/src/app/node_modules/request/request.js:185:22)
    at Request.emit (events.js:198:13)
    at Request.onRequestError (/usr/src/app/node_modules/request/request.js:881:8)
    at ClientRequest.emit (events.js:198:13)
    at Socket.socketErrorListener (_http_client.js:392:9)
    at Socket.emit (events.js:198:13)
    at emitErrorNT (internal/streams/destroy.js:91:8)
February 10th 2020, 8:41:01.720 am    Error: Wrapped: body         undefined
Error: Wrapped: body         undefined
    at errorize (/usr/src/app/built/utils/Logger.js:9:16)
    at Function.e (/usr/src/app/built/utils/Logger.js:31:19)
    at Request._callback (/usr/src/app/built/user/system/DomainResolveChecker.js:63:32)
    at self.callback (/usr/src/app/node_modules/request/request.js:185:22)
    at Request.emit (events.js:198:13)
    at Request.onRequestError (/usr/src/app/node_modules/request/request.js:881:8)
    at ClientRequest.emit (events.js:198:13)
    at Socket.socketErrorListener (_http_client.js:392:9)
    at Socket.emit (events.js:198:13)
    at emitErrorNT (internal/streams/destroy.js:91:8)
February 10th 2020, 8:41:01.720 am    Error: Wrapped: randomUuid   b580ba99-6621-4ba1-a251-017a6c5e53e2
Error: Wrapped: randomUuid   b580ba99-6621-4ba1-a251-017a6c5e53e2
    at errorize (/usr/src/app/built/utils/Logger.js:9:16)
    at Function.e (/usr/src/app/built/utils/Logger.js:31:19)
    at Request._callback (/usr/src/app/built/user/system/DomainResolveChecker.js:64:32)
    at self.callback (/usr/src/app/node_modules/request/request.js:185:22)
    at Request.emit (events.js:198:13)
    at Request.onRequestError (/usr/src/app/node_modules/request/request.js:881:8)
    at ClientRequest.emit (events.js:198:13)
    at Socket.socketErrorListener (_http_client.js:392:9)
    at Socket.emit (events.js:198:13)
    at emitErrorNT (internal/streams/destroy.js:91:8)
February 10th 2020, 8:41:01.720 am    Captain health check failed: #2 at captain.renamed-domain.com
February 10th 2020, 8:41:01.721 am    NGINX health check failed: #2
February 10th 2020, 8:41:18.627 am    executeCommand Container: captain-certbot certbot certificates --non-interactive
February 10th 2020, 8:41:21.333 am    executeCommand Container: captain-certbot certbot renew --non-interactive
February 10th 2020, 8:41:22.767 am    Error: Wrapped: Verification Failed for captain.renamed-domain.com
Error: Wrapped: Verification Failed for captain.renamed-domain.com
    at errorize (/usr/src/app/built/utils/Logger.js:9:16)
    at Function.e (/usr/src/app/built/utils/Logger.js:31:19)
    at Request._callback (/usr/src/app/built/user/system/DomainResolveChecker.js:61:32)
    at self.callback (/usr/src/app/node_modules/request/request.js:185:22)
    at Request.emit (events.js:198:13)
    at Request.onRequestError (/usr/src/app/node_modules/request/request.js:881:8)
    at ClientRequest.emit (events.js:198:13)
    at Socket.socketErrorListener (_http_client.js:392:9)
    at Socket.emit (events.js:198:13)
    at emitErrorNT (internal/streams/destroy.js:91:8)
February 10th 2020, 8:41:22.768 am    Error: Wrapped: Error        Error: connect ECONNREFUSED 123.123.123.123:80
Error: Wrapped: Error        Error: connect ECONNREFUSED 123.123.123.123:80
    at errorize (/usr/src/app/built/utils/Logger.js:9:16)
    at Function.e (/usr/src/app/built/utils/Logger.js:31:19)
    at Request._callback (/usr/src/app/built/user/system/DomainResolveChecker.js:62:32)
    at self.callback (/usr/src/app/node_modules/request/request.js:185:22)
    at Request.emit (events.js:198:13)
    at Request.onRequestError (/usr/src/app/node_modules/request/request.js:881:8)
    at ClientRequest.emit (events.js:198:13)
    at Socket.socketErrorListener (_http_client.js:392:9)
    at Socket.emit (events.js:198:13)
    at emitErrorNT (internal/streams/destroy.js:91:8)
February 10th 2020, 8:41:22.768 am    Error: Wrapped: body         undefined
Error: Wrapped: body         undefined
    at errorize (/usr/src/app/built/utils/Logger.js:9:16)
    at Function.e (/usr/src/app/built/utils/Logger.js:31:19)
    at Request._callback (/usr/src/app/built/user/system/DomainResolveChecker.js:63:32)
    at self.callback (/usr/src/app/node_modules/request/request.js:185:22)
    at Request.emit (events.js:198:13)
    at Request.onRequestError (/usr/src/app/node_modules/request/request.js:881:8)
    at ClientRequest.emit (events.js:198:13)
    at Socket.socketErrorListener (_http_client.js:392:9)
    at Socket.emit (events.js:198:13)
    at emitErrorNT (internal/streams/destroy.js:91:8)
February 10th 2020, 8:41:22.768 am    Error: Wrapped: randomUuid   f1b6ebf5-b742-4aee-b806-76eb523737a9
Error: Wrapped: randomUuid   f1b6ebf5-b742-4aee-b806-76eb523737a9
    at errorize (/usr/src/app/built/utils/Logger.js:9:16)
    at Function.e (/usr/src/app/built/utils/Logger.js:31:19)
    at Request._callback (/usr/src/app/built/user/system/DomainResolveChecker.js:64:32)
    at self.callback (/usr/src/app/node_modules/request/request.js:185:22)
    at Request.emit (events.js:198:13)
    at Request.onRequestError (/usr/src/app/node_modules/request/request.js:881:8)
    at ClientRequest.emit (events.js:198:13)
    at Socket.socketErrorListener (_http_client.js:392:9)
    at Socket.emit (events.js:198:13)
    at emitErrorNT (internal/streams/destroy.js:91:8)
February 10th 2020, 8:41:22.769 am    Captain health check failed: #3 at captain.renamed-domain.com
February 10th 2020, 8:41:22.769 am    NGINX health check failed: #3
February 10th 2020, 8:41:44.800 am    Error: Wrapped: Verification Failed for captain.renamed-domain.com
Error: Wrapped: Verification Failed for captain.renamed-domain.com
    at errorize (/usr/src/app/built/utils/Logger.js:9:16)
    at Function.e (/usr/src/app/built/utils/Logger.js:31:19)
    at Request._callback (/usr/src/app/built/user/system/DomainResolveChecker.js:61:32)
    at self.callback (/usr/src/app/node_modules/request/request.js:185:22)
    at Request.emit (events.js:198:13)
    at Request.onRequestError (/usr/src/app/node_modules/request/request.js:881:8)
    at ClientRequest.emit (events.js:198:13)
    at Socket.socketErrorListener (_http_client.js:392:9)
    at Socket.emit (events.js:198:13)
    at emitErrorNT (internal/streams/destroy.js:91:8)
February 10th 2020, 8:41:44.801 am    Error: Wrapped: Error        Error: read ECONNRESET
Error: Wrapped: Error        Error: read ECONNRESET
    at errorize (/usr/src/app/built/utils/Logger.js:9:16)
    at Function.e (/usr/src/app/built/utils/Logger.js:31:19)
    at Request._callback (/usr/src/app/built/user/system/DomainResolveChecker.js:62:32)
    at self.callback (/usr/src/app/node_modules/request/request.js:185:22)
    at Request.emit (events.js:198:13)
    at Request.onRequestError (/usr/src/app/node_modules/request/request.js:881:8)
    at ClientRequest.emit (events.js:198:13)
    at Socket.socketErrorListener (_http_client.js:392:9)
    at Socket.emit (events.js:198:13)
    at emitErrorNT (internal/streams/destroy.js:91:8)
February 10th 2020, 8:41:44.801 am    Error: Wrapped: body         undefined
Error: Wrapped: body         undefined
    at errorize (/usr/src/app/built/utils/Logger.js:9:16)
    at Function.e (/usr/src/app/built/utils/Logger.js:31:19)
    at Request._callback (/usr/src/app/built/user/system/DomainResolveChecker.js:63:32)
    at self.callback (/usr/src/app/node_modules/request/request.js:185:22)
    at Request.emit (events.js:198:13)
    at Request.onRequestError (/usr/src/app/node_modules/request/request.js:881:8)
    at ClientRequest.emit (events.js:198:13)
    at Socket.socketErrorListener (_http_client.js:392:9)
    at Socket.emit (events.js:198:13)
    at emitErrorNT (internal/streams/destroy.js:91:8)
February 10th 2020, 8:41:44.801 am    Error: Wrapped: randomUuid   52481bfa-0d27-4519-b00a-51de88ed1054
Error: Wrapped: randomUuid   52481bfa-0d27-4519-b00a-51de88ed1054
    at errorize (/usr/src/app/built/utils/Logger.js:9:16)
    at Function.e (/usr/src/app/built/utils/Logger.js:31:19)
    at Request._callback (/usr/src/app/built/user/system/DomainResolveChecker.js:64:32)
    at self.callback (/usr/src/app/node_modules/request/request.js:185:22)
    at Request.emit (events.js:198:13)
    at Request.onRequestError (/usr/src/app/node_modules/request/request.js:881:8)
    at ClientRequest.emit (events.js:198:13)
    at Socket.socketErrorListener (_http_client.js:392:9)
    at Socket.emit (events.js:198:13)
    at emitErrorNT (internal/streams/destroy.js:91:8)
February 10th 2020, 8:41:44.802 am    Captain health check failed: #4 at captain.renamed-domain.com
February 10th 2020, 8:41:44.802 am    NGINX health check failed: #4
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `node ./bin/www`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2020-02-10T08_41_44_817Z-debug.log

No longer see build progress in CLI

Not sure yet what the pattern is, but sometimes now when I deploy my app via the CLI there are no progress reports like there used to be... I just get:

This might take several minutes. PLEASE BE PATIENT...

and then immediately it returns to the command prompt (no need to be patient!).

But in the build logs of the console the build process is shown (like it used to be in the CLI), so the build is progressing after all.

If this is deliberate, I think I prefer it how it used to be, where you can see what is going on in the place where you actually set the build going.

Running caprover without args does nothing

Running caprover (without any args) just does nothing, whereas running captainduckduck (without args) shows usage instructions (like -h)... perhaps best if caprover did the same?

Deploy command with subdirectory

Why do I can't choose a subdirectory for me application root?
It is only possible to have another branch.

But if you have a frontend and a backend you want both in one repository and not in two branches.

Better error message for bad user input, maybe?

Maybe I'm incredibly stupid and dense but I took the prompt of It is captain.[your-captain-root-domain] : to mean I should not include the "captain" part. I know after reading it a closely it doesn't say that but I'd like to think at least one other person had this issue. The error you get is:

I've replaced the actual values with placeholders. Assume I have a caprover instance at captain.example.com with a wildcard DNS on *.example.com

❯❯❯ caprover login
Login to a CapRover Machine
?
Enter address of the CapRover machine.
It is captain.[your-captain-root-domain] : example.com
? Is HTTPS activated for this CapRover machine? Yes
? Enter your password: [hidden]
? Enter a name for this Captain machine: dev1
Something bad happened. Cannot save "dev1"
Error: Hostname/IP doesn't match certificate's altnames: "Host: example.com. is not in the cert's altnames: DNS:captain.example.com"

I started to think login.ts could be edited to check for "captain." at the start of the URL but I'm not sure if it's possible to change the url caprover admin is served over and if it could be changed it would break the CLI for those people. Maybe not if you just showed a warning message 1 time on login "Warning: Most CapRover installations start with 'captain.' or something like that. The other option that comes to mind is catch that specific error and only then show the warning (or silently add it yourself to see if that works after you see that error).

The obvious "third option" is to do nothing, which is perfectly reasonable seeing how "login" happens only once, or handful of times at most per person and once you know you won't make the same mistake twice.

As someone used this back when it was called Captain Duck Duck (but never used the cli till now) I was starting to think it was some issue in the update/migration (I've had enough issues with Ghost blog's updates...). I was close to uninstalled CR and reinstalling it fresh to see if that helped. Thankfully I found a post about this error, not related to CR, and attempted to suppress it only to get a different error that triggered something in my brain to attempt throwing "captain" on the front of my URL.

If you do pick the third option at least this issue should point people in the right direction if they are similarly challenged at stopping to full read a prompt before continuing.

CLI command to remove an app

Is your feature request related to a problem? Please describe.
Apologies if this is already something that's possible, but I'm assessing solutions to a CI pipeline I'm trying to setup which involves deploying a pull request for testing and CapRover looks perfect for what we want to do. I couldn't find a way however of removing an app from the CLI?

I'd like a way of dynamically adding/removing apps from the CLI so it can be automated by the CI. This would allow me to have a new app deployed when a pull request is opened (which seems possible already), but more specifically to be able to remove that app when the PR is merged/closed. The documentation doesn't make any mentione of removing apps.

If this is already possible then great but I haven't seen anything

missing git hash in deployment tab (and missing versions)

For some of my apps the git hash information is n/a:

image

Sure enough, in /captain/data/config-captain.json this information is missing too:

"gitHash": ""

These are for versions deployed since upgrading to CapRover, incidentally.

Also, having questioned recently whether it was really necessary to keep hundreds of version entries for each app, I now find that (since upgrading to CapRover) my config files have indeed now stripped the number of versions down to mostly three or four (or less) version entries per app! The app I mentioned in the above post with 670+ version entries going back to the first deploy now only has two versions listed in the config file, the most recent of which doesn't even have gitHash information.

P.S. no I didn't manually edit the config to remove versions ;-) And I should mention that I have Keep most recent (in Disk Cleanup) set to 2 but it's been that way for a long time, and some apps (e.g. the one screenshotted above) still has more than two version entries listed.

caprover deploy outputs nothing after selecting branch

I select the machine, then the app name and after the branch is selected caprover just sits there with no output whatsoever.

This is a fresh install on DigitalOcean using the marketplace app and the updated to 1.6.1.

CLI version is 2.1.1

This happens with all the sample apps. I've even tried deploying via TAR file, with no success.

One-click-apps like MySQL and PhpMyAdmin work great.

Any insights on the root of this issue?

automation using CLI

Please forgive me if I'm missing something obvious, but I'm a bit confused about the documentation.

I'm trying to essentially automate the creation of my CapRover apps using the CLI.

So, I'm basically trying to see if I can install one-click-apps or specific docker images to CapRover using only the CLI. This includes things like the environment variables that go into the App Config on the web console, the custom URLs that those apps might have, etc.

Is it possible? How do I pass those environment variables when I deploy a new app? Or a custom HTTP domain, custom volume locations etc?

Can only deploy interactively (neither CLI arguments, nor config file work)

The options I supplied are these:
caprover deploy --caproverUrl "https://captain.region.mydomain.com" --caproverApp myApp --branch master --caproverPassword "myPassword"

Similarly in a .yml file:

---
branch: master
caproverApp: myApp
caproverPassword: 'myPassword'
caproverUrl: https://captain.region.mydomain.com

But with both ways, I get stuck at (and by stuck I mean that it freezes there. If I supply a wrong password, I do get an error):

Ensuring authentication...

CLI version: 2.0.2
CapRover instance: 1.5.2

Deploy with custom admin domain url

I would like to deploy to a custom URL http://<IP-ADDRESS-OF-SERVER>:3000 because of a local installation inside a local network without using domain names. Similar to the setup explained in caprover/caprover#246.

But right now the cli is cleaning the url with cleanAdminDomainUrl, adding the ADMIN_DOMAIN by default and getting rip off the port.

Is there a way around it ? Thank you so much.

Incorrect password throws error

When I deploy an app and the auth token is no longer valid, it prompts for a password. If I type it in wrong, it doesn't fail gracefully with a polite message, it gives the following unhandled promise rejection error message:

(node:3095) UnhandledPromiseRejectionWarning: Error: Password is incorrect.
	at ErrorFactory.createError (/usr/lib/node_modules/caprover/built/utils/ErrorFactory.js:19:17)
	at /usr/lib/node_modules/caprover/built/api/HttpClient.js:68:50
(node:3095) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 4)
(node:3095) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Way to bypass message about uncommitted and gitignored files?

Is there a way to bypass message about uncommitted and gitignored files? I don't see anything relevant in captover deploy --help. By "bypass" I'd just like to be able to automatically answer yes or no in the same way I can provide the (for example) app name via the -a command line switch.

Error 500 on /user/apps/appDefinitions/register

Hi everyone,

I can't figure how to make de /user/apps part of the API work, the GET functions are working well but when I try a POST function I always get an error :

Call generic CapRover API [Experimental Feature]... Ensuring authentication... Something bad happened calling API /user/apps/appDefinitions/register at ams02. Error Code: 1000 Message: Push failed: Error: (HTTP code 500) server error - invalid reference format

Here's the caprover.json :

{"caproverName":"test01","path":"/user/apps/appDefinitions/register","method":"POST","data":{"appName":"akjlsdlkjsfd","hasPersistentData":"1"}}

please let me know if you have any idea! Thanks!

Caprover stateless deploy command fails on Gitlab CI Pipeline

Caprover stateless deploy fails on Gitlab CI Pipeline. This is working normally when I ran the command locally. I am using a node:8.15.1 image

$ caprover deploy -h https://domain.com -p pass -b dev -a staging-app
Preparing deployment to Captain...

**** Warning **** No captain-definition was found in main directory. Falling back to Dockerfile.
Saving tar file to:
/builds/Projects/App-Project/temporary-captain-to-deploy.tar

TAR file failed
Error: Command failed: git archive --format tar --output "/builds/Projects/App-Project/temporary-captain-to-deploy.tar" dev
fatal: Not a valid object name

TAR file failed

Possibility it might be related to git. Git version 2.11.0 was already installed there.

request is deprecated

Am sure you are aware, but just noticed a deprecation warning when installing caprover, regarding deprecation of the node request package. It is a pain because I also use it in most of my node-based apps too! Given how widespread this is, I am sure it will be around for a long time, but deprecated packages can I suppose break your app at any time.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.