Skip to content

Commit c353145

Browse files
committed
#4148: fixed merge confilcts
2 parents c50f372 + 2784ce6 commit c353145

188 files changed

Lines changed: 7539 additions & 1856 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.ebextensions/03_ssh_keys.config

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
files:
2+
"/tmp/add_authorized_keys.sh":
3+
mode: "000755"
4+
owner: root
5+
group: root
6+
content: |
7+
#!/bin/bash
8+
AUTHORIZED_KEYS="/home/ec2-user/.ssh/authorized_keys"
9+
mkdir -p /home/ec2-user/.ssh
10+
touch "$AUTHORIZED_KEYS"
11+
chown ec2-user:ec2-user /home/ec2-user/.ssh
12+
chmod 700 /home/ec2-user/.ssh
13+
14+
add_key() {
15+
local key="$1"
16+
if ! grep -qF "$key" "$AUTHORIZED_KEYS"; then
17+
echo "$key" >> "$AUTHORIZED_KEYS"
18+
fi
19+
}
20+
21+
# Chris Pyle
22+
add_key "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMqV5gwot3utGLPGpAPWr8znU1cjMn1RE7jN8htvaOMt aws-eb"
23+
24+
# Sean Walker
25+
add_key "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICf1UhVM+65hiKahvdvEj20ohDu+bZVS+btVFJTtg0oP seanwalker@Seans-MacBook-Pro-2.local"
26+
27+
chown ec2-user:ec2-user "$AUTHORIZED_KEYS"
28+
chmod 600 "$AUTHORIZED_KEYS"
29+
30+
commands:
31+
add_authorized_keys:
32+
command: "/tmp/add_authorized_keys.sh"
33+
ignoreErrors: false

infrastructure/modules/elasticbeanstalk/variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ variable "solution_stack_name" {
1414
description = "Elastic Beanstalk solution stack name"
1515
type = string
1616
# Find the latest: aws elasticbeanstalk list-available-solution-stacks
17-
default = "64bit Amazon Linux 2023 v4.7.4 running Docker"
17+
default = "64bit Amazon Linux 2023 v4.11.0 running Docker"
1818
}
1919

2020
variable "vpc_id" {

infrastructure/modules/monitoring/main.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,10 @@ resource "aws_cloudwatch_metric_alarm" "eb_memory_high" {
357357
Environment = var.environment
358358
Project = var.project_name
359359
}
360+
361+
lifecycle {
362+
ignore_changes = [metric_query]
363+
}
360364
}
361365

362366
#############

infrastructure/modules/network/main.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,14 @@ resource "aws_security_group" "eb_instance" {
164164
security_groups = [aws_security_group.alb.id]
165165
}
166166

167+
ingress {
168+
description = "SSH access"
169+
from_port = 22
170+
to_port = 22
171+
protocol = "tcp"
172+
cidr_blocks = ["0.0.0.0/0"]
173+
}
174+
167175
egress {
168176
description = "Allow all outbound traffic"
169177
from_port = 0

infrastructure/scripts/ssh-to-eb.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ echo "🔌 Connecting to EB instance..."
5858
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
5959
echo ""
6060
echo "Instance: $INSTANCE_IP ($INSTANCE_ID)"
61+
echo "Direct SSH: ssh -i $KEY_PATH_EXPANDED ec2-user@$INSTANCE_IP"
6162
echo "User: ec2-user"
6263
echo ""
6364
echo "Useful commands once connected:"

src/backend/custom.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
import { Organization } from '@prisma/client';
1+
import { Organization, Prisma } from '@prisma/client';
22
import { User as SharedUser } from 'shared';
33

44
declare global {
55
namespace Express {
66
export interface Request {
77
currentUser: SharedUser;
88
organization: Organization;
9+
currentCar?: Prisma.CarGetPayload<{ include: { wbsElement: true } }>;
910
}
1011
}
1112
}

src/backend/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import cors from 'cors';
33
import cookieParser from 'cookie-parser';
44
import { getUserAndOrganization, prodHeaders, requireJwtDev, requireJwtProd } from './src/utils/auth.utils.js';
55
import { errorHandler } from './src/utils/errors.utils.js';
6+
import { getCurrentCar } from './src/utils/car.utils.js';
67
import userRouter from './src/routes/users.routes.js';
78
import projectRouter from './src/routes/projects.routes.js';
89
import teamsRouter from './src/routes/teams.routes.js';
@@ -90,6 +91,9 @@ app.use(isProd ? requireJwtProd : requireJwtDev);
9091
// get user and organization
9192
app.use(getUserAndOrganization);
9293

94+
// get current car
95+
app.use(getCurrentCar);
96+
9397
// routes
9498
app.use('/users', userRouter);
9599
app.use('/projects', projectRouter);

src/backend/src/controllers/attendance.controllers.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,16 @@ export default class AttendanceController {
2121
}
2222
}
2323

24+
static async getAttendanceById(req: Request, res: Response, next: NextFunction) {
25+
try {
26+
const { meetingAttendanceId } = req.params as Record<string, string>;
27+
const attendance = await AttendanceService.getAttendanceById(meetingAttendanceId, req.organization);
28+
res.status(200).json(attendance);
29+
} catch (error: unknown) {
30+
next(error);
31+
}
32+
}
33+
2434
static async getOngoingAttendance(req: Request, res: Response, next: NextFunction) {
2535
try {
2636
const { teamId } = req.params as Record<string, string>;

src/backend/src/controllers/calendar.controllers.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,4 +596,18 @@ export default class CalendarController {
596596
next(error);
597597
}
598598
}
599+
600+
static async getAllEventsPaginated(req: Request, res: Response, next: NextFunction) {
601+
try {
602+
const { cursor, pageSize } = req.body;
603+
const paginatedEvents = await CalendarService.getAllEventsPaginated(
604+
req.organization,
605+
cursor ? new Date(cursor) : undefined,
606+
pageSize ? parseInt(pageSize) : undefined
607+
);
608+
res.status(200).json(paginatedEvents);
609+
} catch (error: unknown) {
610+
next(error);
611+
}
612+
}
599613
}

src/backend/src/controllers/change-requests.controllers.ts

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,16 @@ export default class ChangeRequestsController {
1616

1717
static async getAllChangeRequests(req: Request, res: Response, next: NextFunction) {
1818
try {
19-
const changeRequests = await ChangeRequestsService.getAllChangeRequests(req.organization);
19+
const changeRequests = await ChangeRequestsService.getAllChangeRequests(req.organization, req.currentCar?.carId);
20+
res.status(200).json(changeRequests);
21+
} catch (error: unknown) {
22+
next(error);
23+
}
24+
}
25+
26+
static async getAllGuestChangeRequests(req: Request, res: Response, next: NextFunction) {
27+
try {
28+
const changeRequests = await ChangeRequestsService.getAllGuestChangeRequests(req.organization);
2029
res.status(200).json(changeRequests);
2130
} catch (error: unknown) {
2231
next(error);
@@ -25,7 +34,11 @@ export default class ChangeRequestsController {
2534

2635
static async getToReviewChangeRequests(req: Request, res: Response, next: NextFunction) {
2736
try {
28-
const changeRequests = await ChangeRequestsService.getToReviewChangeRequests(req.currentUser, req.organization);
37+
const changeRequests = await ChangeRequestsService.getToReviewChangeRequests(
38+
req.currentUser,
39+
req.organization,
40+
req.currentCar?.carId
41+
);
2942
res.status(200).json(changeRequests);
3043
} catch (error: unknown) {
3144
next(error);
@@ -41,7 +54,8 @@ export default class ChangeRequestsController {
4154
const changeRequests = await ChangeRequestsService.getUnreviewedChangeRequests(
4255
req.currentUser,
4356
validatedWbs,
44-
req.organization
57+
req.organization,
58+
req.currentCar?.carId
4559
);
4660
res.status(200).json(changeRequests);
4761
} catch (error: unknown) {
@@ -58,7 +72,8 @@ export default class ChangeRequestsController {
5872
const changeRequests = await ChangeRequestsService.getApprovedChangeRequests(
5973
req.currentUser,
6074
validatedWbs,
61-
req.organization
75+
req.organization,
76+
req.currentCar?.carId
6277
);
6378
res.status(200).json(changeRequests);
6479
} catch (error: unknown) {

0 commit comments

Comments
 (0)