Browse Source

Revert "Rename onpremise to self-hosted in configs (#30528)" (#30550)

This reverts commit 31ad2a946be00698a13afdb18fcae0e7ba94b5c9.
Chad Whitacre 3 years ago
parent
commit
fb0c745e40

+ 2 - 6
src/sentry/conf/server.py

@@ -1921,11 +1921,7 @@ SENTRY_RAW_EVENT_MAX_AGE_DAYS = 10
 STATUS_PAGE_ID = None
 STATUS_PAGE_API_HOST = "statuspage.io"
 
-# Downstream (i.e., getsentry) sets SENTRY_ONPREMISE, so keep reading from that
-# for now, but in the rest of _this_ codebase we should reference
-# SENTRY_SELF_HOSTED.
-SENTRY_ONPREMISE = True  # deprecated, use ...
-SENTRY_SELF_HOSTED = SENTRY_ONPREMISE  # ... this instead
+SENTRY_ONPREMISE = True
 
 # Whether we should look at X-Forwarded-For header or not
 # when checking REMOTE_ADDR ip addresses
@@ -2185,7 +2181,7 @@ JS_SDK_LOADER_SDK_VERSION = ""
 # This should be the url pointing to the JS SDK
 JS_SDK_LOADER_DEFAULT_SDK_URL = ""
 
-# block domains which are generally used by spammers -- keep this configurable in case a self-hosted
+# block domains which are generally used by spammers -- keep this configurable in case an onpremise
 # install wants to allow it
 INVALID_EMAIL_ADDRESS_PATTERN = re.compile(r"\@qq\.com$", re.I)
 

+ 1 - 2
src/sentry/web/client_config.py

@@ -153,8 +153,7 @@ def get_client_config(request=None):
         "statuspage": _get_statuspage(),
         "messages": [{"message": msg.message, "level": msg.tags} for msg in messages],
         "apmSampling": float(settings.SENTRY_FRONTEND_APM_SAMPLING or 0),
-        "isOnPremise": settings.SENTRY_SELF_HOSTED,  # deprecated, use ...
-        "isSelfHosted": settings.SENTRY_SELF_HOSTED,  # ... this instead
+        "isOnPremise": settings.SENTRY_ONPREMISE,
         "invitesEnabled": settings.SENTRY_ENABLE_INVITES,
         "gravatarBaseUrl": settings.SENTRY_GRAVATAR_BASE_URL,
         "termsUrl": settings.TERMS_URL,

+ 1 - 1
src/sentry/web/frontend/out.py

@@ -7,7 +7,7 @@ from sentry import options
 
 class OutView(View):
     def get(self, request):
-        if not settings.SENTRY_SELF_HOSTED:
+        if not settings.SENTRY_ONPREMISE:
             raise Http404
 
         install_id = options.get("sentry:install-id")

+ 1 - 2
src/sentry/web/helpers.py

@@ -20,8 +20,7 @@ def get_default_context(request, existing_context=None, team=None):
         "URL_PREFIX": options.get("system.url-prefix"),
         "SINGLE_ORGANIZATION": settings.SENTRY_SINGLE_ORGANIZATION,
         "PLUGINS": plugins,
-        "ONPREMISE": settings.SENTRY_SELF_HOSTED,  # deprecated, use ...
-        "SELF_HOSTED": settings.SENTRY_SELF_HOSTED,  # ... this instead
+        "ONPREMISE": settings.SENTRY_ONPREMISE,
     }
 
     if existing_context:

+ 1 - 1
src/sentry_plugins/sessionstack/plugin.py

@@ -123,7 +123,7 @@ class SessionStackPlugin(CorePluginMixin, Plugin2):
             },
         ]
 
-        if settings.SENTRY_SELF_HOSTED:
+        if settings.SENTRY_ONPREMISE:
             configurations.extend(
                 [
                     {

+ 2 - 2
static/app/components/footer.tsx

@@ -18,7 +18,7 @@ function BaseFooter({className}: Props) {
   return (
     <footer className={className}>
       <LeftLinks>
-        {config.isSelfHosted && (
+        {config.isOnPremise && (
           <Fragment>
             {'Sentry '}
             {getDynamicText({
@@ -47,7 +47,7 @@ function BaseFooter({className}: Props) {
         <FooterLink href="https://github.com/getsentry/sentry">
           {t('Contribute')}
         </FooterLink>
-        {config.isSelfHosted && !config.demoMode && (
+        {config.isOnPremise && !config.demoMode && (
           <FooterLink href="/out/">{t('Migrate to SaaS')}</FooterLink>
         )}
       </RightLinks>

+ 11 - 11
static/app/plugins/sessionstack/components/settings.tsx

@@ -7,12 +7,12 @@ import DefaultSettings from 'sentry/plugins/components/settings';
 type Props = DefaultSettings['props'];
 
 type State = DefaultSettings['state'] & {
-  showSelfHostedConfiguration?: boolean;
+  showOnPremisesConfiguration?: boolean;
 };
 
 class Settings extends DefaultSettings<Props, State> {
   REQUIRED_FIELDS = ['account_email', 'api_token', 'website_id'];
-  SELF_HOSTED_FIELDS = ['api_url', 'player_url'];
+  ON_PREMISES_FIELDS = ['api_url', 'player_url'];
 
   renderFields(fields: State['fieldList']) {
     return fields?.map(f =>
@@ -29,9 +29,9 @@ class Settings extends DefaultSettings<Props, State> {
     return fields?.filter(field => fieldNames.includes(field.name)) ?? [];
   }
 
-  toggleSelfHostedConfiguration = () => {
+  toggleOnPremisesConfiguration = () => {
     this.setState({
-      showSelfHostedConfiguration: !this.state.showSelfHostedConfiguration,
+      showOnPremisesConfiguration: !this.state.showOnPremisesConfiguration,
     });
   };
 
@@ -53,9 +53,9 @@ class Settings extends DefaultSettings<Props, State> {
     const hasChanges = !isEqual(this.state.initialData, this.state.formData);
 
     const requiredFields = this.filterFields(this.state.fieldList, this.REQUIRED_FIELDS);
-    const selfHostedFields = this.filterFields(
+    const onPremisesFields = this.filterFields(
       this.state.fieldList,
-      this.SELF_HOSTED_FIELDS
+      this.ON_PREMISES_FIELDS
     );
 
     return (
@@ -68,19 +68,19 @@ class Settings extends DefaultSettings<Props, State> {
           </div>
         )}
         {this.renderFields(requiredFields)}
-        {selfHostedFields.length > 0 ? (
+        {onPremisesFields.length > 0 ? (
           <div className="control-group">
             <button
               className="btn btn-default"
               type="button"
-              onClick={this.toggleSelfHostedConfiguration}
+              onClick={this.toggleOnPremisesConfiguration}
             >
-              Configure self-hosted
+              Configure on-premises
             </button>
           </div>
         ) : null}
-        {this.state.showSelfHostedConfiguration
-          ? this.renderFields(selfHostedFields)
+        {this.state.showOnPremisesConfiguration
+          ? this.renderFields(onPremisesFields)
           : null}
       </Form>
     );

+ 1 - 2
static/app/types/system.tsx

@@ -121,8 +121,7 @@ export interface Config {
   invitesEnabled: boolean;
   privacyUrl: string | null;
   termsUrl: string | null;
-  isOnPremise: boolean; // deprecated, use ...
-  isSelfHosted: boolean; // ... this instead
+  isOnPremise: boolean;
   lastOrganization: string | null;
   gravatarBaseUrl: string;
 

+ 1 - 1
static/app/views/alerts/issueRuleEditor/setupAlertIntegrationButton.tsx

@@ -55,7 +55,7 @@ export default class SetupAlertIntegrationButton extends AsyncComponent<Props, S
     const config = ConfigStore.getConfig();
     // link to docs to set up Slack for on-prem folks
     const referrerQuery = '?referrer=issue-alert-builder';
-    const buttonProps = config.isSelfHosted
+    const buttonProps = config.isOnPremise
       ? {
           href: `https://develop.sentry.dev/integrations/slack/${referrerQuery}`,
         }

+ 6 - 6
static/app/views/settings/settingsIndex.tsx

@@ -67,17 +67,17 @@ class SettingsIndex extends React.Component<Props> {
   render() {
     const {organization} = this.props;
     const user = ConfigStore.get('user');
-    const isSelfHosted = ConfigStore.get('isSelfHosted');
+    const isOnPremise = ConfigStore.get('isOnPremise');
 
     const organizationSettingsUrl =
       (organization && `/settings/${organization.slug}/`) || '';
 
     const supportLinkProps = {
-      isSelfHosted,
+      isOnPremise,
       href: LINKS.FORUM,
       to: `${organizationSettingsUrl}support`,
     };
-    const supportText = isSelfHosted ? t('Community Forums') : t('Contact Support');
+    const supportText = isOnPremise ? t('Community Forums') : t('Contact Support');
 
     return (
       <SentryDocumentTitle
@@ -340,7 +340,7 @@ const ExternalHomeLink = styled(
 `;
 
 type SupportLinkProps<T extends boolean> = {
-  isSelfHosted: T;
+  isOnPremise: T;
   href: string;
   to: string;
   isCentered?: boolean;
@@ -350,12 +350,12 @@ type SupportLinkProps<T extends boolean> = {
 
 const SupportLinkComponent = <T extends boolean>({
   isCentered,
-  isSelfHosted,
+  isOnPremise,
   href,
   to,
   ...props
 }: SupportLinkProps<T>) =>
-  isSelfHosted ? (
+  isOnPremise ? (
     <ExternalHomeLink isCentered={isCentered} href={href} {...props} />
   ) : (
     <HomeLink to={to} {...props} />

Some files were not shown because too many files changed in this diff