[mirror] Scalable static site server for Git forges (like GitHub Pages)
at v0.1.0 2.3 kB view raw
1edition = "2023"; 2 3option go_package = "codeberg.org/git-pages/git-pages/git_pages"; 4 5enum Type { 6 // Invalid entry. 7 Invalid = 0; 8 // Directory. 9 Directory = 1; 10 // Inline file. `Blob.Data` contains file contents. 11 InlineFile = 2; 12 // External file. `Blob.Data` contains object reference. 13 ExternalFile = 3; 14 // Symlink. `Blob.Data` contains relative path. 15 Symlink = 4; 16} 17 18enum Transform { 19 // No transformation. 20 None = 0; 21 // Zstandard compression. 22 Zstandard = 1; 23} 24 25message Entry { 26 Type type = 1; 27 // Only present for `type == InlineFile` and `type == ExternalFile`. 28 // For transformed entries, refers to the post-transformation (compressed) size. 29 int64 size = 2; 30 // Meaning depends on `type`: 31 // * If `type == InlineFile`, contains file data. 32 // * If `type == ExternalFile`, contains blob name (an otherwise unspecified 33 // cryptographically secure content hash). 34 // * If `type == Symlink`, contains link target. 35 // * Otherwise not present. 36 bytes data = 3; 37 // Only present for `type == InlineFile` and `type == ExternalFile` that 38 // have been transformed. 39 Transform transform = 4; 40 // Only present for `type == InlineFile` and `type == ExternalFile`. 41 // Currently, optional (not present on certain legacy manifests). 42 string content_type = 5; 43} 44 45// See https://docs.netlify.com/manage/routing/redirects/overview/ for details. 46// Only a subset of the Netlify specification is representable here. 47message RedirectRule { 48 string from = 1; 49 string to = 2; 50 uint32 status = 3; 51 bool force = 4; 52} 53 54// See https://docs.netlify.com/manage/routing/headers/ for details. 55message Header { 56 string name = 1; 57 repeated string values = 2; 58} 59 60message HeaderRule { 61 string path = 1; 62 repeated Header header_map = 2; 63} 64 65message Problem { 66 string path = 1; 67 string cause = 2; 68} 69 70message Manifest { 71 // Source metadata 72 string repo_url = 1; 73 string branch = 2; 74 string commit = 3; 75 76 // Contents 77 map<string, Entry> contents = 4; 78 int64 original_size = 10; // total size of entries before compression 79 int64 compressed_size = 5; // simple sum of each `entry.size` 80 int64 stored_size = 8; // total size of (deduplicated) external objects 81 82 // Netlify-style `_redirects` and `_headers` 83 repeated RedirectRule redirects = 6; 84 repeated HeaderRule headers = 9; 85 86 // Diagnostics for non-fatal errors 87 repeated Problem problems = 7; 88}