Skip to content

Commit 4e9f07d

Browse files
committed
fix: readme and public_url
1 parent 56f0e2f commit 4e9f07d

4 files changed

Lines changed: 20 additions & 10 deletions

File tree

README.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Graasp Backend
1+
# Graasp API
22

33
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
44

@@ -9,19 +9,23 @@
99
[![GitHub Release](https://img.shields.io/github/release/graasp/graasp)](https://github.com/graasp/graasp/releases/latest)
1010
![Test CI](https://github.com/graasp/graasp/actions/workflows/test.yml/badge.svg?branch=main)
1111
![typescript version](https://img.shields.io/github/package-json/dependency-version/graasp/graasp/dev/typescript)
12-
[![Translations](https://gitlocalize.com/repo/9284/whole_project/badge.svg)](https://gitlocalize.com/repo/9284?utm_source=badge)
12+
[![Translations](https://gitlocalize.com/repo/10770/whole_project/badge.svg)](https://gitlocalize.com/repo/10770?utm_source=badge)
1313

14-
This repository contains the source code and configurations for the Graasp backend. Visit the Graasp Platform at [graasp.org](https://graasp.org)
14+
This repository contains the source code and configurations for the Graasp API backend. Visit the Graasp Platform at [graasp.org](https://graasp.org)
1515

1616
❓Looking for our client applications/front-ends ?
17-
Head over to: [Client](https://github.com/graasp/client), [Library](https://github.com/graasp/graasp-library)
17+
Head over to: [Graasp Web](https://github.com/graasp/graasp-web), [Client](https://github.com/graasp/client), [Library](https://github.com/graasp/graasp-library)
18+
19+
The Graasp API backend is a Node.js server (with fastify) allowing operations to be carried out in the client interface. It persists data to a PostgreSQL database.
20+
21+
If you are interested to hosting Graasp yourself please have a look at the [self-hosting document](./docs/self-hosting.md)
1822

1923
## Requirements
2024

21-
In order to run the Graasp backend, it requires:
25+
In order to run the Graasp backend, you will need:
2226

2327
- [Mise](https://mise.jdx.dev) (tool manager)
24-
- [Docker](https://docs.docker.com/get-docker/) or [Podman](https://podman.io/): Docker is not necessary, it is possible to install everything locally. However it is strongly recommended to use the Docker installation guide.
28+
- [Docker](https://docs.docker.com/get-docker/) or [Podman](https://podman.io/): We recommend using docker as it makes setup of services much easier. It is however possible to setup all the services natively instead. We will provide guidance in this document for the docker installation.
2529

2630
Mise will automatically install the correct version of node and pnpm. You should only have to do:
2731
`mise install`. You might have to trust the workspace with `mise trust` first.
@@ -67,7 +71,7 @@ This will create 11 containers :
6771
6872
> **Troubleshoot**
6973
> If during setup of the devcontainer you get an error like `nudenet Error pull access denied for public.ecr.aws/g...`
70-
> This can occure if you previously logged in to the public ECR. When you want to pull from the public ECR, you should be unauthenticated. Simply run the following on you host: `docker logout public.ecr.aws`. It will log you out of the public ECR and you should be able to rebuild the containers without issue. If it persissts please [open an issue](https://github.com/graasp/graasp/issues/new?title=NudeNet%20DevContainer%20Docker%20Install%20Issue)
74+
> This can occur if you previously logged in to the public ECR. When you want to pull from the public ECR, you should be unauthenticated. Simply run the following on you host: `docker logout public.ecr.aws`. It will log you out of the public ECR and you should be able to rebuild the containers without issue. If it persissts please [open an issue](https://github.com/graasp/graasp/issues/new?title=NudeNet%20DevContainer%20Docker%20Install%20Issue)
7175
7276
Then install the required npm packages with `yarn install`. You should run this command in the docker's terminal, because some packages are built depending on the operating system (eg. `bcrypt`).
7377

src/bustCache.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ export async function bustFileCache() {
1212
redis.expire(key, 0);
1313
});
1414
console.debug('DEV: Done busting cache');
15+
return cache_keys.length;
1516
}

src/plugins/meta.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ const plugin: FastifyPluginAsyncTypebox = async (fastify) => {
117117
});
118118

119119
fastify.get('/api/bust-cache', { preHandler: authenticateAdminSharedSecret }, async () => {
120-
await bustFileCache();
120+
const result = await bustFileCache();
121+
return result;
121122
});
122123
};
123124

src/utils/config.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,14 @@ export const CORS_ORIGIN_REGEX = process.env.CORS_ORIGIN_REGEX;
6868
* }
6969
* >
7070
*/
71-
export const PUBLIC_URL = new URL(HOST);
71+
export const PUBLIC_URL = new URL(process.env.PUBLIC_URL || HOST);
7272
export const LIBRARY_HOST = process.env.LIBRARY_CLIENT_HOST || HOST;
7373

74-
export const ALLOWED_ORIGINS = [new URL(HOST).origin, new URL(LIBRARY_HOST).origin];
74+
export const ALLOWED_ORIGINS = [
75+
new URL(PUBLIC_URL).origin,
76+
new URL(HOST).origin,
77+
new URL(LIBRARY_HOST).origin,
78+
];
7579

7680
// Add the hosts of the different clients
7781
ClientManager.getInstance().setHost(HOST).addHost(Context.Library, LIBRARY_HOST);

0 commit comments

Comments
 (0)