Skip to content

Commit db15258

Browse files
committed
Merge remote-tracking branch 'origin' into #3937-RichardFeng-GuestDefinition
2 parents 6bb3cd3 + 51c6ab1 commit db15258

118 files changed

Lines changed: 4463 additions & 1146 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/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: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@ export default class ChangeRequestsController {
2323
}
2424
}
2525

26+
static async getAllGuestChangeRequests(req: Request, res: Response, next: NextFunction) {
27+
try {
28+
const changeRequests = await ChangeRequestsService.getAllGuestChangeRequests(req.organization);
29+
res.status(200).json(changeRequests);
30+
} catch (error: unknown) {
31+
next(error);
32+
}
33+
}
34+
2635
static async getToReviewChangeRequests(req: Request, res: Response, next: NextFunction) {
2736
try {
2837
const changeRequests = await ChangeRequestsService.getToReviewChangeRequests(req.currentUser, req.organization);

src/backend/src/controllers/recruitment.controllers.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,4 +137,23 @@ export default class RecruitmentController {
137137
next(error);
138138
}
139139
}
140+
141+
static async deleteGuestDefinition(req: Request, res: Response, next: NextFunction) {
142+
try {
143+
const { definitionId } = req.params as Record<string, string>;
144+
await RecruitmentServices.deleteGuestDefinition(req.currentUser, definitionId, req.organization);
145+
res.status(200).json({ message: `Successfully deleted guestDefinition with id ${definitionId}` });
146+
} catch (error: unknown) {
147+
next(error);
148+
}
149+
}
150+
151+
static async getAllGuestDefintions(req: Request, res: Response, next: NextFunction) {
152+
try {
153+
const allDefinitons = await RecruitmentServices.getAllGuestDefinitions(req.organization);
154+
res.status(200).json(allDefinitons);
155+
} catch (error: unknown) {
156+
next(error);
157+
}
158+
}
140159
}

src/backend/src/controllers/users.controllers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export default class UsersController {
102102

103103
const { user, token } = await UsersService.logUserIn(idToken, header!);
104104

105-
res.cookie('token', token, { httpOnly: true, sameSite: 'none', secure: true });
105+
res.cookie('token', token, { httpOnly: true, sameSite: 'none', secure: true, maxAge: 7 * 24 * 60 * 60 * 1000 });
106106
res.status(200).json(user);
107107
} catch (error: unknown) {
108108
next(error);

0 commit comments

Comments
 (0)