Skip to content

[server] Use content-service #3288

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 23, 2021
Merged
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
10 changes: 3 additions & 7 deletions chart/config/proxy/lib.gitpod-plugins.conf
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,18 @@ proxy_set_header Content-Type '*/*';

if ($action = preflight) {
set $targetUrl "no-url";
access_by_lua_block {
rewrite_by_lua_block {
url = "/plugins-preflight?type=" .. ngx.var.type .. "&" .. ngx.var.api_key_encoded .. "&" .. ngx.var.qs;
response = ngx.location.capture(url);
if response.status == ngx.HTTP_OK then
ngx.var.targetUrl = response.body;
ngx.log(ngx.ERR, " redirect to " .. ngx.var.targetUrl);
return ngx.redirect(ngx.var.targetUrl, 307);
else
ngx.log(ngx.ERR, "Bad Request: /plugins/preflight returned with code " .. response.status)
return ngx.exit(400)
end
}

log_by_lua_block {
ngx.log(ngx.ERR, " proxy_pass to " .. ngx.var.targetUrl)
}

proxy_pass $targetUrl;
}

if ($action = checkin) {
Expand Down
14 changes: 5 additions & 9 deletions chart/config/proxy/lib.locations.conf
Original file line number Diff line number Diff line change
Expand Up @@ -121,23 +121,19 @@ location /code-sync {
location /workspace-download {
set $qs "${request_uri}";
set $targetUrl "no-url";
access_by_lua_block {
url = "/internal-wsdl/" .. ngx.var.qs;
response = ngx.location.capture(url);
rewrite_by_lua_block {
local url = "/internal-wsdl/" .. ngx.var.qs;
local response = ngx.location.capture(url);
if response.status == ngx.HTTP_OK then
ngx.var.targetUrl = response.body;
ngx.log(ngx.ERR, " redirect to " .. ngx.var.targetUrl);
return ngx.redirect(ngx.var.targetUrl, 303);
else
ngx.log(ngx.ERR, "Bad Request: /workspace-download/get returned with code " .. response.status)
return ngx.exit(400)
end
}

log_by_lua_block {
ngx.log(ngx.ERR, " proxy_pass to " .. ngx.var.targetUrl)
}

proxy_pass $targetUrl;

# Google wants to see */* as content type due to the way we sign the URLs.
proxy_set_header content-type "*/*";
# The browser needs to see the correct archive content type to trigger the download.
Expand Down
36 changes: 0 additions & 36 deletions chart/templates/server-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,6 @@ spec:
privileged: false
runAsUser: 31001
volumeMounts:
{{- if $comp.storage }}
- name: storage-key
mountPath: "/storageKeySecret"
readOnly: true
{{- end }}
{{- if $comp.github.app }}
- name: github-app-cert-secret
mountPath: "/github-app-cert"
Expand Down Expand Up @@ -163,20 +158,6 @@ spec:
{{- end }}
- name: SESSION_SECRET
value: {{ $comp.sessionSecret | quote }}
{{- if eq .Values.components.contentService.remoteStorage.kind "minio" }}
- name: GITPOD_STORAGE_CLIENT
value: minio
- name: MINIO_END_POINT
value: minio.{{ .Release.Namespace }}.svc.cluster.local
- name: MINIO_PORT
value: "9000"
- name: MINIO_ACCESS_KEY
value: {{ .Values.minio.accessKey }}
- name: MINIO_SECRET_KEY
value: {{ .Values.minio.secretKey }}
- name: MINIO_REGION
value: {{ .Values.minio.region }}
{{- end }}
{{- if .Values.components.workspace.localTheia }}
- name: LOCAL_THEIA
value: "true"
Expand Down Expand Up @@ -213,29 +194,12 @@ spec:
secretKeyRef:
name: server-proxy-apikey
key: apikey
{{- if (or .Values.components.contentService.remoteStorage.gcloud $comp.storage) }}
- name: GCLOUD_PROJECT_ID
value: {{ .Values.components.contentService.remoteStorage.gcloud.projectId }}
- name: GCLOUD_REGION
value: {{ .Values.components.contentService.remoteStorage.gcloud.region }}
- name: GCLOUD_CREDENTIALS_FILE
{{- if .Values.components.contentService.remoteStorage.gcloud.credentialsFile }}
value: {{ base .Values.components.contentService.remoteStorage.gcloud.credentialsFile }}
{{- else }}
value: key.json
{{- end }}
{{- end }}
- name: GITPOD_GARBAGE_COLLECTION_DISABLED
value: {{ $comp.garbageCollection.disabled | default "false" | quote }}
{{- if $comp.serverContainer.env }}
{{ toYaml $comp.serverContainer.env | indent 8 }}
{{- end }}
volumes:
{{- if $comp.storage.secretName }}
- name: storage-key
secret:
secretName: {{ $comp.storage.secretName }}
{{- end }}
{{- if $comp.github.app }}
- name: github-app-cert-secret
secret:
Expand Down
19 changes: 19 additions & 0 deletions components/content-service-api/content.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Copyright (c) 2020 TypeFox GmbH. All rights reserved.
// Licensed under the GNU Affero General Public License (AGPL).
// See License-AGPL.txt in the project root for license information.

syntax = "proto3";

package contentservice;

option go_package = "github.com/gitpod-io/gitpod/content-service/api";

service ContentService {
// DeleteUserContent deletes all content associated with a user.
rpc DeleteUserContent(DeleteUserContentRequest) returns (DeleteUserContentResponse) {};
}

message DeleteUserContentRequest {
string owner_id = 1;
}
message DeleteUserContentResponse {}
206 changes: 206 additions & 0 deletions components/content-service-api/go/content.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading