diff --git a/gitea/config/app.ini b/gitea/config/app.ini index 80fc288..8fb2a66 100644 --- a/gitea/config/app.ini +++ b/gitea/config/app.ini @@ -94,3 +94,10 @@ DEFAULT_MERGE_STYLE = merge [repository.signing] DEFAULT_TRUST_MODEL = committer + +[storage] +STORAGE_TYPE = minio +MINIO_ENDPOINT = s3.us-east-1.amazonaws.com +MINIO_BUCKET = myrica-faya +MINIO_USE_SSL = true +MINIO_INSECURE_SKIP_VERIFY = false \ No newline at end of file diff --git a/playbooks/fast.yml b/playbooks/fast.yml index 6258bff..cbc46f7 100644 --- a/playbooks/fast.yml +++ b/playbooks/fast.yml @@ -63,6 +63,8 @@ GITEA__server__SSH_DOMAIN: "{{ full_domain.value }}" GITEA__server__DOMAIN: "{{ full_domain.value }}" GITEA__server__ROOT_URL: "https://{{ full_domain.value }}/" + GITEA__storage__MINIO_ACCESS_KEY_ID: "{{ minio_access_key }}" + GITEA__storage__MINIO_SECRET_ACCESS_KEY: "{{ minio_secret_key }}" labels: docker-volume-backup.stop-during-backup: "true" volumes: diff --git a/playbooks/slow.yml b/playbooks/slow.yml index a8b1966..f851fb0 100644 --- a/playbooks/slow.yml +++ b/playbooks/slow.yml @@ -11,22 +11,17 @@ rebuild: always pull: true - - name: Make temp file. - ansible.builtin.tempfile: - suffix: .tar - register: tar_file - - name: Push image to archive. community.docker.docker_image: name: "{{ image_name }}" - archive_path: "{{ tar_file.path }}" + archive_path: ../dist/image.tar source: local - name: Compress archive to artifact. register: compress_image community.general.archive: - path: "{{ tar_file.path }}" - dest: "{{ tar_file.path }}.xz" + path: ../dist/image.tar + dest: ../dist/image.tar.xz format: xz mode: "0644" @@ -34,7 +29,7 @@ amazon.aws.s3_object: bucket: "{{ image_bucket }}" object: "{{ image_key }}" - src: "{{ tar_file.path }}.xz" + src: ../dist/image.tar.xz mode: put region: "{{ aws_region }}" @@ -98,6 +93,8 @@ GITEA__server__SSH_DOMAIN: "{{ full_domain.value }}" GITEA__server__DOMAIN: "{{ full_domain.value }}" GITEA__server__ROOT_URL: "https://{{ full_domain.value }}/" + GITEA__storage__MINIO_ACCESS_KEY_ID: "{{ minio_access_key }}" + GITEA__storage__MINIO_SECRET_ACCESS_KEY: "{{ minio_secret_key }}" labels: docker-volume-backup.stop-during-backup: "true" volumes: diff --git a/terraform/install.sh b/terraform/install.sh index bcb2efd..895828d 100755 --- a/terraform/install.sh +++ b/terraform/install.sh @@ -1,5 +1,6 @@ #!/bin/sh +## Install extras. rpm --rebuilddb amazon-linux-extras install docker ansible2 python3.8 -y @@ -10,7 +11,7 @@ systemctl start docker # Set up the correct version of Python (for Ansible). ln -sf /usr/bin/python3.8 /usr/bin/python3 ln -sf /usr/bin/pip3.8 /usr/bin/pip3 -pip3 install botocore boto3 requests packaging +pip3 install botocore boto3 requests packaging --user ssm-user python3 -m pip install -U pip # Add some swap space. diff --git a/terraform/main.tf b/terraform/main.tf index 12a99ae..69704ec 100644 --- a/terraform/main.tf +++ b/terraform/main.tf @@ -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]