-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/v2-master' into merge-v2-master
- Loading branch information
Showing
26 changed files
with
335 additions
and
324 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#!/usr/bin/env node | ||
|
||
console.log('Collecting Change Log'); | ||
|
||
let since = '>=2019-05-03'; | ||
|
||
const request = require('request-promise-native'); | ||
const repo = 'cloudfoundry-incubator/stratos'; | ||
const fs = require('fs'); | ||
|
||
let url = 'https://api.github.com/search/issues?q=state:closed+repo:' + repo + '+updated:' + since; | ||
url = url + '&per_page=100'; | ||
|
||
const fileName = './log.md'; | ||
|
||
console.log(url); | ||
|
||
let total = -1; | ||
let fetched = 0; | ||
let results = []; | ||
|
||
function fetchPage(url, page) { | ||
const pageUrl = url + '&page=' + page; | ||
return request(pageUrl, { | ||
headers: { | ||
'User-Agent': 'Changelog' | ||
}, | ||
json: true}).then(data => { | ||
console.log('Fetched page : ' + page); | ||
|
||
if (page === 1) { | ||
total = data.total_count; | ||
console.log('Total results : ' + total); | ||
} | ||
fetched += data.items.length; | ||
results = results.concat(data.items); | ||
|
||
if (fetched < total) { | ||
return fetchPage(url, page + 1); | ||
} | ||
console.log('Got all data'); | ||
}); | ||
} | ||
|
||
fetchPage(url, 1).then(data => { | ||
fs.writeFileSync(fileName, '# Changes\n'); | ||
for(let i = 0; i<results.length;i++) { | ||
const item = results[i]; | ||
let line = '- ' + item.title + ' [\\#' + item.number + '](' + item.html_url + ')\n'; | ||
fs.appendFileSync(fileName, line); | ||
}; | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,12 @@ | ||
FROM {{BASE_IMAGE}} | ||
{{#IS_SLE}} | ||
RUN zypper addrepo -G -t yum -c 'http://nginx.org/packages/sles/12' nginx | ||
RUN zypper addrepo -t rpm-md -G -c '{{SMT_INTERNAL_SERVER}}' smt_internal_server | ||
{{/IS_SLE}} | ||
RUN zypper -n ref && \ | ||
zypper -n up && \ | ||
zypper in -y nginx | ||
zypper in -y nginx apache2-utils | ||
|
||
{{#IS_SLE}} | ||
RUN zypper rr smt_internal_server | ||
{{/IS_SLE}} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
src/frontend/packages/core/src/core/not-setup-guard.service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { Injectable } from '@angular/core'; | ||
import { CanActivate } from '@angular/router'; | ||
import { Store } from '@ngrx/store'; | ||
import { Observable, of as observableOf } from 'rxjs'; | ||
import { map, catchError, tap } from 'rxjs/operators'; | ||
|
||
import { RouterNav } from '../../../store/src/actions/router.actions'; | ||
import { AppState } from '../../../store/src/app-state'; | ||
import { HttpClient } from '@angular/common/http'; | ||
import { environment } from '../environments/environment'; | ||
|
||
const { proxyAPIVersion } = environment; | ||
|
||
@Injectable() | ||
export class NotSetupGuardService implements CanActivate { | ||
|
||
constructor( | ||
private http: HttpClient, | ||
private store: Store<AppState> | ||
) { } | ||
|
||
canActivate(): Observable<boolean> { | ||
|
||
const url = `/pp/${proxyAPIVersion}/auth/session/verify`; | ||
return this.http.get(url).pipe( | ||
map(v => { | ||
// If the requests succeeds, then the user has a session, so everything must be setup already | ||
return false; | ||
}), | ||
catchError(err => { | ||
const needsSetup = err.status === 503 && err.headers.has('stratos-setup-required'); | ||
return observableOf(needsSetup); | ||
}), | ||
tap(result => { | ||
// False means already setup, so should not be able to access /uaa endpoint | ||
if (!result) { | ||
this.store.dispatch(new RouterNav({ | ||
path: ['/not-found'] | ||
})); | ||
} | ||
}) | ||
); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.