mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-07-01 01:18:04 +02:00
Merge commit '84ec1c80d283cbea8b186629e7b1de49d91cf9ba'
* commit '84ec1c80d283cbea8b186629e7b1de49d91cf9ba': fix(heroku): fix invalid app.json (#1901) feat(deps): dependencies upgrade (#1887) release(0.6.0): MEAN.JS 0.6.0 (#1863) feat(readme): Deploy to Heroku button (#1854) fix(users): Spacing Issues Abstracted OAuth routes to use req param to identify strategy & moved scope to actual strategy definition. Save profile images to Amazon S3 (#1857) fix(build): Require correct dependencies for prod build (#1855) fix(eslint): Make `space-before-function-paren` rule consistent with other rules (#1858) fix(gulpfile): show error on uglify (#1860) feat(core): Add manifest.json (#1851) # Conflicts: # CHANGELOG.md # README.md # modules/core/client/views/header.client.view.html # modules/users/client/views/settings/change-profile-picture.client.view.html # modules/users/server/controllers/users/users.profile.server.controller.js # package.json
This commit is contained in:
@@ -41,7 +41,7 @@ module.exports = {
|
||||
'one-var': [0, 'never'],
|
||||
'one-var-declaration-per-line': [2, 'always'],
|
||||
'padded-blocks': 0,
|
||||
'space-before-function-paren': ['error', {
|
||||
'space-before-function-paren': [2, {
|
||||
'anonymous': 'always',
|
||||
'named': 'never',
|
||||
'asyncArrow': 'always'
|
||||
|
||||
134
CHANGELOG.md
134
CHANGELOG.md
@@ -1,5 +1,139 @@
|
||||
## Change Log
|
||||
|
||||
<a name="0.6.0"></a>
|
||||
# 0.6.0 (2017-09-23)
|
||||
|
||||
* Abstracted OAuth routes to use req param to identify strategy & moved scope to actual strategy defin ([6377a1e](https://github.com/meanjs/mean/commit/6377a1e))
|
||||
* Better autofocus (#1664) ([f53db0f](https://github.com/meanjs/mean/commit/f53db0f))
|
||||
* Incorrect production assets (#1647) ([d37b603](https://github.com/meanjs/mean/commit/d37b603))
|
||||
* release(0.6.0) ([5554541](https://github.com/meanjs/mean/commit/5554541))
|
||||
* Remove deprecated crypto package (#1843) ([c6d4a17](https://github.com/meanjs/mean/commit/c6d4a17))
|
||||
* Save profile images to Amazon S3 (#1857) ([f146cbc](https://github.com/meanjs/mean/commit/f146cbc))
|
||||
* Update templateCache root path ([1177746](https://github.com/meanjs/mean/commit/1177746))
|
||||
* updating changelog ([73379bf](https://github.com/meanjs/mean/commit/73379bf))
|
||||
* feat(articles): Promisifies article server test set up and clean up (#1774) ([d72da37](https://github.com/meanjs/mean/commit/d72da37)), closes [#1773](https://github.com/meanjs/mean/issues/1773)
|
||||
* feat(articles): Simple test enhancement (#1659) ([44a569e](https://github.com/meanjs/mean/commit/44a569e)), closes [#1658](https://github.com/meanjs/mean/issues/1658)
|
||||
* feat(build): Ignore compiled sass/less files from git (#1592) ([d47dd41](https://github.com/meanjs/mean/commit/d47dd41))
|
||||
* feat(build): Turn on mangling for uglify (#1841) ([1e3eeb7](https://github.com/meanjs/mean/commit/1e3eeb7))
|
||||
* feat(build): Update dependencies (#1847) ([b43c80e](https://github.com/meanjs/mean/commit/b43c80e))
|
||||
* feat(build): updating supported Node.js versions for CI (#1768) ([7b91f76](https://github.com/meanjs/mean/commit/7b91f76))
|
||||
* feat(ci): Test for Node v7 (allow failure) (#1596) ([aed6235](https://github.com/meanjs/mean/commit/aed6235))
|
||||
* feat(config): Mongo Seed 2.0 (#1808) ([eb9cdd7](https://github.com/meanjs/mean/commit/eb9cdd7))
|
||||
* feat(config): Mongoose 4.11 upgrade (#1818) ([dc880eb](https://github.com/meanjs/mean/commit/dc880eb))
|
||||
* feat(core): Add manifest.json (#1851) ([e4f83c6](https://github.com/meanjs/mean/commit/e4f83c6))
|
||||
* feat(core): Enhancement page title directive (#1686) ([c69644d](https://github.com/meanjs/mean/commit/c69644d))
|
||||
* feat(dependencies): replace PhantomJS in favor of chrome (#1776) ([16a1dcd](https://github.com/meanjs/mean/commit/16a1dcd))
|
||||
* feat(docker): cleaning up pkgs and enabling npm install for dev env (#1603) ([e62b680](https://github.com/meanjs/mean/commit/e62b680))
|
||||
* feat(Karma): Add mocha style progress to Karma tests ([f43d3ea](https://github.com/meanjs/mean/commit/f43d3ea))
|
||||
* feat(packages): updating packages (#1819) ([3470dc5](https://github.com/meanjs/mean/commit/3470dc5))
|
||||
* feat(readme): Deploy to Heroku button (#1854) ([0bf364d](https://github.com/meanjs/mean/commit/0bf364d))
|
||||
* feat(Travis): Don't allow Node.js 8 testing fail (#1815) ([19478ba](https://github.com/meanjs/mean/commit/19478ba))
|
||||
* feat(travis): start testing against Node.js 8 and other CI improvements (#1785) ([482c38c](https://github.com/meanjs/mean/commit/482c38c))
|
||||
* feat(user): Add email support to forgot password (#1834) ([f65d4b9](https://github.com/meanjs/mean/commit/f65d4b9))
|
||||
* fix: package.json to reduce vulnerabilities (#1782) ([c6215a0](https://github.com/meanjs/mean/commit/c6215a0))
|
||||
* fix: package.json to reduce vulnerabilities (#1787) ([8c975c4](https://github.com/meanjs/mean/commit/8c975c4))
|
||||
* fix(build): E2E coverage broken on Travis CI (#1805) ([e3df83e](https://github.com/meanjs/mean/commit/e3df83e))
|
||||
* fix(build): ESLint error in Express config (#1807) ([b7fc24d](https://github.com/meanjs/mean/commit/b7fc24d))
|
||||
* fix(build): Require correct dependencies for prod build (#1855) ([36887dc](https://github.com/meanjs/mean/commit/36887dc))
|
||||
* fix(build): updating travis to use the trusty image for speedy CIs (#1793) ([962f50e](https://github.com/meanjs/mean/commit/962f50e))
|
||||
* fix(config): Default env config lint error (#1604) ([502143b](https://github.com/meanjs/mean/commit/502143b))
|
||||
* fix(core): updating instructions on how to generate the changelog for releases (#1587) ([99496e6](https://github.com/meanjs/mean/commit/99496e6))
|
||||
* fix(dependencies): moving phantomjs-prebuild to devDependencies (#1754) ([5f9e018](https://github.com/meanjs/mean/commit/5f9e018))
|
||||
* fix(dependencies): upgrading dependencies to latest versions (#1753) ([e5d7f15](https://github.com/meanjs/mean/commit/e5d7f15))
|
||||
* fix(dependencies): upgrading nodemailer (#1794) ([4321744](https://github.com/meanjs/mean/commit/4321744))
|
||||
* fix(eslint): Inconsistent spacing before function parentheses (#1844) ([f44c9bc](https://github.com/meanjs/mean/commit/f44c9bc))
|
||||
* fix(eslint): Make `space-before-function-paren` rule consistent with other rules (#1858) ([2c05600](https://github.com/meanjs/mean/commit/2c05600))
|
||||
* fix(gulp): fix broken test:server:watch task (#1842) ([c467c84](https://github.com/meanjs/mean/commit/c467c84)), closes [#1842](https://github.com/meanjs/mean/issues/1842)
|
||||
* fix(gulpfile): show error on uglify (#1860) ([4320780](https://github.com/meanjs/mean/commit/4320780))
|
||||
* fix(mocha): update mochajs version to reduce vulnerabilities (#1830) ([27f5065](https://github.com/meanjs/mean/commit/27f5065))
|
||||
* fix(mongodb): update ssl connection settings (#1809) ([4fcf240](https://github.com/meanjs/mean/commit/4fcf240))
|
||||
* fix(mongoose): fixing mongoose deprecation notice for promises lib (#1691) ([f838404](https://github.com/meanjs/mean/commit/f838404))
|
||||
* fix(node-inspector): deprecating node-inspector infavor of native nodejs debug (#1744) ([994369d](https://github.com/meanjs/mean/commit/994369d))
|
||||
* fix(package): updating node engine supported version (#1789) ([68c9606](https://github.com/meanjs/mean/commit/68c9606))
|
||||
* fix(protractor): support for gulp-protractor for v6-7 only (#1752) ([73135df](https://github.com/meanjs/mean/commit/73135df))
|
||||
* fix(security): updated compression lib in package.json to reduce vulnerabilities (#1812) ([810dd81](https://github.com/meanjs/mean/commit/810dd81))
|
||||
* fix(security): updating vulnerable packages (#1802) ([57c63e6](https://github.com/meanjs/mean/commit/57c63e6))
|
||||
* fix(snyk): disabling snyk until we resolve insecure deps & snyk integration ([817c4e3](https://github.com/meanjs/mean/commit/817c4e3))
|
||||
* fix(snyk): travis snyk setup with snyk auth (#1749) ([d7b6d95](https://github.com/meanjs/mean/commit/d7b6d95))
|
||||
* fix(tests): removing unused mock-fs library which caused tests to fail (#1751) ([e596375](https://github.com/meanjs/mean/commit/e596375))
|
||||
* fix(travis): Fix Travis failing on webdriver issues (#1845) ([9dd0a7b](https://github.com/meanjs/mean/commit/9dd0a7b)), closes [#1845](https://github.com/meanjs/mean/issues/1845)
|
||||
* fix(users): Better MIME-type checking, remove image cropping library (#1589) ([2b6cf53](https://github.com/meanjs/mean/commit/2b6cf53))
|
||||
* fix(users): Domain config setting (#1803) ([0cbdbda](https://github.com/meanjs/mean/commit/0cbdbda))
|
||||
* fix(users): don't fail on missing old image on image upload (#1839) ([be88a2c](https://github.com/meanjs/mean/commit/be88a2c))
|
||||
* fix(users): Duplicate Provider Accounts (#1767) ([e4a3d38](https://github.com/meanjs/mean/commit/e4a3d38))
|
||||
* fix(users): Spacing Issues ([fabccc8](https://github.com/meanjs/mean/commit/fabccc8))
|
||||
* refactor(menus): Refactor to the Menus client service to use functional loops/filters (#1575) ([6021c14](https://github.com/meanjs/mean/commit/6021c14))
|
||||
* chore(documentation): add comment to remind change for mongo replicaset connection ([7eedfcc](https://github.com/meanjs/mean/commit/7eedfcc))
|
||||
* build(gems): we shouldnt need any gem file installations anymore (#1759) ([9c3a4f5](https://github.com/meanjs/mean/commit/9c3a4f5))
|
||||
|
||||
|
||||
|
||||
<a name="0.6.0"></a>
|
||||
# 0.6.0 (2017-09-07)
|
||||
|
||||
* Better autofocus (#1664) ([f53db0f](https://github.com/meanjs/mean/commit/f53db0f))
|
||||
* Incorrect production assets (#1647) ([d37b603](https://github.com/meanjs/mean/commit/d37b603))
|
||||
* release(0.6.0) ([81280d3](https://github.com/meanjs/mean/commit/81280d3))
|
||||
* Remove deprecated crypto package (#1843) ([c6d4a17](https://github.com/meanjs/mean/commit/c6d4a17))
|
||||
* Update templateCache root path ([1177746](https://github.com/meanjs/mean/commit/1177746))
|
||||
* fix: package.json to reduce vulnerabilities (#1782) ([c6215a0](https://github.com/meanjs/mean/commit/c6215a0))
|
||||
* fix: package.json to reduce vulnerabilities (#1787) ([8c975c4](https://github.com/meanjs/mean/commit/8c975c4))
|
||||
* fix(build): E2E coverage broken on Travis CI (#1805) ([e3df83e](https://github.com/meanjs/mean/commit/e3df83e))
|
||||
* fix(build): ESLint error in Express config (#1807) ([b7fc24d](https://github.com/meanjs/mean/commit/b7fc24d))
|
||||
* fix(build): Require correct dependencies for prod build (#1855) ([36887dc](https://github.com/meanjs/mean/commit/36887dc))
|
||||
* fix(build): updating travis to use the trusty image for speedy CIs (#1793) ([962f50e](https://github.com/meanjs/mean/commit/962f50e))
|
||||
* fix(config): Default env config lint error (#1604) ([502143b](https://github.com/meanjs/mean/commit/502143b))
|
||||
* fix(core): updating instructions on how to generate the changelog for releases (#1587) ([99496e6](https://github.com/meanjs/mean/commit/99496e6))
|
||||
* fix(dependencies): moving phantomjs-prebuild to devDependencies (#1754) ([5f9e018](https://github.com/meanjs/mean/commit/5f9e018))
|
||||
* fix(dependencies): upgrading dependencies to latest versions (#1753) ([e5d7f15](https://github.com/meanjs/mean/commit/e5d7f15))
|
||||
* fix(dependencies): upgrading nodemailer (#1794) ([4321744](https://github.com/meanjs/mean/commit/4321744))
|
||||
* fix(eslint): Inconsistent spacing before function parentheses (#1844) ([f44c9bc](https://github.com/meanjs/mean/commit/f44c9bc))
|
||||
* fix(eslint): Make `space-before-function-paren` rule consistent with other rules (#1858) ([2c05600](https://github.com/meanjs/mean/commit/2c05600))
|
||||
* fix(gulp): fix broken test:server:watch task (#1842) ([c467c84](https://github.com/meanjs/mean/commit/c467c84)), closes [#1842](https://github.com/meanjs/mean/issues/1842)
|
||||
* fix(gulpfile): show error on uglify (#1860) ([4320780](https://github.com/meanjs/mean/commit/4320780))
|
||||
* fix(mocha): update mochajs version to reduce vulnerabilities (#1830) ([27f5065](https://github.com/meanjs/mean/commit/27f5065))
|
||||
* fix(mongodb): update ssl connection settings (#1809) ([4fcf240](https://github.com/meanjs/mean/commit/4fcf240))
|
||||
* fix(mongoose): fixing mongoose deprecation notice for promises lib (#1691) ([f838404](https://github.com/meanjs/mean/commit/f838404))
|
||||
* fix(node-inspector): deprecating node-inspector infavor of native nodejs debug (#1744) ([994369d](https://github.com/meanjs/mean/commit/994369d))
|
||||
* fix(package): updating node engine supported version (#1789) ([68c9606](https://github.com/meanjs/mean/commit/68c9606))
|
||||
* fix(protractor): support for gulp-protractor for v6-7 only (#1752) ([73135df](https://github.com/meanjs/mean/commit/73135df))
|
||||
* fix(security): updated compression lib in package.json to reduce vulnerabilities (#1812) ([810dd81](https://github.com/meanjs/mean/commit/810dd81))
|
||||
* fix(security): updating vulnerable packages (#1802) ([57c63e6](https://github.com/meanjs/mean/commit/57c63e6))
|
||||
* fix(snyk): disabling snyk until we resolve insecure deps & snyk integration ([817c4e3](https://github.com/meanjs/mean/commit/817c4e3))
|
||||
* fix(snyk): travis snyk setup with snyk auth (#1749) ([d7b6d95](https://github.com/meanjs/mean/commit/d7b6d95))
|
||||
* fix(tests): removing unused mock-fs library which caused tests to fail (#1751) ([e596375](https://github.com/meanjs/mean/commit/e596375))
|
||||
* fix(travis): Fix Travis failing on webdriver issues (#1845) ([9dd0a7b](https://github.com/meanjs/mean/commit/9dd0a7b)), closes [#1845](https://github.com/meanjs/mean/issues/1845)
|
||||
* fix(users): Better MIME-type checking, remove image cropping library (#1589) ([2b6cf53](https://github.com/meanjs/mean/commit/2b6cf53))
|
||||
* fix(users): Domain config setting (#1803) ([0cbdbda](https://github.com/meanjs/mean/commit/0cbdbda))
|
||||
* fix(users): don't fail on missing old image on image upload (#1839) ([be88a2c](https://github.com/meanjs/mean/commit/be88a2c))
|
||||
* fix(users): Duplicate Provider Accounts (#1767) ([e4a3d38](https://github.com/meanjs/mean/commit/e4a3d38))
|
||||
* feat(articles): Promisifies article server test set up and clean up (#1774) ([d72da37](https://github.com/meanjs/mean/commit/d72da37)), closes [#1773](https://github.com/meanjs/mean/issues/1773)
|
||||
* feat(articles): Simple test enhancement (#1659) ([44a569e](https://github.com/meanjs/mean/commit/44a569e)), closes [#1658](https://github.com/meanjs/mean/issues/1658)
|
||||
* feat(build): Ignore compiled sass/less files from git (#1592) ([d47dd41](https://github.com/meanjs/mean/commit/d47dd41))
|
||||
* feat(build): Turn on mangling for uglify (#1841) ([1e3eeb7](https://github.com/meanjs/mean/commit/1e3eeb7))
|
||||
* feat(build): Update dependencies (#1847) ([b43c80e](https://github.com/meanjs/mean/commit/b43c80e))
|
||||
* feat(build): updating supported Node.js versions for CI (#1768) ([7b91f76](https://github.com/meanjs/mean/commit/7b91f76))
|
||||
* feat(ci): Test for Node v7 (allow failure) (#1596) ([aed6235](https://github.com/meanjs/mean/commit/aed6235))
|
||||
* feat(config): Mongo Seed 2.0 (#1808) ([eb9cdd7](https://github.com/meanjs/mean/commit/eb9cdd7))
|
||||
* feat(config): Mongoose 4.11 upgrade (#1818) ([dc880eb](https://github.com/meanjs/mean/commit/dc880eb))
|
||||
* feat(core): Add manifest.json (#1851) ([e4f83c6](https://github.com/meanjs/mean/commit/e4f83c6))
|
||||
* feat(core): Enhancement page title directive (#1686) ([c69644d](https://github.com/meanjs/mean/commit/c69644d))
|
||||
* feat(dependencies): replace PhantomJS in favor of chrome (#1776) ([16a1dcd](https://github.com/meanjs/mean/commit/16a1dcd))
|
||||
* feat(docker): cleaning up pkgs and enabling npm install for dev env (#1603) ([e62b680](https://github.com/meanjs/mean/commit/e62b680))
|
||||
* feat(Karma): Add mocha style progress to Karma tests ([f43d3ea](https://github.com/meanjs/mean/commit/f43d3ea))
|
||||
* feat(packages): updating packages (#1819) ([3470dc5](https://github.com/meanjs/mean/commit/3470dc5))
|
||||
* feat(Travis): Don't allow Node.js 8 testing fail (#1815) ([19478ba](https://github.com/meanjs/mean/commit/19478ba))
|
||||
* feat(travis): start testing against Node.js 8 and other CI improvements (#1785) ([482c38c](https://github.com/meanjs/mean/commit/482c38c))
|
||||
* feat(user): Add email support to forgot password (#1834) ([f65d4b9](https://github.com/meanjs/mean/commit/f65d4b9))
|
||||
* refactor(menus): Refactor to the Menus client service to use functional loops/filters (#1575) ([6021c14](https://github.com/meanjs/mean/commit/6021c14))
|
||||
* chore(documentation): add comment to remind change for mongo replicaset connection ([7eedfcc](https://github.com/meanjs/mean/commit/7eedfcc))
|
||||
* build(gems): we shouldnt need any gem file installations anymore (#1759) ([9c3a4f5](https://github.com/meanjs/mean/commit/9c3a4f5))
|
||||
|
||||
|
||||
|
||||
<a name="0.5.0"></a>
|
||||
# 0.5.0 (2016-10-21)
|
||||
|
||||
### upcoming (2017/05/17 10:32 +00:00)
|
||||
- [bbf0b43](https://github.com/taobataoma/meanTorrent/commit/bbf0b43528ba196f1b02e2deaaa57b269e123a70) change torrent file upload mode, first save temp folder, when create data ok, then move the file to dest folder,and delete the temp file (@taobataoma)
|
||||
- [2729ed4](https://github.com/taobataoma/meanTorrent/commit/2729ed400abc33816a2ef8469c30e04714899373) change torrent list order key (@taobataoma)
|
||||
|
||||
18
README.md
18
README.md
@@ -313,7 +313,23 @@ the upload ratio more than `contition.ratio`, otherwise, the user will get a HnR
|
||||
then the user can not download any torrent. but can continue the warning torrent and seed it until the warning disappears,
|
||||
and the user can remove a warning by score number of `scoreToRemoveWarning` or donate a VIP qualifications.
|
||||
|
||||
There is not much comment of `config/env/torrent.js`, because the development time is limited, I'll add more comment in my free time, If you has any question, please post an [issue](https://github.com/taobataoma/meanTorrent/issues), and i will focus it.
|
||||
## Deploying to PAAS
|
||||
|
||||
### Deploying MEANJS To Heroku
|
||||
|
||||
By clicking the button below you can signup for Heroku and deploy a working copy of MEANJS to the cloud without having to do the steps above.
|
||||
|
||||
[](https://heroku.com/deploy)
|
||||
|
||||
### Amazon S3 configuration
|
||||
|
||||
To save the profile images to S3, simply set those environment variables:
|
||||
```javascript
|
||||
UPLOADS_STORAGE: s3
|
||||
S3_BUCKET: the name of the bucket where the images will be saved
|
||||
S3_ACCESS_KEY_ID: Your S3 access key
|
||||
S3_SECRET_ACCESS_KEY: Your S3 access key password
|
||||
```
|
||||
|
||||
## License
|
||||
[The MIT License](LICENSE.md)
|
||||
|
||||
32
app.json
Normal file
32
app.json
Normal file
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"name": "meanTorrent",
|
||||
"description": "MEAN.JS BitTorrent - Full-Stack JavaScript Using MongoDB, Express, AngularJS, and Node.js, a Private BitTorrent Tracker CMS",
|
||||
"repository": "https://github.com/taobataoma/meanTorrent",
|
||||
"logo": "http://meanjs.org/img/logo-small.png",
|
||||
"keywords": [
|
||||
"mongodb",
|
||||
"express",
|
||||
"angularjs",
|
||||
"node.js",
|
||||
"mongoose",
|
||||
"passport",
|
||||
"torrent",
|
||||
"bitTorrent",
|
||||
"tracker",
|
||||
"announce"
|
||||
],
|
||||
"addons": [
|
||||
{
|
||||
"plan": "mongolab:sandbox"
|
||||
},
|
||||
{
|
||||
"plan": "papertrail:choklad"
|
||||
}
|
||||
],
|
||||
"env": {
|
||||
"NPM_CONFIG_PRODUCTION": "true",
|
||||
"NPM_CONFIG_LOGLEVEL": "error",
|
||||
"NODE_ENV": "production",
|
||||
"NODE_VERBOSE": "false"
|
||||
}
|
||||
}
|
||||
17
config/env/default.js
vendored
17
config/env/default.js
vendored
@@ -45,7 +45,16 @@ module.exports = {
|
||||
illegalUsernames: ['meanjs', 'administrator', 'password', 'admin', 'user',
|
||||
'unknown', 'anonymous', 'null', 'undefined', 'api'
|
||||
],
|
||||
aws: {
|
||||
s3: {
|
||||
accessKeyId: process.env.S3_ACCESS_KEY_ID,
|
||||
secretAccessKey: process.env.S3_SECRET_ACCESS_KEY,
|
||||
bucket: process.env.S3_BUCKET
|
||||
}
|
||||
},
|
||||
uploads: {
|
||||
// Storage can be 'local' or 's3'
|
||||
storage: process.env.UPLOADS_STORAGE || 'local',
|
||||
profile: {
|
||||
image: {
|
||||
dest: './modules/users/client/img/profile/uploads/',
|
||||
@@ -59,21 +68,21 @@ module.exports = {
|
||||
dest: './modules/torrents/client/uploads/',
|
||||
temp: './modules/torrents/client/uploads/temp/',
|
||||
limits: {
|
||||
fileSize: 2 * 1024 * 1024 // Max file size in bytes (1 MB)
|
||||
fileSize: 2 * 1024 * 1024 // Max file size in bytes (2 MB)
|
||||
}
|
||||
},
|
||||
cover: {
|
||||
dest: './modules/torrents/client/uploads/cover/',
|
||||
temp: './modules/torrents/client/uploads/temp/',
|
||||
limits: {
|
||||
fileSize: 2 * 1024 * 1024 // Max file size in bytes (1 MB)
|
||||
fileSize: 2 * 1024 * 1024 // Max file size in bytes (2 MB)
|
||||
}
|
||||
},
|
||||
image: {
|
||||
dest: './modules/torrents/client/uploads/image/',
|
||||
temp: './modules/torrents/client/uploads/temp/',
|
||||
limits: {
|
||||
fileSize: 2 * 1024 * 1024 // Max file size in bytes (1 MB)
|
||||
fileSize: 2 * 1024 * 1024 // Max file size in bytes (2 MB)
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -90,7 +99,7 @@ module.exports = {
|
||||
file: {
|
||||
dest: './modules/torrents/client/uploads/subtitles/',
|
||||
limits: {
|
||||
fileSize: 2 * 1024 * 1024 // Max file size in bytes (1 MB)
|
||||
fileSize: 2 * 1024 * 1024 // Max file size in bytes (2 MB)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
17
gulpfile.js
17
gulpfile.js
@@ -21,11 +21,7 @@ var _ = require('lodash'),
|
||||
wiredep = require('wiredep').stream,
|
||||
path = require('path'),
|
||||
endOfLine = require('os').EOL,
|
||||
protractor = require('gulp-protractor').protractor,
|
||||
webdriver_update = require('gulp-protractor').webdriver_update,
|
||||
webdriver_standalone = require('gulp-protractor').webdriver_standalone,
|
||||
del = require('del'),
|
||||
KarmaServer = require('karma').Server,
|
||||
semver = require('semver');
|
||||
|
||||
// Local settings
|
||||
@@ -153,6 +149,8 @@ gulp.task('uglify', function () {
|
||||
.pipe(plugins.ngAnnotate())
|
||||
.pipe(plugins.uglify({
|
||||
mangle: true
|
||||
}).on('error', function (err) {
|
||||
console.log('Uglify error : ', err.toString());
|
||||
}))
|
||||
.pipe(plugins.concat('application.min.js'))
|
||||
.pipe(plugins.rev())
|
||||
@@ -367,6 +365,7 @@ gulp.task('mocha:coverage', ['pre-test', 'mocha'], function () {
|
||||
|
||||
// Karma test runner task
|
||||
gulp.task('karma', function (done) {
|
||||
var KarmaServer = require('karma').Server;
|
||||
new KarmaServer({
|
||||
configFile: __dirname + '/karma.conf.js'
|
||||
}, done).start();
|
||||
@@ -374,6 +373,7 @@ gulp.task('karma', function (done) {
|
||||
|
||||
// Run karma with coverage options set and write report
|
||||
gulp.task('karma:coverage', function (done) {
|
||||
var KarmaServer = require('karma').Server;
|
||||
new KarmaServer({
|
||||
configFile: __dirname + '/karma.conf.js',
|
||||
preprocessors: {
|
||||
@@ -451,15 +451,20 @@ gulp.task('mongo-seed', function (done) {
|
||||
});
|
||||
|
||||
// Downloads the selenium webdriver if protractor version is compatible
|
||||
gulp.task('webdriver_update', webdriver_update);
|
||||
gulp.task('webdriver_update', function (done) {
|
||||
return require('gulp-protractor').webdriver_update(done);
|
||||
});
|
||||
|
||||
// Start the standalone selenium server
|
||||
// NOTE: This is not needed if you reference the
|
||||
// seleniumServerJar in your protractor.conf.js
|
||||
gulp.task('webdriver_standalone', webdriver_standalone);
|
||||
gulp.task('webdriver_standalone', function (done) {
|
||||
return require('gulp-protractor').webdriver_standalone(done);
|
||||
});
|
||||
|
||||
// Protractor test runner task
|
||||
gulp.task('protractor', ['webdriver_update'], function () {
|
||||
var protractor = require('gulp-protractor').protractor;
|
||||
gulp.src([])
|
||||
.pipe(protractor({
|
||||
configFile: 'protractor.conf.js'
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
</div>
|
||||
<div ng-class="(message.user.username == vm.user.username) && (message.type == 'message') ? 'chat-wrapper-me' : 'chat-wrapper'">
|
||||
<a class="chat-avatar" ng-dblclick="vm.onUserImgDblClicked(message.user.displayName);">
|
||||
<img title="@{{message.user.displayName}}" ng-src="/{{message.user.profileImageURL}}">
|
||||
<img title="@{{message.user.displayName}}" ng-src="{{message.user.profileImageURL}}">
|
||||
</a>
|
||||
|
||||
<div class="chat-message-item">
|
||||
@@ -78,7 +78,7 @@
|
||||
<li ng-repeat="u in vm.users | orderBy:['-isAdmin', '-isOper', '-isVip', 'username']">
|
||||
<div class="user-item-wrapper" mt-scale-by-mouse="{scale: 1.1, duration: '.5s'}" ng-dblclick="vm.onUserListItemDblClicked(u);">
|
||||
<a class="user-item-avatar">
|
||||
<img title="@{{u.displayName}}" ng-src="/{{u.profileImageURL}}">
|
||||
<img title="@{{u.displayName}}" ng-src="{{u.profileImageURL}}">
|
||||
</a>
|
||||
|
||||
<div class="user-item-body">
|
||||
|
||||
BIN
modules/core/client/img/brand/icon.png
Normal file
BIN
modules/core/client/img/brand/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.2 KiB |
@@ -32,8 +32,8 @@
|
||||
<ul class="nav navbar-nav navbar-right" ng-show="vm.authentication.user">
|
||||
<li class="dropdown" uib-dropdown>
|
||||
<a class="dropdown-toggle user-header-dropdown-toggle" uib-dropdown-toggle role="button">
|
||||
<img ng-src="/{{vm.authentication.user.profileImageURL}}" alt="{{vm.authentication.user.displayName}}" class="header-profile-image" />
|
||||
<span ng-bind="vm.authentication.user.displayName" class="hide-on-sm"></span> <b class="caret"></b>
|
||||
<img ng-src="{{vm.authentication.user.profileImageURL}}" alt="{{vm.authentication.user.displayName}}" class="header-profile-image" />
|
||||
<span ng-bind="vm.authentication.user.displayName"></span> <b class="caret"></b>
|
||||
</a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li>
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
<div data-ng-if="$index != 0 && $index % 6 == 0" class="clearfix visible-md-block visible-lg-block"></div>
|
||||
<div class="col-xs-4 col-md-2 text-center">
|
||||
<img ng-src="{{vm.tmdbConfig.castImgBaseUrl}}{{cast.profile_path}}"
|
||||
on-error-src="/./modules/core/client/img/default_face.jpg"
|
||||
on-error-src="/modules/core/client/img/default_face.jpg"
|
||||
class="img-circle img-thumbnail img-responsive center-block">
|
||||
<span class="cast-xs-info"><strong>{{cast.name}}</strong></span>
|
||||
|
||||
@@ -171,7 +171,7 @@
|
||||
<td>
|
||||
<div class="newest-item-big" ng-click="vm.openTorrentInfo(nt._id);">
|
||||
<img ng-src="{{vm.tmdbConfig.backdropImgBaseUrl_300}}{{nt.resource_detail_info.backdrop_path}}"
|
||||
on-error-src="/./modules/torrents/client/img/default_backdrop_300.jpg">
|
||||
on-error-src="/modules/torrents/client/img/default_backdrop_300.jpg">
|
||||
|
||||
<div class="newest-user-info">
|
||||
<table>
|
||||
@@ -307,7 +307,7 @@
|
||||
<div data-ng-if="$index != 0 && $index % 6 == 0" class="clearfix visible-md-block visible-lg-block"></div>
|
||||
<div class="col-xs-4 col-md-2 text-center">
|
||||
<img ng-src="{{vm.tmdbConfig.castImgBaseUrl}}{{cast.profile_path}}"
|
||||
on-error-src="/./modules/core/client/img/default_face.jpg"
|
||||
on-error-src="/modules/core/client/img/default_face.jpg"
|
||||
class="img-circle img-thumbnail img-responsive center-block">
|
||||
<span class="cast-xs-info"><strong>{{cast.name}}</strong></span>
|
||||
|
||||
@@ -391,7 +391,7 @@
|
||||
<td>
|
||||
<div class="newest-item-big" ng-click="vm.openTorrentInfo(nt._id);">
|
||||
<img ng-src="{{vm.tmdbConfig.backdropImgBaseUrl_300}}{{nt.resource_detail_info.backdrop_path}}"
|
||||
on-error-src="/./modules/torrents/client/img/default_backdrop_300.jpg">
|
||||
on-error-src="/modules/torrents/client/img/default_backdrop_300.jpg">
|
||||
|
||||
<div class="newest-user-info">
|
||||
<table>
|
||||
|
||||
@@ -34,6 +34,9 @@
|
||||
<!-- Fav Icon -->
|
||||
<link href="/{{favicon}}" rel="shortcut icon" type="image/x-icon">
|
||||
|
||||
<!-- Manifest -->
|
||||
<link href="/manifest.json" rel="manifest">
|
||||
|
||||
<!-- Application CSS Files -->
|
||||
{{#each cssFiles}}<link rel="stylesheet" href="/{{this}}">{{/each}}
|
||||
</head>
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
<tbody>
|
||||
<tr class="message-item" ng-repeat="m in vm.pagedItems" ng-click="vm.showMessage($event, m);">
|
||||
<td>
|
||||
<img class="message-avatar" ng-src="/{{m.from_user.profileImageURL}}" ng-if="m.type=='user'">
|
||||
<img class="message-avatar" ng-src="{{m.from_user.profileImageURL}}" ng-if="m.type=='user'">
|
||||
<span class="message-avatar glyphicon glyphicon-cog admin-message-avatar" ng-if="m.type!='user'"></span>
|
||||
|
||||
<span class="message-title" ng-class="vm.isUnread(m)? 'unread' : 'read'" ng-bind="m.title"></span>
|
||||
@@ -101,7 +101,7 @@
|
||||
<div id="popupSlide" side-overlay="right" side-class="popup-side-overlay" side-close-on-esc side-close-on-outside-click>
|
||||
<div class="message-popup message-item">
|
||||
<div>
|
||||
<img class="message-avatar" ng-src="/{{vm.selectedMessage.from_user.profileImageURL}}">
|
||||
<img class="message-avatar" ng-src="{{vm.selectedMessage.from_user.profileImageURL}}">
|
||||
|
||||
<div class="title-info">
|
||||
<span class="message-title" ng-class="vm.isUnread(vm.selectedMessage)? 'unread' : 'read'"
|
||||
@@ -128,7 +128,7 @@
|
||||
<li class="status-divider"></li>
|
||||
|
||||
<div class="reply-item" ng-repeat="r in vm.selectedMessage._replies">
|
||||
<img class="reply-avatar" ng-src="/{{r.from_user.profileImageURL}}">
|
||||
<img class="reply-avatar" ng-src="{{r.from_user.profileImageURL}}">
|
||||
|
||||
<div class="reply-info">
|
||||
<div class="message-content" ng-bind-html="vm.getContentMarked(r);"></div>
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
<tbody>
|
||||
<tr class="ranking-list-info" ng-repeat="user in vm.upload_ranking">
|
||||
<td class="text-center">{{$index + 1}}</td>
|
||||
<td class="text-center"><img class="ranking-user-img" title="{{user.displayName}}" ng-src="/{{user.profileImageURL}}">
|
||||
<td class="text-center"><img class="ranking-user-img" title="{{user.displayName}}" ng-src="{{user.profileImageURL}}">
|
||||
</td>
|
||||
<td>
|
||||
<span user-info="user" info-name></span>
|
||||
@@ -90,7 +90,7 @@
|
||||
<tbody>
|
||||
<tr class="ranking-list-info" ng-repeat="user in vm.download_ranking">
|
||||
<td class="text-center">{{$index + 1}}</td>
|
||||
<td class="text-center"><img class="ranking-user-img" title="{{user.displayName}}" ng-src="/{{user.profileImageURL}}">
|
||||
<td class="text-center"><img class="ranking-user-img" title="{{user.displayName}}" ng-src="{{user.profileImageURL}}">
|
||||
</td>
|
||||
<td>
|
||||
<span user-info="user" info-name></span>
|
||||
@@ -140,7 +140,7 @@
|
||||
<tbody>
|
||||
<tr class="ranking-list-info" ng-repeat="user in vm.ratio_ranking">
|
||||
<td class="text-center">{{$index + 1}}</td>
|
||||
<td class="text-center"><img class="ranking-user-img" title="{{user.displayName}}" ng-src="/{{user.profileImageURL}}">
|
||||
<td class="text-center"><img class="ranking-user-img" title="{{user.displayName}}" ng-src="{{user.profileImageURL}}">
|
||||
</td>
|
||||
<td>
|
||||
<span user-info="user" info-name></span>
|
||||
@@ -190,7 +190,7 @@
|
||||
<tbody>
|
||||
<tr class="ranking-list-info" ng-repeat="user in vm.score_ranking">
|
||||
<td class="text-center">{{$index + 1}}</td>
|
||||
<td class="text-center"><img class="ranking-user-img" title="{{user.displayName}}" ng-src="/{{user.profileImageURL}}">
|
||||
<td class="text-center"><img class="ranking-user-img" title="{{user.displayName}}" ng-src="{{user.profileImageURL}}">
|
||||
</td>
|
||||
<td>
|
||||
<span user-info="user" info-name></span>
|
||||
|
||||
@@ -178,7 +178,7 @@
|
||||
<div class="row cast-list">
|
||||
<div class="col-xs-4 col-md-2 text-center" ng-repeat="cast in vm.movieinfo.credits.cast | limitTo: 6">
|
||||
<img ng-src="{{vm.tmdbConfig.castImgBaseUrl}}{{cast.profile_path}}"
|
||||
on-error-src="/./modules/core/client/img/default_face.jpg"
|
||||
on-error-src="/modules/core/client/img/default_face.jpg"
|
||||
class="img-circle img-thumbnail img-responsive center-block">
|
||||
<span class="cast-xs-info"><strong>{{cast.name}}</strong></span>
|
||||
|
||||
@@ -337,7 +337,7 @@
|
||||
<div class="row cast-list">
|
||||
<div class="col-xs-4 col-md-2 text-center" ng-repeat="cast in vm.tvinfo.credits.cast | limitTo: 6">
|
||||
<img ng-src="{{vm.tmdbConfig.castImgBaseUrl}}{{cast.profile_path}}"
|
||||
on-error-src="/./modules/core/client/img/default_face.jpg"
|
||||
on-error-src="/modules/core/client/img/default_face.jpg"
|
||||
class="img-circle img-thumbnail img-responsive center-block">
|
||||
<span class="cast-xs-info"><strong>{{cast.name}}</strong></span>
|
||||
|
||||
|
||||
@@ -200,7 +200,7 @@
|
||||
<div data-ng-if="$index != 0 && $index % 6 == 0" class="clearfix visible-md-block visible-lg-block"></div>
|
||||
<div class="col-xs-4 col-md-2 text-center">
|
||||
<img ng-src="{{vm.tmdbConfig.castImgBaseUrl}}{{cast.profile_path}}"
|
||||
on-error-src="/./modules/core/client/img/default_face.jpg"
|
||||
on-error-src="/modules/core/client/img/default_face.jpg"
|
||||
class="img-circle img-thumbnail img-responsive center-block">
|
||||
<span class="cast-xs-info"><strong>{{cast.name}}</strong></span>
|
||||
|
||||
@@ -249,7 +249,7 @@
|
||||
ng-repeat="item in vm.commentPagedItems">
|
||||
<div class="timeline-comment-wrapper">
|
||||
<a class="timeline-comment-avatar" ng-click="vm.replyComment(item);">
|
||||
<img title="{{item.user.displayName}}" ng-src="/{{item.user.profileImageURL}}">
|
||||
<img title="{{item.user.displayName}}" ng-src="{{item.user.profileImageURL}}">
|
||||
</a>
|
||||
|
||||
<div class="timeline-comment">
|
||||
@@ -275,7 +275,7 @@
|
||||
<div class="col-sm-10 col-sm-offset-2 timeline-comment-sub-list">
|
||||
<div class="timeline-comment-sub-item" ng-repeat="sitem in item._replies">
|
||||
<a class="timeline-comment-sub-avatar" ng-click="vm.replySubComment(item, sitem);">
|
||||
<img title="{{sitem.user.displayName}}" ng-src="/{{sitem.user.profileImageURL}}">
|
||||
<img title="{{sitem.user.displayName}}" ng-src="{{sitem.user.profileImageURL}}">
|
||||
</a>
|
||||
|
||||
<div class="timeline-comment-sub-body">
|
||||
@@ -331,7 +331,7 @@
|
||||
<div class="comment-new" ng-if="vm.user">
|
||||
<div class="timeline-comment-wrapper">
|
||||
<a href="#" class="timeline-comment-avatar">
|
||||
<img title="{{vm.user.displayName}}" ng-src="/{{vm.user.profileImageURL}}">
|
||||
<img title="{{vm.user.displayName}}" ng-src="{{vm.user.profileImageURL}}">
|
||||
</a>
|
||||
|
||||
<div class="timeline-comment timeline-new-comment">
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
} else if (attrs.hasOwnProperty('infoUname')) {
|
||||
e = angular.element('<a href="#" ui-sref="userinfo({userId: \'' + user._id + '\'})" ng-click="$event.stopPropagation();">' + user.username + '</a>');
|
||||
} else if (attrs.hasOwnProperty('infoAvatar')) {
|
||||
e = angular.element('<a href="#" ui-sref="userinfo({userId: \'' + user._id + '\'})" ng-click="$event.stopPropagation();"><img src="/' + user.profileImageURL + '"></a>');
|
||||
e = angular.element('<a href="#" ui-sref="userinfo({userId: \'' + user._id + '\'})" ng-click="$event.stopPropagation();"><img src="' + user.profileImageURL + '"></a>');
|
||||
}
|
||||
if (e) {
|
||||
e.addClass(cls ? cls : '');
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<div class="list-group">
|
||||
<a ng-repeat="user in vm.pagedItems" ui-sref="admin.user({userId: user._id})" class="list-group-item"
|
||||
ng-class="{'span-banned': user.status == 'banned'}">
|
||||
<img class="ulist-avatar" ng-src="/{{user.profileImageURL}}">
|
||||
<img class="ulist-avatar" ng-src="{{user.profileImageURL}}">
|
||||
|
||||
<h4 class="list-group-item-heading">{{user.displayName}} <span vip-flag="user"></span> -
|
||||
<small>{{user.username}}</small>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<dl class="dl-horizontal">
|
||||
<dt class="h-line">{{ 'STATUS_FIELD.PICTURE' | translate}}:</dt>
|
||||
<dd class="h-line">
|
||||
<img class="status-avatar" ng-src="/{{vm.user.profileImageURL}}">
|
||||
<img class="status-avatar" ng-src="{{vm.user.profileImageURL}}">
|
||||
</dd>
|
||||
|
||||
<dt class="h-line">{{ 'STATUS_FIELD.USERNAME' | translate}}:</dt>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<form class="signin form-horizontal">
|
||||
<fieldset>
|
||||
<div class="form-group">
|
||||
<img ngf-src="vm.fileSelected ? vm.resultImageURL : '/' + vm.user.profileImageURL" alt="{{vm.user.displayName}}"
|
||||
<img ngf-src="vm.fileSelected ? vm.resultImageURL : vm.user.profileImageURL" alt="{{vm.user.displayName}}"
|
||||
class="img-thumbnail user-profile-picture" ngf-drop>
|
||||
</div>
|
||||
<div ng-show="vm.loading" class="form-group text-center">
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<dl class="dl-horizontal">
|
||||
<dt class="h-line">{{ 'STATUS_FIELD.PICTURE' | translate}}:</dt>
|
||||
<dd class="h-line">
|
||||
<img class="status-avatar" ng-src="/{{vm.user.profileImageURL}}">
|
||||
<img class="status-avatar" ng-src="{{vm.user.profileImageURL}}">
|
||||
</dd>
|
||||
|
||||
<dt class="h-line">{{ 'STATUS_FIELD.USERNAME' | translate}}:</dt>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<dl class="dl-horizontal">
|
||||
<dt class="h-line">{{ 'STATUS_FIELD.PICTURE' | translate}}:</dt>
|
||||
<dd class="h-line">
|
||||
<img class="status-avatar" ng-src="/{{vm.user.profileImageURL}}">
|
||||
<img class="status-avatar" ng-src="{{vm.user.profileImageURL}}">
|
||||
</dd>
|
||||
|
||||
<dt class="h-line">{{ 'STATUS_FIELD.USERNAME' | translate}}:</dt>
|
||||
|
||||
@@ -14,7 +14,8 @@ module.exports = function (config) {
|
||||
clientSecret: config.facebook.clientSecret,
|
||||
callbackURL: config.facebook.callbackURL,
|
||||
profileFields: ['id', 'name', 'displayName', 'emails', 'photos'],
|
||||
passReqToCallback: true
|
||||
passReqToCallback: true,
|
||||
scope: ['email']
|
||||
},
|
||||
function (req, accessToken, refreshToken, profile, done) {
|
||||
// Set the provider data and include tokens
|
||||
|
||||
@@ -13,28 +13,31 @@ module.exports = function (config) {
|
||||
clientID: config.google.clientID,
|
||||
clientSecret: config.google.clientSecret,
|
||||
callbackURL: config.google.callbackURL,
|
||||
passReqToCallback: true
|
||||
passReqToCallback: true,
|
||||
scope: ['https://www.googleapis.com/auth/userinfo.profile',
|
||||
'https://www.googleapis.com/auth/userinfo.email'
|
||||
]
|
||||
},
|
||||
function (req, accessToken, refreshToken, profile, done) {
|
||||
// Set the provider data and include tokens
|
||||
var providerData = profile._json;
|
||||
providerData.accessToken = accessToken;
|
||||
providerData.refreshToken = refreshToken;
|
||||
function (req, accessToken, refreshToken, profile, done) {
|
||||
// Set the provider data and include tokens
|
||||
var providerData = profile._json;
|
||||
providerData.accessToken = accessToken;
|
||||
providerData.refreshToken = refreshToken;
|
||||
|
||||
// Create the user OAuth profile
|
||||
var providerUserProfile = {
|
||||
firstName: profile.name.givenName,
|
||||
lastName: profile.name.familyName,
|
||||
displayName: profile.displayName,
|
||||
email: profile.emails[0].value,
|
||||
username: profile.username,
|
||||
profileImageURL: (providerData.picture) ? providerData.picture : undefined,
|
||||
provider: 'google',
|
||||
providerIdentifierField: 'id',
|
||||
providerData: providerData
|
||||
};
|
||||
// Create the user OAuth profile
|
||||
var providerUserProfile = {
|
||||
firstName: profile.name.givenName,
|
||||
lastName: profile.name.familyName,
|
||||
displayName: profile.displayName,
|
||||
email: profile.emails[0].value,
|
||||
username: profile.username,
|
||||
profileImageURL: (providerData.picture) ? providerData.picture : undefined,
|
||||
provider: 'google',
|
||||
providerIdentifierField: 'id',
|
||||
providerData: providerData
|
||||
};
|
||||
|
||||
// Save the user OAuth profile
|
||||
users.saveOAuthUserProfile(req, providerUserProfile, done);
|
||||
}));
|
||||
// Save the user OAuth profile
|
||||
users.saveOAuthUserProfile(req, providerUserProfile, done);
|
||||
}));
|
||||
};
|
||||
|
||||
@@ -14,7 +14,11 @@ module.exports = function (config) {
|
||||
consumerSecret: config.linkedin.clientSecret,
|
||||
callbackURL: config.linkedin.callbackURL,
|
||||
passReqToCallback: true,
|
||||
profileFields: ['id', 'first-name', 'last-name', 'email-address', 'picture-url']
|
||||
profileFields: ['id', 'first-name', 'last-name', 'email-address', 'picture-url'],
|
||||
scope: [
|
||||
'r_basicprofile',
|
||||
'r_emailaddress'
|
||||
]
|
||||
},
|
||||
function (req, accessToken, refreshToken, profile, done) {
|
||||
// Set the provider data and include tokens
|
||||
|
||||
@@ -111,39 +111,34 @@ exports.signout = function (req, res) {
|
||||
/**
|
||||
* OAuth provider call
|
||||
*/
|
||||
exports.oauthCall = function (strategy, scope) {
|
||||
return function (req, res, next) {
|
||||
if (req.query && req.query.redirect_to)
|
||||
req.session.redirect_to = req.query.redirect_to;
|
||||
|
||||
// Authenticate
|
||||
passport.authenticate(strategy, scope)(req, res, next);
|
||||
};
|
||||
exports.oauthCall = function (req, res, next) {
|
||||
var strategy = req.params.strategy;
|
||||
// Authenticate
|
||||
passport.authenticate(strategy)(req, res, next);
|
||||
};
|
||||
|
||||
/**
|
||||
* OAuth callback
|
||||
*/
|
||||
exports.oauthCallback = function (strategy) {
|
||||
return function (req, res, next) {
|
||||
exports.oauthCallback = function (req, res, next) {
|
||||
var strategy = req.params.strategy;
|
||||
|
||||
// info.redirect_to contains inteded redirect path
|
||||
passport.authenticate(strategy, function (err, user, info) {
|
||||
// info.redirect_to contains inteded redirect path
|
||||
passport.authenticate(strategy, function (err, user, info) {
|
||||
if (err) {
|
||||
return res.redirect('/authentication/signin?err=' + encodeURIComponent(errorHandler.getErrorMessage(err)));
|
||||
}
|
||||
if (!user) {
|
||||
return res.redirect('/authentication/signin');
|
||||
}
|
||||
req.login(user, function (err) {
|
||||
if (err) {
|
||||
return res.redirect('/authentication/signin?err=' + encodeURIComponent(errorHandler.getErrorMessage(err)));
|
||||
}
|
||||
if (!user) {
|
||||
return res.redirect('/authentication/signin');
|
||||
}
|
||||
req.login(user, function (err) {
|
||||
if (err) {
|
||||
return res.redirect('/authentication/signin');
|
||||
}
|
||||
|
||||
return res.redirect(info.redirect_to || '/');
|
||||
});
|
||||
})(req, res, next);
|
||||
};
|
||||
return res.redirect(info.redirect_to || '/');
|
||||
});
|
||||
})(req, res, next);
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -9,6 +9,9 @@ var _ = require('lodash'),
|
||||
errorHandler = require(path.resolve('./modules/core/server/controllers/errors.server.controller')),
|
||||
mongoose = require('mongoose'),
|
||||
multer = require('multer'),
|
||||
multerS3 = require('multer-s3'),
|
||||
aws = require('aws-sdk'),
|
||||
amazonS3URI = require('amazon-s3-uri'),
|
||||
config = require(path.resolve('./config/config')),
|
||||
User = mongoose.model('User'),
|
||||
validator = require('validator');
|
||||
@@ -16,6 +19,18 @@ var _ = require('lodash'),
|
||||
var whitelistedFields = ['firstName', 'lastName', 'email', 'username'];
|
||||
var mtDebug = require(path.resolve('./config/lib/debug'));
|
||||
|
||||
var useS3Storage = config.uploads.storage === 's3' && config.aws.s3;
|
||||
var s3;
|
||||
|
||||
if (useS3Storage) {
|
||||
aws.config.update({
|
||||
accessKeyId: config.aws.s3.accessKeyId,
|
||||
secretAccessKey: config.aws.s3.secretAccessKey
|
||||
});
|
||||
|
||||
s3 = new aws.S3();
|
||||
}
|
||||
|
||||
/**
|
||||
* Update user details
|
||||
*/
|
||||
@@ -58,10 +73,24 @@ exports.update = function (req, res) {
|
||||
exports.changeProfilePicture = function (req, res) {
|
||||
var user = req.user;
|
||||
var existingImageUrl;
|
||||
var multerConfig;
|
||||
|
||||
|
||||
if (useS3Storage) {
|
||||
multerConfig = {
|
||||
storage: multerS3({
|
||||
s3: s3,
|
||||
bucket: config.aws.s3.bucket,
|
||||
acl: 'public-read'
|
||||
})
|
||||
};
|
||||
} else {
|
||||
multerConfig = config.uploads.profile.image;
|
||||
}
|
||||
|
||||
// Filtering to upload only images
|
||||
var multerConfig = config.uploads.profile.image;
|
||||
multerConfig.fileFilter = require(path.resolve('./config/lib/multer')).imageFileFilter;
|
||||
|
||||
var upload = multer(multerConfig).single('newProfilePicture');
|
||||
|
||||
if (user) {
|
||||
@@ -96,7 +125,7 @@ exports.changeProfilePicture = function (req, res) {
|
||||
|
||||
function updateUser() {
|
||||
return new Promise(function (resolve, reject) {
|
||||
user.profileImageURL = config.uploads.profile.image.dest + req.file.filename;
|
||||
user.profileImageURL = config.uploads.storage === 's3' && config.aws.s3 ? req.file.location : '/' + req.file.path;
|
||||
user.save(function (err, theuser) {
|
||||
if (err) {
|
||||
reject(err);
|
||||
@@ -110,24 +139,47 @@ exports.changeProfilePicture = function (req, res) {
|
||||
function deleteOldImage() {
|
||||
return new Promise(function (resolve, reject) {
|
||||
if (existingImageUrl !== User.schema.path('profileImageURL').defaultValue) {
|
||||
fs.unlink(existingImageUrl, function (unlinkError) {
|
||||
if (unlinkError) {
|
||||
if (useS3Storage) {
|
||||
try {
|
||||
var { region, bucket, key } = amazonS3URI(existingImageUrl);
|
||||
var params = {
|
||||
Bucket: config.aws.s3.bucket,
|
||||
Key: key
|
||||
};
|
||||
|
||||
// If file didn't exist, no need to reject promise
|
||||
if (unlinkError.code === 'ENOENT') {
|
||||
mtDebug.debugRed('Removing profile image failed because file did not exist.');
|
||||
return resolve();
|
||||
}
|
||||
s3.deleteObject(params, function (err) {
|
||||
if (err) {
|
||||
console.log('Error occurred while deleting old profile picture.');
|
||||
console.log('Check if you have sufficient permissions : ' + err);
|
||||
}
|
||||
|
||||
console.error(unlinkError);
|
||||
|
||||
reject({
|
||||
message: 'Error occurred while deleting old profile picture'
|
||||
resolve();
|
||||
});
|
||||
} else {
|
||||
resolve();
|
||||
} catch (err) {
|
||||
console.warn('${existingImageUrl} is not a valid S3 uri');
|
||||
|
||||
return resolve();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
fs.unlink(path.resolve('.' + existingImageUrl), function (unlinkError) {
|
||||
if (unlinkError) {
|
||||
|
||||
// If file didn't exist, no need to reject promise
|
||||
if (unlinkError.code === 'ENOENT') {
|
||||
console.log('Removing profile image failed because file did not exist.');
|
||||
return resolve();
|
||||
}
|
||||
|
||||
console.error(unlinkError);
|
||||
|
||||
reject({
|
||||
message: 'Error occurred while deleting old profile picture'
|
||||
});
|
||||
} else {
|
||||
resolve();
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
resolve();
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ var UserSchema = new Schema({
|
||||
},
|
||||
profileImageURL: {
|
||||
type: String,
|
||||
default: 'modules/users/client/img/profile/default.png'
|
||||
default: '/modules/users/client/img/profile/default.png'
|
||||
},
|
||||
provider: {
|
||||
type: String,
|
||||
|
||||
@@ -21,39 +21,8 @@ module.exports = function (app) {
|
||||
app.route('/api/auth/signin').post(users.signin);
|
||||
app.route('/api/auth/signout').get(users.signout);
|
||||
|
||||
// Setting the facebook oauth routes
|
||||
app.route('/api/auth/facebook').get(users.oauthCall('facebook', {
|
||||
scope: ['email']
|
||||
}));
|
||||
app.route('/api/auth/facebook/callback').get(users.oauthCallback('facebook'));
|
||||
// Setting the oauth routes
|
||||
app.route('/api/auth/:strategy').get(users.oauthCall);
|
||||
app.route('/api/auth/:strategy/callback').get(users.oauthCallback);
|
||||
|
||||
// Setting the twitter oauth routes
|
||||
app.route('/api/auth/twitter').get(users.oauthCall('twitter'));
|
||||
app.route('/api/auth/twitter/callback').get(users.oauthCallback('twitter'));
|
||||
|
||||
// Setting the google oauth routes
|
||||
app.route('/api/auth/google').get(users.oauthCall('google', {
|
||||
scope: [
|
||||
'https://www.googleapis.com/auth/userinfo.profile',
|
||||
'https://www.googleapis.com/auth/userinfo.email'
|
||||
]
|
||||
}));
|
||||
app.route('/api/auth/google/callback').get(users.oauthCallback('google'));
|
||||
|
||||
// Setting the linkedin oauth routes
|
||||
app.route('/api/auth/linkedin').get(users.oauthCall('linkedin', {
|
||||
scope: [
|
||||
'r_basicprofile',
|
||||
'r_emailaddress'
|
||||
]
|
||||
}));
|
||||
app.route('/api/auth/linkedin/callback').get(users.oauthCallback('linkedin'));
|
||||
|
||||
// Setting the github oauth routes
|
||||
app.route('/api/auth/github').get(users.oauthCall('github'));
|
||||
app.route('/api/auth/github/callback').get(users.oauthCallback('github'));
|
||||
|
||||
// Setting the paypal oauth routes
|
||||
app.route('/api/auth/paypal').get(users.oauthCall('paypal'));
|
||||
app.route('/api/auth/paypal/callback').get(users.oauthCallback('paypal'));
|
||||
};
|
||||
|
||||
11124
package-lock.json
generated
Normal file
11124
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
75
package.json
75
package.json
@@ -2,7 +2,7 @@
|
||||
"name": "meanTorrent",
|
||||
"description": "MEAN.JS BitTorrent - Full-Stack JavaScript Using MongoDB, Express, AngularJS, and Node.js, a Private BitTorrent Tracker CMS",
|
||||
"version": "0.1.0",
|
||||
"meanjs-version": "0.5.0",
|
||||
"meanjs-version": "0.6.0",
|
||||
"private": false,
|
||||
"author": "https://github.com/taobataoma/meanTorrent/graphs/contributors",
|
||||
"license": "MIT",
|
||||
@@ -37,23 +37,45 @@
|
||||
"seed:test": "gulp seed:test"
|
||||
},
|
||||
"dependencies": {
|
||||
"acl": "~0.4.10",
|
||||
"acl": "^0.4.11",
|
||||
"amazon-s3-uri": "0.0.3",
|
||||
"async": "~2.5.0",
|
||||
"aws-sdk": "^2.123.0",
|
||||
"bencoding": "0.0.1",
|
||||
"body-parser": "~1.17.1",
|
||||
"bower": "~1.8.0",
|
||||
"body-parser": "^1.18.2",
|
||||
"bower": "^1.8.2",
|
||||
"chalk": "~2.1.0",
|
||||
"compression": "~1.7.0",
|
||||
"connect-flash": "~0.1.1",
|
||||
"connect-mongo": "~1.3.2",
|
||||
"cookie-parser": "~1.4.1",
|
||||
"cron": "^1.2.1",
|
||||
"express": "~4.15.2",
|
||||
"express-hbs": "^1.0.4",
|
||||
"express-session": "~1.15.2",
|
||||
"del": "~3.0.0",
|
||||
"eslint-config-airbnb": "~6.0.2",
|
||||
"express": "^4.15.5",
|
||||
"express-hbs": "~1.0.4",
|
||||
"express-session": "^1.15.6",
|
||||
"generate-password": "~1.3.0",
|
||||
"glob": "~7.1.1",
|
||||
"gulp": "~3.9.1",
|
||||
"gulp-angular-templatecache": "~2.0.0",
|
||||
"gulp-autoprefixer": "~4.0.0",
|
||||
"gulp-concat": "~2.6.0",
|
||||
"gulp-csslint": "~1.0.0",
|
||||
"gulp-csso": "~3.0.0",
|
||||
"gulp-eslint": "~3.0.1",
|
||||
"gulp-imagemin": "~3.3.0",
|
||||
"gulp-less": "~3.3.0",
|
||||
"gulp-load-plugins": "~1.5.0",
|
||||
"gulp-ng-annotate": "~2.0.0",
|
||||
"gulp-nodemon": "~2.2.1",
|
||||
"gulp-refresh": "~1.1.0",
|
||||
"gulp-rename": "~1.2.2",
|
||||
"gulp-rev": "~8.0.0",
|
||||
"gulp-sass": "~3.1.0",
|
||||
"gulp-uglify": "~3.0.0",
|
||||
"helmet": "~3.8.1",
|
||||
"imagemin-pngquant": "~5.0.0",
|
||||
"irc": "^0.5.2",
|
||||
"jasmine-core": "~2.7.0",
|
||||
"lodash": "~4.17.4",
|
||||
@@ -61,12 +83,13 @@
|
||||
"method-override": "~2.3.8",
|
||||
"mocha": "~3.4.2",
|
||||
"moment": "^2.18.1",
|
||||
"mongoose": "~4.11.3",
|
||||
"mongoose": "^4.11.13",
|
||||
"morgan": "~1.8.1",
|
||||
"moviedb": "^0.2.8",
|
||||
"multer": "~1.3.0",
|
||||
"multer-s3": "^2.7.0",
|
||||
"node-sass": "^4.5.3",
|
||||
"nodemailer": "~2.6.4",
|
||||
"nodemailer": "~4.0.1",
|
||||
"nt": "^0.5.3",
|
||||
"owasp-password-strength-test": "~1.3.0",
|
||||
"passport": "~0.3.2",
|
||||
@@ -77,46 +100,26 @@
|
||||
"passport-local": "~1.0.0",
|
||||
"passport-paypal-openidconnect": "~0.1.1",
|
||||
"passport-twitter": "~1.0.4",
|
||||
"serve-favicon": "~2.4.2",
|
||||
"run-sequence": "~2.1.0",
|
||||
"serve-favicon": "^2.4.5",
|
||||
"snyk": "^1.34.3",
|
||||
"socket.io": "^2.0.2",
|
||||
"socket.io": "~2.0.2",
|
||||
"sprintf-js": "^1.1.1",
|
||||
"validator": "~8.0.0",
|
||||
"winston": "^2.3.1",
|
||||
"winston": "~2.3.1",
|
||||
"wiredep": "~4.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"coveralls": "~2.13.0",
|
||||
"del": "^3.0.0",
|
||||
"eslint-config-airbnb": "~6.0.2",
|
||||
"gulp": "~3.9.1",
|
||||
"gulp-angular-templatecache": "~2.0.0",
|
||||
"gulp-autoprefixer": "~4.0.0",
|
||||
"gulp-concat": "~2.6.0",
|
||||
"gulp-csslint": "~1.0.0",
|
||||
"gulp-csso": "~3.0.0",
|
||||
"gulp-eslint": "~3.0.1",
|
||||
"gulp-imagemin": "~3.3.0",
|
||||
"gulp-istanbul": "~1.1.1",
|
||||
"gulp-less": "~3.3.0",
|
||||
"gulp-load-plugins": "~1.5.0",
|
||||
"gulp-mocha": "~3.0.1",
|
||||
"gulp-ng-annotate": "~2.0.0",
|
||||
"gulp-nodemon": "~2.2.1",
|
||||
"gulp-protractor": "^4.0.0",
|
||||
"gulp-refresh": "~1.1.0",
|
||||
"gulp-rename": "~1.2.2",
|
||||
"gulp-rev": "~8.0.0",
|
||||
"gulp-sass": "~3.1.0",
|
||||
"gulp-uglify": "~3.0.0",
|
||||
"imagemin-pngquant": "~5.0.0",
|
||||
"karma": "~1.7.0",
|
||||
"gulp-protractor": "~4.0.0",
|
||||
"karma": "^1.7.1",
|
||||
"karma-chrome-launcher": "~2.2.0",
|
||||
"karma-coverage": "~1.1.1",
|
||||
"karma-jasmine": "~1.1.0",
|
||||
"karma-mocha-reporter": "~2.2.3",
|
||||
"karma-mocha-reporter": "^2.2.4",
|
||||
"karma-ng-html2js-preprocessor": "~1.0.0",
|
||||
"run-sequence": "~2.1.0",
|
||||
"semver": "~5.4.1",
|
||||
"should": "~11.2.1",
|
||||
"supertest": "~3.0.0"
|
||||
|
||||
14
public/manifest.json
Normal file
14
public/manifest.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "meanjs",
|
||||
"short_name": "meanjs",
|
||||
"start_url": ".",
|
||||
"display": "browser",
|
||||
"background_color": "#fff",
|
||||
"theme_color": "#000",
|
||||
"description": "Fullstack JavaScript with MongoDB, Express, AngularJS, and Node.js.",
|
||||
"icons": [{
|
||||
"src": "/modules/core/client/img/brand/icon.png",
|
||||
"sizes": "128x128",
|
||||
"type": "image/png"
|
||||
}]
|
||||
}
|
||||
Reference in New Issue
Block a user