Compare commits
10 Commits
refactor/c
...
experiment
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4522aeb79a | ||
|
|
31a275b971 | ||
|
|
9575f3c9e3 | ||
|
|
89e05f501a | ||
|
|
fd84f4e1fa | ||
|
|
5e84e6b479 | ||
|
|
cc5359b80b | ||
|
|
96c18c0500 | ||
|
|
e4e0278b6a | ||
|
|
5bf1b6942b |
@@ -1,40 +1,14 @@
|
|||||||
# Docker Compose config used for internal test and QA deployments
|
# THIS IS NOT TO BE USED FOR PERSONAL DEPLOYMENTS!
|
||||||
# This just spins up the AIO container along with an attached DB to the standard HTTP ports with subpath access mode
|
# Internal Docker Compose Image used for internal testing deployments
|
||||||
|
|
||||||
# TODO: Add Healthcheck for the AIO container
|
|
||||||
|
|
||||||
version: "3.7"
|
version: "3.7"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
# The service that spins up all 3 services at once in one container
|
|
||||||
hoppscotch-aio:
|
|
||||||
container_name: hoppscotch-aio
|
|
||||||
restart: unless-stopped
|
|
||||||
build:
|
|
||||||
dockerfile: prod.Dockerfile
|
|
||||||
context: .
|
|
||||||
target: aio
|
|
||||||
environment:
|
|
||||||
- DATABASE_URL=postgresql://postgres:testpass@hoppscotch-db:5432/hoppscotch
|
|
||||||
- ENABLE_SUBPATH_BASED_ACCESS=true
|
|
||||||
depends_on:
|
|
||||||
hoppscotch-db:
|
|
||||||
condition: service_healthy
|
|
||||||
ports:
|
|
||||||
- "3080:80"
|
|
||||||
|
|
||||||
# The preset DB service, you can delete/comment the below lines if
|
|
||||||
# you are using an external postgres instance
|
|
||||||
# This will be exposed at port 5432
|
|
||||||
hoppscotch-db:
|
hoppscotch-db:
|
||||||
image: postgres:15
|
image: postgres:15
|
||||||
ports:
|
|
||||||
- "5432:5432"
|
|
||||||
user: postgres
|
user: postgres
|
||||||
environment:
|
environment:
|
||||||
# The default user defined by the docker image
|
|
||||||
POSTGRES_USER: postgres
|
POSTGRES_USER: postgres
|
||||||
# NOTE: Please UPDATE THIS PASSWORD!
|
|
||||||
POSTGRES_PASSWORD: testpass
|
POSTGRES_PASSWORD: testpass
|
||||||
POSTGRES_DB: hoppscotch
|
POSTGRES_DB: hoppscotch
|
||||||
healthcheck:
|
healthcheck:
|
||||||
@@ -46,3 +20,29 @@ services:
|
|||||||
interval: 5s
|
interval: 5s
|
||||||
timeout: 5s
|
timeout: 5s
|
||||||
retries: 10
|
retries: 10
|
||||||
|
|
||||||
|
hoppscotch-aio:
|
||||||
|
container_name: hoppscotch-aio
|
||||||
|
build:
|
||||||
|
dockerfile: prod.Dockerfile
|
||||||
|
context: .
|
||||||
|
target: aio
|
||||||
|
environment:
|
||||||
|
- DATABASE_URL=postgresql://postgres:testpass@hoppscotch-db:5432/hoppscotch
|
||||||
|
- ENABLE_SUBPATH_BASED_ACCESS=true
|
||||||
|
env_file:
|
||||||
|
- ./.env
|
||||||
|
depends_on:
|
||||||
|
hoppscotch-db:
|
||||||
|
condition: service_healthy
|
||||||
|
command: ["sh", "-c", "pnpm exec prisma migrate deploy && node /usr/src/app/aio_run.mjs"]
|
||||||
|
healthcheck:
|
||||||
|
test:
|
||||||
|
- CMD
|
||||||
|
- curl
|
||||||
|
- '-f'
|
||||||
|
- 'http://localhost:80'
|
||||||
|
interval: 2s
|
||||||
|
timeout: 10s
|
||||||
|
retries: 30
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import { throwHTTPErr } from 'src/utils';
|
|||||||
export class TeamCollectionController {
|
export class TeamCollectionController {
|
||||||
constructor(private readonly teamCollectionService: TeamCollectionService) {}
|
constructor(private readonly teamCollectionService: TeamCollectionService) {}
|
||||||
|
|
||||||
@Get('search/:teamID')
|
@Get('search/:teamID/:searchQuery')
|
||||||
@RequiresTeamRole(
|
@RequiresTeamRole(
|
||||||
TeamMemberRole.VIEWER,
|
TeamMemberRole.VIEWER,
|
||||||
TeamMemberRole.EDITOR,
|
TeamMemberRole.EDITOR,
|
||||||
@@ -21,7 +21,7 @@ export class TeamCollectionController {
|
|||||||
)
|
)
|
||||||
@UseGuards(JwtAuthGuard, RESTTeamMemberGuard)
|
@UseGuards(JwtAuthGuard, RESTTeamMemberGuard)
|
||||||
async searchByTitle(
|
async searchByTitle(
|
||||||
@Query('searchQuery') searchQuery: string,
|
@Param('searchQuery') searchQuery: string,
|
||||||
@Param('teamID') teamID: string,
|
@Param('teamID') teamID: string,
|
||||||
@Query('take') take: string,
|
@Query('take') take: string,
|
||||||
@Query('skip') skip: string,
|
@Query('skip') skip: string,
|
||||||
|
|||||||
@@ -261,28 +261,29 @@ export function checkEnvironmentAuthProvider(
|
|||||||
* Source: https://stackoverflow.com/a/32648526
|
* Source: https://stackoverflow.com/a/32648526
|
||||||
*/
|
*/
|
||||||
export function escapeSqlLikeString(str: string) {
|
export function escapeSqlLikeString(str: string) {
|
||||||
if (typeof str != 'string') return str;
|
if (typeof str != 'string')
|
||||||
|
return str;
|
||||||
|
|
||||||
return str.replace(/[\0\x08\x09\x1a\n\r"'\\\%]/g, function (char) {
|
return str.replace(/[\0\x08\x09\x1a\n\r"'\\\%]/g, function (char) {
|
||||||
switch (char) {
|
switch (char) {
|
||||||
case '\0':
|
case "\0":
|
||||||
return '\\0';
|
return "\\0";
|
||||||
case '\x08':
|
case "\x08":
|
||||||
return '\\b';
|
return "\\b";
|
||||||
case '\x09':
|
case "\x09":
|
||||||
return '\\t';
|
return "\\t";
|
||||||
case '\x1a':
|
case "\x1a":
|
||||||
return '\\z';
|
return "\\z";
|
||||||
case '\n':
|
case "\n":
|
||||||
return '\\n';
|
return "\\n";
|
||||||
case '\r':
|
case "\r":
|
||||||
return '\\r';
|
return "\\r";
|
||||||
case '"':
|
case "\"":
|
||||||
case "'":
|
case "'":
|
||||||
case '\\':
|
case "\\":
|
||||||
case '%':
|
case "%":
|
||||||
return '\\' + char; // prepends a backslash to backslash, percent,
|
return "\\"+char; // prepends a backslash to backslash, percent,
|
||||||
// and double/single quotes
|
// and double/single quotes
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user