-
-
Notifications
You must be signed in to change notification settings - Fork 712
Expand file tree
/
Copy pathapp-index.capnp
More file actions
198 lines (171 loc) · 6.52 KB
/
Copy pathapp-index.capnp
File metadata and controls
198 lines (171 loc) · 6.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
# Sandstorm - Personal Cloud Sandbox
# Copyright (c) 2015 Sandstorm Development Group, Inc. and contributors
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
@0xe16c039c931f2a8a;
# The app index is designed to run inside a Sandstorm grain, where it maintains the following
# directory structure:
#
# /var/
# packages/
# <packageId>/ Info about a specific package.
# spk Raw SPK file (immutable).
# metadata Serialized Package.VerifiedInfo (immutable).
# status Serialized SubmissionStatus (mutable).
# apps/
# <appId> Symlink to latest approved package version.
# keybase/
# <keyId> Serialized KeybaseIdentity for a person.
# descriptions Serialized ShortDescriptionOverrides
# www/
# apps/
# index.json JSON of AppIndexForMatker.
# <appId>.json JSON of AppDetailsForMarket for given app.
# images/
# <imageId> An image.
# packages/
# <packageId> Hard link to released SPK.
# tmp/ Temp files staged to be moved elsewhere or deleted.
#
# TODO(cleanup): Currently we actually append file extensions like .json, .svg, and .png to the
# stuff under www, because Sandstorm web publishing depends on it. Eventually we should fix
# web publishing then remove the unnecessary extensions. Note that to keep code changes minimal,
# the JSON files list imageIds that include the extensions. The client must know to add ".json",
# though. Note also that we do NOT add ".spk" to packages currently, because there's no
# particular need.
$import "/capnp/c++.capnp".namespace("sandstorm::appindex");
using Package = import "/sandstorm/package.capnp";
using Grain = import "/sandstorm/grain.capnp";
using Util = import "/sandstorm/util.capnp";
struct AppIndexForMarket {
# Type containing the index of all apps, downloaded by the market at startup.
apps @0 :List(App);
struct App {
appId @0 :Package.AppId;
name @1 :Text; # title
version @2 :Text; # marketing version
packageId @3 :Package.PackageId;
imageId @4 :Text; # Image found at: /images/<imageId>
webLink @5 :Text;
codeLink @6 :Text;
isOpenSource @7 :Bool;
categories @8 :List(Text);
author @9 :Identity;
struct Identity {
name @0 :Text;
keybaseUsername @1 :Text;
picture @2 :Text;
githubUsername @3 :Text;
twitterUsername @4 :Text;
hackernewsUsername @5 :Text;
redditUsername @6 :Text;
}
upstreamAuthor @11 :Text;
shortDescription @10 :Text;
createdAt @12 :Text; # date like "2014-08-21T09:19:29.761Z"
versionNumber @13 :UInt32;
}
}
struct AppDetailsForMarket {
# Type containing detailed information downloaded by the app market when the user browses to a
# specific app page.
description @0 :Text;
screenshots @1 :List(Screenshot);
struct Screenshot {
imageId @0 :Text; # Image found at: /images/<imageId>
width @1 :UInt32;
height @2 :UInt32;
}
license @2 :Text; # name only
}
struct KeybaseIdentity {
# Social identities verified using Keybase.
#
# Unfortunately, Keybase apparently verifies handles and not user IDs for Github, Twitter, etc.
# These services allow users to change their handles. Hopefully, Keybase users will not change
# their handles.
keybaseHandle @0 :Text;
name @1 :Text;
picture @2 :Text;
websites @3 :List(Text);
githubHandles @4 :List(Text);
twitterHandles @5 :List(Text);
hackernewsHandles @6 :List(Text);
redditHandles @7 :List(Text);
}
struct ShortDescriptionOverrides {
# Definition of a file which can be used to override short descriptions. We mainly have this
# because a number of apps were first submitted before short descriptions became required.
items @0 :List(Item);
struct Item {
appId @0 :Text;
shortDescription @1 :Text;
}
}
# ========================================================================================
struct CategoryTable {
categories @0 :List(Package.Category);
}
const appIndexViewInfo :Grain.UiView.ViewInfo = (
permissions = [(name = "approve", title = (defaultText = "approve"),
description = (defaultText = "allows approving apps")),
(name = "review", title = (defaultText = "review"),
description = (defaultText = "allows viewing the submission queue")),
(name = "submit", title = (defaultText = "submit"),
description = (defaultText = "allows submitting apps"))],
roles = [(title = (defaultText = "approver"),
permissions = [true, true, false],
verbPhrase = (defaultText = "can approve"),
default = true),
(title = (defaultText = "reviewer"),
permissions = [false, true, false],
verbPhrase = (defaultText = "can review")),
(title = (defaultText = "submitter"),
permissions = [false, false, true],
verbPhrase = (defaultText = "can submit"))]
);
const approvePermission :UInt32 = 0;
const reviewPermission :UInt32 = 1;
const submitPermission :UInt32 = 2;
const reviewAppHtml :Text = embed "review.html";
const pkgdef :Package.PackageDefinition = (
id = "ghze43a24vg5rck3w5kegeuhu1hy52nh17j8qm7vf40ekc3r5z3h",
manifest = (
appTitle = (defaultText = "Sandstorm App Index"),
appVersion = 5,
appMarketingVersion = (defaultText = "2020-09-17"),
actions = [
( title = (defaultText = "New Sandstorm App Index"),
command = (argv = ["/app-index", "--init"])
)
],
continueCommand = (argv = ["/app-index"]),
metadata = (
author = (contactEmail = "support@sandstorm.io"),
categories = [developerTools],
license = (openSource = apache2),
shortDescription = (defaultText = "App Market")
)
),
fileList = "app-index-sandstorm-files.list",
sourceMap = (
searchPath = [
( packagePath = "app-index", sourcePath = "app-index" ),
( sourcePath = "/", # Then search the system root directory.
hidePaths = [ "home", "proc", "sys" ]
)
]
),
alwaysInclude = ["app-index"]
);