Skip to content
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

💻 Use subdomains to navigate through languages #5829

Open
wants to merge 39 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 33 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
3d7f6a9
add subdomain in routes inside app.py
jpelay Oct 3, 2024
f1d0391
adding subdomains in auth pages
jpelay Oct 3, 2024
5e2ee24
commit to test something
jpelay Oct 7, 2024
3c79486
fixing redirection locally
jpelay Oct 8, 2024
365c171
fix tests
jpelay Oct 9, 2024
d34186b
fix language switcher
jpelay Oct 9, 2024
24ac449
add subdomains to admin routes
jpelay Oct 11, 2024
644364d
add subdomains to class routes
jpelay Oct 11, 2024
c996b15
add routs to feedback
jpelay Oct 11, 2024
192bdb9
change every remaining route
jpelay Oct 11, 2024
a61ee44
fix programs and teacher tests
jpelay Oct 14, 2024
fbe5339
Merge branch 'main' into subdomains
jpelay Oct 28, 2024
af4d50a
fix profile route
jpelay Oct 29, 2024
ff03266
fix end to end tests
jpelay Oct 29, 2024
676cded
update config
jpelay Oct 29, 2024
f944e33
Update app.py
jpelay Oct 29, 2024
1486492
use domain name parameter
jpelay Nov 7, 2024
9755651
Merge main into subdomains
jpelay Nov 7, 2024
9844aad
🤖 Automatically update generated files
jpelay Nov 7, 2024
ca1a343
fix cypress test
jpelay Nov 8, 2024
69598af
correctly redirect after login and signup
jpelay Nov 12, 2024
cef4f51
properly set subdomain when changing lang in profile
jpelay Nov 12, 2024
8fc0533
fix languages witn underscore
jpelay Nov 12, 2024
6828533
Merge branch 'main' into subdomains
jpelay Nov 12, 2024
502198b
🤖 Automatically update generated files
jpelay Nov 12, 2024
d5e22a4
improving things a bit
jpelay Nov 12, 2024
996680f
also login cookie set to stritc
jpelay Nov 13, 2024
11354e2
fix tests
jpelay Nov 13, 2024
a1143a7
Merge branch 'main' into subdomains
jpelay Nov 13, 2024
6251173
🤖 Automatically update generated files
jpelay Nov 13, 2024
ca2e370
delete unwanted file
jpelay Nov 13, 2024
b878194
delete logs
jpelay Nov 13, 2024
0b4393d
fix e2e tests
jpelay Nov 13, 2024
1effa88
Merge branch 'main' into subdomains
jpelay Nov 13, 2024
9be4d87
use strict cookie
jpelay Nov 18, 2024
40426df
no cache for cookies
jpelay Nov 18, 2024
f2cc1c0
Merge branch 'main' into subdomains
jpelay Nov 18, 2024
297f4c4
Update appbundle.js.map
jpelay Nov 18, 2024
9dcedbe
strict
jpelay Nov 18, 2024
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
217 changes: 163 additions & 54 deletions app.py

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@
import socket

app_name = os.getenv('HEROKU_APP_NAME', socket.gethostname())
dyno = os.getenv('DYNO')
dyno = os.getenv('DYNO') # if this env variable is set, it means we are in a Heroku
athena_query = os.getenv('AWS_ATHENA_PREPARE_STATEMENT')

config = {
'port': os.getenv('PORT') or 8080,
'port': os.getenv('PORT', 8080),
# I can't reference a previous field, so copying and pasting here
boryanagoncharenko marked this conversation as resolved.
Show resolved Hide resolved
'domain_name': (
f"{os.getenv('DOMAIN_NAME')}" if dyno # if we are in localhost no need to add port
boryanagoncharenko marked this conversation as resolved.
Show resolved Hide resolved
else f"{os.getenv('DOMAIN_NAME', 'localhost')}:{os.getenv('PORT', 8080)}"
),
'session': {
'cookie_name': 'hedy',
# in minutes
Expand Down
4 changes: 2 additions & 2 deletions dodo.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from glob import glob
import sys
import platform

from config import config as CONFIG
from doit.tools import LongRunning

if os.getenv('GITHUB_ACTION') and platform.system() == 'Windows':
Expand Down Expand Up @@ -354,7 +354,7 @@ def task_devserver():
LongRunning([python3, 'app.py'], shell=False, env=dict(
os.environ,
# These are required to make some local features work.
BASE_URL="http://localhost:8080/",
BASE_URL=f"http://{CONFIG['domain_name']}",
ADMIN_USER="admin",))
],
verbosity=2, # show everything live
Expand Down
Loading
Loading