Skip to content

Commit

Permalink
Replace intel with sitespeed.io/log
Browse files Browse the repository at this point in the history
  • Loading branch information
soulgalore committed Jan 7, 2025
1 parent cc7b700 commit 948c75d
Show file tree
Hide file tree
Showing 25 changed files with 68 additions and 311 deletions.
3 changes: 1 addition & 2 deletions server/config/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ database:
password: jhde7gFArda33Saa1!4dd2dagJ
port: 5432

# Configure the log. If you want to log to a file, set full path and name of the file.
# Configure the log.
log:
file: null
verbose: false

# Make sure only users with the correct key can add tests
Expand Down
135 changes: 10 additions & 125 deletions server/npm-shrinkwrap.json

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

2 changes: 1 addition & 1 deletion server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
"pug-lint-config-clock": "2.0.0"
},
"dependencies": {
"@sitespeed.io/log": "0.2.2",
"body-parser": "1.20.3",
"bull": "4.16.5",
"compression": "1.7.5",
Expand All @@ -70,7 +71,6 @@
"express": "5.0.1",
"express-beautify": "0.1.3",
"helmet": "8.0.0",
"intel": "1.2.0",
"js-yaml": "4.1.0",
"lodash.get": "4.4.2",
"lodash.merge": "4.6.2",
Expand Down
4 changes: 2 additions & 2 deletions server/src/database/databasehelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import postgrespackage from 'pg';
const { Pool } = postgrespackage;

import nconf from 'nconf';
import log from 'intel';
import { getLogger } from '@sitespeed.io/log';

const logger = log.getLogger('sitespeedio.database.query');
const logger = getLogger('sitespeedio.database.query');

class DatabaseHelper {
constructor() {
Expand Down
4 changes: 2 additions & 2 deletions server/src/database/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import log from 'intel';
import { getLogger } from '@sitespeed.io/log';

import DatabaseHelper from './databasehelper.js';

const logger = log.getLogger('sitespeedio.database');
const logger = getLogger('sitespeedio.database');

const LIMITED_COLUMS =
'id, location, test_type, run_date, browser_name, url, result_url, status, scripting_name, label, slug';
Expand Down
4 changes: 2 additions & 2 deletions server/src/database/search.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import dayjs from 'dayjs';
import log from 'intel';
import { getLogger } from '@sitespeed.io/log';

import DatabaseHelper from './databasehelper.js';

const logger = log.getLogger('sitespeedio.database.search');
const logger = getLogger('sitespeedio.database.search');

const LIMITED_COLUMS =
'id, location, test_type, run_date, browser_name, url, result_url, status, scripting_name, label, slug';
Expand Down
4 changes: 2 additions & 2 deletions server/src/middleware/errorhandler.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import nconf from 'nconf';
import { getText } from '../util/text.js';

import log from 'intel';
const logger = log.getLogger('sitespeedio.server');
import { getLogger } from '@sitespeed.io/log';
const logger = getLogger('sitespeedio.server');

export const error404 = function (request, response) {
response.status(400);
Expand Down
4 changes: 2 additions & 2 deletions server/src/middleware/validatekey.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import nconf from 'nconf';
import log from 'intel';
const logger = log.getLogger('sitespeedio.server');
import { getLogger } from '@sitespeed.io/log';
const logger = getLogger('sitespeedio.server');
import { getText } from '../util/text.js';

export const validateKey = (request, response, next) => {
Expand Down
4 changes: 2 additions & 2 deletions server/src/middleware/validatequeue.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { getDeviceQueue, getExistingQueue } from '../queuehandler.js';
import get from 'lodash.get';
import log from 'intel';
const logger = log.getLogger('sitespeedio.server');
import { getLogger } from '@sitespeed.io/log';
const logger = getLogger('sitespeedio.server');

import { getText } from '../util/text.js';

Expand Down
4 changes: 2 additions & 2 deletions server/src/middleware/validatescripting.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import validator from 'validator';
import log from 'intel';
import { getLogger } from '@sitespeed.io/log';
import nconf from 'nconf';

const { isURL } = validator;
const logger = log.getLogger('sitespeedio.server');
const logger = getLogger('sitespeedio.server');

import { getText } from '../util/text.js';

Expand Down
4 changes: 2 additions & 2 deletions server/src/middleware/validateurl.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// middleware/validateURL.js
import validator from 'validator';
import log from 'intel';
import { getLogger } from '@sitespeed.io/log';
import nconf from 'nconf';

const { isURL } = validator;

import { getText } from '../util/text.js';

const logger = log.getLogger('sitespeedio.server');
const logger = getLogger('sitespeedio.server');

export const validateURL = (request, response, next) => {
const testDomain = nconf.get('validTestDomains');
Expand Down
4 changes: 2 additions & 2 deletions server/src/queuehandler.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import NodeCache from 'node-cache';
const idToQueue = new NodeCache({ stdTTL: 60 * 60, checkperiod: 120 });
import Queue from 'bull';
import log from 'intel';
const logger = log.getLogger('sitespeedio.server');
import { getLogger } from '@sitespeed.io/log';
const logger = getLogger('sitespeedio.server');
const queues = {};
const deviceToQueue = {};
import nconf from 'nconf';
Expand Down
4 changes: 2 additions & 2 deletions server/src/routes/api/api.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Router } from 'express';
import log from 'intel';
import { getLogger } from '@sitespeed.io/log';

import { createRequire } from 'node:module';

Expand All @@ -15,7 +15,7 @@ import { addTestFromAPI } from '../../util/add-test.js';
import { getTestRunners } from '../../testrunners.js';
import { getText } from '../../util/text.js';
import { validateQueue } from '../../middleware/validatequeue.js';
const logger = log.getLogger('sitespeedio.server.api');
const logger = getLogger('sitespeedio.server.api');

const require = createRequire(import.meta.url);
const version = require('../../../package.json').version;
Expand Down
4 changes: 2 additions & 2 deletions server/src/routes/html/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Router } from 'express';
import { createRequire } from 'node:module';

import nconf from 'nconf';
import log from 'intel';
import { getLogger } from '@sitespeed.io/log';

import { getTestRunners } from '../../testrunners.js';
import { addTest } from '../../util/add-test.js';
Expand All @@ -15,7 +15,7 @@ import { validateQueue } from '../../middleware/validatequeue.js';
import { getQueueSize } from '../../queuehandler.js';

export const index = Router();
const logger = log.getLogger('sitespeedio.server');
const logger = getLogger('sitespeedio.server');

const require = createRequire(import.meta.url);
const version = require('../../../package.json').version;
Expand Down
4 changes: 2 additions & 2 deletions server/src/routes/html/result.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import nconf from 'nconf';
import log from 'intel';
import { getLogger } from '@sitespeed.io/log';

import { Router } from 'express';
import { getConfigByTestId } from '../../configs.js';
Expand All @@ -9,7 +9,7 @@ import { getText } from '../../util/text.js';
import { getTest } from '../../database/index.js';

export const result = Router();
const logger = log.getLogger('sitespeedio.server');
const logger = getLogger('sitespeedio.server');

result.get('/:id', async function (request, response) {
const id = request.params.id;
Expand Down
Loading

0 comments on commit 948c75d

Please sign in to comment.