Skip to content

Commit 2e19fe1

Browse files
committed
Updated to kth-node-configuration@1.3.1 = DOCKER READY + simplified settings
1 parent 97eb20d commit 2e19fe1

35 files changed

+257
-310
lines changed

.gitignore

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22

33
.git/
44

5-
# Sass compilation related files
6-
public/css/*.css
7-
8-
95
# IDEA specific
106
.idea
117
*.iml
@@ -31,12 +27,6 @@ logs/*
3127
# Dependency directory for NPM
3228
node_modules
3329

34-
public/css/bootstrap
35-
public/css/font-awesome
36-
public/css/fonts
37-
public/css/kth-style
38-
public/img/kth-style
39-
4030
# Built at startup
4131
bundles
4232
public/js/app/config*.js

Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ RUN cp -a /npm/node_modules /application && \
1717

1818
# Copy files used by Gulp.
1919
COPY ["config", "config"]
20-
COPY ["config/secretSettings.js", "config/localSettings.js"]
2120
COPY ["public", "public"]
2221
COPY ["gulpfile.js", "gulpfile.js"]
2322
COPY ["package.json", "package.json"]

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,34 +11,51 @@ The two projects are [node-web](https://github.com/KTH/node-web), a web server w
1111

1212
It's important that we try to make changes that affect the template projects in the template projects themselves.
1313

14+
###Where do you keep you secrets?
15+
Secrets during local development are ALWAYS stored in a `.env`-file in the root of your project. This file should be in .gitignore. It needs to contain at least ldap connection URI and password in order for authentication to work properly:
16+
17+
```
18+
LDAP_URI=ldaps://[usertname]@ldap.ref.ug.kth.se
19+
LDAP_PASSWORD=[password]
20+
```
21+
22+
During local development the defaults in serverSettings.js should work fine. If you need to make specific changes for your machine, add these to the `.env`-file. If you want changes that should be used by anyone developing your project, change the default variables in the settings-files.
23+
1424
###How do I use node-web template project for a project of my own?
1525
1. Create a new git repository on github.com/KTH (or other somewhere else).
26+
1627
2. Clone the newly created repository locally by using:
1728

1829
```bash
1930
git clone https://github.com/USER/REPOSITORY.git
2031
```
32+
2133
3. Navigate to the cloned project directory
34+
2235
4. Add node-web or node-api as the upstream repository to use:
2336

2437
```bash
2538
git remote add upstream https://github.com/KTH/node-web.git
2639
```
40+
2741
5. Fetch the latest changes/branches for the upstream repository (use your KTH login if prompted):
2842

2943
```bash
3044
git fetch upstream
3145
```
46+
3247
6. Checkout the branch you want to use:
3348

3449
```bash
3550
git checkout master
3651
```
52+
3753
7. Merge the changes from node-api into your cloned repository:
3854

3955
```bash
4056
git merge upstream/master
4157
```
58+
4259
8. Solve merge conflicts and commit/push to your cloned repository.
4360

4461
To keep your cloned repository up to date with the upstream repository, just repeat steps 5-7 from above. Make sure to commit and push your existing changes before you merge!

buildConfig.js

Lines changed: 0 additions & 4 deletions
This file was deleted.

config/browserSettings.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/**
2+
*
3+
* Browser specific settings
4+
*
5+
* **************************************************
6+
* * WARNING! Never access any secrets in this file *
7+
* **************************************************
8+
*
9+
*/
10+
11+
module.exports = {
12+
}

config/commonSettings.js

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,19 @@
11
/**
2-
* This configuration file is shared among all other configurations.
3-
* Its keys and values can be overridden in environment specific configuration files.
2+
*
3+
* Common settings for server and browser
4+
*
5+
* **************************************************
6+
* * WARNING! Never access any secrets in this file *
7+
* **************************************************
8+
*
49
*/
10+
const { getEnv } = require('kth-node-configuration')
11+
12+
const devPrefixPath = '/node'
513

614
module.exports = {
7-
auth: {
8-
adminGroup: 'app.APPNAME.admin'
9-
},
10-
ldapClient: {
11-
version: 3,
12-
searchlimit: 10,
13-
searchtimeout: 10, // seconds
14-
connecttimeout: 3000, // millis - 3 sec
15-
timeout: 3000, // millis - 3 sec
16-
maxconnections: 10, //
17-
checkinterval: 10000, // millis - 10 sec
18-
maxidletime: 300000, // millis - 5 min
19-
scope: 'sub',
20-
filterReplaceHolder: 'KTHID',
21-
userattrs: [ 'displayName', 'mail', 'ugUsername', 'memberOf' ],
22-
groupattrs: [ 'cn', 'objectCategory' ]
23-
},
2415
// The proxy prefix path if the application is proxied. E.g /places
2516
proxyPrefixPath: {
26-
uri: '/node'
17+
uri: getEnv('SERVICE_PUBLISH', devPrefixPath)
2718
}
2819
}

config/devSettings.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

config/localSettings.js.in

Lines changed: 0 additions & 100 deletions
This file was deleted.

config/prodSettings.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

config/refSettings.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

config/secretSettings.js

Lines changed: 0 additions & 76 deletions
This file was deleted.

0 commit comments

Comments
 (0)