Skip to content
This repository was archived by the owner on Aug 12, 2020. It is now read-only.

Commit 4c6f686

Browse files
committed
update more links to https and new README/LICENSE
1 parent 0645651 commit 4c6f686

File tree

8 files changed

+775
-53
lines changed

8 files changed

+775
-53
lines changed

LICENSE.md

+674-20
Large diffs are not rendered by default.

README.md

+81-21
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,83 @@
1-
Initial version of tenant resolutions webapp through Blue Ridge Labs. Repo/product name TBD
1+
This is the codebase for the JustFix.nyc platform, including the Tenant Webapp, Advocate Dashboard, and the back-end API for managing data. For more information about our organization, please visit [www.justfix.nyc](https://www.justfix.nyc).
2+
3+
## Getting Started
4+
5+
This guide assumes that you are using a [UNIX](http://i.imgur.com/uE6fkx7.gif) system (most likely macOS), but everything is available on Windows if you follow the appropriate guides thru the links below.
6+
7+
#### Build tools and languages
8+
9+
0. Open terminal. Some of these steps may require `sudo` in order to install.
10+
11+
1. Install [Node.js](https://nodejs.org/en/) (v4.4.x is ideal) and make sure everything works:
12+
13+
```
14+
node -v
15+
```
16+
17+
3. Update [npm](https://www.npmjs.com/) and make sure everything works:
18+
19+
```
20+
npm install -g npm@latest
21+
npm -v
22+
```
23+
24+
4. Download and install [MongoDB](https://www.mongodb.com/download-center). Make sure that it runs on the default port (27017)
25+
26+
5. Use npm to install [bower](http://bower.io/) and [grunt](http://gruntjs.com/). You'll probably need sudo for this (using `-g` affects your machine globally).
27+
28+
```
29+
sudo npm install -g bower grunt-cli
30+
```
31+
32+
6. Set up [git](https://help.github.com/articles/set-up-git/) if you don't already have it.
33+
34+
7. Set up Ruby and Sass to compile CSS. See [here](https://github.com/gruntjs/grunt-contrib-sass#sass-task) for instructions.
35+
36+
#### Download and install libraries
37+
38+
1. Get a copy of the code!
39+
40+
```
41+
git clone https://github.com/JustFixNYC/tenants.git
42+
```
43+
44+
2. You should have a `development.js` copy from me. (If not, email me at [[email protected]](mailto:[email protected])). Place that file in `config/env`.
45+
46+
3. Use npm to install the needed back-end and buildtool libraries. It should trigger a `bower install` for front-end dependencies automatically. Make sure you're in the root directory for the project - i.e. the same level as the `package.json` file.
47+
48+
```
49+
npm install
50+
```
51+
52+
#### Regular use
53+
54+
1. To start, you'll need an active mongodb instance running. I like to do this in a folder within `app` - e.g. `app/mongodb` but it can be run globally or anywhere else.
55+
56+
```
57+
mongod --dbpath . &
58+
```
59+
Open a new terminal window and make sure its running:
60+
```
61+
ps aux | grep mongo
62+
```
63+
You should see the process running, as well as the `grep mongo` command process you just ran. Ex:
64+
65+
```
66+
dan@Dans-MacBook tenants (master) $ ps aux | grep mongo
67+
dan 4072 0.3 0.0 2583596 6272 ?? S 16Feb17 48:14.37 mongod --dbpath .
68+
dan 24473 0.0 0.0 2444056 796 s001 S+ 4:26PM 0:00.01 grep mongo
69+
```
70+
71+
2. After that, it should be quite simple to start the app (again, make sure this is from the root directory):
72+
```
73+
grunt
74+
```
75+
76+
3. Go to `http://localhost:3000` to see your development version! Grunt will watch for any changes you make to the code and automatically restart the server for live development.
77+
78+
79+
280

381
## License
4-
(The MIT License)
5-
6-
Permission is hereby granted, free of charge, to any person obtaining
7-
a copy of this software and associated documentation files (the
8-
'Software'), to deal in the Software without restriction, including
9-
without limitation the rights to use, copy, modify, merge, publish,
10-
distribute, sublicense, and/or sell copies of the Software, and to
11-
permit persons to whom the Software is furnished to do so, subject to
12-
the following conditions:
13-
14-
The above copyright notice and this permission notice shall be
15-
included in all copies or substantial portions of the Software.
16-
17-
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
18-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
20-
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
21-
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
22-
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
23-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
82+
83+
JustFix.nyc uses the GNU General Public License v3.0 Open-Source License. See `LICENSE.md` file for the full text.

config/express.js

+9-1
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,18 @@ module.exports = function(db) {
108108
// Express MongoDB session storage
109109
// [TODO] this is still causing issues (see https://github.com/meanjs/mean/issues/224)
110110
// this is inconsistent, be wary of it...
111+
112+
var cookieSettings = {};
113+
cookieSettings.maxAge = 14 * 24 * 60 * 60 * 1000;
114+
if(process.env.NODE_ENV !== 'development') {
115+
cookieSettings.domain = 'justfix.nyc';
116+
}
117+
111118
app.use(session({
112119
saveUninitialized: false,
113120
resave: true,
114121
secret: config.sessionSecret,
115-
cookie: { maxAge: 14 * 24 * 60 * 60 * 1000 }, // 14 days
122+
cookie: cookieSettings,
116123
store: new mongoStore({
117124
mongooseConnection: db.connection,
118125
collection: config.sessionCollection
@@ -141,6 +148,7 @@ module.exports = function(db) {
141148
if (process.env.NODE_ENV === 'production') {
142149
app.use('*',function(req,res,next) {
143150
if(req.headers['x-forwarded-proto'] !== 'https') {
151+
144152
res.redirect('https://' + req.hostname + req.url);
145153
}
146154
else {

public/dist/application.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -923,7 +923,7 @@ angular.module('actions').factory('Messages', ['$http', '$q', '$filter', '$locat
923923
var deferred = $q.defer;
924924
$http.get('languages/locale-en_US.json')
925925
.then(function(res){
926-
deferred.resolve(res);
926+
deferred.resolve(res);
927927
}, function(err) {
928928
deferred.reject();
929929
});
@@ -938,10 +938,10 @@ angular.module('actions').factory('Messages', ['$http', '$q', '$filter', '$locat
938938
case 'share':
939939
message = 'Hello, this is ' + user.fullName + ' at ' + user.address + ', Apt. ' + user.unit + '.' +
940940
' I\'m experiencing issues with my apartment and would like to get them resolved.' +
941-
' A link to my Case History can be found at http://' + $location.host() + '/share/' + user.sharing.key + '. Thank you!';
941+
' A link to my Case History can be found at https://' + $location.host() + '/share/' + user.sharing.key + '. Thank you!';
942942
break;
943943
case 'friendShare':
944-
message = 'I am using JustFix.nyc to take action on my housing issues! Click here to sign up: http://justfix.nyc/signup';
944+
message = 'I am using JustFix.nyc to take action on my housing issues! Click here to sign up: https://justfix.nyc/signup';
945945
break;
946946
default:
947947
message = 'Hello, this is ' + user.fullName + ' at ' + user.address + ', Apt. ' + user.unit + '.' +
@@ -971,7 +971,7 @@ angular.module('actions').factory('Messages', ['$http', '$q', '$filter', '$locat
971971

972972
var problemsContent = '';
973973

974-
for(var i = 0; i < user.problems.length; i++) {
974+
for(var i = 0; i < user.problems.length; i++) {
975975

976976
var prob = user.problems[i];
977977
if (prob.key === 'landlordIssues') {

public/dist/application.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/dist/application.min.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/modules/actions/services/messages.client.service.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ angular.module('actions').factory('Messages', ['$http', '$q', '$filter', '$locat
2121
var deferred = $q.defer;
2222
$http.get('languages/locale-en_US.json')
2323
.then(function(res){
24-
deferred.resolve(res);
24+
deferred.resolve(res);
2525
}, function(err) {
2626
deferred.reject();
2727
});
@@ -36,10 +36,10 @@ angular.module('actions').factory('Messages', ['$http', '$q', '$filter', '$locat
3636
case 'share':
3737
message = 'Hello, this is ' + user.fullName + ' at ' + user.address + ', Apt. ' + user.unit + '.' +
3838
' I\'m experiencing issues with my apartment and would like to get them resolved.' +
39-
' A link to my Case History can be found at http://' + $location.host() + '/share/' + user.sharing.key + '. Thank you!';
39+
' A link to my Case History can be found at https://' + $location.host() + '/share/' + user.sharing.key + '. Thank you!';
4040
break;
4141
case 'friendShare':
42-
message = 'I am using JustFix.nyc to take action on my housing issues! Click here to sign up: http://justfix.nyc/signup';
42+
message = 'I am using JustFix.nyc to take action on my housing issues! Click here to sign up: https://justfix.nyc/signup';
4343
break;
4444
default:
4545
message = 'Hello, this is ' + user.fullName + ' at ' + user.address + ', Apt. ' + user.unit + '.' +
@@ -69,7 +69,7 @@ angular.module('actions').factory('Messages', ['$http', '$q', '$filter', '$locat
6969

7070
var problemsContent = '';
7171

72-
for(var i = 0; i < user.problems.length; i++) {
72+
for(var i = 0; i < user.problems.length; i++) {
7373

7474
var prob = user.problems[i];
7575
if (prob.key === 'landlordIssues') {

public/modules/activity/views/list-activity.client.view.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ <h2>
4545

4646
<div class="share-link" ng-if="authentication.user.sharing.enabled">
4747
<label>{{'modules.activity.views.listActivity.labelShare' | translate}}</label>
48-
<h2><a ng-href="/share/{{authentication.user.sharing.key}}" target="_blank">http://{{location}}/share/{{authentication.user.sharing.key}}</a></h2>
48+
<h2><a ng-href="/share/{{authentication.user.sharing.key}}" target="_blank">https://{{location}}/share/{{authentication.user.sharing.key}}</a></h2>
4949
</div>
5050

5151

0 commit comments

Comments
 (0)