-
Notifications
You must be signed in to change notification settings - Fork 210
/
profile.mjs
149 lines (140 loc) · 5.9 KB
/
profile.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
import chalk from 'chalk';
const CONFIGS = {
local: {
auth: 'http://localhost:9000/v1',
content: 'http://localhost:3030/',
token: 'http://localhost:8000/1.0/sync/1.5',
loop: 'http://localhost:10222',
oauth: 'http://localhost:9000/v1',
profile: 'http://localhost:1111/v1',
},
latest: {
auth: 'https://latest.dev.lcip.org/auth/v1',
content: 'https://latest.dev.lcip.org/',
token: 'https://latest.dev.lcip.org/syncserver/token/1.0/sync/1.5',
oauth: 'https://oauth-latest.dev.lcip.org/v1',
profile: 'https://latest.dev.lcip.org/profile/v1',
},
'start-remote': {
auth: 'https://fxaci.dev.lcip.org/auth/v1',
content: 'http://localhost:3030/',
token: 'https://fxaci.dev.lcip.org/syncserver/token/1.0/sync/1.5',
oauth: 'https://oauth-fxaci.dev.lcip.org/v1',
profile: 'https://fxaci.dev.lcip.org/profile/v1',
},
stable: {
auth: 'https://stable.dev.lcip.org/auth/v1',
content: 'https://stable.dev.lcip.org/',
token: 'https://stable.dev.lcip.org/syncserver/token/1.0/sync/1.5',
oauth: 'https://oauth-stable.dev.lcip.org/v1',
profile: 'https://stable.dev.lcip.org/profile/v1',
},
stage: {
auth: 'https://api-accounts.stage.mozaws.net/v1',
content: 'https://accounts.stage.mozaws.net/',
token: 'https://token.stage.mozaws.net/1.0/sync/1.5',
oauth: 'https://oauth.stage.mozaws.net/v1',
profile: 'https://profile.stage.mozaws.net/v1',
},
prod: {
auth: 'https://api.accounts.firefox.com/v1',
content: 'https://accounts.firefox.com/',
token: 'https://token.services.mozilla.com/1.0/sync/1.5',
oauth: 'https://oauth.accounts.firefox.com/v1',
profile: 'https://profile.accounts.firefox.com/v1',
},
};
const env = process.env.FXA_ENV || 'local';
const FXA_DESKTOP_CONTEXT = process.env.FXA_DESKTOP_CONTEXT || 'fx_desktop_v3';
const e10sDisabled = process.env.DISABLE_E10S === 'true';
let fxaEnv = CONFIGS[env];
if (!fxaEnv) {
// If env is not found in the above list, assume it's an fxa-dev box.
const host = 'https://' + env + '.dev.lcip.org/';
fxaEnv = {
auth: host + 'auth/v1',
content: host,
token: host + 'syncserver/token/1.0/sync/1.5',
oauth: 'https://oauth-' + env + '.dev.lcip.org/v1',
profile: host + 'profile/v1',
};
}
const fxaProfile = {
// enable debugger and toolbox
'devtools.chrome.enabled': true,
'devtools.debugger.remote-enabled': true,
'devtools.debugger.prompt-connection': false,
// disable about:config warning
'general.warnOnAboutConfig': false,
// disable signed extensions
// the WebDriver extension will not work in Nightly because signed extensions are forced
'xpinstall.signatures.required': false,
'xpinstall.whitelist.required': false,
'services.sync.prefs.sync.xpinstall.whitelist.required': false,
'extensions.checkCompatibility.nightly': false,
// enable pocket
'browser.pocket.enabled': true,
// identity logs
'identity.fxaccounts.log.appender.dump': 'Debug',
'identity.fxaccounts.loglevel': 'Debug',
'services.sync.log.appender.file.logOnSuccess': true,
'services.sync.log.appender.console': 'Debug',
'browser.uitour.testingOrigins':
'http://localhost:8001,http://localhost:8000,https://www.mozilla.org,https://www.allizom.org,https://www-demo5.allizom.org,https://www-dev.allizom.org',
'browser.uitour.requireSecure': false,
'services.sync.log.appender.dump': 'Debug',
'identity.fxaccounts.auth.uri': fxaEnv.auth,
'identity.fxaccounts.allowHttp': true,
'identity.fxaccounts.remote.root': fxaEnv.content,
'identity.fxaccounts.remote.force_auth.uri':
fxaEnv.content + 'force_auth?service=sync&context=' + FXA_DESKTOP_CONTEXT,
'identity.fxaccounts.remote.signin.uri':
fxaEnv.content + 'signin?service=sync&context=' + FXA_DESKTOP_CONTEXT,
'identity.fxaccounts.remote.signup.uri':
fxaEnv.content + 'signup?service=sync&context=' + FXA_DESKTOP_CONTEXT,
'identity.fxaccounts.remote.webchannel.uri': fxaEnv.content,
'identity.fxaccounts.remote.oauth.uri': fxaEnv.oauth,
'identity.fxaccounts.remote.profile.uri': fxaEnv.profile,
'identity.fxaccounts.settings.uri':
fxaEnv.content + 'settings?service=sync&context=' + FXA_DESKTOP_CONTEXT,
// for some reason there are 2 settings for the token server
'identity.sync.tokenserver.uri': fxaEnv.token,
'services.sync.tokenServerURI': fxaEnv.token,
'identity.fxaccounts.contextParam': FXA_DESKTOP_CONTEXT,
'browser.newtabpage.activity-stream.fxaccounts.endpoint': fxaEnv.content,
// disable auto update
'app.update.auto': false,
'app.update.enabled': false,
'app.update.silent': false,
'app.update.staging.enabled': false,
// allow webchannel url, strips slash from content-server origin.
'webchannel.allowObject.urlWhitelist': fxaEnv.content.slice(0, -1),
'browser.tabs.firefox-view': true,
'identity.fxaccounts.autoconfig.uri': fxaEnv.content,
// TODO in FXA-9872, make oauth_webchannel_v1 the default context and
// change these values for fx_desktop_v3. (Also, update the README note)
...(process.env.FXA_DESKTOP_CONTEXT === 'oauth_webchannel_v1' && {
'identity.fxaccounts.oauth.enabled': true,
'identity.fxaccounts.contextParam': 'oauth_webchannel_v1',
}),
};
// Configuration for local sync development
if (e10sDisabled) {
// disable e10s
fxaProfile['browser.tabs.remote.autostart'] = false;
fxaProfile['browser.tabs.remote.autostart.1'] = false;
fxaProfile['browser.tabs.remote.autostart.2'] = false;
}
console.log(chalk.yellow('Configuration:', JSON.stringify(fxaEnv, null, 2)));
console.log(chalk.yellow('E10S Status:', !e10sDisabled));
console.log(chalk.yellow('FXA_ENV:', env));
console.log(
chalk.yellow(
'FIREFOX_BIN Binary:',
process.env.FIREFOX_BIN || 'Default System Firefox binary'
)
);
console.log(chalk.yellow('FXA_DESKTOP_CONTEXT:', FXA_DESKTOP_CONTEXT));
console.log(chalk.yellow('FIREFOX_DEBUGGER:', !!process.env.FIREFOX_DEBUGGER));
console.log(chalk.yellow('FXA_DESKTOP_CONTEXT:', FXA_DESKTOP_CONTEXT));
export default fxaProfile;