···10971097 })
10981098 conn.ExecContext(ctx, "pragma foreign_keys = on;")
1099109911001100+ // knots may report the combined patch for a comparison, we can store that on the appview side
11011101+ // (but not on the pds record), because calculating the combined patch requires a git index
11021102+ runMigration(conn, logger, "add-combined-column-submissions", func(tx *sql.Tx) error {
11031103+ _, err := tx.Exec(`
11041104+ alter table pull_submissions add column combined text;
11051105+ `)
11061106+ return err
11071107+ })
11081108+11001109 return &DB{
11011110 db,
11021111 logger,
···11+package validator
22+33+import (
44+ "fmt"
55+ "strings"
66+77+ "tangled.org/core/patchutil"
88+)
99+1010+func (v *Validator) ValidatePatch(patch *string) error {
1111+ if patch == nil || *patch == "" {
1212+ return fmt.Errorf("patch is empty")
1313+ }
1414+1515+ // add newline if not present to diff style patches
1616+ if !patchutil.IsFormatPatch(*patch) && !strings.HasSuffix(*patch, "\n") {
1717+ *patch = *patch + "\n"
1818+ }
1919+2020+ if err := patchutil.IsPatchValid(*patch); err != nil {
2121+ return err
2222+ }
2323+2424+ return nil
2525+}
+2-1
docs/knot-hosting.md
···3939```
40404141Next, move the `knot` binary to a location owned by `root` --
4242-`/usr/local/bin/knot` is a good choice:
4242+`/usr/local/bin/` is a good choice. Make sure the binary itself is also owned by `root`:
43434444```
4545sudo mv knot /usr/local/bin/knot
4646+sudo chown root:root /usr/local/bin/knot
4647```
47484849This is necessary because SSH `AuthorizedKeysCommand` requires [really