Permalink
Browse files

Prevent accidental commits of hacked legal.md

  • Loading branch information...
bkimminich committed Nov 22, 2018
1 parent 362c381 commit aa6097b4cd5ac6d35fc7899fd0252a8298bff075
@@ -6,9 +6,7 @@ app/
!frontend/src/app
uploads/complaints/*.*
!uploads/complaints/.gitkeep
# Tests
test/files/legal.md
ftp/legal.md
# Build
.nyc_output/
@@ -26,7 +26,7 @@ module.exports = function (grunt) {
'frontend/dist/frontend/**',
'config/*.yml',
'data/*.js',
'data/static/*.yml',
'data/static/**',
'encryptionkeys/**',
'ftp/**',
'lib/**',
File renamed without changes.
@@ -0,0 +1,8 @@
const path = require('path')
const fs = require('fs-extra')
const restoreOriginalLegalInformation = () => {
fs.copyFileSync(path.resolve(__dirname, '../../data/static/legal.md'), path.resolve(__dirname, '../../ftp/legal.md'))
}
module.exports = restoreOriginalLegalInformation
@@ -68,6 +68,7 @@ errorhandler.title = `${config.get('application.name')} (Express ${utils.version
require('./lib/startup/validatePreconditions')()
require('./lib/startup/validateConfig')()
require('./lib/startup/cleanupFtpFolder')()
require('./lib/startup/restoreOriginalLegalInformation')()
/* Locals */
app.locals.captchaId = 0
@@ -6,24 +6,6 @@ const utils = require('../../lib/utils')
const URL = 'http://localhost:3000'
describe('/file-upload', () => {
beforeAll((done) => {
fs.copyFile(path.resolve(__dirname, '../../ftp/legal.md'), path.resolve(__dirname, '../files/legal.md'), (err) => {
if (err) {
console.log('Error backing up original legal.md file: ' + err.message)
}
done()
})
})
afterAll((done) => {
fs.copyFile(path.resolve(__dirname, '../files/legal.md'), path.resolve(__dirname, '../../ftp/legal.md'), (err) => {
if (err) {
console.log('Error restoring backup of original legal.md file: ' + err.message)
}
done()
})
})
it('POST file valid PDF for client and API', () => {
const file = path.resolve(__dirname, '../files/validSizeAndTypeForClient.pdf')
const form = frisby.formData()

0 comments on commit aa6097b

Please sign in to comment.