forgejo/docs
31
58
Fork
You've already forked docs
248

config: Clarify the purpose of CustomPath and StaticRootPath #597

Open
opened 2024年05月06日 19:28:30 +02:00 by el0n · 3 comments

I would classify following as a missing section of the "Forgejo Administrator Guide" documentation.

  • Installation
    • [Missing part] From Source

I'm RPM packaging forgejo the first time and struggling with
some integration config choices, so - bear with me.

The build section looks like:

%build
sed -i s/gitea/%{name}/ contrib/autocompletion/bash_autocomplete
TAGS="bindata sqlite sqlite_unlock_notify" \
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

Problem description:

The setting.StaticRootPath variable can also be configured like the others above but I leave it to fallback to the internal default.
The default for StaticRootPath is then the value of AppWorkPath. In my case as above configured, it is /var/lib/forgejo.

So, my understanding is that this StaticRootPath path delivers the options,templates, public directories. When running
forgejo I noticed that it ignores the contents for instance of /var/lib/forgejo/public/ instead delivers the files out of /etc/forgejo/public which is the CustomPath + /public. Even forcing the StaticRootPath being a specific directory via the STATIC_ROOT_PATH key in app.ini config does not honour the files in it. It stills deliver it out of CustomPath.

What's the purpose of the setting.StaticRootPath / STATIC_ROOT_PATH key for run-time (and build-time)?

What's the relation between CustomPath and StaticRootPath ?

The goal is to put static content (when needed for customization) into an appropriate location that complies with packaging guidelines of the target distribution (in this case FEDORA/RHEL/SUSE).

Thanks!

I would classify following as a missing section of the "Forgejo Administrator Guide" documentation. - Installation - [Missing part] From Source ---- I'm RPM packaging forgejo the first time and struggling with some integration config choices, so - bear with me. The build section looks like: ``` %build sed -i s/gitea/%{name}/ contrib/autocompletion/bash_autocomplete TAGS="bindata sqlite sqlite_unlock_notify" \ 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 ``` Problem description: The _setting.StaticRootPath_ variable can also be configured like the others above but I leave it to fallback to the internal default. The default for _StaticRootPath_ is then the value of _AppWorkPath_. In my case as above configured, it is _/var/lib/forgejo_. So, my understanding is that this _StaticRootPath_ path delivers the _options,templates, public_ directories. When running forgejo I noticed that it ignores the contents for instance of _/var/lib/forgejo/public/_ instead delivers the files out of _/etc/forgejo/public_ which is the _CustomPath_ + /public. Even forcing the _StaticRootPath_ being a specific directory via the STATIC_ROOT_PATH key in app.ini config does not honour the files in it. It stills deliver it out of _CustomPath_. What's the purpose of the _setting.StaticRootPath / STATIC_ROOT_PATH_ key for run-time (and build-time)? What's the relation between _CustomPath_ and _StaticRootPath_ ? The goal is to put static content (when needed for customization) into an appropriate location that complies with packaging guidelines of the target distribution (in this case FEDORA/RHEL/SUSE). Thanks!
Author
Copy link

...

What's the purpose of the setting.StaticRootPath / STATIC_ROOT_PATH key for run-time (and build-time)?

What's the relation between CustomPath and StaticRootPath ?

The goal is to put static content (when needed for customization) into an appropriate location that complies with packaging guidelines of the target distribution (in this case FEDORA/RHEL/SUSE).

...

I'd really appreciate any feedback. Just for the sake to close this ... Thanks.

... > > What's the purpose of the _setting.StaticRootPath / STATIC_ROOT_PATH_ key for run-time (and build-time)? > > What's the relation between _CustomPath_ and _StaticRootPath_ ? > > The goal is to put static content (when needed for customization) into an appropriate location that complies with packaging guidelines of the target distribution (in this case FEDORA/RHEL/SUSE). > ... I'd really appreciate any feedback. Just for the sake to close this ... Thanks.
n0toose changed title from (削除) Clarification/description/purpose of the StaticRootPath key (build- and run-time) (削除ここまで) to config: Clarify the purpose of CustomPath and StaticRootPath 2024年09月03日 12:03:52 +02:00
Member
Copy link

(I am not very sure either, but I just shared this in the Forgejo chat because this does seem important for packagers and I'm hoping that someone will be able to enlighten us both.)

(I am not very sure either, but I just shared this in the Forgejo chat because this does seem important for packagers and I'm hoping that someone will be able to enlighten us both.)
Author
Copy link

I found myself an answer. Take a look into forgejo/forgejo#3655 (comment) . Its there because of the proposed code snipped.

I found myself an answer. Take a look into https://codeberg.org/forgejo/forgejo/issues/3655#issuecomment-2451466 . Its there because of the proposed code snipped.
Sign in to join this conversation.
No Branch/Tag specified
next
v16.0
v15.0
v11.0
bp-v15.0-c7697f2
actions-remove-non-existing-strategy-options
v14.0
v13.0
v12.0
v7.0
v10.0
v9.0
v8.0
v1.21
v1.20
v1.19
v13.0.0-dev
Labels
Clear labels
404
Broken links or missing content
backport/v1.19
Changes which should be backported to the v1.19 docs

Archived

backport/v1.20
Changes which should be backported to the v1.20 docs

Archived

backport/v1.21
Changes which should be backported to the v1.21 docs

Archived

backport/v10.0
Automated backport to v10.0

Archived

backport/v11.0
Automated backport to v11.0
backport/v12.0
Automated backport to v12.0

Archived

backport/v13.0
Automated backport to v13.0

Archived

backport/v14.0
Automated backport to v14.0

Archived

backport/v15.0
Automated backport to v15.0
backport/v16.0
Automated backport to v16.0
backport/v7.0
Automated backport to the v7.0 docs

Archived

backport/v8.0
Automated backport to the v8.0 docs

Archived

backport/v9.0
Automated backport to the v9.0 docs

Archived

good first issue
This issue is suitable for "drive-by contributors" wanting to contribute for the first time, and fixing it should be straightforward.
meta
Tooling and processes for maintaining the docs
new docs
Content to be added to the documentation

Archived

User research - Accessibility
Requires input about accessibility features, likely involves user testing.
User research - Blocked
Do not pick as-is! We are happy if you can help, but please coordinate with ongoing redesign in this area.
User research - Community
Community features, such as discovering other people's work or otherwise feeling welcome on a Forgejo instance.
User research - Config (instance)
Instance-wide configuration, authentication and other admin-only needs.
User research - Errors
How to deal with errors in the application and write helpful error messages.
User research - Filters
How filter and search is being worked with.
User research - Future backlog
The issue might be inspiring for future design work.
User research - Git workflow
AGit, fork-based and new Git workflow, PR creation etc
User research - Labels
Active research about Labels
User research - Moderation
Moderation Featuers for Admins are undergoing active User Research
User research - Needs input
Use this label to let the User Research team know their input is requested.
User research - Notifications/Dashboard
Research on how users should know what to do next.
User research - Rendering
Text rendering, markup languages etc
User research - Repo creation
Active research about the New Repo dialog.
User research - Repo units
The repo sections, disabling them and the "Add more" button.
User research - Security
User research - Settings (in-app)
How to structure in-app settings in the future?
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
forgejo/docs#597
Reference in a new issue
forgejo/docs
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?