remove gitea-rc4
This commit is contained in:
parent
5930a96a5e
commit
6e0a319d9b
@ -1,26 +0,0 @@
|
|||||||
---
|
|
||||||
services:
|
|
||||||
my_service:
|
|
||||||
environment:
|
|
||||||
- USER_UID=${GITEA_UID}
|
|
||||||
- USER_GID=${GITEA_GID}
|
|
||||||
- GITEA__database__DB_TYPE=${RDBMS}
|
|
||||||
- GITEA__database__HOST=my_db:${RDBMS_PORT}
|
|
||||||
- GITEA__database__NAME=${DB_NAME}
|
|
||||||
- GITEA__database__USER=${DB_USER}
|
|
||||||
- GITEA__database__PASSWD=${DB_PASSWD}
|
|
||||||
volumes:
|
|
||||||
- ${GITEA_VOL_HOST}:${GITEA_VOL_CONTAINER}
|
|
||||||
- ${GIT_SSH_VOL_HOST}:${GITEA_SSH_PATH_CONTAINER}
|
|
||||||
|
|
||||||
ports:
|
|
||||||
# - "${GITEA_SSH_EXPOSE}:${GITEA_SSH_CONTAINER}"
|
|
||||||
- "${GITEA_IP_SSH_EXPOSE}:${GITEA_SSH_CONTAINER}"
|
|
||||||
|
|
||||||
my_db:
|
|
||||||
environment:
|
|
||||||
- POSTGRES_USER=${DB_USER}
|
|
||||||
- POSTGRES_PASSWORD=${DB_PASSWD}
|
|
||||||
- POSTGRES_DB=${DB_NAME}
|
|
||||||
volumes:
|
|
||||||
- ${POSTGRES_VOL_PATH_HOST}:${POSTGRES_PATH_CONTAINER}
|
|
||||||
@ -1,28 +0,0 @@
|
|||||||
---
|
|
||||||
## version: '3.9'
|
|
||||||
|
|
||||||
networks:
|
|
||||||
my_net:
|
|
||||||
external: false
|
|
||||||
|
|
||||||
services:
|
|
||||||
my_service:
|
|
||||||
image: ${GITEA_IMAGE}
|
|
||||||
container_name: ${CONTAINER_NAME}
|
|
||||||
restart: always
|
|
||||||
networks:
|
|
||||||
- my_net
|
|
||||||
volumes:
|
|
||||||
- ${TIMEZONE_FILE}:${TIMEZONE_FILE_CONTAINER}
|
|
||||||
- ${LOCALTIME_FILE}:${LOCALTIME_FILE_CONTAINER}
|
|
||||||
ports:
|
|
||||||
- "${GITEA_HTTP_EXPOSE}:${GITEA_HTTP_CONTAINER}"
|
|
||||||
depends_on:
|
|
||||||
- my_db
|
|
||||||
|
|
||||||
my_db:
|
|
||||||
image: ${RDBMS_IMAGE}
|
|
||||||
restart: always
|
|
||||||
|
|
||||||
networks:
|
|
||||||
- my_net
|
|
||||||
@ -1,113 +0,0 @@
|
|||||||
# Estructura inicial del proyecto
|
|
||||||
|
|
||||||
```bash
|
|
||||||
gitea-rc4 $ tree -a
|
|
||||||
.
|
|
||||||
├── docker-compose.override.yml
|
|
||||||
├── docker-compose.yml
|
|
||||||
└── .env
|
|
||||||
```
|
|
||||||
|
|
||||||
_Nota autor:_ algunos datos en este documento pueden estar ofuscados.
|
|
||||||
|
|
||||||
## Configuración y ejecución de los contenedores Docker
|
|
||||||
|
|
||||||
### Configuración autenticación ssh - Docker Shell (with authorized_keys)
|
|
||||||
|
|
||||||
_Referencia principal:_ [Installation with Docker](https://docs.gitea.com/installation/install-with-docker#docker-shell-with-authorized_keys) - Docker Shell (with authorized_keys).
|
|
||||||
|
|
||||||
### Configuración de la aplicación y usario de Gitea
|
|
||||||
|
|
||||||
En el host motor de Docker se realizan las siguientes tareas de configuración. Estas son:
|
|
||||||
|
|
||||||
```
|
|
||||||
source .env
|
|
||||||
export CONTAINER_NAME GITEA_ACCOUNT GITEA_UID GITEA_GID
|
|
||||||
sudo groupadd -g ${GITEA_UID} ${GITEA_ACCOUNT}
|
|
||||||
sudo useradd -u ${GITEA_UID} -g ${GITEA_GID} -G docker -d /home/${GITEA_ACCOUNT} ${GITEA_ACCOUNT}
|
|
||||||
#sudo usermod -G docker -a ${GITEA_ACCOUNT}
|
|
||||||
sudo -u ${GITEA_ACCOUNT} ssh-keygen -t rsa -b 4096 -C "Gitea Host Key"
|
|
||||||
|
|
||||||
sudo -u ${GITEA_ACCOUNT} cat /home/${GITEA_ACCOUNT}/.ssh/id_rsa.pub | sudo -u ${GITEA_ACCOUNT} tee -a /home/${GITEA_ACCOUNT}/.ssh/authorized_keys
|
|
||||||
sudo -u ${GITEA_ACCOUNT} chmod 600 /home/${GITEA_ACCOUNT}/.ssh/authorized_keys
|
|
||||||
|
|
||||||
cat <<EOF | sudo tee /home/${GITEA_ACCOUNT}/docker-shell
|
|
||||||
#!/bin/sh
|
|
||||||
/usr/bin/docker exec -i -u ${GITEA_ACCOUNT} --env SSH_ORIGINAL_COMMAND="\$SSH_ORIGINAL_COMMAND" ${CONTAINER_NAME} sh "\$@"
|
|
||||||
EOF
|
|
||||||
sudo chmod +x /home/${GITEA_ACCOUNT}/docker-shell
|
|
||||||
sudo usermod -s /home/${GITEA_ACCOUNT}/docker-shell ${GITEA_ACCOUNT}
|
|
||||||
|
|
||||||
# id ${GITEA_ACCOUNT} # <-- el usuario git sobre el host anfitrion debe poder ejecutar docker para esta configuración funcione (es el usuario que redirecciona la conexión ssh al propio contenedor de Gitea).
|
|
||||||
##$ id ${GITEA_ACCOUNT}
|
|
||||||
## uid=...(git) gid=...(git) groups=...(git),...(docker)
|
|
||||||
```
|
|
||||||
|
|
||||||
## Revisar/ajustar estructura
|
|
||||||
|
|
||||||
```bash
|
|
||||||
mkdir -pv data/{gitea,postgres}
|
|
||||||
```
|
|
||||||
|
|
||||||
### Estructura (sugerida) antes de ejcutar los contenedores
|
|
||||||
|
|
||||||
```bash
|
|
||||||
gitea-rc4]$ tree -a
|
|
||||||
.
|
|
||||||
├── data # Carpeta para los volúmenes persistentes
|
|
||||||
│ ├── gitea
|
|
||||||
│ └── postgres
|
|
||||||
├── docker-compose.override.yml
|
|
||||||
├── docker-compose.yml
|
|
||||||
├── .env
|
|
||||||
└── gitea-rc4.md
|
|
||||||
```
|
|
||||||
|
|
||||||
## Iniciar los contenedores
|
|
||||||
|
|
||||||
```
|
|
||||||
docker compose up -d
|
|
||||||
```
|
|
||||||
|
|
||||||
## Instalar Gitea
|
|
||||||
|
|
||||||
Acceder a: `http://localhost:<$GITEA_HTTP_PORT_EXTERNAL>` e instalar Gitea
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
## Registrar usuario y copiar credenciales
|
|
||||||
|
|
||||||
En esta sección se registra un usuario y se copia su clave pública.
|
|
||||||
|
|
||||||
### Registrar usuario
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
### Usuario logado - setting
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
#### Setting - copiar clave pública
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
### Utilización de Gitea
|
|
||||||
|
|
||||||
En las siguientes capturas se muestran ejemplo como copiar/clonar dos repositorios que el usuario `userdevel1`. Uno mediante el URL sobre `http` y el otro mediante `ssh`.
|
|
||||||
|
|
||||||
- `git clone http://almalinux9-docker:3000/usrdevel1/repositorio1.git`
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
- `git clone git@almalinux9-docker:usrdevel1/repo-2.git`
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
## Otros comandos
|
|
||||||
|
|
||||||
- Ver los logs
|
|
||||||
|
|
||||||
```bash
|
|
||||||
docker-compose logs -f
|
|
||||||
```
|
|
||||||
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 130 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 153 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 66 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 114 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 115 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 54 KiB |
Loading…
Reference in New Issue
Block a user