Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,8 @@ The following settings are available per profile:
Defaults to false.
* `stack.elastic_cloud.host` can be used to override the address when connecting with
the Elastic Cloud APIs. It defaults to `https://cloud.elastic.co`.
* `stack.epr.proxy_to` indicates the local Package Registry to proxy requests to the configured
endpoint. When not set, it uses `https://epr.elastic.co`.
* `stack.geoip_dir` defines a directory with GeoIP databases that can be used by
Elasticsearch in stacks managed by elastic-package. It is recommended to use
an absolute path, out of the `.elastic-package` directory.
Expand Down
13 changes: 9 additions & 4 deletions internal/profile/_static/config.yml.example
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
## Elasticssearch settings
# Directory containing GeoIP databases for stacks managed by elastic-agent.
# stack.geoip_dir: "/path/to/geoip_dir/"
#
# Flag to enable the logs index mode in logs data stream.
# stack.logsdb_enabled: true

## Elastic Cloud
# Host URL
# stack.elastic_cloud.host: https://cloud.elastic.co

## Package Registry settings
# Package Registry used to proxy requests to (EPR_PROXY_TO environment variable).
# stack.epr.proxy_to: https://epr.elastic.co

## Serverless stack provider
# Project type
# stack.serverless.type: observability
Expand All @@ -14,10 +23,6 @@
# Flag to enable apm-server in elastic-package stack profile config
# stack.apm_enabled: true

## Logs DB
# Flag to enable the logs index mode in logs data stream.
# stack.logsdb_enabled: true

## Enable logstash for testing
# Flag to enable logstash in elastic-package stack profile config
# stack.logstash_enabled: true
Expand Down
4 changes: 2 additions & 2 deletions internal/registry/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ import (
)

const (
productionURL = "https://epr.elastic.co"
ProductionURL = "https://epr.elastic.co"
)

var (
// Production is a pre-configured production client
Production = NewClient(productionURL)
Production = NewClient(ProductionURL)
)

// Client is responsible for exporting dashboards from Kibana.
Expand Down
2 changes: 1 addition & 1 deletion internal/stack/_static/Dockerfile.package-registry.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ARG PROFILE
ENV EPR_DISABLE_PACKAGE_VALIDATION=true

ENV EPR_FEATURE_PROXY_MODE=true
ENV EPR_PROXY_TO=https://epr.elastic.co
ENV EPR_PROXY_TO={{ fact "epr_proxy_to" }}

COPY profiles/${PROFILE}/stack/package-registry.yml /package-registry/config.yml
COPY stack/development/ /packages/development
3 changes: 2 additions & 1 deletion internal/stack/boot.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"github.com/elastic/elastic-package/internal/configuration/locations"
"github.com/elastic/elastic-package/internal/files"
"github.com/elastic/elastic-package/internal/profile"
"github.com/elastic/elastic-package/internal/registry"
)

// baseComposeProjectName is the base name of the Docker Compose project used to boot up
Expand Down Expand Up @@ -69,7 +70,7 @@ func BootUp(ctx context.Context, options Options) error {
}

options.Printer.Println("Local package-registry will serve packages from these sources:")
options.Printer.Println("- Proxy to https://epr.elastic.co")
options.Printer.Printf("- Proxy to %s\n", options.Profile.Config(configElasticEPRProxyTo, registry.ProductionURL))

if found {
options.Printer.Printf("- Local directory %s\n", buildPackagesPath)
Expand Down
3 changes: 3 additions & 0 deletions internal/stack/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"github.com/elastic/go-resource"

"github.com/elastic/elastic-package/internal/profile"
"github.com/elastic/elastic-package/internal/registry"
)

//go:embed _static
Expand Down Expand Up @@ -64,6 +65,7 @@ const (
configLogsDBEnabled = "stack.logsdb_enabled"
configLogstashEnabled = "stack.logstash_enabled"
configSelfMonitorEnabled = "stack.self_monitor_enabled"
configElasticEPRProxyTo = "stack.epr.proxy_to"
configElasticSubscription = "stack.elastic_subscription"
)

Expand Down Expand Up @@ -180,6 +182,7 @@ func applyResources(profile *profile.Profile, stackVersion string, agentVersion
"logsdb_enabled": profile.Config(configLogsDBEnabled, "false"),
"logstash_enabled": profile.Config(configLogstashEnabled, "false"),
"self_monitor_enabled": profile.Config(configSelfMonitorEnabled, "false"),
"epr_proxy_to": profile.Config(configElasticEPRProxyTo, registry.ProductionURL),
"elastic_subscription": elasticSubscriptionProfile,
})

Expand Down
2 changes: 2 additions & 0 deletions tools/readme/readme.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@ The following settings are available per profile:
Defaults to false.
* `stack.elastic_cloud.host` can be used to override the address when connecting with
the Elastic Cloud APIs. It defaults to `https://cloud.elastic.co`.
* `stack.epr.proxy_to` indicates the local Package Registry to proxy requests to the configured
endpoint. When not set, it uses `https://epr.elastic.co`.
* `stack.geoip_dir` defines a directory with GeoIP databases that can be used by
Elasticsearch in stacks managed by elastic-package. It is recommended to use
an absolute path, out of the `.elastic-package` directory.
Expand Down