Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makes CONTENT_ORIGIN not a required setting #6156

Closed
wants to merge 1 commit into from
Closed
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
1 change: 1 addition & 0 deletions CHANGES/5931.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Allow CONTENT_ORIGIN to be None. When None, the base_url for Distributions is a relative path.
8 changes: 4 additions & 4 deletions docs/admin/reference/settings.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# Settings

There are only two required settings, although specific plugins may have additional required
There is one required settings, although specific plugins may have additional required
settings.

- `SECRET_KEY <secret-key-setting>`
- `CONTENT_ORIGIN <content-origin-setting>`

!!! note
For more information on how to specify settings see the [`Applying Settings`](#).
Expand Down Expand Up @@ -197,10 +196,11 @@ this setting only applies to uploads created after the change.

### CONTENT_ORIGIN

A required string containing the protocol, fqdn, and port where the content app is reachable by
A string containing the protocol, fqdn, and port where the content app is reachable by
users. This is used by `pulpcore` and various plugins when referring users to the content app.
For example if the API should refer users to content at using http to pulp.example.com on port
24816, (the content default port), you would set: `https://pulp.example.com:24816`.
24816, (the content default port), you would set: `http://pulp.example.com:24816`. The default is
`None`. When set to `None`, the API returns relative URLs (without the protocol, fqdn, and port).
Comment on lines -200 to +203
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now this is off wrt formatting. It's neither break at 100 c nor one sentence per line.


### HIDE_GUARDED_DISTRIBUTIONS

Expand Down
15 changes: 0 additions & 15 deletions pulpcore/app/checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,6 @@
from django.core.checks import Error as CheckError, Warning as CheckWarning, register


@register(deploy=True)
def content_origin_check(app_configs, **kwargs):
messages = []
if getattr(settings, "CONTENT_ORIGIN", "UNREACHABLE") == "UNREACHABLE":
messages.append(
CheckError(
"CONTENT_ORIGIN is a required setting but it was not configured. This may be "
"caused by invalid read permissions of the settings file. Note that "
"CONTENT_ORIGIN is set by the installation automatically.",
id="pulpcore.E001",
)
)
return messages


@register(deploy=True)
def secret_key_check(app_configs, **kwargs):
messages = []
Expand Down
3 changes: 1 addition & 2 deletions pulpcore/app/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,7 @@

DRF_ACCESS_POLICY = {"reusable_conditions": ["pulpcore.app.global_access_conditions"]}

# This is a sentinal value for deploy checks, since we don't want to set a default one.
CONTENT_ORIGIN = "UNREACHABLE"
CONTENT_ORIGIN = None
CONTENT_PATH_PREFIX = "/pulp/content/"

API_APP_TTL = 120 # The heartbeat is called from gunicorn notify (defaulting to 45 sec).
Expand Down
Loading