# Configuration: StaticRootPath vs CustomPath and their data directories

**URL:** <https://forum.gitea.com/t/configuration-staticrootpath-vs-custompath-and-their-data-directories/8838>\
**Category:** Install/Maintain/Configure\
**Created:** [March 26, 2024, 3:50pm UTC](https://forum.gitea.com/t/configuration-staticrootpath-vs-custompath-and-their-data-directories/8838 "2024-03-26T15:50:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![l0en](https://avatars.discourse-cdn.com/v4/letter/l/c5a1d2/32.png) [@l0en](https://forum.gitea.com/u/l0en)\
**Post date:** [March 26, 2024, 3:50pm UTC](https://forum.gitea.com/t/configuration-staticrootpath-vs-custompath-and-their-data-directories/8838/1 "2024-03-26T15:50:58Z")

</div>

I’m doing my first packaging steps - so, bear with me.

I wonder about the STATIC\_ROOT\_PATH key (or setting.StaticRootPath).  
**Q:** What is the propose of that directory?  
As my understanding is, that the gitea binary file have all the assets already included. I’m saying this because I see people packaging such directory with the content (dirs) _options, public, templates_ of the sources, that bloats it with more then 45MiB of data. My current layout looks like this

```auto
/etc/gitea/conf/app.example.ini
/etc/gitea/conf/app.ini
/etc/sysconfig/gitea
/usr/bin/gitea
/usr/lib/systemd/system/gitea.service
/usr/share/doc/gitea
/usr/share/doc/gitea/CHANGELOG.md
/usr/share/doc/gitea/README.md
/usr/share/doc/gitea/app.example.ini
/usr/share/licenses/gitea
/usr/share/licenses/gitea/LICENSE
/var/lib/gitea
/var/log/gitea

```

with the config

```auto
LDFLAGS="-X \"code.gitea.io/gitea/modules/setting.CustomPath=%{_sysconfdir}/%{name}\" \
         -X \"code.gitea.io/gitea/modules/setting.CustomConf=%{_sysconfdir}/%{name}/conf/app.ini\" \
         -X \"code.gitea.io/gitea/modules/setting.AppWorkPath=%{_sharedstatedir}/%{name}\" \
	 -X \"main.Version=%{full_version}\"" \
make build

```

and the application works as expected (without the above mentioned data). As I’m not setting the _STATIC\_ROOT\_PATH / StaticRootPath_ key, it defaults to _AppWorkPath_. In this case resolves to _/var/lib/gitea_.

All that said; **Q:** how does this _StaticRootPath_ relates to _CustomPath_ key?  
My understanding regards this is, that CustomPath should have such directories (options, public, templates) for individual configuration but **Q:** just with a selected amount of files, right?

Last one; the config file defaults to _{CustomPath}/conf/app.ini_ albeit I configured it exactly that way with _CustomConf_ but I wonder **Q:** If I should put the config file outside of _CustomPath_ as a measure to prevent access to it by path traversals access (even when the code prevent it (not validated), just as a best practice).

Thanks in advance!
