Skip to content

Commit e99df7f

Browse files
committed
Show link to SaaS
1 parent eef4849 commit e99df7f

File tree

8 files changed

+32
-1
lines changed

8 files changed

+32
-1
lines changed

src/sentry/conf/server.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -969,6 +969,8 @@ def create_partitioned_queues(name):
969969
STATUS_PAGE_ID = None
970970
STATUS_PAGE_API_HOST = 'statuspage.io'
971971

972+
SENTRY_ONPREMISE = True
973+
972974

973975
def get_raven_config():
974976
return {

src/sentry/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def get_all_languages():
7575
RESERVED_ORGANIZATION_SLUGS = (
7676
'admin', 'manage', 'login', 'account', 'register', 'api',
7777
'accept', 'organizations', 'teams', 'projects', 'help',
78-
'docs', 'logout', '404', '500', '_static',
78+
'docs', 'logout', '404', '500', '_static', 'out',
7979
)
8080

8181
RESERVED_TEAM_SLUGS = RESERVED_ORGANIZATION_SLUGS

src/sentry/static/sentry/app/components/footer.jsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ const Footer = React.createClass({
2525
<a href={config.urlPrefix + '/api/'}>{t('API')}</a>
2626
<a href={config.urlPrefix + '/docs/'}>{t('Docs')}</a>
2727
<a href="https://github.com/getsentry/sentry">{t('Contribute')}</a>
28+
{config.isOnPremise &&
29+
<a href={config.urlPrefix + '/out/'}>{t('Migrate to SaaS')}</a>
30+
}
2831
</div>
2932
<div className="version pull-left">
3033
{'Sentry'} {config.version.current}

src/sentry/templates/sentry/layout.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@
190190
<a href="https://docs.getsentry.com/hosted/api/">{% trans "API" %}</a>
191191
<a href="https://docs.getsentry.com">{% trans "Docs" %}</a>
192192
<a href="https://github.com/getsentry/sentry">{% trans "Contribute" %}</a>
193+
{% if ONPREMISE %}<a href="/out/">{% trans "Migrate to SaaS" %}</a>{% endif %}
193194
</div>
194195
<div class="version pull-left">Sentry {{ sentry_version.current }} {% if sentry_version.update_available %}<a href="#" title="You're running an old version of Sentry, did you know {{ sentry_version.latest }} is available?" class="tip icon-circle-arrow-up">&nbsp;</a>{% endif %}</div>
195196
<a href="/" class="icon-sentry-logo"></a>

src/sentry/templatetags/sentry_react.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ def get_react_config(context):
123123
'message': msg.message,
124124
'level': msg.tags,
125125
} for msg in messages],
126+
'isOnPremise': settings.SENTRY_ONPREMISE,
126127
}
127128
if user and user.is_authenticated():
128129
context.update({

src/sentry/web/frontend/out.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
from __future__ import absolute_import
2+
3+
from django.conf import settings
4+
from django.http import Http404, HttpResponseRedirect
5+
from django.views.generic import View
6+
7+
from sentry import options
8+
9+
10+
class OutView(View):
11+
def get(self, request):
12+
if not settings.SENTRY_ONPREMISE:
13+
raise Http404
14+
15+
install_id = options.get('sentry:install-id')
16+
if install_id:
17+
query = '?install_id=' + install_id
18+
else:
19+
query = ''
20+
return HttpResponseRedirect('https://getsentry.com/from/self-hosted/' + query)

src/sentry/web/helpers.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ def get_default_context(request, existing_context=None, team=None):
5454
'SINGLE_ORGANIZATION': settings.SENTRY_SINGLE_ORGANIZATION,
5555
'PLUGINS': plugins,
5656
'ALLOWED_HOSTS': list(settings.ALLOWED_HOSTS),
57+
'ONPREMISE': settings.SENTRY_ONPREMISE,
5758
}
5859

5960
if existing_context:

src/sentry/web/urls.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
OrganizationAuthSettingsView
4747
from sentry.web.frontend.organization_member_settings import \
4848
OrganizationMemberSettingsView
49+
from sentry.web.frontend.out import OutView
4950
from sentry.web.frontend.organization_members import OrganizationMembersView
5051
from sentry.web.frontend.organization_settings import OrganizationSettingsView
5152
from sentry.web.frontend.project_issue_tracking import ProjectIssueTrackingView
@@ -268,6 +269,8 @@ def init_all_applications():
268269
url(r'^api/$', react_page_view, name='sentry-api'),
269270
url(r'^api/new-token/$', react_page_view),
270271

272+
url(r'^out/$', OutView.as_view()),
273+
271274
# Organizations
272275
url(r'^(?P<organization_slug>[\w_-]+)/$', react_page_view,
273276
name='sentry-organization-home'),

0 commit comments

Comments
 (0)