Convert atlas references to vagrant cloud
This commit is contained in:
parent
238ac6c4e2
commit
5f955c3d38
|
@ -5,12 +5,12 @@ require "thread"
|
|||
module Vagrant
|
||||
@@global_lock = Mutex.new
|
||||
|
||||
# This is the default endpoint of the Atlas in
|
||||
# This is the default endpoint of the Vagrant Cloud in
|
||||
# use. API calls will be made to this for various functions
|
||||
# of Vagrant that may require remote access.
|
||||
#
|
||||
# @return [String]
|
||||
DEFAULT_SERVER_URL = "https://atlas.hashicorp.com"
|
||||
DEFAULT_SERVER_URL = "https://vagrantcloud.com"
|
||||
|
||||
# Max number of seconds to wait for joining an active thread.
|
||||
#
|
||||
|
|
|
@ -40,7 +40,7 @@ module VagrantPlugins
|
|||
end
|
||||
|
||||
o.separator ""
|
||||
o.separator "The box descriptor can be the name of a box on HashiCorp's Atlas,"
|
||||
o.separator "The box descriptor can be the name of a box on HashiCorp's Vagrant Cloud,"
|
||||
o.separator "or a URL, or a local .box file, or a local .json file containing"
|
||||
o.separator "the catalog metadata."
|
||||
o.separator ""
|
||||
|
|
|
@ -86,28 +86,26 @@ module VagrantPlugins
|
|||
end
|
||||
|
||||
# Reads the access token if there is one. This will first read the
|
||||
# `ATLAS_TOKEN` environment variable and then fallback to the stored
|
||||
# `VAGRANT_CLOUD_TOKEN` environment variable and then fallback to the stored
|
||||
# access token on disk.
|
||||
#
|
||||
# @return [String]
|
||||
def token
|
||||
if present?(ENV["ATLAS_TOKEN"]) && token_path.exist?
|
||||
if present?(ENV["VAGRANT_CLOUD_TOKEN"]) && token_path.exist?
|
||||
@env.ui.warn <<-EOH.strip
|
||||
Vagrant detected both the ATLAS_TOKEN environment variable and a Vagrant login
|
||||
token are present on this system. The ATLAS_TOKEN environment variable takes
|
||||
Vagrant detected both the VAGRANT_CLOUD_TOKEN environment variable and a Vagrant login
|
||||
token are present on this system. The VAGRANT_CLOUD_TOKEN environment variable takes
|
||||
precedence over the locally stored token. To remove this error, either unset
|
||||
the ATLAS_TOKEN environment variable or remove the login token stored on disk:
|
||||
the VAGRANT_CLOUD_TOKEN environment variable or remove the login token stored on disk:
|
||||
|
||||
~/.vagrant.d/data/vagrant_login_token
|
||||
|
||||
In general, the ATLAS_TOKEN is more preferred because it is respected by all
|
||||
HashiCorp products.
|
||||
EOH
|
||||
end
|
||||
|
||||
if present?(ENV["ATLAS_TOKEN"])
|
||||
if present?(ENV["VAGRANT_CLOUD_TOKEN"])
|
||||
@logger.debug("Using authentication token from environment variable")
|
||||
return ENV["ATLAS_TOKEN"]
|
||||
return ENV["VAGRANT_CLOUD_TOKEN"]
|
||||
end
|
||||
|
||||
if token_path.exist?
|
||||
|
@ -115,6 +113,11 @@ EOH
|
|||
return token_path.read.strip
|
||||
end
|
||||
|
||||
if present?(ENV["ATLAS_TOKEN"])
|
||||
@logger.warn("ATLAS_TOKEN detected within environment. Using ATLAS_TOKEN in place of VAGRANT_CLOUD_TOKEN.")
|
||||
return ENV["ATLAS_TOKEN"]
|
||||
end
|
||||
|
||||
@logger.debug("No authentication token in environment or #{token_path}")
|
||||
|
||||
nil
|
||||
|
|
|
@ -2,7 +2,7 @@ module VagrantPlugins
|
|||
module LoginCommand
|
||||
class Command < Vagrant.plugin("2", "command")
|
||||
def self.synopsis
|
||||
"log in to HashiCorp's Atlas"
|
||||
"log in to HashiCorp's Vagrant Cloud"
|
||||
end
|
||||
|
||||
def execute
|
||||
|
@ -19,7 +19,7 @@ module VagrantPlugins
|
|||
options[:logout] = k
|
||||
end
|
||||
|
||||
o.on("-t", "--token TOKEN", String, "Set the Atlas token") do |t|
|
||||
o.on("-t", "--token TOKEN", String, "Set the Vagrant Cloud token") do |t|
|
||||
options[:token] = t
|
||||
end
|
||||
end
|
||||
|
@ -44,14 +44,14 @@ module VagrantPlugins
|
|||
|
||||
# If it is a private cloud installation, show that
|
||||
if Vagrant.server_url != Vagrant::DEFAULT_SERVER_URL
|
||||
@env.ui.output("Atlas URL: #{Vagrant.server_url}")
|
||||
@env.ui.output("Vagrant Cloud URL: #{Vagrant.server_url}")
|
||||
end
|
||||
|
||||
# Ask for the username
|
||||
login = nil
|
||||
password = nil
|
||||
while !login
|
||||
login = @env.ui.ask("Atlas Username: ")
|
||||
login = @env.ui.ask("Vagrant Cloud Username: ")
|
||||
end
|
||||
|
||||
while !password
|
||||
|
|
|
@ -2,11 +2,11 @@ en:
|
|||
login_command:
|
||||
errors:
|
||||
server_error: |-
|
||||
The Atlas server responded with an not-OK response:
|
||||
The Vagrant Cloud server responded with an not-OK response:
|
||||
|
||||
%{errors}
|
||||
server_unreachable: |-
|
||||
The Atlas server is not currently accepting connections. Please check
|
||||
The Vagrant Cloud server is not currently accepting connections. Please check
|
||||
your network connection and try again later.
|
||||
|
||||
check_logged_in: |-
|
||||
|
@ -16,12 +16,12 @@ en:
|
|||
your login information to authenticate.
|
||||
command_header: |-
|
||||
In a moment we will ask for your username and password to HashiCorp's
|
||||
Atlas. After authenticating, we will store an access token locally on
|
||||
Vagrant Cloud. After authenticating, we will store an access token locally on
|
||||
disk. Your login details will be transmitted over a secure connection, and
|
||||
are never stored on disk locally.
|
||||
|
||||
If you do not have an Atlas account, sign up at
|
||||
https://atlas.hashicorp.com.
|
||||
If you do not have an Vagrant Cloud account, sign up at
|
||||
https://www.vagrantcloud.com
|
||||
invalid_login: |-
|
||||
Invalid username or password. Please try again.
|
||||
invalid_token: |-
|
||||
|
|
|
@ -29,7 +29,8 @@ module VagrantPlugins
|
|||
# Vagrant Cloud to Atlas. This preserves access tokens
|
||||
# appending to both without leaking access tokens to
|
||||
# unsavory URLs.
|
||||
if u.host == VCLOUD && server_uri.host == ATLAS
|
||||
if (u.host == VCLOUD && server_uri.host == ATLAS) ||
|
||||
(u.host == ATLAS && server_uri.host == VCLOUD)
|
||||
replace = true
|
||||
end
|
||||
end
|
||||
|
|
|
@ -8,7 +8,7 @@ module VagrantPlugins
|
|||
class Plugin < Vagrant.plugin("2")
|
||||
name "vagrant-login"
|
||||
description <<-DESC
|
||||
Provides the login command and internal API access to Atlas.
|
||||
Provides the login command and internal API access to Vagrant Cloud.
|
||||
DESC
|
||||
|
||||
command(:login) do
|
||||
|
|
|
@ -11,7 +11,7 @@ Vagrant.configure("2") do |config|
|
|||
# https://docs.vagrantup.com.
|
||||
|
||||
# Every Vagrant development environment requires a box. You can search for
|
||||
# boxes at https://atlas.hashicorp.com/search.
|
||||
# boxes at https://vagrantcloud.com/search.
|
||||
config.vm.box = "<%= box_name %>"
|
||||
<% if box_version -%>
|
||||
config.vm.box_version = "<%= box_version %>"
|
||||
|
@ -69,13 +69,6 @@ Vagrant.configure("2") do |config|
|
|||
# View the documentation for the provider you are using for more
|
||||
# information on available options.
|
||||
|
||||
# Define a Vagrant Push strategy for pushing to Atlas. Other push strategies
|
||||
# such as FTP and Heroku are also available. See the documentation at
|
||||
# https://docs.vagrantup.com/v2/push/atlas.html for more information.
|
||||
# config.push.define "atlas" do |push|
|
||||
# push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME"
|
||||
# end
|
||||
|
||||
# Enable provisioning with a shell script. Additional provisioners such as
|
||||
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
|
||||
# documentation for more information about their specific syntax and use.
|
||||
|
|
|
@ -387,7 +387,7 @@ en:
|
|||
provider. Double-check your requested provider to verify you didn't
|
||||
simply misspell it.
|
||||
|
||||
If you're adding a box from HashiCorp's Atlas, make sure the box is
|
||||
If you're adding a box from HashiCorp's Vagrant Cloud, make sure the box is
|
||||
released.
|
||||
|
||||
Name: %{name}
|
||||
|
@ -406,7 +406,7 @@ en:
|
|||
box_add_short_not_found: |-
|
||||
The box '%{name}' could not be found or
|
||||
could not be accessed in the remote catalog. If this is a private
|
||||
box on HashiCorp's Atlas, please verify you're logged in via
|
||||
box on HashiCorp's Vagrant Cloud, please verify you're logged in via
|
||||
`vagrant login`. Also, please double-check the name. The expanded
|
||||
URL and error message are shown below:
|
||||
|
||||
|
@ -571,12 +571,12 @@ en:
|
|||
|
||||
%{versions}
|
||||
box_server_not_set: |-
|
||||
A URL to an Atlas server is not set, so boxes cannot be added with a
|
||||
A URL to a Vagrant Cloud server is not set, so boxes cannot be added with a
|
||||
shorthand ("mitchellh/precise64") format. You may also be seeing this
|
||||
error if you meant to type in a path to a box file which doesn't exist
|
||||
locally on your system.
|
||||
|
||||
To set a URL to an Atlas server, set the `VAGRANT_SERVER_URL`
|
||||
To set a URL to a Vagrant Cloud server, set the `VAGRANT_SERVER_URL`
|
||||
environmental variable. Or, if you meant to use a file path, make sure
|
||||
the path to the file is valid.
|
||||
box_update_multi_provider: |-
|
||||
|
|
|
@ -107,13 +107,13 @@ describe VagrantPlugins::LoginCommand::Client do
|
|||
end
|
||||
|
||||
it "prefers the environment variable" do
|
||||
stub_env("ATLAS_TOKEN" => "ABCD1234")
|
||||
stub_env("VAGRANT_CLOUD_TOKEN" => "ABCD1234")
|
||||
subject.store_token("EFGH5678")
|
||||
expect(subject.token).to eq("ABCD1234")
|
||||
end
|
||||
|
||||
it "prints a warning if the envvar and stored file are both present" do
|
||||
stub_env("ATLAS_TOKEN" => "ABCD1234")
|
||||
stub_env("VAGRANT_CLOUD_TOKEN" => "ABCD1234")
|
||||
subject.store_token("EFGH5678")
|
||||
expect(env.ui).to receive(:warn).with(/detected both/)
|
||||
subject.token
|
||||
|
|
|
@ -67,9 +67,8 @@ description: |-
|
|||
<h3>Jack Pearkes (<a href="https://github.com/pearkes">@pearkes</a>)</h3>
|
||||
<p>
|
||||
Jack Pearkes created and maintains many projects at HashiCorp. He
|
||||
is the original author of Vagrant Cloud (now
|
||||
<a href="https://atlas.hashicorp.com">Atlas</a>). He is also a
|
||||
core committer to <a href="https://www.packer.io">Packer</a>
|
||||
is the original author of <a href="https://vagrantcloud.com">Vagrant Cloud</a>.
|
||||
He is also a core committer to <a href="https://www.packer.io">Packer</a>
|
||||
and maintains many successful
|
||||
<a href="https://github.com/pearkes">open source projects</a>
|
||||
while also being an employee of
|
||||
|
|
|
@ -19,7 +19,7 @@ boxes. You can read the documentation on the [vagrant box](/docs/cli/box.html)
|
|||
command for more information.
|
||||
|
||||
The easiest way to use a box is to add a box from the
|
||||
[publicly available catalog of Vagrant boxes](https://atlas.hashicorp.com/boxes/search).
|
||||
[publicly available catalog of Vagrant boxes](https://vagrantcloud.com/boxes/search).
|
||||
You can also add and share your own customized boxes on this website.
|
||||
|
||||
Boxes also support versioning so that members of your team using Vagrant
|
||||
|
@ -32,7 +32,7 @@ sub-pages in the navigation to the left.
|
|||
## Discovering Boxes
|
||||
|
||||
The easiest way to find boxes is to look on the
|
||||
[public Vagrant box catalog](https://atlas.hashicorp.com/boxes/search)
|
||||
[public Vagrant box catalog](https://vagrantcloud.com/boxes/search)
|
||||
for a box matching your use case. The catalog contains most major operating
|
||||
systems as bases, as well as specialized boxes to get you up and running
|
||||
quickly with LAMP stacks, Ruby, Python, etc.
|
||||
|
@ -53,7 +53,7 @@ initialize a Vagrant environment with `vagrant init hashicorp/precise64`.
|
|||
|
||||
~> **Namespaces do not guarantee canonical boxes!** A common misconception is
|
||||
that a namespace like "ubuntu" represents the canonical space for Ubuntu boxes.
|
||||
This is untrue. Namespaces on Atlas behave very similarly to namespaces on
|
||||
This is untrue. Namespaces on Vagrant Cloud behave very similarly to namespaces on
|
||||
GitHub, for example. Just as GitHub's support team is unable to assist with
|
||||
issues in someone's repository, HashiCorp's support team is unable to assist
|
||||
with third-party published boxes.
|
||||
|
@ -74,8 +74,8 @@ Vagrant.configure("2") do |config|
|
|||
end
|
||||
```
|
||||
|
||||
For other users, we recommend the [Bento boxes](https://atlas.hashicorp.com/bento). The Bento boxes are [open source](https://github.com/chef/bento) and built for a number of providers including VMware, Virtualbox, and Parallels. There are a variety of operating systems and versions available.
|
||||
For other users, we recommend the [Bento boxes](https://vagrantcloud.com/bento). The Bento boxes are [open source](https://github.com/chef/bento) and built for a number of providers including VMware, Virtualbox, and Parallels. There are a variety of operating systems and versions available.
|
||||
|
||||
These are the only two officially-recommended box sets.
|
||||
|
||||
~> **It is often a point of confusion**, but Canonical (the company that makes the Ubuntu operating system) publishes boxes under the "ubuntu" namespace on Atlas. These boxes only support Virtualbox and do not provide an ideal experience for most users. If you encounter issues with these boxes, please try the Bento boxes instead.
|
||||
~> **It is often a point of confusion**, but Canonical (the company that makes the Ubuntu operating system) publishes boxes under the "ubuntu" namespace on Vagrant Cloud. These boxes only support Virtualbox and do not provide an ideal experience for most users. If you encounter issues with these boxes, please try the Bento boxes instead.
|
||||
|
|
|
@ -66,7 +66,7 @@ Provider-specific guides for creating base boxes are linked below:
|
|||
* [VMware Base Boxes](/docs/vmware/boxes.html)
|
||||
* [VirtualBox Base Boxes](/docs/virtualbox/boxes.html)
|
||||
|
||||
### Packer and Atlas
|
||||
### Packer and Vagrant Cloud
|
||||
|
||||
We strongly recommend using [Packer](https://www.packer.io) to create reproducible
|
||||
builds for your base boxes, as well as automating the builds with
|
||||
|
@ -265,7 +265,7 @@ provider-specific guides are linked to towards the top of this page.
|
|||
You can distribute the box file however you would like. However, if you want
|
||||
to support versioning, putting multiple providers at a single URL, pushing
|
||||
updates, analytics, and more, we recommend you add the box to
|
||||
[HashiCorp's Atlas](/docs/other/atlas.html).
|
||||
[HashiCorp's Vagrant Cloud](/docs/vagrant-cloud).
|
||||
|
||||
You can upload both public and private boxes to this service.
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ Today, there are three different components:
|
|||
box file and so on.
|
||||
|
||||
* Box Catalog Metadata - This is a JSON document (typically exchanged
|
||||
during interactions with [HashiCorp's Atlas](/docs/other/atlas.html))
|
||||
during interactions with [HashiCorp's Vagrant Cloud](/docs/vagrant-cloud))
|
||||
that specifies the name of the box, a description, available
|
||||
versions, available providers, and URLs to the actual box files
|
||||
(next component) for each provider and version. If this catalog
|
||||
|
@ -86,8 +86,8 @@ providers from a single file, and more.
|
|||
|
||||
<div class="alert alert-block alert-info">
|
||||
<strong>You do not need to manually make the metadata.</strong> If you
|
||||
have an account with <a href="/docs/other/atlas.html">HashiCorp's Atlas</a>, you
|
||||
can create boxes there, and HashiCorp's Atlas automatically creates
|
||||
have an account with <a href="/docs/vagrant-cloud">HashiCorp's Vagrant Cloud</a>, you
|
||||
can create boxes there, and HashiCorp's Vagrant Cloud automatically creates
|
||||
the metadata for you. The format is still documented here.
|
||||
</div>
|
||||
|
||||
|
|
|
@ -30,10 +30,10 @@ to update your own custom boxes with versions. That is covered in
|
|||
|
||||
`vagrant box list` only shows _installed_ versions of boxes. If you want
|
||||
to see all available versions of a box, you will have to find the box
|
||||
on [HashiCorp's Atlas](/docs/other/atlas.html). An easy way to find a box
|
||||
is to use the url `https://atlas.hashicorp.com/$USER/$BOX`. For example, for
|
||||
on [HashiCorp's Vagrant Cloud](/docs/vagrant-cloud). An easy way to find a box
|
||||
is to use the url `https://vagrantcloud.com/$USER/$BOX`. For example, for
|
||||
the `hashicorp/precise64` box, you can find information about it at
|
||||
`https://atlas.hashicorp.com/hashicorp/precise64`.
|
||||
`https://vagrantcloud.com/hashicorp/precise64`.
|
||||
|
||||
You can check if the box you are using is outdated with `vagrant box outdated`.
|
||||
This can check if the box in your current Vagrant environment is outdated
|
||||
|
@ -104,4 +104,4 @@ be large, you may want to actively prune them once in a while using
|
|||
`vagrant box remove`. You can see all the boxes that are installed
|
||||
using `vagrant box list`.
|
||||
|
||||
Another option is to use `vagrant box prune` command to remove all installed boxes that are outdated and not currently in use.
|
||||
Another option is to use `vagrant box prune` command to remove all installed boxes that are outdated and not currently in use.
|
||||
|
|
|
@ -32,10 +32,10 @@ This adds a box with the given address to Vagrant. The address can be
|
|||
one of three things:
|
||||
|
||||
* A shorthand name from the
|
||||
[public catalog of available Vagrant images](https://atlas.hashicorp.com/boxes/search),
|
||||
[public catalog of available Vagrant images](https://vagrantcloud.com/boxes/search),
|
||||
such as "hashicorp/precise64".
|
||||
|
||||
* File path or HTTP URL to a box in a [catalog](https://atlas.hashicorp.com/boxes/search).
|
||||
* File path or HTTP URL to a box in a [catalog](https://vagrantcloud.com/boxes/search).
|
||||
For HTTP, basic authentication is supported and `http_proxy` environmental
|
||||
variables are respected. HTTPS is also supported.
|
||||
|
||||
|
@ -99,8 +99,8 @@ you are not using a catalog).
|
|||
to be specified.
|
||||
|
||||
<div class="alert alert-warning">
|
||||
<strong>Checksums for versioned boxes or boxes from HashiCorp's Atlas:</strong>
|
||||
For boxes from HashiCorp's Atlas, the checksums are embedded in the metadata
|
||||
<strong>Checksums for versioned boxes or boxes from HashiCorp's Vagrant Cloud:</strong>
|
||||
For boxes from HashiCorp's Vagrant Cloud, the checksums are embedded in the metadata
|
||||
of the box. The metadata itself is served over TLS and its format is validated.
|
||||
</div>
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ page_title: "vagrant login - Command-Line Interface"
|
|||
sidebar_current: "cli-login"
|
||||
description: |-
|
||||
The "vagrant login" command is used to authenticate Vagrant with HashiCorp's
|
||||
Atlas service to use features like private boxes and "vagrant push".
|
||||
Vagrant Cloud service to use features like private boxes and "vagrant push".
|
||||
---
|
||||
|
||||
# Login
|
||||
|
@ -12,7 +12,7 @@ description: |-
|
|||
**Command: `vagrant login`**
|
||||
|
||||
The login command is used to authenticate with the
|
||||
[HashiCorp's Atlas](/docs/other/atlas.html) server. Logging is only
|
||||
[HashiCorp's Vagrant Cloud](/docs/vagrant-cloud) server. Logging is only
|
||||
necessary if you are accessing protected boxes or using
|
||||
[Vagrant Share](/docs/share/).
|
||||
|
||||
|
@ -34,19 +34,19 @@ is available below.
|
|||
logged out, this command will do nothing. It is not an error to call this
|
||||
command if you are already logged out.
|
||||
|
||||
* `--token` - This will set the Atlas login token manually to the provided
|
||||
string. It is assumed this token is a valid Atlas access token.
|
||||
* `--token` - This will set the Vagrant Cloud login token manually to the provided
|
||||
string. It is assumed this token is a valid Vagrant Cloud access token.
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
Securely authenticate to Atlas using a username and password:
|
||||
Securely authenticate to Vagrant Cloud using a username and password:
|
||||
|
||||
```text
|
||||
$ vagrant login
|
||||
# ...
|
||||
Atlas username:
|
||||
Atlas password:
|
||||
Vagrant Cloud username:
|
||||
Vagrant Cloud password:
|
||||
```
|
||||
|
||||
Check if the current user is authenticated:
|
||||
|
@ -56,7 +56,7 @@ $ vagrant login --check
|
|||
You are already logged in.
|
||||
```
|
||||
|
||||
Securely authenticate with Atlas using a token:
|
||||
Securely authenticate with Vagrant Cloud using a token:
|
||||
|
||||
```text
|
||||
$ vagrant login --token ABCD1234
|
||||
|
|
|
@ -21,5 +21,5 @@ admin rights. Vagrant will show you an error if it does not have the proper
|
|||
permissions.
|
||||
|
||||
Boxes for Hyper-V can be easily found on
|
||||
[HashiCorp's Atlas](https://atlas.hashicorp.com/boxes/search). To get started, you might
|
||||
[HashiCorp's Vagrant Cloud](https://vagrantcloud.com/boxes/search). To get started, you might
|
||||
want to try the `hashicorp/precise64` box.
|
||||
|
|
|
@ -1,23 +0,0 @@
|
|||
---
|
||||
layout: "docs"
|
||||
page_title: "Atlas and Vagrant"
|
||||
sidebar_current: "other-atlas"
|
||||
description: |-
|
||||
A brief description of how to use, sign up for and access the
|
||||
Vagrant features in Atlas.
|
||||
---
|
||||
|
||||
# Atlas and Vagrant
|
||||
|
||||
Atlas is the HashiCorp Suite for the Enterprise,
|
||||
but also provides features for the community. It hosts
|
||||
a <a href="https://atlas.hashicorp.com/boxes/search">public registry of Vagrant boxes</a>
|
||||
as well as powers the Vagrant share features.
|
||||
|
||||
Vagrant Enterprise is provided via Atlas and allows
|
||||
for private boxes to be hosted and distributed to
|
||||
your team.
|
||||
|
||||
## Signing up for Atlas
|
||||
|
||||
You can signup for a free Atlas account <a href="https://atlas.hashicorp.com/account/new">here</a>.
|
|
@ -12,6 +12,5 @@ description: |-
|
|||
This section covers other information that does not quite fit under the
|
||||
other categories.
|
||||
|
||||
- [Atlas](/docs/other/atlas.html)
|
||||
- [Debugging](/docs/other/debugging.html)
|
||||
- [Environment Variables](/docs/other/environmental-variables.html)
|
||||
|
|
|
@ -1,68 +0,0 @@
|
|||
---
|
||||
layout: "docs"
|
||||
page_title: "Vagrant Push - Atlas Strategy"
|
||||
sidebar_current: "push-atlas"
|
||||
description: |-
|
||||
Atlas is HashiCorp's commercial offering to bring your Vagrant development
|
||||
environments to production. The Vagrant Push Atlas strategy pushes your
|
||||
application's code to HashiCorp's Atlas service.
|
||||
---
|
||||
|
||||
# Vagrant Push
|
||||
|
||||
## Atlas Strategy
|
||||
|
||||
[Atlas][] is HashiCorp's commercial offering to bring your Vagrant development
|
||||
environments to production. You can read more about HashiCorp's Atlas and all
|
||||
its features on [the Atlas homepage][Atlas]. The Vagrant Push Atlas strategy
|
||||
pushes your application's code to HashiCorp's Atlas service.
|
||||
|
||||
The Vagrant Push Atlas strategy supports the following configuration options:
|
||||
|
||||
- `app` - The name of the application in [HashiCorp's Atlas][Atlas]. If the
|
||||
application does not exist, it will be created with user confirmation.
|
||||
|
||||
- `exclude` - Add a file or file pattern to exclude from the upload, relative to
|
||||
the `dir`. This value may be specified multiple times and is additive.
|
||||
`exclude` take precedence over `include` values.
|
||||
|
||||
- `include` - Add a file or file pattern to include in the upload, relative to
|
||||
the `dir`. This value may be specified multiple times and is additive.
|
||||
|
||||
- `dir` - The base directory containing the files to upload. By default this is
|
||||
the same directory as the Vagrantfile, but you can specify this if you have
|
||||
a `src` folder or `bin` folder or some other folder you want to upload.
|
||||
|
||||
- `vcs` - If set to true, Vagrant will automatically use VCS data to determine
|
||||
the files to upload. Uncommitted changes will not be deployed.
|
||||
|
||||
Additionally, the following options are exposed for power users of the Vagrant
|
||||
Atlas push strategy. Most users will not require these options:
|
||||
|
||||
- `address` - The address of the Atlas server to upload to. By default this will
|
||||
be the public Atlas server.
|
||||
|
||||
- `token` - The Atlas token to use. If the user has run `vagrant login`, this
|
||||
will the token generated by that command. If the environment variable
|
||||
`ATLAS_TOKEN` is set, the uploader will use this value. By default, this is
|
||||
nil.
|
||||
|
||||
|
||||
### Usage
|
||||
|
||||
The Vagrant Push Atlas strategy is defined in the `Vagrantfile` using the
|
||||
`atlas` key:
|
||||
|
||||
```ruby
|
||||
config.push.define "atlas" do |push|
|
||||
push.app = "username/application"
|
||||
end
|
||||
```
|
||||
|
||||
And then push the application to Atlas:
|
||||
|
||||
```shell
|
||||
$ vagrant push
|
||||
```
|
||||
|
||||
[Atlas]: /docs/other/atlas.html "HashiCorp's Atlas Service"
|
|
@ -10,8 +10,7 @@ description: |-
|
|||
# Vagrant Push
|
||||
|
||||
As of version 1.7, Vagrant is capable of deploying or "pushing" application code
|
||||
in the same directory as your Vagrantfile to a remote such as an FTP server or
|
||||
[HashiCorp's Atlas][Atlas].
|
||||
in the same directory as your Vagrantfile to a remote such as an FTP server.
|
||||
|
||||
Pushes are defined in an application's `Vagrantfile` and are invoked using the
|
||||
`vagrant push` subcommand. Much like other components of Vagrant, each Vagrant
|
||||
|
@ -57,5 +56,4 @@ $ vagrant push staging
|
|||
Vagrant Push is the easiest way to deploy your application. You can read more
|
||||
in the documentation links on the sidebar.
|
||||
|
||||
[Atlas]: https://atlas.hashicorp.com/ "HashiCorp's Atlas Service"
|
||||
[Vagrant Providers]: /docs/providers/ "Vagrant Providers"
|
||||
|
|
|
@ -16,15 +16,12 @@ Any TCP traffic sent to this IP is sent to the shared Vagrant environment.
|
|||
|
||||
## Usage
|
||||
|
||||
Just call `vagrant share`. This will automatically share as many ports as
|
||||
possible for remote connections. If the Vagrant environment has a static IP or
|
||||
DNS address, then almost every port will be available (although some must be
|
||||
explicitly enabled for security reasons). Otherwise, Vagrant will only
|
||||
expose forwarded ports on the machine. Please see
|
||||
Just call `vagrant share --full`. This will automatically share as many ports as
|
||||
possible for remote connections. Please see
|
||||
[the Vagrant share security page](/docs/share/security.html) for more
|
||||
information.
|
||||
|
||||
Note the share name at the end of calling `vagrant share`, and give this to
|
||||
Note the share name at the end of calling `vagrant share --full`, and give this to
|
||||
the person who wants to connect to your machine. They simply have to call
|
||||
`vagrant connect NAME`. This will give them a static IP they can use to access
|
||||
your Vagrant environment.
|
||||
|
|
|
@ -28,15 +28,11 @@ To use HTTP sharing, simply run `vagrant share`:
|
|||
```
|
||||
$ vagrant share
|
||||
==> default: Detecting network information for machine...
|
||||
default: Local machine address: 192.168.163.152
|
||||
default: Local HTTP port: 4567
|
||||
default: Local HTTPS port: disabled
|
||||
==> default: Checking authentication and authorization...
|
||||
default: Local machine address: 192.168.84.130
|
||||
default: Local HTTP port: 9999
|
||||
default: Local HTTPS port: disabled
|
||||
==> default: Creating Vagrant Share session...
|
||||
default: Share will be at: ghastly-wombat-4051
|
||||
==> default: Your Vagrant Share is running!
|
||||
default: Name: ghastly-wombat-4051
|
||||
==> default: URL: http://ghastly-wombat-4051.vagrantshare.com
|
||||
==> default: HTTP URL: http://b1fb1f3f.ngrok.io
|
||||
```
|
||||
|
||||
Vagrant detects where your HTTP server is running in your Vagrant environment
|
||||
|
@ -83,12 +79,10 @@ should do this anyways!
|
|||
## HTTPS (SSL)
|
||||
|
||||
Vagrant Share can also expose an SSL port that can be accessed over
|
||||
SSL. For example, instead of accessing `http://foo.vagrantshare.com`, it
|
||||
could be accessed at `https://foo.vagrantshare.com`.
|
||||
SSL. Creating an HTTPS share requires a non-free ngrok account.
|
||||
|
||||
`vagrant share` by default looks for any SSL traffic on port 443 in your
|
||||
development environment. If it cannot find any, then SSL is disabled by
|
||||
default.
|
||||
|
||||
You can force SSL by setting the `--https` flag to point to the accessible
|
||||
SSL port.
|
||||
The HTTPS share can be explicitly disabled using the `--disable-https` flag.
|
||||
|
|
|
@ -38,5 +38,4 @@ The details of each are covered in their specific section in the sidebar
|
|||
to the left. We also have a section where we go into detail about the
|
||||
security implications of this feature.
|
||||
|
||||
Vagrant Share requires an account with
|
||||
[HashiCorp's Atlas](/docs/other/atlas.html) to be used.
|
||||
Vagrant Share requires [ngrok](https://ngrok.com) to be used.
|
||||
|
|
|
@ -1,66 +0,0 @@
|
|||
---
|
||||
layout: "docs"
|
||||
page_title: "ngrok - Vagrant Share"
|
||||
sidebar_current: "share-ngrok"
|
||||
description: |-
|
||||
Vagrant share can be driven using ngrok for the underlying transport
|
||||
by supplying the "--driver ngrok" flag to "vagrant share".
|
||||
---
|
||||
|
||||
# Sharing via ngrok
|
||||
|
||||
[ngrok](https://ngrok.com) is a hosted reverse proxy service. It allows you to
|
||||
create a secure tunnel from a public endpoint to a locally running web service.
|
||||
|
||||
Vagrant share can be driven using ngrok from the underlying transport
|
||||
by supplying the `--driver ngrok` flag to `vagrant share`.
|
||||
|
||||
The ngrok driver is not enabled by default. When starting the Vagrant
|
||||
share, ngrok must be specified as the driver. Users connecting to
|
||||
the share must also specify the ngrok driver to make a proper connection.
|
||||
|
||||
|
||||
## Sharing
|
||||
|
||||
Starting a Vagrant share using the ngrok driver is very similar to the
|
||||
default Vagrant share command. The only addition it requires is the
|
||||
`--driver ngrok` flag:
|
||||
|
||||
```
|
||||
$ vagrant share --driver ngrok
|
||||
```
|
||||
|
||||
By default this will create a public HTTP endpoint
|
||||
connected to the shared VM via an ngrok process. When only HTTP is being
|
||||
shared, no connection is required from the remote side. All that is required
|
||||
is the public ngrok URL.
|
||||
|
||||
### SSH
|
||||
|
||||
To share an ssh connection to the shared VM the `--ssh` flag must be provided.
|
||||
Vagrant share will then create a small utility VM to enable the share with
|
||||
remote users. Once the setup is complete, a name will be assigned to the
|
||||
utility VM that remote users can reach using the `vagrant connect` command.
|
||||
|
||||
### Full Share
|
||||
|
||||
To enable full remote access to the shared VM the `--full` flag must be provided.
|
||||
This will enable remote users connecting to the local share full access to all
|
||||
forwarded ports defined by the shared VM Vagrantfile.
|
||||
|
||||
## Connecting
|
||||
|
||||
Much like the `vagrant share` command, when connecting to a Vagrant share
|
||||
that was created using the ngrok driver, the `--driver ngrok` flag must
|
||||
be provided:
|
||||
|
||||
```
|
||||
$ vagrant connect --driver ngrok share_name
|
||||
```
|
||||
|
||||
## ngrok configuration
|
||||
|
||||
The current user's ngrok configuration file is used by default when
|
||||
tunnels are created for Vagrant share. While specific customization
|
||||
to the ngrok configuration is not yet supported, the feature is being
|
||||
actively worked on and will be available in the future.
|
|
@ -20,20 +20,11 @@ help control access and manage security:
|
|||
* `--disable-http` will not create a publicly accessible HTTP URL. When
|
||||
this is set, the only way to access the share is with `vagrant connect`.
|
||||
|
||||
* `--ssh-once` will allow only one person to SSH into your shared environment.
|
||||
After the first SSH access, the keypair is physically deleted and SSH
|
||||
access will not be possible anymore.
|
||||
|
||||
In addition to these options, there are other features we've built to help:
|
||||
|
||||
* Vagrant share uses end-to-end TLS connections. So even unencrypted TCP streams
|
||||
are encrypted through the various proxies and only unencrypted during the final
|
||||
local communication between the local proxy and the Vagrant environment.
|
||||
|
||||
* Share names, such as happy-panda-1234, are randomly chosen from a pool
|
||||
of over 40,000,000 possible names. And we're routinely adding more
|
||||
words to grow this pool. It is unlikely that anyone will guess your
|
||||
share name.
|
||||
* Vagrant share uses end-to-end TLS for non-HTTP connections. So even unencrypted
|
||||
TCP streams are encrypted through the various proxies and only unencrypted during
|
||||
the final local communication between the local proxy and the Vagrant environment.
|
||||
|
||||
* SSH keys are encrypted by default, using a password that is not transmitted
|
||||
to our servers or across the network at all.
|
||||
|
@ -41,20 +32,6 @@ In addition to these options, there are other features we've built to help:
|
|||
* SSH is not shared by default, it must explicitly be shared with the
|
||||
`--ssh` flag.
|
||||
|
||||
* A web interface we've built shows share history and will show basic
|
||||
access logs in the future.
|
||||
|
||||
* Share sessions expire after a short time (currently 1 hour), but
|
||||
can also be expired manually by `ctrl-c` from the sharing machine
|
||||
or via the web interface.
|
||||
|
||||
Most importantly, you must understand that by running `vagrant share`,
|
||||
you are making your Vagrant environment accessible by anyone who knows
|
||||
the share name. When share is not running, it is not accessible.
|
||||
|
||||
Later, we will be expanding the security of this feature by adding ACLs,
|
||||
so you are able to explicitly allow
|
||||
access to your share based on who is connecting.
|
||||
|
||||
For maximum security, we will also allow you to run your own Vagrant
|
||||
Share server. This option is not available yet.
|
||||
|
|
|
@ -25,31 +25,54 @@ Just run `vagrant share --ssh`!
|
|||
|
||||
When SSH sharing is enabled, Vagrant generates a brand new keypair for
|
||||
SSH access. The public key portion is automatically inserted
|
||||
into the Vagrant machine, and the private key portion is uploaded to the
|
||||
server managing the Vagrant shares. This private key is encrypted using
|
||||
into the Vagrant machine, and the private key portion is provided to the
|
||||
user connecting to the Vagrant share. This private key is encrypted using
|
||||
a password that you will be prompted for. This password is _never_ transmitted
|
||||
across the network by Vagrant, and is an extra layer of security preventing
|
||||
us or anyone who may know your share name from easily accessing your machine.
|
||||
anyone who may know your share name from easily accessing your machine.
|
||||
|
||||
After running `vagrant share --ssh`, it will output the name of your share:
|
||||
|
||||
```
|
||||
$ vagrant share --ssh
|
||||
==> default: Detecting network information for machine...
|
||||
default: Local machine address: 192.168.163.152
|
||||
default: Local HTTP port: 4567
|
||||
default: Local HTTPS port: disabled
|
||||
default: SSH Port: 22
|
||||
default: Local machine address: 192.168.84.130
|
||||
==> default: Generating new SSH key...
|
||||
default: Please enter a password to encrypt the key:
|
||||
default: Repeat the password to confirm:
|
||||
default: Inserting generated SSH key into machine...
|
||||
==> default: Checking authentication and authorization...
|
||||
default: Please enter a password to encrypt the key:
|
||||
default: Repeat the password to confirm:
|
||||
default: Inserting generated SSH key into machine...
|
||||
default: Local HTTP port: disabled
|
||||
default: Local HTTPS port: disabled
|
||||
default: SSH Port: 2200
|
||||
==> default: Creating Vagrant Share session...
|
||||
default: Share will be at: itty-bitty-polar-8667
|
||||
==> default: Your Vagrant Share is running!
|
||||
default: Name: itty-bitty-polar-8667
|
||||
...
|
||||
share: Cloning VMware VM: 'hashicorp/vagrant-share'. This can take some time...
|
||||
share: Verifying vmnet devices are healthy...
|
||||
share: Preparing network adapters...
|
||||
share: Starting the VMware VM...
|
||||
share: Waiting for machine to boot. This may take a few minutes...
|
||||
share: SSH address: 192.168.84.134:22
|
||||
share: SSH username: tc
|
||||
share: SSH auth method: password
|
||||
share:
|
||||
share: Inserting generated public key within guest...
|
||||
share: Removing insecure key from the guest if it's present...
|
||||
share: Key inserted! Disconnecting and reconnecting using new SSH key...
|
||||
share: Machine booted and ready!
|
||||
share: Forwarding ports...
|
||||
share: -- 31338 => 65534
|
||||
share: -- 22 => 2202
|
||||
share: SSH address: 192.168.84.134:22
|
||||
share: SSH username: tc
|
||||
share: SSH auth method: password
|
||||
share: Configuring network adapters within the VM...
|
||||
==> share:
|
||||
==> share: Your Vagrant Share is running! Name: bazaar_wolf:sultan_oasis
|
||||
==> share:
|
||||
==> share: You're sharing with SSH access. This means that another can SSH to
|
||||
==> share: your Vagrant machine by running:
|
||||
==> share:
|
||||
==> share: vagrant connect --ssh bazaar_wolf:sultan_oasis
|
||||
==> share:
|
||||
```
|
||||
|
||||
Anyone can then SSH directly to your Vagrant environment by running
|
||||
|
@ -57,8 +80,8 @@ Anyone can then SSH directly to your Vagrant environment by running
|
|||
previously.
|
||||
|
||||
```
|
||||
$ vagrant connect --ssh itty-bitty-polar-8667
|
||||
Loading share 'itty-bitty-polar-8667'...
|
||||
$ vagrant connect --ssh bazaar_wolf:sultan_oasis
|
||||
Loading share 'bazaar_wolf:sultan_oasis'...
|
||||
The SSH key to connect to this share is encrypted. You will
|
||||
require the password entered when creating the share to
|
||||
decrypt it. Verify you have access to this password before
|
||||
|
@ -76,8 +99,3 @@ vagrant@vagrant:~$
|
|||
|
||||
If the private key is encrypted (the default behavior), then the connecting
|
||||
person will be prompted for the password to decrypt the private key.
|
||||
|
||||
Additional flags are available such as `--ssh-once` to add another layer
|
||||
of security to your SSH shared session. With this flag active, only one
|
||||
`vagrant connect --ssh` can be attempted before the keypair is destroyed,
|
||||
preventing any future connections.
|
||||
|
|
|
@ -24,7 +24,7 @@ for the machine to boot and be accessible. By default this is 300 seconds.
|
|||
`config.vm.box` - This configures what [box](/docs/boxes.html) the
|
||||
machine will be brought up against. The value here should be the name
|
||||
of an installed box or a shorthand name of a box in
|
||||
[HashiCorp's Atlas](/docs/other/atlas.html).
|
||||
[HashiCorp's Vagrant Cloud](/docs/vagrant-cloud).
|
||||
|
||||
This option requires Vagrant 1.5 or higher. You can download the latest version
|
||||
of Vagrant from the [Vagrant installers page](/downloads.html).
|
||||
|
@ -35,7 +35,7 @@ of Vagrant from the [Vagrant installers page](/downloads.html).
|
|||
the configured box on every `vagrant up`. If an update is found, Vagrant
|
||||
will tell the user. By default this is true. Updates will only be checked
|
||||
for boxes that properly support updates (boxes from
|
||||
[HashiCorp's Atlas](/docs/other/atlas.html)
|
||||
[HashiCorp's Vagrant Cloud](/docs/vagrant-cloud)
|
||||
or some other versioned box).
|
||||
|
||||
<hr>
|
||||
|
@ -88,7 +88,7 @@ all subsequent redirects. By default, redirect locations are untrusted so creden
|
|||
<hr>
|
||||
|
||||
`config.vm.box_url` - The URL that the configured box can be found at.
|
||||
If `config.vm.box` is a shorthand to a box in [HashiCorp's Atlas](/docs/other/atlas.html)
|
||||
If `config.vm.box` is a shorthand to a box in [HashiCorp's Vagrant Cloud](/docs/vagrant-cloud)
|
||||
then this value does not need to be specified. Otherwise, it should
|
||||
point to the proper place where the box can be found if it is not
|
||||
installed.
|
||||
|
|
|
@ -14,7 +14,7 @@ description: |-
|
|||
|
||||
<a class="button primary" href="/intro/index.html">Get Started</a>
|
||||
<a class="button" href="/downloads.html">Download <%= latest_version %></a>
|
||||
<a class="button" href="https://atlas.hashicorp.com/boxes/search" target="_TOP">Find Boxes</a>
|
||||
<a class="button" href="https://vagrantcloud.com/boxes/search" target="_TOP">Find Boxes</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -34,8 +34,8 @@ $ vagrant box add hashicorp/precise64
|
|||
```
|
||||
|
||||
This will download the box named "hashicorp/precise64" from
|
||||
[HashiCorp's Atlas box catalog](https://atlas.hashicorp.com/boxes/search), a place where you can find
|
||||
and host boxes. While it is easiest to download boxes from HashiCorp's Atlas
|
||||
[HashiCorp's Vagrant Cloud box catalog](https://vagrantcloud.com/boxes/search), a place where you can find
|
||||
and host boxes. While it is easiest to download boxes from HashiCorp's Vagrant Cloud
|
||||
you can also add boxes from a local file, custom URL, etc.
|
||||
|
||||
Boxes are globally stored for the current user. Each project uses a box
|
||||
|
@ -52,7 +52,7 @@ will not be covered in the getting started guide.
|
|||
|
||||
~> **Namespaces do not guarantee canonical boxes!** A common misconception is
|
||||
that a namespace like "ubuntu" represents the canonical space for Ubuntu boxes.
|
||||
This is untrue. Namespaces on Atlas behave very similarly to namespaces on
|
||||
This is untrue. Namespaces on Vagrant Cloud behave very similarly to namespaces on
|
||||
GitHub, for example. Just as GitHub's support team is unable to assist with
|
||||
issues in someone's repository, HashiCorp's support team is unable to assist
|
||||
with third-party published boxes.
|
||||
|
@ -103,12 +103,12 @@ For the remainder of this getting started guide, we will only use the
|
|||
this getting started guide, the first question you will probably have is
|
||||
"where do I find more boxes?"
|
||||
|
||||
The best place to find more boxes is [HashiCorp's Atlas box catalog](https://atlas.hashicorp.com/boxes/search).
|
||||
HashiCorp's Atlas has a public directory of freely available boxes that
|
||||
run various platforms and technologies. HashiCorp's Atlas also has a great search
|
||||
The best place to find more boxes is [HashiCorp's Vagrant Cloud box catalog](https://vagrantcloud.com/boxes/search).
|
||||
HashiCorp's Vagrant Cloud has a public directory of freely available boxes that
|
||||
run various platforms and technologies. HashiCorp's Vagrant Cloud also has a great search
|
||||
feature to allow you to find the box you care about.
|
||||
|
||||
In addition to finding free boxes, HashiCorp's Atlas lets you host your own
|
||||
In addition to finding free boxes, HashiCorp's Vagrant Cloud lets you host your own
|
||||
boxes, as well as private boxes if you intend on creating boxes for your
|
||||
own organization.
|
||||
|
||||
|
|
|
@ -200,7 +200,6 @@
|
|||
<li<%= sidebar_current("push") %>>
|
||||
<a href="/docs/push/">Push</a>
|
||||
<ul class="nav">
|
||||
<li<%= sidebar_current("push-atlas") %>><a href="/docs/push/atlas.html">Atlas</a></li>
|
||||
<li<%= sidebar_current("push-ftp") %>><a href="/docs/push/ftp.html">FTP / SFTP</a></li>
|
||||
<li<%= sidebar_current("push-heroku") %>><a href="/docs/push/heroku.html">Heroku</a></li>
|
||||
<li<%= sidebar_current("push-local-exec") %>><a href="/docs/push/local-exec.html">Local Exec</a></li>
|
||||
|
|
Loading…
Reference in New Issue