-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move public asset files to the proper directory #25907
Conversation
6bc6553
to
5c775e8
Compare
Good change, thanks. |
5c775e8
to
456632d
Compare
There are many references to |
After getting approvals, I will update the documents (including: customization, public/css, public/js, public/img) 1.21 is at the early stage, so I think we have enough time to test this PR after it gets merged. |
CI passes. If the code change looks good to reviewers, I will update the documents (including: customization, public/css, public/js, public/img). If there are concerns, let's resolve the concerns first before the documentation work (to save everyone's time) |
* main: Refactor "Content" for file uploading (go-gitea#25851) Fix SSPI auth panic (go-gitea#25955) Make pending commit status yellow again (go-gitea#25935) Move public asset files to the proper directory (go-gitea#25907) Disallow dangerous url schemes (go-gitea#25960) Avoid creating directories when loading config (go-gitea#25944) [skip ci] Updated translations via Crowdin
* giteaofficial/main: [skip ci] Updated translations via Crowdin Fix commit status color on dashboard repolist (go-gitea#25993) Improve profile readme rendering (go-gitea#25988) avoid hard-coding height in language dropdown menu (go-gitea#25986) parseScope with owner/repo always sets owner to zero (go-gitea#25987) Bump github.com/golang-jwt/jwt to v5 (go-gitea#25975) Update path related documents (go-gitea#25417) Update djlint, enable H026 and T027 (go-gitea#25980) [skip ci] Updated translations via Crowdin Show the mismatched ROOT_URL warning on the sign-in page if OAuth2 is enabled (go-gitea#25947) Refactor "Content" for file uploading (go-gitea#25851) Fix SSPI auth panic (go-gitea#25955) Make pending commit status yellow again (go-gitea#25935) Move public asset files to the proper directory (go-gitea#25907) Disallow dangerous url schemes (go-gitea#25960) Avoid creating directories when loading config (go-gitea#25944)
Move
public/*
topublic/assets/*
Some old PRs (like #15219) introduced inconsistent directory system.
For example: why the local directory "public" is accessed by
http://site/assets
? How to serve the ".well-known" files properly in the public directory?For convention rules, the "public" directory is widely used for the website's root directory. It shouldn't be an exception for Gitea.
So, this PR makes the things consistent:
http://site/assets/foo
means{CustomPath}/public/assets/foo
.{CustomPath}/public/.well-known
and{CustomPath}/public/robots.txt
can be used in the future.This PR is also a prerequisite for a clear solution for:
This PR is breaking for users who have custom "public" files (CSS/JS). After getting approvals, I will update the documents.
If you have files in your "custom/public/" folder, please move them to "custom/public/assets/".