Closed PierreLouisPAUGAM closed 6 months ago
I'm not the best with the config, but after a quick test I think you have to do something like
gitea --config /path/to/app.ini
to get the same result for help and for the service
Hello @zokkis and thanks for your answer.
I pasted content from my gitea.service file in my initial post and I think the following line :
ExecStart=/usr/local/bin/gitea web --config /etc/gitea/app.ini
should perform what you suggested don't you agree ?
I think zokkis is right. Gitea detects its paths by the config file.
So you would see different outputs by gitea help --config /etc/gitea/app.ini
and gitea help
For your case, your custom folder should be /var/lib/gitea/custom
, you need some "sudo" trick to create the direcotry and access/manage these files.
Thanks @wxiaoguang and @zokkis. I managed to access the folder and do some tests as the git user.
If anyone is stuck in the same way in the future, the only way around I found is to :
sudo -i
to access custom folder and manage files in it, then once changes are done change files owner and permissions so that gitea can access the files :
chown -R git:git /var/lib/gitea/
chmod -R 750 /var/lib/gitea/
su - git
as root to run commands as git if needed (for debug purposes)
Automatically locked because of our CONTRIBUTING guidelines
Description
Hello,
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 :
But when I type
gitea help
I get :While the site administration page gives me this :
When I try to list these directories I get this :
For reference here is how I installed Gitea :
HOW I INSTALLED GITEA
**# Downloading** ```bash 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** ```bash sudo apt install gnupg gpg --keyserver keys.openpgp.org --recv 7C9E68152594688862D62AF62D9AE806EC1592E2 gpg --verify gitea.asc gitea ``` **# Git user creation** ```bash sudo adduser \ --system \ --shell /bin/bash \ --gecos 'Git Version Control' \ --group \ --disabled-password \ --home /home/git \ git ``` **# Directory structure creation (as root)** ```bash 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** ```bash sudo cp gitea /usr/local/bin/gitea ``` **# Autocomplete scripts** [bash_autocomplete](https://raw.githubusercontent.com/go-gitea/gitea/main/contrib/autocompletion/bash_autocomplete) in /usr/share/bash-completion/completions/gitea [zsh_autocomplete](https://raw.githubusercontent.com/go-gitea/gitea/main/contrib/autocompletion/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 : ```bash [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 https://mygiteadomain and went through installation process which gave my this /etc/gitea/app.ini :
APP.INI
```bash 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 :
gitea help
and site administration displaying different directories ?/var/lib/gitea
unless we are user 'git' ?Gitea Version
1.21.4
Git Version
2.39.2
Operating System
Debian 12
Database
PostgreSQL