Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ bundle exec jekyll serve --livereload

## Docsy Jekyll Template

* [Source on Github](https://github.com/vsoch/docsy-jekyll)
* [View on Github Pages](https://vsoch.github.io/docsy-jekyll/)
* [Source on GitHub](https://github.com/vsoch/docsy-jekyll)
* [View on GitHub Pages](https://vsoch.github.io/docsy-jekyll/)
2 changes: 1 addition & 1 deletion tavern/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ var (
EnvOAuthClientSecret = EnvString{"OAUTH_CLIENT_SECRET", ""}
EnvOAuthDomain = EnvString{"OAUTH_DOMAIN", ""}

// EnvMySQLAddr defines the MySQL address to connect to, if unset SQLLite is used.
// EnvMySQLAddr defines the MySQL address to connect to, if unset SQLite is used.
// EnvMySQLNet defines the network used to connect to MySQL (e.g. unix).
// EnvMySQLUser defines the MySQL user to authenticate as.
// EnvMySQLPasswd defines the password for the MySQL user to authenticate with.
Expand Down
4 changes: 2 additions & 2 deletions tavern/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func TestConfigureMySQLFromEnv(t *testing.T) {
require.NoError(t, os.Unsetenv(EnvDBMaxConnLifetime.Key))
}

t.Run("SQLLite", func(t *testing.T) {
t.Run("SQLite", func(t *testing.T) {
defer cleanup()

cfg := &Config{}
Expand Down Expand Up @@ -80,7 +80,7 @@ func TestConfigureMySQLFromEnv(t *testing.T) {
assert.Equal(t, "root@tcp(127.0.0.1)/tavern?parseTime=true", cfg.mysqlDSN)
})

t.Run("SQLLite", func(t *testing.T) {
t.Run("SQLite", func(t *testing.T) {
defer cleanup()
require.NoError(t, os.Setenv(EnvDBMaxIdleConns.Key, "1337"))
require.NoError(t, os.Setenv(EnvDBMaxOpenConns.Key, "420"))
Expand Down
8 changes: 4 additions & 4 deletions tavern/internal/cdn/download_link.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package cdn

import (
"bytes"
"net/http"
"log/slog"
"net/http"
"strings"
"time"

Expand Down Expand Up @@ -55,15 +55,15 @@ func NewLinkDownloadHandler(graph *ent.Client, prefix string) http.Handler {
if l.DownloadLimit != nil {
downloadLimit = *l.DownloadLimit
}
if downloadLimit > 0 && l.Downloads >= downloadLimit {
if downloadLimit > 0 && l.Downloads >= downloadLimit {
slog.Info("Failed attempt to download link, maximum downloads reached", "path", linkPath, "downloads", l.Downloads, "download_limit", l.DownloadLimit)
return ErrFileNotFound
}

// Increment Link Downloads
if _, err := graph.Link.UpdateOne(l).
SetDownloads(l.Downloads + 1).
Save(ctx); err != nil {
SetDownloads(l.Downloads + 1).
Save(ctx); err != nil {
slog.Error("failed to increment downloads for link", "path", linkPath, "downloads", l.Downloads, "err", err)

// Only error if a download limit is enforced
Expand Down
6 changes: 3 additions & 3 deletions tavern/internal/ent/schema/link_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ func TestCreateLinkWithExplicitExpiresAt(t *testing.T) {
futureTime := time.Now().Add(24 * time.Hour)
downloadLimit := 5
input := ent.CreateLinkInput{
AssetID: asset.ID,
DownloadLimit: &downloadLimit,
ExpiresAt: &futureTime,
AssetID: asset.ID,
DownloadLimit: &downloadLimit,
ExpiresAt: &futureTime,
}

link, err := graph.Link.Create().SetInput(input).Save(ctx)
Expand Down
11 changes: 5 additions & 6 deletions tavern/internal/redirectors/tls.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ func tryACME(ctx context.Context, host string) (tlsCfg *tls.Config, err error) {
slog.Debug("redirectors: using short lived certificates")
}
acme := certmagic.ACMEIssuer{
Agreed: true,
Email: "",
CA: certmagic.LetsEncryptProductionCA,
Agreed: true,
Email: "",
CA: certmagic.LetsEncryptProductionCA,
Profile: profile,
}

Expand Down Expand Up @@ -85,9 +85,8 @@ func selfSignedTLSConfig(host string) (*tls.Config, error) {
}

template := x509.Certificate{
SerialNumber: serialNumber,
Subject: pkix.Name{
},
SerialNumber: serialNumber,
Subject: pkix.Name{},
NotBefore: time.Now(),
NotAfter: time.Now().Add(365 * 24 * time.Hour),
KeyUsage: x509.KeyUsageDigitalSignature | x509.KeyUsageKeyEncipherment,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ const StepAddDeploymentKey: FC<StepAddDeploymentKeyProps> = ({ setCurrStep, newR
To import tomes, you need to give Realm access to your git repository. Copy the public key below into your repositories deployment keys, often found in admin settings.
</p>
<ul className="text-sm list-disc px-4 py-2">
<li>Setup for <a className="external-link" rel="noreferrer" target="_blank" href="https://docs.github.com/en/authentication/connecting-to-github-with-ssh/managing-deploy-keys#set-up-deploy-keys">Github</a></li>
<li>Setup for <a className="external-link" rel="noreferrer" target="_blank" href="https://docs.gitlab.com/ee/user/project/deploy_keys/#create-a-project-deploy-key">Gitlab</a></li>
<li>Setup for <a className="external-link" rel="noreferrer" target="_blank" href="https://docs.github.com/en/authentication/connecting-to-github-with-ssh/managing-deploy-keys#set-up-deploy-keys">GitHub</a></li>
<li>Setup for <a className="external-link" rel="noreferrer" target="_blank" href="https://docs.gitlab.com/ee/user/project/deploy_keys/#create-a-project-deploy-key">GitLab</a></li>
<li>Setup for <a className="external-link" rel="noreferrer" target="_blank" href="https://bitbucket.org/blog/deployment-keys">Bitbucket</a></li>
</ul>
</div>
Expand Down
Loading