feat: local development

This commit is contained in:
2025-10-01 22:27:43 -04:00
parent 31a8eafd65
commit 770edd57ae
14 changed files with 624 additions and 5 deletions

View File

@@ -1,11 +1,24 @@
version: 3
tasks:
dev:
- docker compose down
- docker volume prune -f
- docker compose up --build --force-recreate
vault: ansible-vault edit vault.yml {{.CLI_ARGS}}
provision: ansible-playbook playbooks/provision.yml {{.CLI_ARGS}}
deploy: ansible-playbook playbooks/deploy.yml {{.CLI_ARGS}}
restore: ansible-playbook playbooks/restore.yml {{.CLI_ARGS}}
assets:
- cp ./assets/icon.png ./gitea/custom/public/assets/img/logo.png
- cp ./assets/icon.svg ./gitea/custom/public/assets/img/logo.svg
- cp ./assets/logo.png ./gitea/custom/public/assets/img/favicon.png
- cp ./assets/logo.svg ./gitea/custom/public/assets/img/favicon.svg
- cp ./assets/logo.png ./gitea/custom/public/assets/img/apple-touch-icon.png
enter:
cmd: ssh -i {{.KEY}} -p 2222 root@{{.IP}}
vars:

BIN
assets/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

118
assets/icon.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 22 KiB

BIN
assets/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

127
assets/logo.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 22 KiB

View File

@@ -3,7 +3,6 @@ services:
# Gitea itself.
gitea:
container_name: web-git-instance
restart: unless-stopped
depends_on:
- backup
- bucket-script

13
gitea/Dockerfile.dev Normal file
View File

@@ -0,0 +1,13 @@
FROM gitea/gitea:latest-rootless
ADD --chown=git:git config /etc/gitea
ADD --chown=git:git custom /etc/gitea-custom
ENV GITEA_CUSTOM=/etc/gitea-custom
RUN rm /etc/gitea/app.ini
RUN mv /etc/gitea/dev.app.ini /etc/gitea/app.ini
WORKDIR /etc/gitea-custom
RUN gitea cert --host localhost --ca

106
gitea/config/dev.app.ini Normal file
View File

@@ -0,0 +1,106 @@
APP_NAME = """Max's Code"""
RUN_USER = git
RUN_MODE = prod
WORK_PATH = /var/lib/gitea
[ui]
DEFAULT_THEME = gitea-light
[repository]
ROOT = /var/lib/gitea/git/repositories
[repository.local]
LOCAL_COPY_PATH = /tmp/gitea/local-repo
[repository.upload]
TEMP_PATH = /tmp/gitea/uploads
[server]
APP_DATA_PATH = /var/lib/gitea
LFS_START_SERVER = true
OFFLINE_MODE = true
LFS_JWT_SECRET = x-----------------------------------------x
DISABLE_SSH = false
START_SSH_SERVER = true
SSH_PORT = 2222
SSH_LISTEN_PORT = 2222
SSH_DOMAIN = localhost
BUILTIN_SSH_SERVER_USER = git
PROTOCOL = https
ROOT_URL = https://localhost:443/
DOMAIN = localhost
HTTP_PORT = 443
CERT_FILE = /etc/gitea-custom/cert.pem
KEY_FILE = /etc/gitea-custom/key.pem
[database]
DB_TYPE = sqlite3
[session]
PROVIDER_CONFIG = /var/lib/gitea/data/sessions
PROVIDER = file
[picture]
AVATAR_UPLOAD_PATH = /var/lib/gitea/data/avatars
REPOSITORY_AVATAR_UPLOAD_PATH = /var/lib/gitea/data/repo-avatars
[attachment]
PATH = /var/lib/gitea/data/attachments
[log]
ROOT_PATH = /var/lib/gitea/data/log
MODE = console
LEVEL = info
[security]
INSTALL_LOCK = true
SECRET_KEY =
REVERSE_PROXY_LIMIT = 1
REVERSE_PROXY_TRUSTED_PROXIES = *
PASSWORD_HASH_ALGO = pbkdf2
INTERNAL_TOKEN = x-----------------------------------------x
[service]
DISABLE_REGISTRATION = true
REQUIRE_SIGNIN_VIEW = false
REGISTER_EMAIL_CONFIRM = false
ENABLE_NOTIFY_MAIL = false
ALLOW_ONLY_EXTERNAL_REGISTRATION = false
ENABLE_CAPTCHA = false
DEFAULT_KEEP_EMAIL_PRIVATE = false
DEFAULT_ALLOW_CREATE_ORGANIZATION = true
DEFAULT_ENABLE_TIMETRACKING = true
NO_REPLY_ADDRESS = noreply
[lfs]
PATH = /var/lib/gitea/git/lfs
[mailer]
ENABLED = false
[openid]
ENABLE_OPENID_SIGNIN = false
ENABLE_OPENID_SIGNUP = false
[cron.update_checker]
ENABLED = false
[repository.pull-request]
DEFAULT_MERGE_STYLE = merge
[repository.signing]
DEFAULT_TRUST_MODEL = committer
[oauth2]
JWT_SECRET = x-----------------------------------------x
[storage]
STORAGE_TYPE = minio
MINIO_ENDPOINT = localstack:4566
MINIO_ACCESS_KEY_ID = test
MINIO_SECRET_ACCESS_KEY = test
MINIO_BUCKET = storage
MINIO_USE_SSL = false
MINIO_INSECURE_SKIP_VERIFY = true

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 16 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 819 B

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 15 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 819 B

After

Width:  |  Height:  |  Size: 22 KiB

View File

@@ -2,7 +2,7 @@
<div role="main"
aria-label="{{if .IsSigned}}{{ctx.Locale.Tr "dashboard"}}{{else}}{{ctx.Locale.Tr "home"}}{{end}}" class="page-content home">
<div class="tw-mb-8 tw-px-8">
<div class="center">
<div class="center tw-gap-4">
<img class="logo" width="220" height="220" src="{{AssetUrlPrefix}}/img/logo.svg" alt="{{ctx.Locale.Tr "logo"}}">
<div class="hero">
<h1 class="ui icon header title">{{AppName}}</h1>