WIP, add user remap

This commit is contained in:
Alan O'Cull 2024-01-11 17:04:58 -05:00
parent a674d4f082
commit 5f36417a82
4 changed files with 29 additions and 0 deletions

View File

@ -7,3 +7,4 @@ Automation tool to reduce pain while taking CGT365
- Tips on [managing API tokens](https://support.atlassian.com/atlassian-account/docs/manage-api-tokens-for-your-atlassian-account/) - Tips on [managing API tokens](https://support.atlassian.com/atlassian-account/docs/manage-api-tokens-for-your-atlassian-account/)
- [PatternPacker](https://git.alanocull.com/alan/pattern-packer/src/branch/master/src/server/server.ts) uses some basic express hosting - [PatternPacker](https://git.alanocull.com/alan/pattern-packer/src/branch/master/src/server/server.ts) uses some basic express hosting
- Jira REST API docs for [issues](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-group-issues) - Jira REST API docs for [issues](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-group-issues)
- Gitea REST API [docs](https://git.alanocull.com/api/swagger)

View File

@ -1,3 +1,4 @@
{ {
"gitea": "https://git.alanocull.com",
"port": 3001 "port": 3001
} }

9
config/user_remap.json Normal file
View File

@ -0,0 +1,9 @@
{
"alan": "arocull@purdue.edu",
"Will": "montgow@purdue.edu",
"connor": "celswort@purdue.edu",
"shelby": "shockada@purdue.edu",
"tommy": "thochste@purdue.edu",
"matt": "mcschule@purdue.edu",
"patrick": "ryan227@purdue.edu"
}

View File

@ -9,14 +9,32 @@ const CONFIG = JSON.parse(fs.readFileSync(`${CONFIG_DIRECTORY}server.json`, 'utf
const SECRETS = JSON.parse(fs.readFileSync(`${CONFIG_DIRECTORY}secrets.json`, 'utf-8')); const SECRETS = JSON.parse(fs.readFileSync(`${CONFIG_DIRECTORY}secrets.json`, 'utf-8'));
const PORT = CONFIG['port']; const PORT = CONFIG['port'];
// BUILD OAUTH
const OAUTH_JIRA = `${SECRETS['jira-email']}:${SECRETS['jira-token']}`;
const OAUTH_GITEA = `token ${SECRETS['gitea-token']}`;
const URL_GITEA = `${CONFIG['gitea']}/api`;
// INITIALIZE EXPRESS // INITIALIZE EXPRESS
const app = express(); const app = express();
// FUNCTIONALITY
// SET UP WEBHOOKS
app.get('/', (req, res) => { app.get('/', (req, res) => {
console.log("Got request ", req.url); console.log("Got request ", req.url);
res.send({'data':'nice'}); res.send({'data':'nice'});
}) })
// HOST
app.listen(PORT, () => { app.listen(PORT, () => {
console.log(`Server is running on localhost:${PORT}, working in ${CONFIG_DIRECTORY}`) console.log(`Server is running on localhost:${PORT}, working in ${CONFIG_DIRECTORY}`)
}); });
app.post(`${URL_GITEA}/repos/triple-aaa-games/hook-line-axe/issues`, (req, res) => {
console.log(req.body);
});