Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into release-candidate
Browse files Browse the repository at this point in the history
  • Loading branch information
jpevarnek committed Oct 12, 2015
2 parents e65d18f + d712037 commit 180e579
Show file tree
Hide file tree
Showing 36 changed files with 467 additions and 126 deletions.
2 changes: 2 additions & 0 deletions .shippable.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
language: node_js
node_js:
- '0.10'
env:
- secure: nKJ7N2c+hez7Qs0sNaiqxzEey5CR6QuMNHJ0k9wwm/HLJfeDut8eTe6ZeZtIsDCVed3vCLV/7tlxW8ZQTOf/vX1F8L0hSeADvAnblGi3xG18K7LTjIs5JvAuxSu1ZLRPZ9PkqpSq7Yx1WUdiza8qcYrfsZrhzre+KfzeRzkjFEp7d5DCycr28fFkxA/gXiggaE4K2l6JZrDlK5dxX4TAMIuzr4vVCCUrtzDXXoiXx6kfXF3YcBq5K6QEA08qJMPmhIqHXpBuaiWBangDlWZObnjkdksid5HGHhVkLG4AschRXE4Xh7FCAOTqKNbsPYVJGWBsQNwDXHRHSMc/b9WpUQ==
notifications:
email:
recipients:
Expand Down
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ install:
- ./setup.sh install
script:
- grunt test
sudo: false
16 changes: 16 additions & 0 deletions Gruntfile.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ gruntConfig = {
freedomfirefox: readJSONFile('node_modules/freedom-for-firefox/package.json')
freedomxmpp: readJSONFile('node_modules/freedom-social-xmpp/package.json')
freedomfirebase: readJSONFile('node_modules/freedom-social-firebase/package.json')
freedomGitHub: readJSONFile('node_modules/freedom-social-github/package.json')
freedomwechat: readJSONFile('node_modules/freedom-social-wechat/package.json')

clean: ['build/dev', 'build/dist', '.tscache']
Expand Down Expand Up @@ -304,6 +305,8 @@ gruntConfig = {
'freedom-social-xmpp/vcardstore.js'
'freedom-social-xmpp/node-xmpp-browser.js'
'freedom-social-xmpp/google-auth.js'
'freedom-social-github/social.github.json'
'freedom-social-github/github-social-provider.js'
'freedom-social-firebase/social.firebase-facebook.json'
'freedom-social-firebase/social.firebase-google.json'
'freedom-social-firebase/firebase-shims.js'
Expand Down Expand Up @@ -353,6 +356,8 @@ gruntConfig = {
'data/freedom-social-xmpp/vcardstore.js'
'data/freedom-social-xmpp/node-xmpp-browser.js'
'data/freedom-social-xmpp/google-auth.js'
'data/freedom-social-github/social.github.json'
'data/freedom-social-github/github-social-provider.js'
'data/freedom-social-firebase/social.firebase-facebook.json'
'data/freedom-social-firebase/social.firebase-google.json'
'data/freedom-social-firebase/firebase-shims.js'
Expand Down Expand Up @@ -532,6 +537,11 @@ gruntConfig = {
src: ['**']
dest: chromeAppDevPath + '/freedom-social-firebase'
},
{
expand: true, cwd: 'node_modules/freedom-social-github/dist/',
src: ['**/*.js', '**/*.json']
dest: chromeAppDevPath + '/freedom-social-github'
},
{
expand: true, cwd: 'node_modules/freedom-social-wechat/dist/',
src: ['**']
Expand Down Expand Up @@ -604,6 +614,11 @@ gruntConfig = {
src: ['**']
dest: firefoxDevPath + '/data/freedom-social-firebase'
},
{
expand: true, cwd: 'node_modules/freedom-social-github/dist/',
src: ['**/*.js', '**/*.json']
dest: firefoxDevPath + '/data/freedom-social-github'
},
{
expand: true, cwd: 'node_modules/freedom-social-wechat/dist/',
src: ['**']
Expand Down Expand Up @@ -736,6 +751,7 @@ gruntConfig = {
'freedom-for-firefox': '<%= pkgs.freedomfirefox.version %>'
'freedom-social-xmpp': '<%= pkgs.freedomxmpp.version %>'
'freedom-social-firebase': '<%= pkgs.freedomfirebase.version %>'
'freedom-social-github': '<%= pkgs.freedomGitHub.version %>'
'freedom-social-wechat': '<%= pkgs.freedomwechat.version %>'
}]
chromeExtVulcanized:
Expand Down
55 changes: 34 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# uProxy

[uProxy](uproxy.org) is a browser extension that lets users share their internet connection.
[uProxy](https://www.uproxy.org) is a browser extension that lets users share their internet connection.

## Build Status

Expand All @@ -17,52 +17,65 @@ uProxy is built using the following tools:
- [Polymer](http://www.polymer-project.org/) for UI

To manage dependencies we use:
- [npm](https://www.npmjs.org/) for installing node modules that we use for our build process. (Specified in `package.json`)
- [npm](https://www.npmjs.org/) to install node modules that we use for our build process. (Specified in `package.json`)
- [Bower](http://bower.io) to install libraries that we use in the UI
(specified in `bower.json`) including AngularJS.
(specified in `bower.json`) including Polymer.


## Development setup

Please read the [uProxy Coding Guide](https://docs.google.com/document/d/12RfgwSLnEm-X5Knj1xFVGpp-MH7BdWjuzzo_g7xabro/edit) to learn more about contributing to uProxy.
Please read the [uProxy Coding Guide](https://docs.google.com/document/d/12RfgwSLnEm-X5Knj1xFVGpp-MH7BdWjuzzo_g7xabro/edit) to learn more about contributing to uProxy. For a high level technical overview of uProxy, see the [uProxy Design Doc](https://docs.google.com/document/d/1t_30vX7RcrEGuWwcg0Jub-HiNI0Ko3kBOyqXgrQN3Kw/edit#).

### Pre-Requirements to build uProxy
### Prerequisites to build uProxy

Note: you will either need to run these as root, or set the directories they
modify (`/usr/local`) to being editable by your user (sudo chown -R $USER /usr/local)
modify (`/usr/local`) to being editable by your user (`sudo chown -R $USER /usr/local`)

- [git](https://git-scm.com/)
- Most machines will have git pre-installed. If you need to install git, you can find instructions from the [git website](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git).
- For Windows, install the [desktop git app](https://desktop.github.com/), which provides an easy-to-use interface for git.

- [node](http://nodejs.org/) and npm (Node's package manager):

- On Mac with Brew, you can do: `brew install node` (You may need to update your brew package manager, e.g. `brew update`). You can also install directly from a Mac package off the [NodeJS Website](http://nodejs.org/).
- On **Mac** with Brew, you can do: `brew install node` (You may need to update your brew package manager, e.g. `brew update`). You can also install directly from a Mac package off the [NodeJS Website](http://nodejs.org/).
- If you do not have [Homebrew](http://brew.sh), you can install it by running `ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"`

- On Ubuntu, you can do `apt-get install nodejs`.
- We also need to create symlink ( if we are not running legacy node) <br>
- On **Ubuntu**, you can do `apt-get install nodejs`.
- You may need to create a symlink (if we are not running legacy node) <br>
Use this: <br>
ln -s /usr/bin/nodejs /usr/bin/node
ln -s /usr/bin/nodejs /usr/bin/node

- On **Archlinux**, you can do 'pacman -S nodejs'.

- On Archlinux, you can do 'pacman -S nodejs'.
- On **Windows**, you can download the installer from the [NodeJS Website](http://nodejs.org/).

- You may need to set your `$NODE_PATH` environment variable appropriately
(e.g. it might be: `/usr/local/share/npm/lib/node_modules`).

- If you install npm things globally, you'll need to do so as the
appropriate super-user.

- To run binaries from globally-installed npm packages without
fully-qualifying paths, make sure you have added your npm bin directory to your path (e.g. `export PATH=$PATH:/usr/local/share/npm/bin/grunt`).

- On Windows, you can download the installer from the [NodeJS Website](http://nodejs.org/).
fully-qualifying paths, make sure you have added your npm bin directory to your path
- on Mac or Ubuntu, e.g. `export PATH=$PATH:/usr/local/share/npm/bin/grunt`
- on Windows,
- Open Control Panel > System and Security > System > Advanced System Settings
- In the Advanced tab, click on "Environment Variables"
- In System Variables, click on "Path" (or "PATH")
- At the end of the "Variable value:" string, append a ";" and the path to your bin directory, e.g. "C:\Program Files\nodejs\node_modules\npm\lib;C:\Users\<YOUR_PATH>\AppData\Roaming\npm\node_modules\grunt-cli\bin"

- [Grunt](http://gruntjs.com/): Install globally with `npm install -g grunt-cli`
- To install globally on Windows, open the command prompt as admin and then run the command

### Building uProxy from source

1. Clone uProxy and its submodules (and its submodules' submodules...): `git clone https://github.com/uProxy/uProxy.git` or `git clone git@github.com:uProxy/uproxy.git` if you have your ssh access to github set up (useful if you use 2-step auth for github, which you should do).
1. In your terminal, navigate to a directory where you would like to download uProxy. E.g., `cd ~/uProxy`

1. Clone the uProxy repository: `git clone https://github.com/uProxy/uProxy.git` or `git clone git@github.com:uProxy/uproxy.git` if you have your ssh access to GitHub set up (useful if you use 2-step auth for GitHub, which you should do).

1. Navigate into uProxy's root directory with `cd uproxy`

1. In the root uProxy directory, run:
* In OS X or Linux, run `./setup.sh install` - this will set up build tools and third-party dependencies.
1. Setup build tools and third-party dependencies:
* In OS X or Linux, run `./setup.sh install`
* In Windows, run `.\setup.cmd install` instead (in cmd or PowerShell).
* Then run `grunt` - this will build everything, including uProxy for Chrome and Firefox.
1. Run `grunt` - this will build everything, including uProxy for Chrome and Firefox.

Note that if any local dependencies have changed (i.e. changes to bower dependencies, updates to FreeDOM), you will have to run `./setup.sh install` to update these dependencies, then rerun `grunt`

Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "uProxy",
"version": "0.8.23",
"version": "0.8.24",
"dependencies": {
"polymer": "^0.5.6",
"paper-elements": "Polymer/paper-elements#^0.5.6",
Expand Down
4 changes: 3 additions & 1 deletion 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.23",
"version": "0.8.24",
"repository": {
"type": "git",
"url": "https://github.com/uproxy/uproxy"
Expand Down Expand Up @@ -31,6 +31,7 @@
"freedom-port-control": "^0.9.0",
"freedom-social-firebase": "^2.0.0",
"freedom-social-xmpp": "^0.4.0",
"freedom-social-github": "^0.1.3",
"freedom-social-wechat": "^0.1.5",
"freedomjs-anonymized-metrics": "~0.1.0",
"fs-extra": "^0.12.0",
Expand All @@ -45,6 +46,7 @@
"grunt-jasmine-chromeapp": "git://github.com/uproxy/grunt-jasmine-chromeapp",
"grunt-mozilla-addon-sdk": "^0.4.0",
"grunt-string-replace": "^1.0.0",
"grunt-subgrunt": "^0.4.5",
"grunt-template-jasmine-istanbul": "^0.3.0",
"grunt-ts": "~4.1.0",
"grunt-verbosity": "^0.2.2",
Expand Down
3 changes: 2 additions & 1 deletion 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.23",
"version": "0.8.24",
"default_locale": "en",
"icons": {
"128": "icons/128_online.png"
Expand All @@ -16,6 +16,7 @@
"permissions": [
"storage",
"http://*/",
"https://github.com/login/oauth/access_token",
"https://*.wechat.com/*",
"https://*.qq.com/*"
],
Expand Down
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.23",
"version": "0.8.24",
"manifest_version": 2,
"description": "__MSG_extDescription__",
"minimum_chrome_version": "41.0.2272.63",
Expand Down
2 changes: 1 addition & 1 deletion src/firefox/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"author": "uProxy Team <info@uproxy.org>",
"id": "jid1-uTe1Bgrsb76jSA",
"license": "Apache 2.0",
"version": "0.8.23",
"version": "0.8.24",
"permissions": {
"private-browsing": true
}
Expand Down
8 changes: 8 additions & 0 deletions src/generic/network-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,13 @@ export var NETWORK_OPTIONS :{[name:string]:social.NetworkOptions} = {
supportsReconnect: false,
supportsInvites: false,
isExperimental: true
},
'GitHub': {
isFirebase: false,
enableMonitoring: false,
areAllContactsUproxy: true,
supportsReconnect: false,
supportsInvites: true,
isExperimental: true
}
};
4 changes: 4 additions & 0 deletions src/generic_core/dev_build/freedom-module.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
"url": "../freedom-social-wechat/social.wechat.json",
"api": "social"
},
"SOCIAL-GitHub": {
"url": "../freedom-social-github/social.github.json",
"api": "social2"
},
"loggingcontroller": {
"url": "../uproxy-lib/loggingprovider/freedom-module.json",
"api": "loggingcontroller"
Expand Down
3 changes: 2 additions & 1 deletion src/generic_core/firewall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ import logging = require('../../../third_party/uproxy-lib/logging/logging');
'url' : '?string',
'imageData' : '?string',
'lastUpdated' : '?number',
'lastSeen' : '?number'
'lastSeen' : '?number',
'status' : '?number'
};

function checkSchema(object:any, schema:Schema) :boolean {
Expand Down
11 changes: 11 additions & 0 deletions src/generic_core/freedom-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import logging = require('../../../third_party/uproxy-lib/logging/logging');
import uproxy_core_api = require('../interfaces/uproxy_core_api');
import social = require('../interfaces/social');
import social_network = require('./social');
import version = require('../generic/version');
import browser_connector = require('../interfaces/browser_connector');
Expand Down Expand Up @@ -87,6 +88,11 @@ ui_connector.onPromiseCommand(
uproxy_core_api.Command.START_PROXYING,
core.start);

ui_connector.onPromiseCommand(
uproxy_core_api.Command.SEND_INVITATION,
core.inviteUser);

// Required for version 0.8.23
ui_connector.onPromiseCommand(
uproxy_core_api.Command.ADD_USER,
core.addUser);
Expand Down Expand Up @@ -144,3 +150,8 @@ var dailyMetricsReporter = new metrics_module.DailyMetricsReporter(
ui_connector.onPromiseCommand(
uproxy_core_api.Command.PING_UNTIL_ONLINE,
core.pingUntilOnline);

ui_connector.onPromiseCommand(
uproxy_core_api.Command.ACCEPT_INVITATION,
core.acceptInvitation);

15 changes: 11 additions & 4 deletions src/generic_core/remote-user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ var log :logging.Log = new logging.Log('remote-user');
// Name of the user as provided by the social network.
public name :string;
public clientIdToStatusMap :{ [clientId :string] :social.ClientStatus };
public profile :freedom.Social.UserProfile;
public profile :social.UserProfile;

public consent :consent.State;

Expand Down Expand Up @@ -113,14 +113,17 @@ var log :logging.Log = new logging.Log('remote-user');
* Update the information about this user.
* The userId must match.
*/
public update = (profile :freedom.Social.UserProfile) : void => {
public update = (profile :social.UserProfile) : void => {
if (profile.userId != this.userId) {
throw Error('Updating User ' + this.userId +
' with unexpected userID: ' + profile.userId);
}
this.name = profile.name;
this.fulfillNameReceived_(this.name);
this.profile = profile;
if (!this.profile.status) {
this.profile.status = social.UserStatus.FRIEND;
}
this.saveToStorage();
this.notifyUI();
}
Expand Down Expand Up @@ -385,7 +388,8 @@ var log :logging.Log = new logging.Log('remote-user');
userId: this.profile.userId,
name: this.profile.name,
imageData: this.profile.imageData,
url: this.profile.url
url: this.profile.url,
status: this.profile.status
},
consent: this.consent,
offeringInstances: offeringInstanceStatesForUi,
Expand Down Expand Up @@ -472,6 +476,8 @@ var log :logging.Log = new logging.Log('remote-user');
this.profile.url = state.url;
}

this.profile.status = state.status || social.UserStatus.FRIEND;

// Restore all instances.
var onceLoadedPromises :Promise<void>[] = [];
for (var i in state.instanceIds) {
Expand Down Expand Up @@ -499,7 +505,8 @@ var log :logging.Log = new logging.Log('remote-user');
imageData: this.profile.imageData,
url: this.profile.url,
instanceIds: Object.keys(this.instances_),
consent: this.consent
consent: this.consent,
status: this.profile.status
});
}

Expand Down
Loading

0 comments on commit 180e579

Please sign in to comment.