Skip to content

Commit

Permalink
fix(auth + apis): making things work
Browse files Browse the repository at this point in the history
  • Loading branch information
0x0elliot committed Dec 8, 2023
1 parent b57705c commit b357a31
Show file tree
Hide file tree
Showing 8 changed files with 4,564 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 3.2.23 on 2023-12-08 21:29

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('smartcontract', '0006_alter_smartcontract_address'),
]

operations = [
migrations.AlterField(
model_name='smartcontract',
name='chain',
field=models.CharField(choices=[('ETH', 'eth'), ('ARB', 'arb')], max_length=16),
),
]
2 changes: 2 additions & 0 deletions backend/authentication/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ def github_login(request):
current_domain, REPLACEMENT_DOMAIN
)

redirect_uri = "http://localhost:3000/api/v1/authentication/github-callback"

if settings.DEMO_INSTANCE:
redirect_uri = redirect_uri.replace("http://", "https://")
redirect_uri = "https://demo.thirdeyelabs.xyz/api/v1/authentication/github-callback"
Expand Down
2 changes: 1 addition & 1 deletion backend/backend/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@
FRONTEND_URL = (
FRONTEND_URL_MAIN
if DEMO_INSTANCE
else os.environ.get("FRONTEND_URL", "http://localhost/")
else os.environ.get("FRONTEND_URL", "http://localhost:3000/")
)

# SECURITY WARNING: keep the secret key used in production secret!
Expand Down
28 changes: 14 additions & 14 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,20 @@ services:
# ports:
# - "3000:3000"

nginx:
hostname: nginx
image: nginx:alpine
container_name: nginx_app_thirdeye
networks:
default:
internal:
volumes:
- ./nginx/default.conf:/etc/nginx/nginx.conf
ports:
- "80:80"
depends_on:
# - frontend
- backend
# nginx:
# hostname: nginx
# image: nginx:alpine
# container_name: nginx_app_thirdeye
# networks:
# default:
# internal:
# volumes:
# - ./nginx/default.conf:/etc/nginx/nginx.conf
# ports:
# - "80:80"
# depends_on:
# # - frontend
# - backend

backend:
container_name: backend_app_thirdeye
Expand Down
2 changes: 1 addition & 1 deletion docker/nginx/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ http {
gzip_types text/css application/javascript image/svg+xml;

location / {
proxy_pass http://172.16.9.13:3000;
proxy_pass http://frontend:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
Expand Down
4 changes: 2 additions & 2 deletions frontend/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ const nextConfig = {
const rewrites = [];

// Proxy to backend if not localhost
if (!backendUrl.includes("localhost")) {
// if (!backendUrl.includes("localhost")) {
rewrites.push({
source: "/api/v1/:slug*",
destination: `${backendUrl}/:slug*`,
});
}
// }

return rewrites;
}
Expand Down
Loading

0 comments on commit b357a31

Please sign in to comment.