Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
wildcard hostname vs url
  • Loading branch information
Emyrk committed Apr 4, 2023
commit cce8a7da2a0b1851aee5d52c3e6cb691f2fb5dc8
6 changes: 3 additions & 3 deletions coderd/apidoc/docs.go

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

6 changes: 3 additions & 3 deletions coderd/apidoc/swagger.json

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

20 changes: 10 additions & 10 deletions coderd/database/dbfake/databasefake.go
Original file line number Diff line number Diff line change
Expand Up @@ -4988,15 +4988,15 @@ func (q *fakeQuerier) InsertWorkspaceProxy(_ context.Context, arg database.Inser
}

p := database.WorkspaceProxy{
ID: arg.ID,
OrganizationID: arg.OrganizationID,
Name: arg.Name,
Icon: arg.Icon,
Url: arg.Url,
WildcardUrl: arg.WildcardUrl,
CreatedAt: arg.CreatedAt,
UpdatedAt: arg.UpdatedAt,
Deleted: false,
ID: arg.ID,
OrganizationID: arg.OrganizationID,
Name: arg.Name,
Icon: arg.Icon,
Url: arg.Url,
WildcardHostname: arg.WildcardHostname,
CreatedAt: arg.CreatedAt,
UpdatedAt: arg.UpdatedAt,
Deleted: false,
}
q.workspaceProxies = append(q.workspaceProxies, p)
return p, nil
Expand All @@ -5011,7 +5011,7 @@ func (q *fakeQuerier) UpdateWorkspaceProxy(_ context.Context, arg database.Updat
p.Name = arg.Name
p.Icon = arg.Icon
p.Url = arg.Url
p.WildcardUrl = arg.WildcardUrl
p.WildcardHostname = arg.WildcardHostname
p.UpdatedAt = database.Now()
q.workspaceProxies[i] = p
return p, nil
Expand Down
18 changes: 9 additions & 9 deletions coderd/database/dbgen/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,15 +328,15 @@ func WorkspaceResourceMetadatums(t testing.TB, db database.Store, seed database.

func WorkspaceProxy(t testing.TB, db database.Store, orig database.WorkspaceProxy) database.WorkspaceProxy {
resource, err := db.InsertWorkspaceProxy(context.Background(), database.InsertWorkspaceProxyParams{
ID: takeFirst(orig.ID, uuid.New()),
OrganizationID: takeFirst(orig.OrganizationID, uuid.New()),
Name: takeFirst(orig.Name, namesgenerator.GetRandomName(1)),
DisplayName: takeFirst(orig.DisplayName, namesgenerator.GetRandomName(1)),
Icon: takeFirst(orig.Icon, namesgenerator.GetRandomName(1)),
Url: takeFirst(orig.Url, fmt.Sprintf("https://%s.com", namesgenerator.GetRandomName(1))),
WildcardUrl: takeFirst(orig.WildcardUrl, fmt.Sprintf("https://*.%s.com", namesgenerator.GetRandomName(1))),
CreatedAt: takeFirst(orig.CreatedAt, database.Now()),
UpdatedAt: takeFirst(orig.UpdatedAt, database.Now()),
ID: takeFirst(orig.ID, uuid.New()),
OrganizationID: takeFirst(orig.OrganizationID, uuid.New()),
Name: takeFirst(orig.Name, namesgenerator.GetRandomName(1)),
DisplayName: takeFirst(orig.DisplayName, namesgenerator.GetRandomName(1)),
Icon: takeFirst(orig.Icon, namesgenerator.GetRandomName(1)),
Url: takeFirst(orig.Url, fmt.Sprintf("https://%s.com", namesgenerator.GetRandomName(1))),
WildcardHostname: takeFirst(orig.WildcardHostname, fmt.Sprintf(".%s.com", namesgenerator.GetRandomName(1))),
CreatedAt: takeFirst(orig.CreatedAt, database.Now()),
UpdatedAt: takeFirst(orig.UpdatedAt, database.Now()),
})
require.NoError(t, err, "insert app")
return resource
Expand Down
4 changes: 2 additions & 2 deletions coderd/database/dump.sql

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

4 changes: 2 additions & 2 deletions coderd/database/migrations/000113_workspace_proxy.up.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ CREATE TABLE workspace_proxies (
display_name text NOT NULL,
icon text NOT NULL,
url text NOT NULL,
wildcard_url text NOT NULL,
wildcard_hostname text NOT NULL,
created_at timestamp with time zone NOT NULL,
updated_at timestamp with time zone NOT NULL,
deleted boolean NOT NULL,
Expand All @@ -15,7 +15,7 @@ CREATE TABLE workspace_proxies (
);

COMMENT ON COLUMN workspace_proxies.url IS 'Full url including scheme of the proxy api url: https://us.example.com';
COMMENT ON COLUMN workspace_proxies.wildcard_url IS 'URL with the wildcard for subdomain based app hosting: https://*.us.example.com';
COMMENT ON COLUMN workspace_proxies.wildcard_hostname IS 'Hostname with the wildcard for subdomain based app hosting: *.us.example.com';


-- Enforces no active proxies have the same name.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
INSERT INTO workspace_proxies
(id, organization_id, name, display_name, icon, url, wildcard_url, created_at, updated_at, deleted)
(id, organization_id, name, display_name, icon, url, wildcard_hostname, created_at, updated_at, deleted)
VALUES
(
'cf8ede8c-ff47-441f-a738-d92e4e34a657',
Expand All @@ -8,7 +8,7 @@ VALUES
'United States',
'/emojis/us.png',
'https://us.coder.com',
'https://*.us.coder.com',
'*.us.coder.com',
'2023-03-30 12:00:00.000+02',
'2023-03-30 12:00:00.000+02',
false
Expand Down
50 changes: 25 additions & 25 deletions coderd/database/models.go

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

2 changes: 1 addition & 1 deletion coderd/database/querier.go

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

Loading