Merge branch 'main' into main

This commit is contained in:
6543 2023-03-21 01:33:33 +00:00
commit 4e60a72236
4 changed files with 16 additions and 3 deletions

View File

@ -1,5 +1,11 @@
# Codeberg Pages
[![License: EUPL-1.2](https://img.shields.io/badge/License-EUPL--1.2-blue)](https://opensource.org/license/eupl-1-2/)
[![status-badge](https://ci.codeberg.org/api/badges/Codeberg/pages-server/status.svg)](https://ci.codeberg.org/Codeberg/pages-server)
<a href="https://matrix.to/#/#gitea-pages-server:matrix.org" title="Join the Matrix room at https://matrix.to/#/#gitea-pages-server:matrix.org">
<img src="https://img.shields.io/matrix/gitea-pages-server:matrix.org?label=matrix">
</a>
Gitea lacks the ability to host static pages from Git.
The Codeberg Pages Server addresses this lack by implementing a standalone service
that connects to Gitea via API.
@ -8,6 +14,9 @@ It is suitable to be deployed by other Gitea instances, too, to offer static pag
**End user documentation** can mainly be found at the [Wiki](https://codeberg.org/Codeberg/pages-server/wiki/Overview)
and the [Codeberg Documentation](https://docs.codeberg.org/codeberg-pages/).
<a href="https://codeberg.org/Codeberg/pages-server"> <img src="https://codeberg.org/Codeberg/GetItOnCodeberg/raw/branch/main/get-it-on-blue-on-white.svg" alt="Get It On Codeberg" width="250"/> <a/>
## Quickstart
This is the new Codeberg Pages server, a solution for serving static pages from Gitea repositories.
@ -29,6 +38,10 @@ record that points to your repo (just like the CNAME record):
Certificates are generated, updated and cleaned up automatically via Let's Encrypt through a TLS challenge.
## Chat for admins & devs
[matrix: #gitea-pages-server:matrix.org](https://matrix.to/#/#gitea-pages-server:matrix.org)
## Deployment
**Warning: Some Caveats Apply**

View File

@ -124,7 +124,7 @@ func TestRawCustomDomain(t *testing.T) {
}
func TestRawIndex(t *testing.T) {
log.Println("=== TestRawCustomDomain ===")
log.Println("=== TestRawIndex ===")
// test raw domain response for index.html
resp, err := getTestHTTPSClient().Get("https://raw.localhost.mock.directory:4430/cb_pages_tests/raw-test/@branch-test/index.html") // need cb_pages_tests fork
assert.NoError(t, err)

View File

@ -64,7 +64,7 @@ func (x xDB) Put(domain string, cert *certificate.Resource) error {
}
defer sess.Close()
if exist, _ := sess.ID(c.Domain).Exist(); exist {
if exist, _ := sess.ID(c.Domain).Exist(new(Cert)); exist {
if _, err := sess.ID(c.Domain).Update(c); err != nil {
return err
}

View File

@ -37,7 +37,7 @@ func TestSanitizeWildcardCerts(t *testing.T) {
}))
// update existing cert
assert.Error(t, certDB.Put(".wildcard.de", &certificate.Resource{
assert.NoError(t, certDB.Put(".wildcard.de", &certificate.Resource{
Domain: "*.wildcard.de",
Certificate: localhost_mock_directory_certificate,
}))