mirror of
https://codeberg.org/Codeberg/pages-server.git
synced 2025-01-19 17:07:54 +00:00
readd err debug
This commit is contained in:
commit
bcb7d773d1
2 changed files with 8 additions and 2 deletions
|
@ -70,7 +70,7 @@ and especially have a look at [this section of the haproxy.cfg](https://codeberg
|
||||||
- `ENABLE_HTTP_SERVER` (default: false): Set this to true to enable the HTTP-01 challenge and redirect all other HTTP requests to HTTPS. Currently only works with port 80.
|
- `ENABLE_HTTP_SERVER` (default: false): Set this to true to enable the HTTP-01 challenge and redirect all other HTTP requests to HTTPS. Currently only works with port 80.
|
||||||
- `DNS_PROVIDER` (default: use self-signed certificate): Code of the ACME DNS provider for the main domain wildcard.
|
- `DNS_PROVIDER` (default: use self-signed certificate): Code of the ACME DNS provider for the main domain wildcard.
|
||||||
See https://go-acme.github.io/lego/dns/ for available values & additional environment variables.
|
See https://go-acme.github.io/lego/dns/ for available values & additional environment variables.
|
||||||
- `DEBUG` (default: false): Set this to true to enable debug logging.
|
- `LOG_LEVEL` (default: warn): Set this to specify the level of logging.
|
||||||
|
|
||||||
|
|
||||||
## Contributing to the development
|
## Contributing to the development
|
||||||
|
|
|
@ -5,16 +5,21 @@ import (
|
||||||
"path"
|
"path"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/rs/zerolog/log"
|
||||||
|
|
||||||
"codeberg.org/codeberg/pages/server/gitea"
|
"codeberg.org/codeberg/pages/server/gitea"
|
||||||
)
|
)
|
||||||
|
|
||||||
// GetBranchTimestamp finds the default branch (if branch is "") and returns the last modification time of the branch
|
// GetBranchTimestamp finds the default branch (if branch is "") and returns the last modification time of the branch
|
||||||
// (or nil if the branch doesn't exist)
|
// (or nil if the branch doesn't exist)
|
||||||
func GetBranchTimestamp(giteaClient *gitea.Client, owner, repo, branch string) *gitea.BranchTimestamp {
|
func GetBranchTimestamp(giteaClient *gitea.Client, owner, repo, branch string) *gitea.BranchTimestamp {
|
||||||
|
log := log.With().Strs("BranchInfo", []string{owner, repo, branch}).Logger()
|
||||||
|
|
||||||
if len(branch) == 0 {
|
if len(branch) == 0 {
|
||||||
// Get default branch
|
// Get default branch
|
||||||
defaultBranch, err := giteaClient.GiteaGetRepoDefaultBranch(owner, repo)
|
defaultBranch, err := giteaClient.GiteaGetRepoDefaultBranch(owner, repo)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
log.Error().Err(err).Msg("GiteaGetRepoDefaultBranch")
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
branch = defaultBranch
|
branch = defaultBranch
|
||||||
|
@ -22,6 +27,7 @@ func GetBranchTimestamp(giteaClient *gitea.Client, owner, repo, branch string) *
|
||||||
|
|
||||||
timestamp, err := giteaClient.GiteaGetRepoBranchTimestamp(owner, repo, branch)
|
timestamp, err := giteaClient.GiteaGetRepoBranchTimestamp(owner, repo, branch)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
log.Error().Err(err).Msg("GiteaGetRepoBranchTimestamp")
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return timestamp
|
return timestamp
|
||||||
|
|
Loading…
Reference in a new issue