1 Commits

Author SHA1 Message Date
Max
23cf397581 S3 Data Storage (#1)
Using the storage options [here](https://docs.gitea.com/administration/config-cheat-sheet#storage-storage), this commit pushes all packages, avatars, and LFS files to S3.

- Uses AWS S3.
- Frees up storage on EC2 instance, so packages do not eventually steal all of the free space.

Reviewed-on: #1
Co-authored-by: Max <git@maximhutz.me>
Co-committed-by: Max <git@maximhutz.me>
2025-02-19 06:02:46 +00:00
4 changed files with 5 additions and 16 deletions

View File

@@ -52,7 +52,7 @@
state: started
recreate: true
restart_policy: unless-stopped
memory: 300m
memory: 425m
memory_swap: 900m
ports: [80:80, 2222:2222, 443:443, "22:22"]
env:

View File

@@ -82,7 +82,7 @@
state: started
recreate: true
restart_policy: unless-stopped
memory: 300m
memory: 425m
memory_swap: 900m
ports: [80:80, 2222:2222, 443:443, "22:22"]
env:

View File

@@ -18,7 +18,7 @@ resource "aws_instance" "this" {
subnet_id = module.vpc.public_subnets[0]
user_data = file("install.sh")
user_data_replace_on_change = false
user_data_replace_on_change = true
iam_instance_profile = aws_iam_instance_profile.ssm.name
vpc_security_group_ids = [aws_security_group.public_access.id]

View File

@@ -32,8 +32,8 @@ resource "aws_security_group" "public_access" {
tags = { GroupOf = "Main", GroupType = "Public" }
}
resource "aws_vpc_security_group_ingress_rule" "tcp" {
for_each = toset(["80", "443", "22", "51821"])
resource "aws_vpc_security_group_ingress_rule" "ingress" {
for_each = toset(["80", "443", "22", "2222", "81", "8080", "4321", "1234"])
security_group_id = aws_security_group.public_access.id
@@ -43,17 +43,6 @@ resource "aws_vpc_security_group_ingress_rule" "tcp" {
cidr_ipv4 = "0.0.0.0/0"
}
resource "aws_vpc_security_group_ingress_rule" "udp" {
for_each = toset(["51820", "53"])
security_group_id = aws_security_group.public_access.id
from_port = each.value
to_port = each.value
ip_protocol = "udp"
cidr_ipv4 = "0.0.0.0/0"
}
resource "aws_vpc_security_group_egress_rule" "egress" {
for_each = toset(["-1"])