Skip to content

Commit 0ecf48c

Browse files
committed
chore: remove deprecated Google OAuth and configuration files
- Deleted the Google OAuth route implementation, configuration settings, and security utilities as they are no longer in use. - This cleanup helps streamline the codebase and remove unnecessary dependencies.
1 parent 7c19111 commit 0ecf48c

File tree

10 files changed

+148
-7283
lines changed

10 files changed

+148
-7283
lines changed

Makefile

Lines changed: 140 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,21 +59,142 @@ EXTENSION_DIR := $(ROOT_DIR)/extension
5959
# Check if tools are installed
6060
PNPM_EXISTS := $(shell command -v pnpm 2> /dev/null)
6161
UV_EXISTS := $(shell command -v uv 2> /dev/null)
62+
DOPPLER_EXISTS := $(shell command -v doppler 2> /dev/null)
63+
64+
# ==============================================================================
65+
# ENV MANAGEMENT
66+
# ==============================================================================
67+
68+
## env-init: Initialize all .env files by checking for their existence and creating if missing
69+
.PHONY: env-init
70+
env-init: check-root-env check-admin-env check-frontend-env check-extension-env
71+
72+
## check-doppler: Check if Doppler CLI is installed
73+
.PHONY: check-doppler
74+
check-doppler:
75+
ifndef DOPPLER_EXISTS
76+
@echo "===========> Doppler CLI is not installed. Please install it following the instructions at https://docs.doppler.com/docs/cli"
77+
@echo "===========> For example: (curl -Ls --tlsv1.2 --proto \"=https\" --retry 3 https://cli.doppler.com/install.sh || wget -t 3 -qO- https://cli.doppler.com/install.sh) | sh"
78+
@exit 1
79+
endif
80+
@echo "===========> Doppler CLI is installed"
81+
82+
## doppler-login-check: Check if user is logged in to Doppler
83+
.PHONY: doppler-login-check
84+
doppler-login-check: check-doppler
85+
@if ! doppler configure > /dev/null 2>&1; then \
86+
if [ -z "$$DOPPLER_TOKEN" ]; then \
87+
echo "===========> You are not logged in to Doppler and DOPPLER_TOKEN is not set"; \
88+
echo "===========> Please run 'doppler login' or set DOPPLER_TOKEN environment variable"; \
89+
exit 1; \
90+
else \
91+
echo "===========> Using DOPPLER_TOKEN for authentication"; \
92+
fi \
93+
else \
94+
echo "===========> Doppler authentication verified"; \
95+
fi
96+
97+
## env-doppler: Generate .env from Doppler secrets
98+
.PHONY: env-doppler
99+
env-doppler: check-doppler doppler-login-check
100+
@echo "===========> Setting up Doppler for nexus project with dev config"
101+
@doppler setup --silent --project nexus --config dev
102+
@echo "===========> Downloading secrets to .env file"
103+
@doppler secrets download --no-file --format env > .env
104+
@echo "===========> .env file generated from Doppler secrets"
105+
106+
## check-root-env: Check if root .env exists, copy from .env.example if not
107+
.PHONY: check-root-env
108+
check-root-env:
109+
@if [ ! -f "$(ROOT_DIR)/.env" ]; then \
110+
echo "===========> Root .env file not found, creating from .env.example"; \
111+
cp "$(ROOT_DIR)/.env.example" "$(ROOT_DIR)/.env"; \
112+
echo "===========> Consider running 'make env-doppler' to initialize with Doppler"; \
113+
else \
114+
echo "===========> Root .env file exists"; \
115+
fi
116+
117+
## check-admin-env: Check if admin .env exists, copy from .env.example if not
118+
.PHONY: check-admin-env
119+
check-admin-env:
120+
@if [ -d "$(ADMIN_DIR)" ]; then \
121+
if [ ! -f "$(ADMIN_DIR)/.env" ]; then \
122+
echo "===========> Admin .env file not found, creating from .env.example"; \
123+
if [ -f "$(ADMIN_DIR)/.env.example" ]; then \
124+
cp "$(ADMIN_DIR)/.env.example" "$(ADMIN_DIR)/.env"; \
125+
else \
126+
echo "VITE_API_URL=http://localhost:8000" > "$(ADMIN_DIR)/.env"; \
127+
echo "NODE_ENV=development" >> "$(ADMIN_DIR)/.env"; \
128+
fi; \
129+
else \
130+
echo "===========> Admin .env file exists"; \
131+
fi; \
132+
else \
133+
echo "===========> Admin directory not found, skipping"; \
134+
fi
135+
136+
## check-frontend-env: Check if frontend .env exists, copy from .env.example if not
137+
.PHONY: check-frontend-env
138+
check-frontend-env:
139+
@if [ -d "$(FRONTEND_DIR)" ]; then \
140+
if [ ! -f "$(FRONTEND_DIR)/.env" ]; then \
141+
echo "===========> Frontend .env file not found, creating from .env.example"; \
142+
if [ -f "$(FRONTEND_DIR)/.env.example" ]; then \
143+
cp "$(FRONTEND_DIR)/.env.example" "$(FRONTEND_DIR)/.env"; \
144+
else \
145+
echo "# Backend API base URL" > "$(FRONTEND_DIR)/.env"; \
146+
echo "NEXT_PUBLIC_API_URL=http://localhost:8000" >> "$(FRONTEND_DIR)/.env"; \
147+
echo "" >> "$(FRONTEND_DIR)/.env"; \
148+
echo "# OpenAPI generated file name (relative to the frontend directory)" >> "$(FRONTEND_DIR)/.env"; \
149+
echo "OPENAPI_OUTPUT_FILE=openapi.json" >> "$(FRONTEND_DIR)/.env"; \
150+
echo "" >> "$(FRONTEND_DIR)/.env"; \
151+
echo "NODE_ENV=development" >> "$(FRONTEND_DIR)/.env"; \
152+
fi; \
153+
else \
154+
echo "===========> Frontend .env file exists"; \
155+
fi; \
156+
else \
157+
echo "===========> Frontend directory not found, skipping"; \
158+
fi
159+
160+
## check-extension-env: Check if extension .env exists, copy from .env.example if not
161+
.PHONY: check-extension-env
162+
check-extension-env:
163+
@if [ -d "$(EXTENSION_DIR)" ]; then \
164+
if [ ! -f "$(EXTENSION_DIR)/.env" ]; then \
165+
echo "===========> Extension .env file not found, creating from .env.example"; \
166+
if [ -f "$(EXTENSION_DIR)/.env.example" ]; then \
167+
cp "$(EXTENSION_DIR)/.env.example" "$(EXTENSION_DIR)/.env"; \
168+
else \
169+
echo "# Extension环境变量" > "$(EXTENSION_DIR)/.env"; \
170+
echo "" >> "$(EXTENSION_DIR)/.env"; \
171+
echo "# API服务器地址" >> "$(EXTENSION_DIR)/.env"; \
172+
echo "PLASMO_PUBLIC_API_URL=http://localhost:8000" >> "$(EXTENSION_DIR)/.env"; \
173+
echo "" >> "$(EXTENSION_DIR)/.env"; \
174+
echo "# 前端地址" >> "$(EXTENSION_DIR)/.env"; \
175+
echo "PLASMO_PUBLIC_FRONTEND_URL=http://localhost:3000" >> "$(EXTENSION_DIR)/.env"; \
176+
fi; \
177+
else \
178+
echo "===========> Extension .env file exists"; \
179+
fi; \
180+
else \
181+
echo "===========> Extension directory not found, skipping"; \
182+
fi
62183

63184
# ==============================================================================
64185
# PRIMARY TARGETS
65186
# ==============================================================================
66187

67188
## all: Run all tests, linting, formatting and build all components
68189
.PHONY: all
69-
all: format lint generate-client backend-build frontend-build admin-build # test
190+
all: env-init format lint generate-client backend-build frontend-build admin-build # test
70191
@echo "===========> All checks and builds completed successfully"
71192

72193
## dev: Start development environment
73194
.PHONY: dev
74-
dev:
195+
dev: env-init
75196
@echo "===========> Starting development environment"
76-
docker-compose up -d
197+
docker compose up -d
77198

78199
## lint: Run linters on all components
79200
.PHONY: lint
@@ -112,7 +233,7 @@ backend-all: backend-format backend-lint backend-test
112233

113234
## backend: Start backend development server
114235
.PHONY: backend
115-
backend: check-uv backend-install
236+
backend: check-uv backend-install env-init
116237
@echo "===========> Starting backend development server"
117238
@source backend/.venv/bin/activate && \
118239
cd $(BACKEND_DIR) && fastapi dev app/main.py
@@ -184,7 +305,7 @@ backend-migration:
184305
.PHONY: backend-db-shell
185306
backend-db-shell:
186307
@echo "===========> Connecting to database"
187-
@docker-compose exec db psql -U postgres -d app || \
308+
@docker compose exec db psql -U postgres -d app || \
188309
psql "$(shell cd $(BACKEND_DIR) && python -c "from app.core.config import settings; print(settings.SQLALCHEMY_DATABASE_URI)")"
189310

190311
# ==============================================================================
@@ -198,7 +319,7 @@ frontend-all: frontend-format frontend-lint frontend-test
198319

199320
## frontend: Start frontend development server
200321
.PHONY: frontend
201-
frontend: check-pnpm frontend-install
322+
frontend: check-pnpm frontend-install check-frontend-env
202323
@echo "===========> Starting frontend development server"
203324
@if [ -d "$(FRONTEND_DIR)" ] && [ -f "$(FRONTEND_DIR)/package.json" ]; then \
204325
cd $(FRONTEND_DIR) && unset http_proxy https_proxy && $(PNPM) run dev; \
@@ -286,7 +407,7 @@ admin-all: admin-format admin-lint admin-test
286407

287408
## admin: Start admin development server
288409
.PHONY: admin
289-
admin: check-pnpm admin-install
410+
admin: check-pnpm admin-install check-admin-env
290411
@echo "===========> Starting admin development server"
291412
@cd $(ADMIN_DIR) && $(PNPM) run dev
292413

@@ -409,7 +530,7 @@ extension-all: extension-build extension-package extension-test
409530

410531
## extension: Start extension development
411532
.PHONY: extension
412-
extension: check-pnpm
533+
extension: check-pnpm check-extension-env
413534
@echo "===========> Starting browser extension in development mode"
414535
@cd $(EXTENSION_DIR) && $(PNPM) run dev
415536

@@ -492,6 +613,9 @@ help: Makefile
492613
@printf "\033[1;34m┌─ PRIMARY COMMANDS ───────────────────────────────────────────────────┐\033[0m\n"
493614
@grep -E '^## (all:|dev:|lint:|test:|format:|clean:)' $(MAKEFILE_LIST) | awk -F':' '{printf " \033[1;37m%-25s\033[0m %s\n", $$1, $$2}' | sed -e 's/^##//'
494615

616+
@printf "\n\033[1;34m┌─ ENV MANAGEMENT ────────────────────────────────────────────────────┐\033[0m\n"
617+
@grep -E '^## (env|check-doppler|doppler)' $(MAKEFILE_LIST) | awk -F':' '{printf " \033[1;37m%-25s\033[0m %s\n", $$1, $$2}' | sed -e 's/^##//'
618+
495619
@printf "\n\033[1;34m┌─ BACKEND COMMANDS ──────────────────────────────────────────────────┐\033[0m\n"
496620
@grep -E '^## backend' $(MAKEFILE_LIST) | awk -F':' '{printf " \033[1;37m%-25s\033[0m %s\n", $$1, $$2}' | sed -e 's/^##//'
497621

@@ -522,6 +646,14 @@ help: Makefile
522646
# DEVELOPMENT TOOLS
523647
# ==============================================================================
524648

649+
## setup: Quick setup the whole project (recommended first command for new users)
650+
.PHONY: setup
651+
setup: env-init install-tools
652+
@echo "===========> Setting up environment completed"
653+
@echo "===========> Run 'make dev' to start all services in Docker"
654+
@echo "===========> Or you can run individual components with 'make backend', 'make frontend', etc."
655+
@echo "===========> Note: For better environment variables, run 'make env-doppler' if you have Doppler access"
656+
525657
## install-tools: Install development tools
526658
.PHONY: install-tools
527659
install-tools: install-python-tools install-js-tools

app/api/routes/google_oauth.py

Lines changed: 0 additions & 29 deletions
This file was deleted.

app/core/config.py

Lines changed: 0 additions & 112 deletions
This file was deleted.

app/core/security.py

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)