Gitea complains about "Found legacy public asset" when INSTALL_LOCK is set #13260

Closed
opened 2025-11-02 10:36:27 -06:00 by GiteaMirror · 5 comments
Owner

Originally created by @hawicz on GitHub (Jul 8, 2024).

Description

When starting Gitea with INSTALL_LOCK set there are several spurious errors about "Found legacy public asset":

2024/07/08 21:32:22 cmd/web.go:188:serveInstalled() [E] Found legacy public asset "css" in CustomPath. Please move it to /tmp/gitea/custom/public/assets/css
2024/07/08 21:32:22 cmd/web.go:188:serveInstalled() [E] Found legacy public asset "fonts" in CustomPath. Please move it to /tmp/gitea/custom/public/assets/fonts
2024/07/08 21:32:22 cmd/web.go:188:serveInstalled() [E] Found legacy public asset "img" in CustomPath. Please move it to /tmp/gitea/custom/public/assets/img
2024/07/08 21:32:22 cmd/web.go:188:serveInstalled() [E] Found legacy public asset "js" in CustomPath. Please move it to /tmp/gitea/custom/public/assets/js

Gitea Version

1.21.11

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

linux

How are you running Gitea?

cd /tmp
mkdir -p gitea/custom/conf
cat >> gitea/custom/conf/app.ini <<EOF
[security]
INSTALL_LOCK = true
EOF
gitea -w $(pwd)/gitea

Database

None

Originally created by @hawicz on GitHub (Jul 8, 2024). ### Description When starting Gitea with INSTALL_LOCK set there are several spurious errors about "Found legacy public asset": > 2024/07/08 21:32:22 cmd/web.go:188:serveInstalled() [E] Found legacy public asset "css" in CustomPath. Please move it to /tmp/gitea/custom/public/assets/css > 2024/07/08 21:32:22 cmd/web.go:188:serveInstalled() [E] Found legacy public asset "fonts" in CustomPath. Please move it to /tmp/gitea/custom/public/assets/fonts > 2024/07/08 21:32:22 cmd/web.go:188:serveInstalled() [E] Found legacy public asset "img" in CustomPath. Please move it to /tmp/gitea/custom/public/assets/img > 2024/07/08 21:32:22 cmd/web.go:188:serveInstalled() [E] Found legacy public asset "js" in CustomPath. Please move it to /tmp/gitea/custom/public/assets/js ### Gitea Version 1.21.11 ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version _No response_ ### Operating System linux ### How are you running Gitea? ``` cd /tmp mkdir -p gitea/custom/conf cat >> gitea/custom/conf/app.ini <<EOF [security] INSTALL_LOCK = true EOF gitea -w $(pwd)/gitea ``` ### Database None
GiteaMirror added the issue/needs-feedbackissue/not-a-bug labels 2025-11-02 10:36:27 -06:00
Author
Owner

@lunny commented on GitHub (Jul 11, 2024):

That means you have custom asset contents that are placed on old positions. You need to move them to the new positions.

@lunny commented on GitHub (Jul 11, 2024): That means you have custom asset contents that are placed on old positions. You need to move them to the new positions.
Author
Owner

@hawicz commented on GitHub (Jul 18, 2024):

Do you mean the app.ini file? Where should it go, if not in gitea/custom/conf/app.ini?
The steps I listed under "How are you running Gitea?" are all that I did, there are absolutely no other files present.

@hawicz commented on GitHub (Jul 18, 2024): Do you mean the app.ini file? Where should it go, if not in gitea/custom/conf/app.ini? The steps I listed under "How are you running Gitea?" are _all_ that I did, there are absolutely no other files present.
Author
Owner

@delvh commented on GitHub (Jul 18, 2024):

No, the problem is exactly not the app.ini:
https://blog.gitea.com/release-of-1.21.0/#%EF%B8%8F-move-public-asset-files-to-the-proper-directory-25907

@delvh commented on GitHub (Jul 18, 2024): No, the problem is exactly **not** the app.ini: https://blog.gitea.com/release-of-1.21.0/#%EF%B8%8F-move-public-asset-files-to-the-proper-directory-25907
Author
Owner

@hawicz commented on GitHub (Jul 18, 2024):

slight update to the previous instructions, as I realized that it's failing later w/ a db error:

cd /tmp
rm -rf gitea
mkdir -p gitea/custom/conf
cat >> gitea/custom/conf/app.ini <<EOF
[security]
INSTALL_LOCK = true
[database]
DB_TYPE  = sqlite3
EOF
gitea -w $(pwd)/gitea

When gitea is started, the only file present is app.ini. After starting it, here are the files present:

: erh@myhost:/tmp; find gitea -type f
gitea/custom/conf/app.ini
gitea/data/home/.gitconfig
gitea/data/queues/common/LOCK
gitea/data/queues/common/LOG
gitea/data/queues/common/MANIFEST-000000
gitea/data/queues/common/CURRENT
gitea/data/queues/common/000001.log
gitea/data/gitea.db
gitea/data/jwt/private.pem
gitea/data/indexers/issues.bleve/index_meta.json
gitea/data/indexers/issues.bleve/store/root.bolt
gitea/data/indexers/issues.bleve/rupture_meta.json
@hawicz commented on GitHub (Jul 18, 2024): slight update to the previous instructions, as I realized that it's failing later w/ a db error: ``` cd /tmp rm -rf gitea mkdir -p gitea/custom/conf cat >> gitea/custom/conf/app.ini <<EOF [security] INSTALL_LOCK = true [database] DB_TYPE = sqlite3 EOF gitea -w $(pwd)/gitea ``` When gitea is started, the only file present is app.ini. After starting it, here are the files present: ``` : erh@myhost:/tmp; find gitea -type f gitea/custom/conf/app.ini gitea/data/home/.gitconfig gitea/data/queues/common/LOCK gitea/data/queues/common/LOG gitea/data/queues/common/MANIFEST-000000 gitea/data/queues/common/CURRENT gitea/data/queues/common/000001.log gitea/data/gitea.db gitea/data/jwt/private.pem gitea/data/indexers/issues.bleve/index_meta.json gitea/data/indexers/issues.bleve/store/root.bolt gitea/data/indexers/issues.bleve/rupture_meta.json ```
Author
Owner

@hawicz commented on GitHub (Jul 18, 2024):

I just tried this again with 1.22.0 instead of 1.21.11, and in the newer version the error message is gone. Is there a bug fix that can be backported? I didn't see anything relevant in the release notes.

@hawicz commented on GitHub (Jul 18, 2024): I just tried this again with 1.22.0 instead of 1.21.11, and in the newer version the error message is gone. Is there a bug fix that can be backported? I didn't see anything relevant in the release notes.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#13260