Skip to content

Commit

Permalink
omg all the things
Browse files Browse the repository at this point in the history
  • Loading branch information
dianabarsan committed Dec 12, 2024
1 parent 35bb802 commit 6c2fb33
Show file tree
Hide file tree
Showing 35 changed files with 509 additions and 1,478 deletions.
5 changes: 3 additions & 2 deletions config/default/app_settings.json

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions scripts/bulk-password-update-export.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ process.env.NODE_TLS_REJECT_UNAUTHORIZED=0;
const minimist = require('minimist');
const {promises: fsPromises} = require('fs');
const readline = require('readline');
const rpn = require('request-promise-native');
const {randomInt} = require('crypto');
const csvSync = require('csv-parse/sync');

Expand Down Expand Up @@ -46,10 +45,9 @@ const user = argv.user;
const password = argv.password;

const options = {
uri: url.href,
json: true,
headers: {
'Authorization': 'Basic ' + Buffer.from(`${user}:${password}`).toString('base64')
'Authorization': 'Basic ' + Buffer.from(`${user}:${password}`).toString('base64'),
'Content-Type': 'application/json',
}
};

Expand All @@ -73,18 +71,20 @@ Do you want to continue? [y/N]

const changeUserPass = async (user, options) => {
const postOptions = {...options};
postOptions.body = {
'password': user.pass
};
postOptions.uri = `${options.uri}/${user.name}`;
postOptions.body = JSON.stringify({ 'password': user.pass });
const uri = `${url}/${user.name}`;
try {
if (admins.includes(user.name)) {
throw new Error(`403 - Password change for "${user.name}" not allowed .`);
}
if (user.name.toString().trim() === '') {
throw new Error(`404 - Username is blank - check CSV and run again.`);
}
await rpn.post(postOptions);

const response = await fetch(uri, postOptions);
if (!response.ok) {
throw new Error(response.error);
}
console.log('SUCCESS', user.name, user.pass);
} catch (e) {
console.log('ERROR', user.name, e.message);
Expand Down
13 changes: 0 additions & 13 deletions scripts/generate-form-attachments/.eslintrc.json

This file was deleted.

39 changes: 0 additions & 39 deletions scripts/generate-form-attachments/README.md

This file was deleted.

13 changes: 0 additions & 13 deletions scripts/generate-form-attachments/package-lock.json

This file was deleted.

12 changes: 0 additions & 12 deletions scripts/generate-form-attachments/package.json

This file was deleted.

163 changes: 0 additions & 163 deletions scripts/generate-form-attachments/src/create-attachments.js

This file was deleted.

17 changes: 0 additions & 17 deletions scripts/generate-form-attachments/src/index.js

This file was deleted.

5 changes: 0 additions & 5 deletions scripts/generate-form-attachments/test/.eslintrc.json

This file was deleted.

Loading

0 comments on commit 6c2fb33

Please sign in to comment.