Skip to content
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

Merged
merged 9 commits into from Jul 18, 2023

Conversation

wxiaoguang
Copy link
Contributor

@wxiaoguang wxiaoguang commented Jul 16, 2023

Move public/* to public/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.


⚠️ BREAKING ⚠️

If you have files in your "custom/public/" folder, please move them to "custom/public/assets/".

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jul 16, 2023
@wxiaoguang wxiaoguang added the pr/breaking Merging this PR means builds will break. Needs a description what exactly breaks, and how to fix it! label Jul 16, 2023
@wxiaoguang wxiaoguang added this to the 1.21.0 milestone Jul 16, 2023
@pull-request-size pull-request-size bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jul 16, 2023
@silverwind
Copy link
Member

Good change, thanks.

.gitignore Outdated Show resolved Hide resolved
@silverwind
Copy link
Member

There are many references to public/img in docs which need to be updated. Unfortunately, I think this is also breaking for all customization images.

@wxiaoguang
Copy link
Contributor Author

There are many references to public/img in docs which need to be updated.

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.

@wxiaoguang
Copy link
Contributor Author

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)

@delvh delvh added the type/refactoring Existing code has been cleaned up. There should be no new functionality. label Jul 16, 2023
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Jul 16, 2023
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jul 16, 2023
@wxiaoguang wxiaoguang added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Jul 18, 2023
@silverwind silverwind merged commit faa28b5 into go-gitea:main Jul 18, 2023
24 checks passed
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Jul 18, 2023
@wxiaoguang wxiaoguang deleted the move-public-assets branch July 18, 2023 16:13
silverwind added a commit to silverwind/gitea that referenced this pull request Jul 18, 2023
* 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
zjjhot added a commit to zjjhot/gitea that referenced this pull request Jul 20, 2023
* 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)
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Oct 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. pr/breaking Merging this PR means builds will break. Needs a description what exactly breaks, and how to fix it! size/L Denotes a PR that changes 100-499 lines, ignoring generated files. type/refactoring Existing code has been cleaned up. There should be no new functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants