Description
Hello,
First of all thanks in advance to anyone who will take some time to help me.
I’m running a fresh install of gitea on a debian server and I have troubles customizing it following this documentation.
First of all it says in the documentation :
You can check the CustomPath using gitea help. You can also find the path on the Configuration tab in the Site Administration page.
But when I type gitea help
I get :
DEFAULT CONFIGURATION:
AppPath: /usr/local/bin/gitea
WorkPath: /usr/local/bin
CustomPath: /usr/local/bin/custom
ConfigFile: /usr/local/bin/custom/conf/app.ini
While the site administration page gives me this :
When I try to list these directories I get this :
user@server:~$ ls -la /usr/local/bin
total 134652
drwxr-xr-x 2 root root 4096 30 janv. 15:50 .
drwxr-xr-x 10 root root 4096 25 janv. 16:15 ..
-rwxr-xr-x 1 root root 137872608 30 janv. 15:50 gitea
user@server:~$ ls -la /var/lib/gitea
ls: impossible d'ouvrir le répertoire '/var/lib/gitea': Permission non accordée
user@server:~$ ls -la /var/lib
total 116
...
drwxr-xr-x 2 root root 4096 28 févr. 2023 git
drwxr-x--- 5 git git 4096 30 janv. 15:50 gitea
...
For reference here is how I installed Gitea :
HOW I INSTALLED GITEA
# Downloading
wget -O gitea https://dl.gitea.com/gitea/1.21.4/gitea-1.21.4-linux-amd64
chmod +x gitea
wget -O gitea.asc https://dl.gitea.com/gitea/1.21.4/gitea-1.21.4-linux-amd64.asc
# Key verification
sudo apt install gnupg
gpg --keyserver keys.openpgp.org --recv 7C9E68152594688862D62AF62D9AE806EC1592E2
gpg --verify gitea.asc gitea
# Git user creation
sudo adduser \
--system \
--shell /bin/bash \
--gecos 'Git Version Control' \
--group \
--disabled-password \
--home /home/git \
git
# Directory structure creation (as root)
mkdir -p /var/lib/gitea/{custom,data,log}
chown -R git:git /var/lib/gitea/
chmod -R 750 /var/lib/gitea/
mkdir /etc/gitea
chown root:git /etc/gitea
chmod 770 /etc/gitea
# copied bin to final location
sudo cp gitea /usr/local/bin/gitea
# Autocomplete scripts
bash_autocomplete in /usr/share/bash-completion/completions/gitea
zsh_autocomplete in /usr/share/zsh/_gitea
Then here are my gitea.service and reverse proxy configurations :
GITEA.SERVICE + REVERSE PROXY
# Service creation
gitea.service [Service] block :
[Service]
RestartSec=2s
Type=simple
User=git
Group=git
WorkingDirectory=/var/lib/gitea/
#RuntimeDirectory=gitea
ExecStart=/usr/local/bin/gitea web --config /etc/gitea/app.ini
Restart=always
Environment=USER=git HOME=/home/git GITEA_WORK_DIR=/var/lib/gitea
# Reverse Proxy
ProxyPreserveHost On
ProxyRequests off
AllowEncodedSlashes NoDecode
ProxyPass / http://localhost:3000/ nocanon
Then after all that I went to gitea URL and went through installation process which gave my this /etc/gitea/app.ini :
APP.INI
APP_NAME = (my app name)
RUN_USER = git
WORK_PATH = /var/lib/gitea
RUN_MODE = prod
[database]
DB_TYPE = postgres
HOST = (my bdd ip address)
NAME = giteadb
USER = gitea
PASSWD = (my bdd password in clear ???)
SCHEMA =
SSL_MODE = disable
PATH = /var/lib/gitea/data/gitea.db
LOG_SQL = false
[repository]
ROOT = /var/lib/gitea/data/gitea-repositories
[server]
SSH_DOMAIN = (my gitea domain)
DOMAIN = (my gitea domain)
HTTP_PORT = 3000
ROOT_URL = https://(my gitea domain)/
APP_DATA_PATH = /var/lib/gitea/data
DISABLE_SSH = false
SSH_PORT = 22
LFS_START_SERVER = true
LFS_JWT_SECRET = (a secret)
OFFLINE_MODE = false
[lfs]
PATH = /var/lib/gitea/data/lfs
[mailer]
ENABLED = true
PROTOCOL = SMTPS
SMTP_ADDR = (my smtp server address)
SMTP_PORT = (my smtp server port)
FROM = (my smtp server address)
USER =
PASSWD =
[service]
REGISTER_EMAIL_CONFIRM = false
ENABLE_NOTIFY_MAIL = true
DISABLE_REGISTRATION = true
ALLOW_ONLY_EXTERNAL_REGISTRATION = false
ENABLE_CAPTCHA = false
REQUIRE_SIGNIN_VIEW = true
DEFAULT_KEEP_EMAIL_PRIVATE = false
DEFAULT_ALLOW_CREATE_ORGANIZATION = false
DEFAULT_ENABLE_TIMETRACKING = true
NO_REPLY_ADDRESS = noreply
[openid]
ENABLE_OPENID_SIGNIN = false
ENABLE_OPENID_SIGNUP = false
[cron.update_checker]
ENABLED = false
[session]
PROVIDER = file
[log]
MODE = console
LEVEL = info
ROOT_PATH = /var/lib/gitea/log
[repository.pull-request]
DEFAULT_MERGE_STYLE = merge
[repository.signing]
DEFAULT_TRUST_MODEL = committer
[security]
INSTALL_LOCK = true
I must admit I’m a little bit confused here so here are some questions :
- Why are
gitea help
and site administration displaying different directories ? - Is it the intended behavior to be unable to access/modify
/var/lib/gitea
unless we are user ‘git’ ? - Generally speaking, did I do something wrong and if so what ?
Gitea Version
1.21.4
Git Version
2.39.2
Operating System
Debian 12
Database
PostgreSQL