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

Run hugo via go run and lock its version #22206

Merged
merged 5 commits into from
Dec 22, 2022

Conversation

silverwind
Copy link
Member

@silverwind silverwind commented Dec 21, 2022

  • Don't rely on obscure docker images like plugins/hugo
  • Lock down hugo to same version the image had used
  • Remove unnecessary verbosity in trans-copy
  • Rename trans-copy to trans-copy.sh

@silverwind silverwind added topic/build PR changes how Gitea is built, i.e. regarding Docker or the Makefile type/docs This PR mainly updates/creates documentation skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. labels Dec 21, 2022
@silverwind
Copy link
Member Author

silverwind commented Dec 21, 2022

Note, this does upgrade hugo from v0.70.0 to v0.108.0 as apparently the image hasn't upgraded it since over two years.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Dec 21, 2022
@silverwind
Copy link
Member Author

silverwind commented Dec 21, 2022

Locking to same hugo version as I'm not motivated to find out what hugo broke and docs are not viewable locally for some reason (docs/public/index.html redirects to https://docs.gitea.io but even when I remove the redirect, nothing renders).

.drone.yml Outdated Show resolved Hide resolved
@techknowlogick techknowlogick added this to the 1.19.0 milestone Dec 21, 2022
@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 Dec 21, 2022
@jolheiser
Copy link
Member

jolheiser commented Dec 21, 2022

We will need to find a version of Hugo without any replace directives in the go.mod, otherwise we cannot directly go run it.

Looks like v0.81.0 is the first to have a clean module.

docs/Makefile Outdated Show resolved Hide resolved
Co-authored-by: John Olheiser <john+github@jolheiser.com>
@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 Dec 22, 2022
@techknowlogick techknowlogick merged commit 3affb02 into go-gitea:main Dec 22, 2022
@silverwind
Copy link
Member Author

silverwind commented Dec 22, 2022

There is a checksum mismatch in https://drone.gitea.io/go-gitea/gitea/64798/4/5. Wonder how that is even possible, is sum.golang.org broken? It does not reproduce locally.

go run github.com/gohugoio/hugo@v0.81.0 --baseURL="/" --cleanDestinationDir
go: downloading github.com/gohugoio/hugo v0.81.0
go: github.com/gohugoio/hugo@v0.81.0: github.com/gohugoio/hugo@v0.81.0: verifying module: checksum mismatch

	downloaded: h1:zToI15wYh6oh4SRAaoy39XixwmiPB0DZDjsgu9szknY=
	sum.golang.org: h1:PX8TYe1nrWOOMBWtQ/YvKs6QRrOjC5/RrZGE4tBb6EE=

SECURITY ERROR
This download does NOT match the one reported by the checksum server.
The bits may have been replaced on the origin server, or an attacker may
have intercepted the download attempt.

@silverwind silverwind deleted the hugorun branch December 22, 2022 07:47
@silverwind
Copy link
Member Author

silverwind commented Dec 22, 2022

Might have something to do with GOPROXY, these fail:

go clean -modcache && GOPROXY=https://goproxy.io go run github.com/gohugoio/hugo@v0.81.0 --help
go clean -modcache && GOPROXY=direct go run github.com/gohugoio/hugo@v0.81.0 --help

This works:

go clean -modcache && GOPROXY=proxy.golang.org go run github.com/gohugoio/hugo@v0.81.0 --help

Next version also works:

go clean -modcache && GOPROXY=direct go run github.com/gohugoio/hugo@v0.82.0 --help

Edit: Apparently it is related to hugo's release process where some releases are just dysfunctional.

lunny pushed a commit that referenced this pull request Dec 22, 2022
See
#22206 (comment).
Apparently hugo 0.81.0 is a broken release in regards to checksums.

https://github.com/gohugoio/hugo/releases/tag/v0.82.0

Co-authored-by: Lauris BH <lauris@nix.lv>
zjjhot added a commit to zjjhot/gitea that referenced this pull request Dec 23, 2022
* giteaoffical/main: (32 commits)
  Hide file borders on sticky diff box (go-gitea#22217)
  Test views of LFS files (go-gitea#22196)
  update docs latest to 1.17.4
  Frontport 1.17.4 changelog (go-gitea#22216)
  Remove test session cache to reduce possible concurrent problem (go-gitea#22199)
  Upgrade hugo to 0.82 (go-gitea#22209)
  Fix container layer display overflow (go-gitea#22208)
  Run hugo via `go run` and lock its version (go-gitea#22206)
  Update bleve and zapx to fix unaligned atomic (go-gitea#22031)
  Allow empty assignees on pull request edit (go-gitea#22150)
  Add Feed for Releases and Tags (go-gitea#21696)
  fix: update libcurl in docs pipeline (go-gitea#22203)
  Fixed colour transparency regex matching in project board sorting (go-gitea#22091) (go-gitea#22092)
  Mobile fix for Project view: Add delay to Sortable.js on mobile, to ensure scrolling is possible. (go-gitea#22152)
  Normalize NuGet package version on upload (go-gitea#22186)
  Attempt to fix TestExportUserGPGKeys (go-gitea#22159)
  Specify ID in `TestAPITeam` (go-gitea#22192)
  Repair LFS web rendering. (go-gitea#22195)
  Fix misc whitespace issues in install docs (go-gitea#22189)
  Update JS dependencies and eslint (go-gitea#22190)
  ...
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 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. skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. topic/build PR changes how Gitea is built, i.e. regarding Docker or the Makefile type/docs This PR mainly updates/creates documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants