debian-mirror-gitlab/doc/development/omnibus.md

39 lines
1.8 KiB
Markdown
Raw Normal View History

2021-01-29 00:20:46 +05:30
---
stage: Enablement
group: Distribution
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers
---
2019-12-04 20:38:33 +05:30
# What you should know about Omnibus packages
2015-04-26 12:48:37 +05:30
2019-12-04 20:38:33 +05:30
Most users install GitLab using our Omnibus packages. As a developer it can be
good to know how the Omnibus packages differ from what you have on your laptop
2015-04-26 12:48:37 +05:30
when you are coding.
## Files are owned by root by default
2019-12-04 20:38:33 +05:30
All the files in the Rails tree (`app/`, `config/` etc.) are owned by `root` in
Omnibus installations. This makes the installation simpler and it provides
extra security. The Omnibus reconfigure script contains commands that give
write access to the `git` user only where needed.
2015-04-26 12:48:37 +05:30
2019-12-04 20:38:33 +05:30
For example, the `git` user is allowed to write in the `log/` directory, in
2020-04-22 19:07:51 +05:30
`public/uploads`, and they are allowed to rewrite the `db/structure.sql` file.
2015-04-26 12:48:37 +05:30
In other cases, the reconfigure script tricks GitLab into not trying to write a
file. For instance, GitLab will generate a `.secret` file if it cannot find one
2019-12-04 20:38:33 +05:30
and write it to the Rails root. In the Omnibus packages, reconfigure writes the
2015-04-26 12:48:37 +05:30
`.secret` file first, so that GitLab never tries to write it.
## Code, data and logs are in separate directories
2019-12-04 20:38:33 +05:30
The Omnibus design separates code (read-only, under `/opt/gitlab`) from data
2015-04-26 12:48:37 +05:30
(read/write, under `/var/opt/gitlab`) and logs (read/write, under
`/var/log/gitlab`). To make this happen the reconfigure script sets custom
2020-06-23 00:09:42 +05:30
paths where it can in GitLab configuration files, and where there are no path
2015-04-26 12:48:37 +05:30
settings, it uses symlinks.
For example, `config/gitlab.yml` is treated as data so that file is a symlink.
2019-12-04 20:38:33 +05:30
The same goes for `public/uploads`. The `log/` directory is replaced by Omnibus
2015-04-26 12:48:37 +05:30
with a symlink to `/var/log/gitlab/gitlab-rails`.