Commit Graph
18303 Commits
Author SHA1 Message Date
hashicorp-copywrite[bot] 19055df3ec [COMPLIANCE] License changes (#12568)
* Updating the license from MPL to Business Source License

Going forward, this project will be licensed under the Business Source License v1.1. Please see our blog post for more details at https://hashi.co/bsl-blog, FAQ at https://hashi.co/license-faq, and details of the license at www.hashicorp.com/bsl.

* Update copyright file headers to BUSL-1.1

---------

Co-authored-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com>
2023-08-10 15:53:29 -07:00
Lucas Bajolet 4d0a51c189 go.mod: bump golang.org/x/net to v0.13.0
The version of the golang.org/x/net we used (v0.8.0), is vulnerable to a
rendering issue, potentially escaping text that should not be, which can
enable other attacks then.

Packer itself is not vulnerable to the CVE as we don't render web pages,
but security checks do point it as an issue, so we fix it by updating
the dependencies.

CVE refrerence: GO-2023-1988
2023-08-08 09:54:06 -04:00
Wilken Rivera 9ccec0d4d5 Removed repetitive statement from HCP debug logs (#12552)
* Remove repetitive log statement

The log being removed is duplicated each time evalContext is
called, which seems like an unneeded debug log.
2023-08-07 20:54:19 -04:00
Lucas Bajolet 168e464ee4 docker: add full image to docker README 2023-08-04 13:30:41 -04:00
Lucas Bajolet 376f0e9991 docker: remove trailing spaces for Docker README 2023-08-04 13:30:41 -04:00
Lucas Bajolet 55854f5537 Makefile: only build dev version of binary/docker
The Docker images release-light and release-full are not to be built
locally from a dev build, but from a release, and the commands to build
those images are only referenced in CI, so we don't need to ship them as
part of the makefile.
In addition, those images are not straightforward to build from the
Makefile, as they require quite a few things from the environment, as
well as the binary installed in a specific location, which is never
setup by the rest of the Makefile.

Therefore, we opted to simplify the Makefile so that it only builds
docker-dev for local use.
2023-08-04 13:30:41 -04:00
Lucas Bajolet c6da777715 workflows: add docker-full to build workflow 2023-08-04 13:30:41 -04:00
Lucas Bajolet 838736982c Dockerfile: add release-full target
In addition to the `release-light' target, we add a `release_full'
target to the Dockerfile, so that we can ship an image of Packer with
the official plugins pre-bundled in their latest version.
2023-08-04 13:30:41 -04:00
Lucas Bajolet ffe2776770 README: fix link to CONTRIBUTING
Since the main branch is not called master anymore, and the anchor was
renamed, we fix both these changes in the link to that page from the
README.
2023-08-04 13:30:41 -04:00
Lucas Bajolet b29abbcd8c Dockerfile: remove trailing whitespaces 2023-08-04 13:30:41 -04:00
Wilken Rivera 99c79ecbd6 Add build tags to skip amd64 tests on darwin/arm64 (#12549) 2023-08-02 15:34:06 -04:00
Wilken Rivera 848039dcdb Update plugin discover testing
* Add test case for loading plugin in CWD
* Add test case to validate checksume files are ignored
* Update Discover to include CWD "." in PluginFolders if KnowPluginFolders is unset
2023-08-01 16:20:58 -04:00
Wilken Rivera a96584fb56 Update plugin discover logic
When copying a plugin's checksum file (packer-plugin-*_SHA256SUM) installed by `packer plugins install` or `packer init`
into a separate directory the file may be copied with the executable bit turned out. If unchanged after the copy, Packer would
discover the checksum file as a possible plugin match and error when trying to execute describe on the plugin look a like. This change
adds a checksum file test to the plugin matching logic. If the discovered plugin name is a checksum it is excluded from the discovered plugin list.
2023-08-01 16:20:58 -04:00
Wilken Rivera d3d33714e6 Update plugin loading for current directory
Starting with Go 1.19 the loading of binaries from the current working directory was
deemed as a possible security problem. Thus the use of exec.Command or exec.LookPath no longer resolves
an executable within the current working directory. This change updates the discover logic to return absolute
paths for any discovered plugin, which is called directly when passed to exec.Command or exec.LookPath. By doing
this Packer is able to load a custom plugin sitting in the current working directory as it did in version prior to v1.9.2.
2023-08-01 16:20:58 -04:00
Wilken Rivera d1aa103ebc workflows/jira: Fix syntax error for createComment 2023-07-27 17:12:17 -04:00
hashicorp-tsccr[bot] 5c9ab19d8f Result of tsccr-helper -log-level=info -pin-all-workflows . 2023-07-27 09:05:01 -04:00
Lucas Bajolet 392232933f website: add usage notice to init
The `packer init' command's wording was not clear, so it was changed in
a preceding commit, and this commit aims to add more details on how the
command is meant to be used, along with a simple example.
2023-07-25 16:45:32 -04:00
Lucas Bajolet 3512a175a6 command: change wording for init's postitional arg
`packer init' is meant to be invoked on a template file or a directory.
This was described in the command-line help message as
`[template.pkr.hcl|folder]'.

Because this is encapsulated between square brackets, this could be
taken as an option instead of a positional, mandatory argument.

This commit changes the wording to adopt a similar convention as `packer
build', so the two are consistent in how they are invoked, and to avoid
mistaking this argument as optional.
2023-07-25 16:45:32 -04:00
Lucas Bajolet d0198c8a17 packer: track bundled plugins usage on telemetry 2023-07-25 15:43:47 -04:00
Wilken Rivera 60c66fdf9f Add additional validation for manually set project ids
When setting a project id via the HCP_PROJECT_ID env the client will try to validate the project
by checking that it has an associated registry. If the project is invalid or not a valid UUID an error
will be displayed to the user

* Add comment to clarify usage of SDK loaded env. variables
2023-07-25 11:31:39 -04:00
Wilken Rivera 38101a64c9 hcp: Add support for project level service principals
HCP supports two types of service principals: Organization-level and project-level.
When a user tries to publish to an active HCP Packer registry using a plsp the client
fails when configuring the client due to a API permission error; namely plsp do not have
the permissions to query an org for a list of projects. Setting the HCP_PROJECT_ID does
not resolve the issue because the call to ListProjects is still executed.

This changes updates the client configuration params to obtain both the HCP Organization and
Project IDs that will be used for connecting to the HCP Packer registry. With this change
if a user provides a project Id via the HCP_PROJECT_ID environment variable no call to ListProjects will
be made. Instead the value will be take as is and used to create the connection. A user connecting with
a project level service principals must provide a valid HCP_PROJECT_ID in order to connect.
2023-07-25 11:31:39 -04:00
Lucas Bajolet 55decee242 .github: fix issues-opened.yml workflow
This commit fixes a bug with the first script, as the object passed to
the REST API is not closed properly.
2023-07-24 14:21:03 -04:00
Wilken Rivera 74b5c2aa56 issue-comment-created: Add guard for labels
The action currently fails when trying to remove the stale or waiting-reply labels from issues
that do not actually contain the labels in question. This update adds a guard clause to only run the
action on issues containing at least one of the labels.
2023-07-24 13:52:17 -04:00
hashicorp-copywrite[bot] a1957a1def [COMPLIANCE] Add Copyright and License Headers 2023-07-24 12:15:59 -04:00
Wilken Rivera 2401add228 Fix body attribute for github-script comment 2023-07-24 11:52:57 -04:00
Wilken Rivera 682f2e7b6c .github/workflows: Replace untrusted GHA in repo workflows (#12530)
The GHA action used for adding comments or labels to issues untrusted by TSCCR
have been replaced with an approved set of actions. The updated workflows use
actions/github-script for adding comments or labels to an issue.

Related to: https://github.com/hashicorp/security-tsccr/pull/608
2023-07-21 17:37:50 -04:00
Wilken Rivera 13ed8d90b3 Update github-script action REST calls
Breaking changed introduced in actions/github-script@v6.
https://github.com/actions/github-script#breaking-changes-in-v5
2023-07-20 07:37:04 -04:00
Kévin Dunglas 739b2acd20 docs: fix typo (#12493) 2023-07-19 17:35:26 -04:00
dependabot[bot] e9e4534321 build(deps): bump tough-cookie from 4.0.0 to 4.1.3 in /website
Bumps [tough-cookie](https://github.com/salesforce/tough-cookie) from 4.0.0 to 4.1.3.
- [Release notes](https://github.com/salesforce/tough-cookie/releases)
- [Changelog](https://github.com/salesforce/tough-cookie/blob/master/CHANGELOG.md)
- [Commits](https://github.com/salesforce/tough-cookie/compare/v4.0.0...v4.1.3)

---
updated-dependencies:
- dependency-name: tough-cookie
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
2023-07-19 17:34:15 -04:00
dependabot[bot] 02f1d50587 build(deps-dev): bump word-wrap from 1.2.3 to 1.2.4 in /website
Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.4.
- [Release notes](https://github.com/jonschlinkert/word-wrap/releases)
- [Commits](https://github.com/jonschlinkert/word-wrap/compare/1.2.3...1.2.4)

---
updated-dependencies:
- dependency-name: word-wrap
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
2023-07-19 17:33:21 -04:00
Lucas Bajolet e3c20e3dc5 CHANGELOG: prepare for 1.9.3 2023-07-19 17:20:26 -04:00
Lucas Bajolet 3c4a4f06da CHANGELOG: add changelog for Packer 1.9.2 2023-07-19 15:13:57 -04:00
hashicorp-tsccr[bot]andhashicorp-tsccr[bot] 0194d839b0 Result of tsccr-helper -log-level=info -pin-all-workflows . (#12507)
Co-authored-by: hashicorp-tsccr[bot] <hashicorp-tsccr[bot]@users.noreply.github.com>
2023-07-19 13:20:14 -04:00
GaryNgandLucas Bajolet 58b193f221 Use backtick to prevent html parsing
Co-authored-by: Lucas Bajolet <[email protected]>
2023-07-19 11:54:11 -04:00
GaryNg cc1e2fca78 Prefix url with product slug 2023-07-19 11:54:11 -04:00
GaryNg 5271c28749 Add closing code block 2023-07-19 11:54:11 -04:00
Lucas Bajolet 6e764658b7 Makefile: remove mode-check target (#12505)
The Makefile would check for executable files inside the Packer
repository, and produce errors if one was detected and not explicitely
whitelisted through the `EXECUTABLE_FILES' Makefile variable.

This check was introduced a while back to avoid having executable files
in the repository, but this check can be problematic sometimes because
of how it is written, namely when building the website, which causes a
lot of JS executable files to appear in the hierarchy, and in turn this
causes the shell expansion to fail because of the large number of
arguments.

Since this test is not necessary for Packer to build or test, and since
it implies that we have to maintain the whitelist regex, we remove it
from the Makefile.
2023-07-18 16:14:35 -04:00
Lucas Bajolet b522edca36 hcl2_upgrade: add required_plugins in out template
When a legacy JSON template references built-in plugins, we add them to
the resulting template as a `required_plugins' block in HCL2.
2023-07-18 16:04:55 -04:00
Lucas Bajolet a2930bda4f packer: warn on bundled plugins usage
Since bundled plugins will be removed in an upcoming version of Packer,
this commit adds a new warning message whenever a template uses one such
plugin.

This warning has been implemented on build, validate, console and the
inspect subcommands.

In addition to warning about the upcoming change and potential issue
this will cause, this warning message proposes solutions to the user so
they know what they'll have to do in order not to rely on those bundled
plugins later.
2023-07-18 15:36:12 -04:00
Lucas Bajolet 2824320aa1 packer: remove discoverExternalComponents
Since the `discoverExternalComponents' function was defined but not
called anywhere, it is dead code, and can be safely removed from the
codebase.
2023-07-18 15:36:12 -04:00
Lucas Bajolet 456bc2397b hcl2template: only warn once for missing plugins
In HCL2, if a template contains a `required_plugins' block, but the
required plugins are not installed, we print a warning.

Prior to this commit, this was reported as an error once per missing
plugin, which was redundant.
This commit changes that by gathering all the missing plugins once, and
printing them as a bullet list, so the message isn't redundant anymore.
2023-07-17 16:54:44 -04:00
akkuman 0e3de18e98 fix: revise env var PACKER_PLUGIN_PATH
ref: https://github.com/hashicorp/packer/pull/8616/files#diff-0e426a43248661127a0c0ee115aef7a1093b635f8993b3f7ebb1dd9f05b8f249R153
2023-07-13 09:21:09 -04:00
Lucas Bajolet 8beddcf52a website: fix header on configure page
When the config file header was reworked, an erroneous link was
included and placed so close to the header that it was rendered verbatim
in the final documentation page.

By adding an extra empty line in between the anchor link and the header,
this renders correctly.
2023-07-12 12:45:42 -04:00
Wilken Rivera 9c85fc274a Update plugin loading documentation (#12485)
Packer checks a number of directories for plugins upon initialization,
with the introduction of multi-component plugins and underlying changes
to the Packer SDK the ordering changed slightly. These changes update
the related documentation to reflect the new ordering, and adds a plugin
loading ordering section to the docs to help users discover how plugin
loading works.

Include in this change are updates to the PACKER_CONFIG_DIR environment
variables to reflect the XDG base directory specification used as the
default Packer configuration directory layout.

* Update website/content/docs/configure.mdx
2023-07-06 16:00:36 -04:00
Wilken Rivera 8982d4f168 Migrate external Parallels plugin to Parallels/packer-plugin-parallels (#12476)
* Update external plugin documentation source

The Parallels plugin for Packer is now maintained by the Parallels team, under
their respective GitHub org. This changes updates the source address for
the external plugin that should be used for pulling new plugin
documentation.

* Removed packer-plugin-parallels for list of vendored plugins
2023-07-03 14:13:08 -04:00
Dylan Staley 18cc6edbd5 docs: move community tools to docs folder 2023-06-23 18:40:57 -04:00
Wilken Rivera 4347e8cee8 Default to PuluginFolders is KnownPluginFolders is unset
* PACKER_PLUGIN_PATH takes precedence over all
2023-06-22 17:28:23 -04:00
Wilken Rivera f7a0df4bd1 Reduce the number of nest plugin scans
Packer will try to discover installed plugins in all of the directories
defined by packer.KnowPluginFolders. In a previous release logic was
added to scan nested directories in order to load plugins installed by
`packer plugins install`. This change resulted in a nested directory
scan for each folder within the KnownPluginFolders slice.

This change reduces the nested directory scan to only the directories
where plugins would have been installed using `packer plugins install`
2023-06-22 17:28:23 -04:00
Wilken Rivera f1c1e49685 Fix executable directory path 2023-06-22 17:28:23 -04:00
Wilken Rivera ffa1e54af5 Delete check-legacy-links-format.yml (#12471)
Remove the check-legacy-links-format.yml workflow. These checks are now included as part of our
content conformance checks that run on PRs with documentation content changes.
2023-06-16 15:46:53 -04:00