feat: using self signed certs

This commit is contained in:
2025-02-10 15:12:51 -05:00
parent 7ae2cd6588
commit 0c5a7ef7f3
8 changed files with 55 additions and 20 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@@ -22,7 +22,6 @@ tasks:
- task: build - task: build
- task: deploy - task: deploy
enter: enter:
cmd: aws ssm start-session --target $INSTANCE_ID cmd: aws ssm start-session --target $INSTANCE_ID
env: env:
@@ -30,3 +29,10 @@ tasks:
AWS_REGION: { sh: jq -r .aws_region < secrets/gitea.json } AWS_REGION: { sh: jq -r .aws_region < secrets/gitea.json }
AWS_ACCESS_KEY_ID: { sh: jq -r .aws_access_key < secrets/gitea.json } AWS_ACCESS_KEY_ID: { sh: jq -r .aws_access_key < secrets/gitea.json }
AWS_SECRET_ACCESS_KEY: { sh: jq -r .aws_secret_key < secrets/gitea.json } AWS_SECRET_ACCESS_KEY: { sh: jq -r .aws_secret_key < secrets/gitea.json }
prune:
- docker system prune -af
- docker image prune -af
- docker system prune -af --volumes
- docker volume prune -af
- docker system df

View File

@@ -15,6 +15,7 @@ services:
ports: ports:
- 80:80 - 80:80
- 443:443 - 443:443
- 3000:3000
- 2222:2222 - 2222:2222
labels: labels:
- docker-volume-backup.stop-during-backup=true - docker-volume-backup.stop-during-backup=true

View File

@@ -3,3 +3,7 @@ FROM gitea/gitea:latest-rootless
ADD --chown=git:git config /etc/gitea ADD --chown=git:git config /etc/gitea
ADD --chown=git:git custom /etc/gitea-custom ADD --chown=git:git custom /etc/gitea-custom
ENV GITEA_CUSTOM /etc/gitea-custom ENV GITEA_CUSTOM /etc/gitea-custom
WORKDIR /etc/gitea-custom
RUN gitea cert --host localhost --ca

View File

@@ -6,3 +6,7 @@ ENV GITEA_CUSTOM /etc/gitea-custom
RUN rm /etc/gitea/app.ini RUN rm /etc/gitea/app.ini
RUN mv /etc/gitea/dev.app.ini /etc/gitea/app.ini RUN mv /etc/gitea/dev.app.ini /etc/gitea/app.ini
WORKDIR /etc/gitea-custom
RUN gitea cert --host code.maximhutz.com --ca

View File

@@ -23,23 +23,32 @@ OFFLINE_MODE = true
DISABLE_SSH = false DISABLE_SSH = false
START_SSH_SERVER = true START_SSH_SERVER = true
SSH_PORT = 22 SSH_PORT = 22
SSH_LISTEN_PORT = 2222 SSH_LISTEN_PORT = 22
SSH_DOMAIN = maximhutz.com SSH_DOMAIN = code.maximhutz.com
BUILTIN_SSH_SERVER_USER = git BUILTIN_SSH_SERVER_USER = git
# PROTOCOL=https ; --- Signed SSL ---
# ENABLE_ACME=true ; PROTOCOL=https
# ACME_ACCEPTTOS=true ; ENABLE_ACME=true
# ACME_DIRECTORY=https ; ACME_ACCEPTTOS=true
# ACME_EMAIL=proxy@maximhutz.com ; ACME_DIRECTORY=https
; ACME_EMAIL=proxy@maximhutz.com
; DOMAIN = code.maximhutz.com
; ROOT_URL = https://code.maximhutz.com/
; HTTP_PORT = 443
# DOMAIN = code.maximhutz.com ; --- No SSL ---
# ROOT_URL = https://code.maximhutz.com/ ; DOMAIN = code.maximhutz.com
# HTTP_PORT = 443 ; ROOT_URL = http://code.maximhutz.com/
; HTTP_PORT = 80
; --- Self-Signed SSL ---
PROTOCOL = https
ROOT_URL = https://code.maximhutz.com/
DOMAIN = code.maximhutz.com DOMAIN = code.maximhutz.com
ROOT_URL = http://code.maximhutz.com/ HTTP_PORT = 443
HTTP_PORT = 80 CERT_FILE = cert.pem
KEY_FILE = key.pem
[database] [database]
DB_TYPE = sqlite3 DB_TYPE = sqlite3

View File

@@ -17,18 +17,29 @@ TEMP_PATH = /tmp/gitea/uploads
[server] [server]
APP_DATA_PATH = /var/lib/gitea APP_DATA_PATH = /var/lib/gitea
LFS_START_SERVER = true
OFFLINE_MODE = true
LFS_JWT_SECRET = x-----------------------------------------x
DISABLE_SSH = false DISABLE_SSH = false
START_SSH_SERVER = true START_SSH_SERVER = true
SSH_PORT = 2222 SSH_PORT = 2222
SSH_LISTEN_PORT = 2222 SSH_LISTEN_PORT = 2222
BUILTIN_SSH_SERVER_USER = git
LFS_START_SERVER = true
OFFLINE_MODE = true
SSH_DOMAIN = localhost SSH_DOMAIN = localhost
BUILTIN_SSH_SERVER_USER = git
; --- No SSL ---
; DOMAIN = localhost
; ROOT_URL = http://localhost:80/
; HTTP_PORT = 80
; --- Self-Signed Certificate ---
PROTOCOL = https
ROOT_URL = https://localhost:443/
DOMAIN = localhost DOMAIN = localhost
ROOT_URL = http://localhost:80/ HTTP_PORT = 443
HTTP_PORT = 80 CERT_FILE = cert.pem
LFS_JWT_SECRET = x-----------------------------------------x KEY_FILE = key.pem
[database] [database]
DB_TYPE = sqlite3 DB_TYPE = sqlite3

View File

@@ -44,7 +44,7 @@
restart_policy: unless-stopped restart_policy: unless-stopped
memory: 425m memory: 425m
memory_swap: 900m memory_swap: 900m
ports: [80:80, 2222:2222, 443:443] ports: [80:80, 2222:2222, 443:443, "22:22"]
env: env:
GITEA__security__INTERNAL_TOKEN: "{{ internal_secret }}" GITEA__security__INTERNAL_TOKEN: "{{ internal_secret }}"
GITEA__server__LFS_JWT_SECRET: "{{ lfs_secret }}" GITEA__server__LFS_JWT_SECRET: "{{ lfs_secret }}"