gitlab-radiator 4.2.0 → 4.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +26 -23
- package/public/client.js +1 -1
- package/public/client.js.LICENSE.txt +4 -0
- package/src/app.js +3 -3
- package/src/auth.js +2 -2
- package/src/gitlab/client.js +1 -1
- package/src/gitlab/pipelines.js +1 -1
- package/src/gitlab/projects.js +1 -1
package/src/app.js
CHANGED
|
@@ -14,7 +14,7 @@ const httpServer = http.Server(app)
|
|
|
14
14
|
const socketIoServer = new Server(httpServer)
|
|
15
15
|
|
|
16
16
|
if (process.env.NODE_ENV !== 'production' && fs.existsSync('./src/dev-assets.js')) {
|
|
17
|
-
|
|
17
|
+
|
|
18
18
|
const {bindDevAssets} = await import('./dev-assets.js')
|
|
19
19
|
bindDevAssets(app)
|
|
20
20
|
}
|
|
@@ -26,7 +26,7 @@ app.use(compression())
|
|
|
26
26
|
app.use(basicAuth(config.auth))
|
|
27
27
|
|
|
28
28
|
httpServer.listen(config.port, () => {
|
|
29
|
-
|
|
29
|
+
|
|
30
30
|
console.log(`Listening on port *:${config.port}`)
|
|
31
31
|
})
|
|
32
32
|
|
|
@@ -50,7 +50,7 @@ async function runUpdate() {
|
|
|
50
50
|
globalState.error = await errorIfRunnerOffline()
|
|
51
51
|
socketIoServer.emit('state', withDate(globalState))
|
|
52
52
|
} catch (error) {
|
|
53
|
-
|
|
53
|
+
|
|
54
54
|
console.error(error.message)
|
|
55
55
|
globalState.error = `Failed to communicate with GitLab API: ${error.message}`
|
|
56
56
|
socketIoServer.emit('state', withDate(globalState))
|
package/src/auth.js
CHANGED
|
@@ -2,12 +2,12 @@ import authenticate from 'basic-auth'
|
|
|
2
2
|
|
|
3
3
|
export function basicAuth(auth) {
|
|
4
4
|
if (!auth || !auth.username || !auth.password) {
|
|
5
|
-
|
|
5
|
+
|
|
6
6
|
console.log('No authentication configured')
|
|
7
7
|
return (req, res, next) => next()
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
|
|
11
11
|
console.log('HTTP basic auth enabled')
|
|
12
12
|
return (req, res, next) => {
|
|
13
13
|
const {name, pass} = authenticate(req) || {}
|
package/src/gitlab/client.js
CHANGED
|
@@ -11,7 +11,7 @@ const clients = new Map()
|
|
|
11
11
|
function lazyClient(gitlab) {
|
|
12
12
|
const gitlabUrl = gitlab.url
|
|
13
13
|
if (gitlabUrl === undefined) {
|
|
14
|
-
|
|
14
|
+
|
|
15
15
|
console.log('Got undefined url for ' + JSON.stringify(gitlab))
|
|
16
16
|
}
|
|
17
17
|
if (!clients.get(gitlabUrl)) {
|
package/src/gitlab/pipelines.js
CHANGED
|
@@ -19,7 +19,7 @@ export async function fetchLatestPipelines(projectId, gitlab) {
|
|
|
19
19
|
return pipelinesWithStages
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
|
|
23
23
|
async function fetchLatestAndMasterPipeline(projectId, config) {
|
|
24
24
|
const pipelines = await fetchPipelines(projectId, config, {per_page: 100})
|
|
25
25
|
if (pipelines.length === 0) {
|
package/src/gitlab/projects.js
CHANGED
|
@@ -15,7 +15,7 @@ async function fetchOwnProjects(gitlab) {
|
|
|
15
15
|
const projects = []
|
|
16
16
|
const SAFETY_MAX_PAGE = 10
|
|
17
17
|
for (let page = 1; page <= SAFETY_MAX_PAGE; page += 1) {
|
|
18
|
-
|
|
18
|
+
|
|
19
19
|
const {data, headers} = await gitlabRequest('/projects', {page, per_page: 100, membership: true}, gitlab)
|
|
20
20
|
projects.push(data)
|
|
21
21
|
if (data.length === 0 || !headers['x-next-page']) {
|