Skip to content

Commit

Permalink
Merge pull request #1937 from uProxy/release-candidate
Browse files Browse the repository at this point in the history
Merge 0.8.23 into release branch
  • Loading branch information
dborkan committed Sep 29, 2015
2 parents 90b625d + 8a90384 commit e65d18f
Show file tree
Hide file tree
Showing 52 changed files with 2,241 additions and 1,139 deletions.
1,868 changes: 952 additions & 916 deletions Gruntfile.coffee

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "uProxy",
"version": "0.8.22",
"version": "0.8.23",
"dependencies": {
"polymer": "^0.5.6",
"paper-elements": "Polymer/paper-elements#^0.5.6",
"core-input": "Polymer/core-input#^0.5.6",
"core-style": "Polymer/core-style#^0.5.6",
"core-icons": "Polymer/core-icons#^0.5.6",
"core-icons": "Polymer/core-icons#~0.5.6",
"core-signals": "Polymer/core-signals#^0.5.6",
"paper-dialog": "Polymer/paper-dialog#^0.5.6",
"core-label": "Polymer/core-label#^0.5.6",
Expand All @@ -16,7 +16,8 @@
"core-drawer-panel": "Polymer/core-drawer-panel#^0.5.6",
"core-overlay": "Polymer/core-overlay#^0.5.6",
"paper-toast": "Polymer/paper-toast#^0.5.6",
"paper-dropdown": "Polymer/paper-dropdown#~0.5.6"
"paper-dropdown": "Polymer/paper-dropdown#~0.5.6",
"paper-fab": "Polymer/paper-fab#~0.5.6"
},
"resolutions": {
"webcomponentsjs": "^0.6.0"
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "uProxy",
"description": "Share your pathway to the Internet",
"version": "0.8.22",
"version": "0.8.23",
"repository": {
"type": "git",
"url": "https://github.com/uproxy/uproxy"
Expand Down Expand Up @@ -29,8 +29,9 @@
"freedom-for-firefox": "^0.6.15",
"freedom-pgp-e2e": "^0.5.0",
"freedom-port-control": "^0.9.0",
"freedom-social-firebase": "^1.0.4",
"freedom-social-firebase": "^2.0.0",
"freedom-social-xmpp": "^0.4.0",
"freedom-social-wechat": "^0.1.5",
"freedomjs-anonymized-metrics": "~0.1.0",
"fs-extra": "^0.12.0",
"grunt": "^0.4.2",
Expand All @@ -53,7 +54,7 @@
"lodash": "^3.7.0",
"regex2dfa": "^0.1.6",
"tsd": "^0.6.3",
"uproxy-lib": "^32.0.0",
"uproxy-lib": "^33.0.0",
"utransformers": "^0.2.1",
"xregexp": "^2.0.0"
},
Expand Down
6 changes: 4 additions & 2 deletions src/chrome/app/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "__MSG_appName__",
"description": "__MSG_appDescription__",
"minimum_chrome_version": "41.0.2272.63",
"version": "0.8.22",
"version": "0.8.23",
"default_locale": "en",
"icons": {
"128": "icons/128_online.png"
Expand All @@ -15,7 +15,9 @@
},
"permissions": [
"storage",
"http://*/"
"http://*/",
"https://*.wechat.com/*",
"https://*.qq.com/*"
],
"sockets": {
"tcp": {
Expand Down
21 changes: 21 additions & 0 deletions src/chrome/extension/invite-received.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!doctype html>
<html>

<head>
<title>Invite successful</title>
<meta name='viewport' content='width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes'>
</head>

<body>
<!-- TODO: translate -->
<h1>Invite received.</h1>

<p>
You just pasted a uProxy invitation link.
Please see the app window for more information.
</p>

<script src='scripts/copypaste.js'></script>
</body>

</html>
2 changes: 1 addition & 1 deletion src/chrome/extension/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "__MSG_extName__",
"version": "0.8.22",
"version": "0.8.23",
"manifest_version": 2,
"description": "__MSG_extDescription__",
"minimum_chrome_version": "41.0.2272.63",
Expand Down
29 changes: 21 additions & 8 deletions src/chrome/extension/scripts/background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,24 +136,37 @@ var lastUrl = '';
var lastUrlTime = 0;

chrome.webRequest.onBeforeRequest.addListener(
function() {
return {cancel: true};
},
{urls: ['https://www.uproxy.org/oauth-redirect-uri*']},
['blocking']
);
function(details) {
browserApi.emit('inviteUrlData', details.url);
// TODO: If there are duplicate emits of this, consider the de-dupe logic
// used by the listener for copypaste links below.
return {
redirectUrl: chrome.extension.getURL('generic_ui/invite-received.html')
};
},
{ urls: ['https://www.uproxy.org/invite/*'] },
['blocking']
);

chrome.webRequest.onBeforeRequest.addListener(
function() {
return { cancel: true };
},
{ urls: ['https://www.uproxy.org/oauth-redirect-uri*'] },
['blocking']
);

chrome.webRequest.onBeforeRequest.addListener(
function(details) {
var url = details.url;

// Chome seems to sometimes send the same url to us twice, we never
// Chrome seems to sometimes send the same url to us twice, we never
// should be receiving the exact same data twice so de-dupe any url
// with the last one we received before processing it. We also want
// to allow a url to be pasted twice if there has been at least a second
// delay in order to allow users to try connecting again.
if (lastUrl !== url || Date.now() - lastUrlTime > 1000) {
browserApi.emit('urlData', url);
browserApi.emit('copyPasteUrlData', url);
} else {
console.warn('Received duplicate url events', url);
}
Expand Down
7 changes: 5 additions & 2 deletions src/firefox/lib/url-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@ exports.setup = function(panel, button) {
subject.QueryInterface(Ci.nsIHttpChannel);
var url = subject.URI.spec

if (!/https:\/\/www.uproxy.org\/(request|offer)\/(.*)/.test(url)) {
if (/^https:\/\/www.uproxy.org\/(request|offer)\/(.*)/.test(url)) {
panel.port.emit('copyPasteUrlData', url);
} else if (/^https:\/\/www.uproxy.org\/invite\/(.*)/.test(url)) {
panel.port.emit('inviteUrlData', url);
} else {
return;
}

panel.port.emit('urlData', url);
panel.show({
position: button
});
Expand Down
4 changes: 2 additions & 2 deletions src/firefox/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "uproxy-firefox",
"title": "uProxy Alpha",
"id": "jid1-uTe1Bgrsb76jSA",
"description": "This is the alpha version of uProxy.",
"author": "uProxy Team <info@uproxy.org>",
"id": "jid1-uTe1Bgrsb76jSA",
"license": "Apache 2.0",
"version": "0.8.22",
"version": "0.8.23",
"permissions": {
"private-browsing": true
}
Expand Down
43 changes: 43 additions & 0 deletions src/generic/network-options.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import social = require('../interfaces/social');

export var NETWORK_OPTIONS :{[name:string]:social.NetworkOptions} = {
'Google': { // Old GTalk XMPP provider, being deprecated.
displayName: 'Google Hangouts',
isFirebase: false,
enableMonitoring: true,
areAllContactsUproxy: false,
supportsReconnect: true,
supportsInvites: false,
isExperimental: true
},
'Facebook': { // Old "v1" Facebook Firebase provider, being deprecated.
isFirebase: true,
enableMonitoring: true,
areAllContactsUproxy: true,
supportsReconnect: true,
supportsInvites: false
},
'Facebook-Firebase-V2': {
displayName: 'Facebook',
isFirebase: true,
enableMonitoring: true,
areAllContactsUproxy: true,
supportsReconnect: true,
supportsInvites: true
},
'GMail': {
isFirebase: true,
enableMonitoring: true,
areAllContactsUproxy: true,
supportsReconnect: true,
supportsInvites: true
},
'WeChat': {
isFirebase: false,
enableMonitoring: false,
areAllContactsUproxy: false,
supportsReconnect: false,
supportsInvites: false,
isExperimental: true
}
};
File renamed without changes.
16 changes: 10 additions & 6 deletions src/generic_core/dev_build/freedom-module.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,20 @@
]
},
"dependencies": {
"SOCIAL-Google": {
"url": "../freedom-social-xmpp/social.google.json",
"api": "social"
"SOCIAL-GMail": {
"url": "../freedom-social-firebase/social.firebase-google.json",
"api": "social2"
},
"SOCIAL-Facebook": {
"SOCIAL-Facebook-Firebase-V2": {
"url": "../freedom-social-firebase/social.firebase-facebook.json",
"api": "social2"
},
"SOCIAL-Google": {
"url": "../freedom-social-xmpp/social.google.json",
"api": "social"
},
"SOCIAL-Google+": {
"url": "../freedom-social-firebase/social.firebase-google.json",
"SOCIAL-WeChat": {
"url": "../freedom-social-wechat/social.wechat.json",
"api": "social"
},
"loggingcontroller": {
Expand Down
12 changes: 8 additions & 4 deletions src/generic_core/dist_build/freedom-module.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,16 @@
]
},
"dependencies": {
"SOCIAL-Google": {
"url": "../freedom-social-xmpp/social.google.json",
"api": "social"
"SOCIAL-GMail": {
"url": "../freedom-social-firebase/social.firebase-google.json",
"api": "social2"
},
"SOCIAL-Facebook": {
"SOCIAL-Facebook-Firebase-V2": {
"url": "../freedom-social-firebase/social.firebase-facebook.json",
"api": "social2"
},
"SOCIAL-Google": {
"url": "../freedom-social-xmpp/social.google.json",
"api": "social"
},
"loggingcontroller": {
Expand Down
13 changes: 12 additions & 1 deletion src/generic_core/freedom-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import logging = require('../../../third_party/uproxy-lib/logging/logging');
import uproxy_core_api = require('../interfaces/uproxy_core_api');
import social_network = require('./social');
import version = require('../version/version');
import version = require('../generic/version');
import browser_connector = require('../interfaces/browser_connector');
import ui = require('./ui_connector');
import uproxy_core = require('./uproxy_core');
Expand Down Expand Up @@ -87,6 +87,17 @@ ui_connector.onPromiseCommand(
uproxy_core_api.Command.START_PROXYING,
core.start);

ui_connector.onPromiseCommand(
uproxy_core_api.Command.ADD_USER,
core.addUser);

ui_connector.onPromiseCommand(
uproxy_core_api.Command.GET_INVITE_URL,
core.getInviteUrl);

ui_connector.onCommand(uproxy_core_api.Command.SEND_EMAIL,
core.sendEmail);

ui_connector.onCommand(uproxy_core_api.Command.STOP_PROXYING,
core.stop);

Expand Down
5 changes: 4 additions & 1 deletion src/generic_core/globals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ export var settings :uproxy_core_api.GlobalSettings = {
statsReportingEnabled: false,
consoleFilter: loggingTypes.Level.warn,
language: 'en',
force_message_version: 0 // zero means "don't override"
force_message_version: 0, // zero means "don't override"
// TODO: remove this in November 2015, to allow 1 month for existing users to
// see the notification that Google+Facebook social providers have changed.
hasSeenGoogleAndFacebookChangedNotification: false
};

export var natType :string = '';
Expand Down
5 changes: 3 additions & 2 deletions src/generic_core/remote-connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -359,12 +359,13 @@ var generateProxyingSessionId_ = (): string => {
this.sendUpdate_(uproxy_core_api.Update.STATE, this.getCurrentState());
}

public getCurrentState = () => {
public getCurrentState = () :uproxy_core_api.ConnectionState => {
return {
bytesSent: this.bytesSent_,
bytesReceived: this.bytesReceived_,
localGettingFromRemote: this.localGettingFromRemote,
localSharingWithRemote: this.localSharingWithRemote
localSharingWithRemote: this.localSharingWithRemote,
activeEndpoint: this.activeEndpoint,
};
}

Expand Down
16 changes: 10 additions & 6 deletions src/generic_core/remote-instance.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,32 +161,36 @@ describe('remote_instance.RemoteInstance', () => {
};

it('can start proxying', (done) => {
expect(alice.localGettingFromRemote).toEqual(social.GettingState.NONE);
var aliceState = alice.currentStateForUi();
expect(aliceState.localGettingFromRemote).toEqual(social.GettingState.NONE);
alice.user.consent.localRequestsAccessFromRemote = true;
alice.wireConsentFromRemote.isOffering = true;
// The module & constructor of SocksToRtc may change in the near future.
spyOn(socks_to_rtc, 'SocksToRtc').and.returnValue(fakeSocksToRtc);
alice.start().then(() => {
expect(alice.localGettingFromRemote)
aliceState = alice.currentStateForUi();
expect(aliceState.localGettingFromRemote)
.toEqual(social.GettingState.GETTING_ACCESS);
done();
});
aliceState = alice.currentStateForUi();
expect(socks_to_rtc.SocksToRtc).toHaveBeenCalled();
expect(alice.localGettingFromRemote)
expect(aliceState.localGettingFromRemote)
.toEqual(social.GettingState.TRYING_TO_GET_ACCESS);
});

it('can stop proxying', () => {
alice.stop();
expect(alice.localGettingFromRemote).toEqual(social.GettingState.NONE);
var aliceState = alice.currentStateForUi();
expect(aliceState.localGettingFromRemote).toEqual(social.GettingState.NONE);
});

it('refuses to start proxy without permission', () => {
spyOn(socks_to_rtc, 'SocksToRtc').and.returnValue(fakeSocksToRtc);
alice.wireConsentFromRemote.isOffering = false;
alice.localGettingFromRemote = social.GettingState.NONE;
alice.start();
expect(alice.localGettingFromRemote).toEqual(social.GettingState.NONE);
var aliceState = alice.currentStateForUi();
expect(aliceState.localGettingFromRemote).toEqual(social.GettingState.NONE);
});

// This test no longer passes with the hack to use
Expand Down
Loading

0 comments on commit e65d18f

Please sign in to comment.