Skip to content

Commit e56ed09

Browse files
[server] Use content-service
1 parent 376ea27 commit e56ed09

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+4460
-432
lines changed

chart/config/proxy/lib.gitpod-plugins.conf

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,22 +39,18 @@ proxy_set_header Content-Type '*/*';
3939

4040
if ($action = preflight) {
4141
set $targetUrl "no-url";
42-
access_by_lua_block {
42+
rewrite_by_lua_block {
4343
url = "/plugins-preflight?type=" .. ngx.var.type .. "&" .. ngx.var.api_key_encoded .. "&" .. ngx.var.qs;
4444
response = ngx.location.capture(url);
4545
if response.status == ngx.HTTP_OK then
4646
ngx.var.targetUrl = response.body;
47+
ngx.log(ngx.ERR, " redirect to " .. ngx.var.targetUrl);
48+
return ngx.redirect(ngx.var.targetUrl, 307);
4749
else
4850
ngx.log(ngx.ERR, "Bad Request: /plugins/preflight returned with code " .. response.status)
4951
return ngx.exit(400)
5052
end
5153
}
52-
53-
log_by_lua_block {
54-
ngx.log(ngx.ERR, " proxy_pass to " .. ngx.var.targetUrl)
55-
}
56-
57-
proxy_pass $targetUrl;
5854
}
5955

6056
if ($action = checkin) {

chart/config/proxy/lib.locations.conf

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -128,23 +128,19 @@ location /code-sync {
128128
location /workspace-download {
129129
set $qs "${request_uri}";
130130
set $targetUrl "no-url";
131-
access_by_lua_block {
132-
url = "/internal-wsdl/" .. ngx.var.qs;
133-
response = ngx.location.capture(url);
131+
rewrite_by_lua_block {
132+
local url = "/internal-wsdl/" .. ngx.var.qs;
133+
local response = ngx.location.capture(url);
134134
if response.status == ngx.HTTP_OK then
135135
ngx.var.targetUrl = response.body;
136+
ngx.log(ngx.ERR, " redirect to " .. ngx.var.targetUrl);
137+
return ngx.redirect(ngx.var.targetUrl, 303);
136138
else
137139
ngx.log(ngx.ERR, "Bad Request: /workspace-download/get returned with code " .. response.status)
138140
return ngx.exit(400)
139141
end
140142
}
141143

142-
log_by_lua_block {
143-
ngx.log(ngx.ERR, " proxy_pass to " .. ngx.var.targetUrl)
144-
}
145-
146-
proxy_pass $targetUrl;
147-
148144
# Google wants to see */* as content type due to the way we sign the URLs.
149145
proxy_set_header content-type "*/*";
150146
# The browser needs to see the correct archive content type to trigger the download.

chart/templates/server-deployment.yaml

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,6 @@ spec:
8484
privileged: false
8585
runAsUser: 31001
8686
volumeMounts:
87-
{{- if $comp.storage }}
88-
- name: storage-key
89-
mountPath: "/storageKeySecret"
90-
readOnly: true
91-
{{- end }}
9287
{{- if $comp.github.app }}
9388
- name: github-app-cert-secret
9489
mountPath: "/github-app-cert"
@@ -163,20 +158,6 @@ spec:
163158
{{- end }}
164159
- name: SESSION_SECRET
165160
value: {{ $comp.sessionSecret | quote }}
166-
{{- if eq .Values.components.contentService.remoteStorage.kind "minio" }}
167-
- name: GITPOD_STORAGE_CLIENT
168-
value: minio
169-
- name: MINIO_END_POINT
170-
value: minio.{{ .Release.Namespace }}.svc.cluster.local
171-
- name: MINIO_PORT
172-
value: "9000"
173-
- name: MINIO_ACCESS_KEY
174-
value: {{ .Values.minio.accessKey }}
175-
- name: MINIO_SECRET_KEY
176-
value: {{ .Values.minio.secretKey }}
177-
- name: MINIO_REGION
178-
value: {{ .Values.minio.region }}
179-
{{- end }}
180161
{{- if .Values.components.workspace.localTheia }}
181162
- name: LOCAL_THEIA
182163
value: "true"
@@ -213,29 +194,12 @@ spec:
213194
secretKeyRef:
214195
name: server-proxy-apikey
215196
key: apikey
216-
{{- if (or .Values.components.contentService.remoteStorage.gcloud $comp.storage) }}
217-
- name: GCLOUD_PROJECT_ID
218-
value: {{ .Values.components.contentService.remoteStorage.gcloud.projectId }}
219-
- name: GCLOUD_REGION
220-
value: {{ .Values.components.contentService.remoteStorage.gcloud.region }}
221-
- name: GCLOUD_CREDENTIALS_FILE
222-
{{- if .Values.components.contentService.remoteStorage.gcloud.credentialsFile }}
223-
value: {{ base .Values.components.contentService.remoteStorage.gcloud.credentialsFile }}
224-
{{- else }}
225-
value: key.json
226-
{{- end }}
227-
{{- end }}
228197
- name: GITPOD_GARBAGE_COLLECTION_DISABLED
229198
value: {{ $comp.garbageCollection.disabled | default "false" | quote }}
230199
{{- if $comp.serverContainer.env }}
231200
{{ toYaml $comp.serverContainer.env | indent 8 }}
232201
{{- end }}
233202
volumes:
234-
{{- if $comp.storage.secretName }}
235-
- name: storage-key
236-
secret:
237-
secretName: {{ $comp.storage.secretName }}
238-
{{- end }}
239203
{{- if $comp.github.app }}
240204
- name: github-app-cert-secret
241205
secret:
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Copyright (c) 2020 TypeFox GmbH. All rights reserved.
2+
// Licensed under the GNU Affero General Public License (AGPL).
3+
// See License-AGPL.txt in the project root for license information.
4+
5+
syntax = "proto3";
6+
7+
package contentservice;
8+
9+
option go_package = "github.com/gitpod-io/gitpod/content-service/api";
10+
11+
service ContentService {
12+
// DeleteUserContent deletes all content associated with a user.
13+
rpc DeleteUserContent(DeleteUserContentRequest) returns (DeleteUserContentResponse) {};
14+
}
15+
16+
message DeleteUserContentRequest {
17+
string owner_id = 1;
18+
}
19+
message DeleteUserContentResponse {}

components/content-service-api/go/content.pb.go

Lines changed: 206 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)