Skip to content

Commit

Permalink
Fixed cors origin (#34)
Browse files Browse the repository at this point in the history
* feat: remove db proxy

* Use ports

* Fixed cors origin
  • Loading branch information
shaynethiessen authored Jun 26, 2024
1 parent 7114f90 commit 65dcee1
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 16 deletions.
4 changes: 2 additions & 2 deletions packages/deploy/server-release/server/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ services:
volumes:
- ./.env:/app/packages/server/.env
- ./assets:/app/packages/server/assets
expose:
- "5001"
ports:
- "5001:5001"
12 changes: 0 additions & 12 deletions packages/deploy/server-setup/historyhall.org
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,6 @@ server {
proxy_set_header X-Forwarded-Proto $scheme;
}
}
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name db.historyhall.org www.db.historyhall.org;
location / {
proxy_pass http://localhost:5432;
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;
}
}
server {
listen 443 ssl;
listen [::]:443 ssl;
Expand Down
1 change: 0 additions & 1 deletion packages/deploy/server-setup/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ sudo systemctl restart nginx
sudo certbot --nginx -d historyhall.org -d www.historyhall.org
sudo certbot --nginx -d registry.historyhall.org -d www.registry.historyhall.org
sudo certbot --nginx -d api.historyhall.org -d www.api.historyhall.org
sudo certbot --nginx -d db.historyhall.org -d db.api.historyhall.org

# Docker Registry
sudo mkdir -p /srv/docker-registry/registry;
Expand Down
2 changes: 1 addition & 1 deletion packages/server/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ MikroORM.init<PostgreSqlDriver>(mikroOrmConfig).then(orm => {
const schema = new GraphQLSchema({query});

d(em.schema || 'schema not defined');
app.use(cors({credentials: true, origin: `http://localhost:5000`}));
app.use(cors({credentials: true, origin: [`http://localhost:5000`, `https://historyhall.org`]}));
app.use(
'/api',
graphqlHTTP({
Expand Down

0 comments on commit 65dcee1

Please sign in to comment.