Merge branch 'ember-cli' of github.com:travis-ci/travis-web into ember-cli
Conflicts: app/styles/app/layouts/footer.sass
This commit is contained in:
commit
5f8562b2e2
|
@ -25,6 +25,7 @@ app.import('bower_components/visibilityjs/lib/visibility.timers.js');
|
|||
app.import('bower_components/JavaScript-MD5/js/md5.js');
|
||||
app.import('vendor/ansiparse.js');
|
||||
app.import('vendor/log.js');
|
||||
app.import('vendor/customerio.js');
|
||||
app.import('bower_components/moment/moment.js');
|
||||
// Use `app.import` to add additional libraries to the generated
|
||||
// output files.
|
||||
|
|
|
@ -41,7 +41,7 @@ Router.map ->
|
|||
@route 'index', path: '/'
|
||||
@resource 'env_vars', ->
|
||||
@route 'new'
|
||||
@resource 'ssh_key' if config.endpoints.ssh_key
|
||||
@resource 'ssh_key' if config.endpoints.sshKey
|
||||
|
||||
@route 'first_sync'
|
||||
@route 'insufficient_oauth_permissions'
|
||||
|
|
|
@ -144,7 +144,7 @@ _emojize = (text) ->
|
|||
if emojis isnt null
|
||||
emojis.uniq().forEach (emoji, ix) ->
|
||||
strippedEmoji = emoji.substring(1, emoji.length - 1)
|
||||
unless EmojiDictionary.indexOf(strippedEmoji) is -1
|
||||
unless emojiDictionary.indexOf(strippedEmoji) is -1
|
||||
image = '<img class=\'emoji\' title=\'' + emoji + '\' alt=\'' + emoji + '\' src=\'' + '/images/emoji/' + strippedEmoji + '.png\'/>'
|
||||
text = text.replace(new RegExp(emoji, 'g'), image)
|
||||
text
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
`import config from 'travis/config/environment'`
|
||||
`import ENV from 'travis/config/environment'`
|
||||
|
||||
TravisPusher = (config) ->
|
||||
@init(config)
|
||||
|
@ -38,7 +38,7 @@ TravisPusher.prototype.unsubscribe = (channel) ->
|
|||
@pusher.unsubscribe(channel) if @pusher?.channel(channel)
|
||||
|
||||
TravisPusher.prototype.prefix = (channel) ->
|
||||
prefix = config.pusher.channel_prefix || ''
|
||||
prefix = ENV.pusher.channel_prefix || ''
|
||||
if channel.indexOf(prefix) != 0
|
||||
"#{prefix}#{channel}"
|
||||
else
|
||||
|
@ -100,9 +100,9 @@ TravisPusher.prototype.ignoreCode = (code) ->
|
|||
TravisPusher.prototype.ignoreMessage = (message) ->
|
||||
message.indexOf('Existing subscription') == 0 or message.indexOf('No current subscription') == 0
|
||||
|
||||
Pusher.SockJSTransport.isSupported = -> false if config.pusher.host != 'ws.pusherapp.com'
|
||||
Pusher.SockJSTransport.isSupported = -> false if ENV.pusher.host != 'ws.pusherapp.com'
|
||||
|
||||
if config.pro
|
||||
if ENV.pro
|
||||
Pusher.channel_auth_transport = 'bulk_ajax'
|
||||
|
||||
Pusher.authorizers.bulk_ajax = (socketId, _callback) ->
|
||||
|
@ -110,7 +110,7 @@ if config.pro
|
|||
channels.callbacks ||= []
|
||||
|
||||
name = this.channel.name
|
||||
names = $.keys(channels.channels)
|
||||
names = Object.keys(channels.channels)
|
||||
|
||||
channels.callbacks.push (auths) ->
|
||||
_callback(false, auth: auths[name])
|
||||
|
@ -125,8 +125,8 @@ if config.pro
|
|||
Pusher.getDefaultStrategy = (config) ->
|
||||
[
|
||||
[":def", "ws_options", {
|
||||
hostUnencrypted: config.wsHost + ":" + config.wsPort + (config.pusher.path && "/#{config.pusher.path}" || ''),
|
||||
hostEncrypted: config.wsHost + ":" + config.wssPort + (config.pusher.path && "/#{config.pusher.path}" || '')
|
||||
hostUnencrypted: config.wsHost + ":" + config.wsPort + (ENV.pusher.path && "/#{config.pusher.path}" || ''),
|
||||
hostEncrypted: config.wsHost + ":" + config.wssPort + (ENV.pusher.path && "/#{config.pusher.path}" || '')
|
||||
path: config.path
|
||||
}],
|
||||
[":def", "sockjs_options", {
|
||||
|
|
|
@ -31,6 +31,26 @@ module.exports = function(environment) {
|
|||
intervals: { updateTimes: 1000 }
|
||||
};
|
||||
|
||||
if (typeof process !== 'undefined') {
|
||||
if (process.env.TRAVIS_PRO) {
|
||||
// set defaults for pro if it's used
|
||||
// TODO: we have the same defaults also in ruby process,
|
||||
// it would be nice to move it to one place. In theory
|
||||
// we could just remove it from ruby process and rely
|
||||
// on things set here, but I haven't tested that yet.
|
||||
ENV.pro = true;
|
||||
ENV.apiEndpoint = 'https://api.travis-ci.com';
|
||||
ENV.pusher.key = '59236bc0716a551eab40';
|
||||
ENV.pagesEndpoint = 'https://billing.travis-ci.com';
|
||||
ENV.billingEndpoint = 'https://billing.travis-ci.com';
|
||||
ENV.endpoints = {
|
||||
sshKey: true,
|
||||
caches: true
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (environment === 'development') {
|
||||
// ENV.APP.LOG_RESOLVER = true;
|
||||
// ENV.APP.LOG_ACTIVE_GENERATION = true;
|
||||
|
@ -57,15 +77,20 @@ module.exports = function(environment) {
|
|||
|
||||
}
|
||||
|
||||
// TODO: I insert values from ENV here, but in production
|
||||
// this file is compiled and is not executed on runtime.
|
||||
// We don't use CSP at the moment outside of development (ie. we don't
|
||||
// set CSP headers), but it would be nice to do it and then we need to
|
||||
// think about a better way to override it
|
||||
ENV.contentSecurityPolicy = {
|
||||
'default-src': "'none'",
|
||||
'script-src': "'self'",
|
||||
'font-src': "'self' https://fonts.googleapis.com/css",
|
||||
'connect-src': "'self' https://api.travis-ci.org ws://ws.pusherapp.com wss://ws.pusherapp.com http://sockjs.pusher.com",
|
||||
'font-src': "'self' https://fonts.googleapis.com/css https://fonts.gstatic.com",
|
||||
'connect-src': "'self' " + ENV.apiEndpoint + " ws://ws.pusherapp.com wss://ws.pusherapp.com http://sockjs.pusher.com https://s3.amazonaws.com/archive.travis-ci.com/ https://s3.amazonaws.com/archive.travis-ci.org/",
|
||||
'img-src': "'self' data: https://www.gravatar.com http://www.gravatar.com",
|
||||
'style-src': "'self'",
|
||||
'style-src': "'self' https://fonts.googleapis.com",
|
||||
'media-src': "'self'",
|
||||
'frame-src': "'self' https://api.travis-ci.org"
|
||||
'frame-src': "'self' " + ENV.apiEndpoint
|
||||
}
|
||||
|
||||
return ENV;
|
||||
|
|
14
vendor/customerio.js
vendored
Normal file
14
vendor/customerio.js
vendored
Normal file
|
@ -0,0 +1,14 @@
|
|||
var _cio = _cio || [];
|
||||
|
||||
function setupCustomerio(siteId) {
|
||||
var a,b,c;a=function(f){return function(){_cio.push([f].
|
||||
concat(Array.prototype.slice.call(arguments,0)))}};b=["load","identify",
|
||||
"sidentify","track","page"];for(c=0;c<b.length;c++){_cio[b[c]]=a(b[c])};
|
||||
var t = document.createElement('script'),
|
||||
s = document.getElementsByTagName('script')[0];
|
||||
t.async = true;
|
||||
t.id = 'cio-tracker';
|
||||
t.setAttribute('data-site-id', siteId);
|
||||
t.src = 'https://assets.customer.io/assets/track.js';
|
||||
s.parentNode.insertBefore(t, s);
|
||||
}
|
|
@ -190,6 +190,11 @@ class Travis::Web::App
|
|||
config['codeClimate'] = options[:code_climate] if options[:code_climate]
|
||||
config['codeClimateUrl'] = options[:code_climate_url] if options[:code_climate_url]
|
||||
|
||||
config['endpoints'] = {
|
||||
'sshKey' => options[:ssh_key_enabled],
|
||||
'caches' => options[:caches_enabled]
|
||||
}
|
||||
|
||||
regexp = %r(<meta name="travis/config/environment"\s+content="([^"]+)")
|
||||
string.gsub!(regexp) do
|
||||
ember_config = JSON.parse(URI.unescape($1))
|
||||
|
|
Loading…
Reference in New Issue
Block a user