fix validation, docker user, and only use dependabot for security upd… (#18)

* fix validation, docker user, and only use dependabot for security updates

* vars
This commit is contained in:
Dustin Decker 2023-01-29 12:40:54 -08:00 committed by GitHub
parent 9282570f40
commit 883039e6fa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 14 deletions

View file

@ -9,6 +9,8 @@ updates:
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
# Disable version updates for npm dependencies, only have security updates
open-pull-requests-limit: 0
- package-ecosystem: "github-actions"
directory: "/"
schedule:

19
api.js
View file

@ -273,6 +273,10 @@ async function set_up_api_server(app) {
*/
app.get(constants.API_BASE_PATH + 'xss-uri', async (req, res) => {
const user = await Users.findOne({ where: { 'id': req.session.user_id } });
if (user === null) {
req.session.destroy();
res.redirect(302, '/').end();
}
const uri = process.env.XSS_HOSTNAME + "/" + user.path;
res.status(200).json({
"success": true,
@ -413,21 +417,21 @@ async function set_up_api_server(app) {
type: 'object',
properties: {
page: {
type: 'string',
type: "Integer",
required: false,
default: '0',
pattern: '[0-9]+',
minimum: 1,
default: 1,
},
limit: {
type: 'string',
type: "Integer",
required: false,
default: '10',
pattern: '[0-9]+',
minimum: 1,
default: 10,
},
}
}
app.get(constants.API_BASE_PATH + 'payloadfires', validate({ query: ListPayloadFiresSchema }), async (req, res) => {
const page = (parseInt(req.query.page) - 1);
const page = (parseInt(req.query.page) - 1);
const limit = parseInt(req.query.limit);
const offset = (page * limit);
const payload_fires = await PayloadFireResults.findAndCountAll({
@ -469,7 +473,6 @@ async function set_up_api_server(app) {
}
return_payloads.push(new_payload);
}
console.log(JSON.stringify(return_payloads));
res.status(200).json({
'success': true,
'result': {

View file

@ -6,9 +6,9 @@ const get_hashed_password = require('./utils.js').get_hashed_password;
const constants = require('./constants.js');
const sequelize = new Sequelize(
process.env.DATABASE_NAME,
process.env.DATABASE_USER,
process.env.DATABASE_PASSWORD,
process.env.POSTGRES_DB,
process.env.POSTGRES_USER,
process.env.POSTGRES_PASSWORD,
{
host: process.env.DATABASE_HOST,
dialect: 'postgres',

View file

@ -16,13 +16,13 @@ services:
postgresdb:
image: postgres
restart: always
user: postgres
env_file:
- dev.env
environment:
PGDATA: /var/lib/postgresql/data/pgdata
POSTGRES_PASSWORD: postgres
POSTGRES_HOST_AUTH_METHOD: trust
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER"]
interval: 3s
timeout: 5s
retries: 5