Skip to content

Commit

Permalink
gitea updated setup process
Browse files Browse the repository at this point in the history
  • Loading branch information
fabio-garavini committed Jan 28, 2025
1 parent f5f0965 commit 2b9e532
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 19 deletions.
2 changes: 2 additions & 0 deletions gitea/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# v1.23.1

- Improved setup process

- ENHANCEMENTS
- Move repo size to sidebar (#33155) (#33182)
- BUGFIXES
Expand Down
28 changes: 20 additions & 8 deletions gitea/DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,21 @@
| `USER_UID` | integer | Yes | User ID for the Gitea process (≥1000) | `1000` |
| `USER_GID` | integer | Yes | Group ID for the Gitea process (≥1000) | `1000` |
| `TZ` | string | No | Timezone (e.g., "America/New_York") | System default |
| `DISABLE_REGISTRATION` | boolean | No | Disable new user registration | `false` |
| `LFS_START_SERVER` | boolean | No | Enable Git LFS support | `true` |
| `DISABLE_SSH` | boolean | No | Disable built-in SSH server | `false` |
| `SECRET_KEY` | string | No | Secret key for secure operations (recommended to change) | Randomly generated |

### Example Configuration

```yaml
USER_UID: 1000
USER_GID: 1000
TZ: "Europe/Berlin"
DISABLE_REGISTRATION: false
LFS_START_SERVER: true
DISABLE_SSH: false
SECRET_KEY: "your-strong-secret-key-here"
```
---
Expand All @@ -49,21 +57,19 @@ TZ: "Europe/Berlin"

### Configure

1. Set UID/GID matching your system user
1. (Optional) Set UID/GID matching your system user
1. Configure timezone if needed
1. (Recommended) Set a custom SECRET_KEY for enhanced security
1. Start the addon

## 🌐 Access

- **Web Interface**: http://[HOME_ASSISTANT_IP]:8080

- **Web Interface**: http://[HOME_ASSISTANT_IP]:3080
- **SSH Access**: ssh://[HOME_ASSISTANT_IP]:222 (if enabled)
- First Run:
1. Create a new user account

1. Complete initial setup wizard
1. Set admin credentials
1. Configure base URL matching your Home Assistant address

## 🔧 Permissions Management
## 🔧 Permissions & Security

### Why UID/GID Matter

Expand All @@ -73,6 +79,12 @@ TZ: "Europe/Berlin"
- Configuration files
- Log files

### Security Recommendations

- Set `DISABLE_REGISTRATION` to `true` after initial setup
- Use a strong custom `SECRET_KEY`
- Disable SSH (`DISABLE_SSH: true`) if not needed

### Troubleshooting Permission Issues

1. Check addon logs for permission errors
Expand Down
11 changes: 10 additions & 1 deletion gitea/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,16 @@ ARG BUILD_FROM

FROM $BUILD_FROM

ENV GITEA_WORK_DIR=/data
ENV GITEA_WORK_DIR=/data \
INSTALL_LOCK=true \
DB_TYPE=sqlite3 \
DB_HOST=localhost:3306 \
DB_NAME=gitea \
DB_USER=root \
DB_PASSWD="" \
HTTP_PORT=3000 \
SSH_LISTEN_PORT=22 \
SSH_PORT=222

RUN apk --no-cache add \
shadow \
Expand Down
10 changes: 9 additions & 1 deletion gitea/config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Gitea
version: "1.23.1-v4"
version: "1.23.1-v5"
slug: gitea
codenotary: [email protected]
description: Gitea is a Git hosting, code review, team collaboration, package registry, and CI/CD
Expand All @@ -24,10 +24,18 @@ schema:
USER_UID: int(1000,)
USER_GID: int(1000,)
TZ: str?
DISABLE_REGISTRATION: bool
LFS_START_SERVER: bool
DISABLE_SSH: bool
SECRET_KEY: password
options:
USER_UID: 1000
USER_GID: 1000
TZ: Etc/UTC
DISABLE_REGISTRATION: false
LFS_START_SERVER: true
DISABLE_SSH: false
SECRET_KEY: "RNXVG8MSeh5ik6abGFctBMllvVAFWmP2"
ports:
3000/tcp: 3080
22/tcp: 222
Expand Down
18 changes: 9 additions & 9 deletions gitea/rootfs/etc/templates/app.ini
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@ TEMP_PATH = /share/gitea/uploads
APP_DATA_PATH = /config
DOMAIN = $DOMAIN
SSH_DOMAIN = $SSH_DOMAIN
HTTP_PORT = 3000
HTTP_PORT = $HTTP_PORT
ROOT_URL = $ROOT_URL
DISABLE_SSH = false
SSH_PORT = 222
SSH_LISTEN_PORT = 22
DISABLE_SSH = $DISABLE_SSH
SSH_PORT = $SSH_PORT
SSH_LISTEN_PORT = $SSH_LISTEN_PORT
LFS_START_SERVER = $LFS_START_SERVER

[database]
PATH = /data/gitea.db
DB_TYPE = sqlite3
HOST = localhost:3306
NAME = gitea
USER = root
PASSWD =
DB_TYPE = $DB_TYPE
HOST = $DB_HOST
NAME = $DB_NAME
USER = $DB_USER
PASSWD = $DB_PASSWD
LOG_SQL = false
SCHEMA =
SSL_MODE = disable
Expand Down

0 comments on commit 2b9e532

Please sign in to comment.