Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/GandalFran/TwiCo into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
luisblazquezm committed Dec 16, 2020
2 parents b474ada + 93c7995 commit e615f76
Show file tree
Hide file tree
Showing 12 changed files with 151 additions and 181 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ jobs:
steps:
- name: download new changes
uses: actions/checkout@v2
build_web:
runs-on: [self-hosted, linux, x64]
needs: download
steps:
- name: install dependencies
run: cd /opt/soa-final/_work/TwiCo/TwiCo/soa-web-app/vue-web; npm install
- name: build vue web
run: cd /opt/soa-final/_work/TwiCo/TwiCo/soa-web-app/vue-web; npm run build
- name: create final location directory
run: mkdir /opt/soa-final/_work/TwiCo/TwiCo/soa-web-app/node-server/static
- name: copy web to final location
run: mv /opt/soa-final/_work/TwiCo/TwiCo/soa-web-app/vue-web/dist/* /opt/soa-final/_work/TwiCo/TwiCo/soa-web-app/node-server/static/
#build_web:
# runs-on: [self-hosted, linux, x64]
# needs: download
# steps:
# - name: install dependencies
# run: cd /opt/soa-final/_work/TwiCo/TwiCo/soa-web-app/vue-web; npm install
# - name: build vue web
# run: cd /opt/soa-final/_work/TwiCo/TwiCo/soa-web-app/vue-web; npm run build
# - name: create final location directory
# run: mkdir /opt/soa-final/_work/TwiCo/TwiCo/soa-web-app/node-server/static
# - name: copy web to final location
# run: mv /opt/soa-final/_work/TwiCo/TwiCo/soa-web-app/vue-web/dist/* /opt/soa-final/_work/TwiCo/TwiCo/soa-web-app/node-server/static/
build_web_server:
runs-on: [self-hosted, linux, x64]
needs: download
Expand Down
16 changes: 0 additions & 16 deletions soa-web-app/certificates/create.bash

This file was deleted.

58 changes: 0 additions & 58 deletions soa-web-app/certificates/server.ca-bundle

This file was deleted.

31 changes: 0 additions & 31 deletions soa-web-app/certificates/server.crt

This file was deleted.

28 changes: 0 additions & 28 deletions soa-web-app/certificates/server.key

This file was deleted.

9 changes: 0 additions & 9 deletions soa-web-app/certificates/validate-cert.js

This file was deleted.

13 changes: 10 additions & 3 deletions soa-web-app/node-server/config/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,15 @@
"caFile": "certs/server.ca-bundle"
},
"auth": {
"id": "706477281622-fc5smi1o8hhu3kjp94ttfkdbno22tv9d.apps.googleusercontent.com",
"secret": "MekxIl70WrvBkW7X5qCJj13F",
"callback": "https://soa.servehttp.com/auth/google/callback"
"google": {
"id": "706477281622-fc5smi1o8hhu3kjp94ttfkdbno22tv9d.apps.googleusercontent.com",
"secret": "MekxIl70WrvBkW7X5qCJj13F",
"callback": "https://soa.servehttp.com/auth/google/callback"
},
"github": {
"id": "088435c6236d21c6c4fe",
"secret": "05ec9b4f795e229bfa9f72351aaab8ad8e8498ae",
"callback": "https://soa.servehttp.com/auth/github/callback"
}
}
}
45 changes: 42 additions & 3 deletions soa-web-app/node-server/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions soa-web-app/node-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"@types/express": "^4.17.8",
"@types/express-session": "^1.17.0",
"@types/passport": "^1.0.4",
"@types/passport-github2": "^1.2.4",
"@types/passport-google-oauth": "^1.0.41",
"@types/request": "^2.48.5",
"nodemon": "^2.0.6",
Expand All @@ -54,6 +55,7 @@
"http": "0.0.1-security",
"https": "^1.0.0",
"passport": "^0.4.1",
"passport-github2": "^0.1.12",
"passport-google-oauth": "^2.0.0",
"request": "^2.88.2"
}
Expand Down
27 changes: 22 additions & 5 deletions soa-web-app/node-server/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ import * as Path from "path";
import Express from "express";
import * as HTTPS from "https";
import Passport from 'passport';
import Session from 'express-session';
import Compression from "compression";
import CookieParser from 'cookie-parser';
import CookieSession from 'cookie-session';
import Session from 'express-session';
import * as BodyParser from 'body-parser';
import GitHubStrategy from 'passport-github2';
import GoogleStrategy from 'passport-google-oauth';

import { log } from "./log";
Expand Down Expand Up @@ -96,17 +97,33 @@ export class Application {
public configurePassportAuth(){
this.application.use(Passport.initialize());
this.application.use(Passport.session());

// google oauth
Passport.use(new GoogleStrategy.OAuth2Strategy({
clientID: Config.getInstance().auth.clientId,
callbackURL: Config.getInstance().auth.callback,
clientSecret: Config.getInstance().auth.clientSecret
}, function(token, refreshToken, profile, done){
clientID: Config.getInstance().auth.google.clientId,
callbackURL: Config.getInstance().auth.google.callback,
clientSecret: Config.getInstance().auth.google.clientSecret
}, function(token:any, refreshToken:any, profile:any, done:any){
return done(null, {
profile: profile,
token: token,
refreshToken: refreshToken
});
}));

// github oauth
Passport.use(new GitHubStrategy.Strategy({
clientID: Config.getInstance().auth.github.clientId,
callbackURL: Config.getInstance().auth.github.callback,
clientSecret: Config.getInstance().auth.github.clientSecret
}, function(token:any, refreshToken:any, profile:any, done:any) {
return done(null, {
profile: profile,
token: token,
refreshToken: refreshToken
});
}));

Passport.serializeUser((user, done) => {
done(null, user);
});
Expand Down
Loading

0 comments on commit e615f76

Please sign in to comment.