Skip to content
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 1 addition & 2 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ updates:
patterns:
- "*"
- package-ecosystem: "npm"
directory: "/ui/web-v2"
directory: "/ui/dashboard"
schedule:
interval: "monthly"
time: "10:00"
Expand All @@ -39,4 +39,3 @@ updates:
dependencies:
patterns:
- "*"

53 changes: 0 additions & 53 deletions .github/workflows/pr-ui-web.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/publish_chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ on:
- "v*"
paths-ignore:
- "README.md"
- "ui/web-v2/README.md"
- "ui/dashboard/README.md"
- "CLA.md"
- "CONTRIBUTING.md"
- "DEPLOYMENT.md"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/push-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ on:
- "v*"
paths-ignore:
- "README.md"
- "ui/web-v2/README.md"
- "ui/dashboard/README.md"
- "CLA.md"
- "CONTRIBUTING.md"
- "DEPLOYMENT.md"
Expand Down
8 changes: 0 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,6 @@ proto-all: proto-fmt proto-lock-commit proto-go proto-web proto-openapi-gen
proto-go:
make -C proto go

.PHONY: proto-web
proto-web:
make -C ui/web-v2 gen_proto

.PHONY: proto-go-check
proto-go-check:
make -C proto go-check
Expand Down Expand Up @@ -143,16 +139,12 @@ $(GO_APP_BUILD_TARGETS): build-%:

.PHONY: clean-web-console
clean-web-console:
rm -rf ui/web-v2/dist/*
rm -rf ui/dashboard/build/*
touch ui/web-v2/dist/DONT-EDIT-FILES-IN-THIS-DIRECTORY
touch ui/dashboard/build/DONT-EDIT-FILES-IN-THIS-DIRECTORY

.PHONY: build-web-console
build-web-console:
rm -rf ui/web-v2/dist/*
rm -rf ui/dashboard/build/*
make -C ui/web-v2 install build
make -C ui/dashboard install build

.PHONY: build-go
Expand Down
17 changes: 1 addition & 16 deletions docker-compose/config/nginx/bucketeer.conf
Original file line number Diff line number Diff line change
Expand Up @@ -458,22 +458,7 @@ server {
proxy_read_timeout 60s;
}

# Old dashboard endpoints
location /legacy {
proxy_pass https://web_console_backend;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_connect_timeout 15s;
proxy_send_timeout 15s;
proxy_read_timeout 15s;
}

# New dashboard endpoints
# Dashboard endpoints
location / {
proxy_pass https://web_dashboard_backend;
proxy_set_header Host $host;
Expand Down
2 changes: 0 additions & 2 deletions manifests/bucketeer/charts/web/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,6 @@ spec:
value: "{{ .Values.env.tagServicePort }}"
- name: BUCKETEER_WEB_TEAM_SERVICE_PORT
value: "{{ .Values.env.teamServicePort }}"
- name: BUCKETEER_WEB_WEB_CONSOLE_SERVICE_PORT
value: "{{ .Values.env.webConsoleServicePort }}"
- name: BUCKETEER_WEB_DASHBOARD_SERVICE_PORT
value: "{{ .Values.env.dashboardServicePort }}"
- name: BUCKETEER_WEB_CODE_REFERENCE_SERVICE_PORT
Expand Down
40 changes: 0 additions & 40 deletions manifests/bucketeer/charts/web/templates/envoy-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -436,38 +436,6 @@ data:
explicit_http_config:
http2_protocol_options: {}
ignore_health_on_host_removal: true
- name: web_console
type: strict_dns
connect_timeout: 5s
dns_lookup_family: V4_ONLY
lb_policy: {{ .Values.envoy.lbPolicy }}
load_assignment:
cluster_name: web_console
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: localhost
port_value: 9102
transport_socket:
name: envoy.transport_sockets.tls
typed_config:
'@type': type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.UpstreamTlsContext
common_tls_context:
alpn_protocols:
- h2
tls_certificates:
- certificate_chain:
filename: /usr/local/certs/service/tls.crt
private_key:
filename: /usr/local/certs/service/tls.key
typed_extension_protocol_options:
envoy.extensions.upstreams.http.v3.HttpProtocolOptions:
'@type': type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions
explicit_http_config:
http2_protocol_options: {}
ignore_health_on_host_removal: true
- name: dashboard
type: strict_dns
connect_timeout: 5s
Expand Down Expand Up @@ -959,14 +927,6 @@ data:
retry_policy:
retry_on: 5xx
num_retries: 3
- match:
prefix: /legacy
route:
cluster: web_console
timeout: 15s
retry_policy:
retry_on: 5xx
num_retries: 3
- match:
prefix: /v1/
route:
Expand Down
16 changes: 1 addition & 15 deletions pkg/web/cmd/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ type server struct {
featureServicePort *int
notificationServicePort *int
pushServicePort *int
webConsoleServicePort *int
dashboardServicePort *int
tagServicePort *int
codeReferenceServicePort *int
Expand Down Expand Up @@ -278,10 +277,6 @@ func RegisterCommand(r cli.CommandRegistry, p cli.ParentCommand) cli.Command {
"push-service-port",
"Port to bind to push service.",
).Default("9101").Int(),
webConsoleServicePort: cmd.Flag(
"web-console-service-port",
"Port to bind to console service.",
).Default("9102").Int(),
dashboardServicePort: cmd.Flag(
"dashboard-service-port",
"Port to bind to dashboard service.",
Expand Down Expand Up @@ -814,15 +809,7 @@ func (s *server) Run(ctx context.Context, metrics metrics.Metrics, logger *zap.L
)
go teamServer.Run()

// Start the web console and dashboard servers
webConsoleServer := rest.NewServer(
*s.certPath, *s.keyPath,
rest.WithLogger(logger),
rest.WithPort(*s.webConsoleServicePort),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also remove webConsoleServicePort itself🙏

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done 4c23efc

rest.WithService(NewWebConsoleService(*s.webConsoleEnvJSPath)),
rest.WithMetrics(registerer),
)
go webConsoleServer.Run()
// Start the dashboard servers
dashboardServer := rest.NewServer(
*s.certPath, *s.keyPath,
rest.WithLogger(logger),
Expand Down Expand Up @@ -868,7 +855,6 @@ func (s *server) Run(ctx context.Context, metrics metrics.Metrics, logger *zap.L
go notificationServer.Stop(serverShutDownTimeout)
go pushServer.Stop(serverShutDownTimeout)
go tagServer.Stop(serverShutDownTimeout)
go webConsoleServer.Stop(serverShutDownTimeout)
go codeReferenceServer.Stop(serverShutDownTimeout)
go teamServer.Stop(serverShutDownTimeout)
go webGrpcGateway.Stop(serverShutDownTimeout)
Expand Down
24 changes: 0 additions & 24 deletions pkg/web/cmd/server/web_console.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (
"time"

"github.com/bucketeer-io/bucketeer/ui/dashboard"
webv2 "github.com/bucketeer-io/bucketeer/ui/web-v2"
)

type spaFileSystem struct {
Expand Down Expand Up @@ -52,11 +51,6 @@ func (fs *spaFileSystem) Open(name string) (http.File, error) {
return fs.root.Open("index.html")
}

// webConsoleHandler returns a http.Handler for the old web console UI.
func webConsoleHandler() http.Handler {
return http.FileServer(&spaFileSystem{root: http.FS(webv2.FS), prefix: "/legacy/"})
}

// fontCacheHandler adds cache headers for font files
func cacheHandler(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
Expand Down Expand Up @@ -110,24 +104,6 @@ func dashboardHandler() http.Handler {
return http.FileServer(&spaFileSystem{root: fs})
}

func webConsoleEnvJSHandler(path string) http.Handler {
return http.FileServer(http.Dir(path))
}

type WebConsoleService struct {
consoleEnvJSPath string
}

func NewWebConsoleService(consoleEnvJSPath string) WebConsoleService {
return WebConsoleService{consoleEnvJSPath: consoleEnvJSPath}
}

func (c WebConsoleService) Register(mux *http.ServeMux) {
mux.Handle("/", webConsoleHandler())
mux.Handle("/legacy/static/js/",
http.StripPrefix("/legacy/static/js/", webConsoleEnvJSHandler(c.consoleEnvJSPath)))
}

type DashboardService struct {
consoleEnvJSPath string
}
Expand Down
4 changes: 1 addition & 3 deletions ui/dashboard/src/@locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,5 @@
"member-role-description": "Can only access specific environments and cannot create or update organization settings, projects, environments, API keys, or members.",
"admin-role-description": "Has access to all environments and can do anything",
"teams": "Teams",
"docs": "Docs",
"new-console": "New console",
"old-console": "Old console"
"docs": "Docs"
}
4 changes: 1 addition & 3 deletions ui/dashboard/src/@locales/ja/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,5 @@
"member-role-description": "特定の環境にのみアクセスでき、組織設定、プロジェクト、環境、APIキー、メンバーの作成や更新はできません。",
"admin-role-description": "すべての環境にアクセスでき、すべての操作を実行できます。",
"teams": "チーム",
"docs": "ドキュメント",
"new-console": "新コンソール",
"old-console": "旧コンソール"
"docs": "ドキュメント"
}
24 changes: 1 addition & 23 deletions ui/dashboard/src/auth/auth-context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,16 @@ import React, {
useContext,
useEffect,
ReactNode,
useState,
useCallback
useState
} from 'react';
import { useNavigate } from 'react-router-dom';
import { accountOrganizationFetcher, MeFetcherParams } from '@api/account';
import { accountMeFetcher } from '@api/account';
import { urls } from 'configs';
import { PAGE_PATH_ROOT } from 'constants/routing';
import { useToast } from 'hooks';
import { getLanguage, Language, setLanguage, useTranslation } from 'i18n';
import isNil from 'lodash/isNil';
import { Undefinable } from 'option-t/undefinable';
import { clearConsoleVersion, getConsoleVersion } from 'storage/console';
import {
clearCurrentEnvIdStorage,
getCurrentEnvIdStorage,
Expand All @@ -38,7 +35,6 @@ import {
} from 'storage/token';
import { AuthToken, ConsoleAccount, Organization } from '@types';
import { onChangeFontWithLocalized } from 'utils/function';
import { useSearchParams } from 'utils/search-params';
import { getAccountAccess } from './utils';

interface AuthContextType {
Expand Down Expand Up @@ -72,7 +68,6 @@ export const AuthProvider: React.FC<{ children: ReactNode }> = ({
const organizationId = getOrgIdStorage();
const environmentId = getCurrentEnvIdStorage();
const { errorNotify } = useToast();
const { searchOptions } = useSearchParams();

const [isInitialLoading, setIsInitialLoading] = useState(
!!authToken?.accessToken
Expand All @@ -92,22 +87,6 @@ export const AuthProvider: React.FC<{ children: ReactNode }> = ({
clearCurrentProjectEnvironmentStorage();
};

const handleCheckConsoleVersion = useCallback(
(account: ConsoleAccount) => {
const backFromOldConsole = !!searchOptions?.fromOldConsole;
const consoleVersion = getConsoleVersion();
const isRedirectToOldConsole =
consoleVersion?.version === 'old' &&
consoleVersion?.email === account.email;
if (!isRedirectToOldConsole || backFromOldConsole)
return clearConsoleVersion();

if (isRedirectToOldConsole)
return (window.location.href = urls.OLD_CONSOLE_ENDPOINT as string);
},
[searchOptions]
);

const onMeFetcher = async (params: MeFetcherParams) => {
try {
const response = await accountMeFetcher(params);
Expand All @@ -117,7 +96,6 @@ export const AuthProvider: React.FC<{ children: ReactNode }> = ({
errorNotify(null, t('message:env-are-empty'));
return logout();
}
handleCheckConsoleVersion(response.account);
setConsoleAccount(response.account);
setIsLogin(true);
if (response.account.lastSeen === '0' || !response.account.lastSeen)
Expand Down
Loading