You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* fix: configuration
* fix: use correct container name from core and add issue about region
* fix: remove mentions of localstack
* fix: make requested changes in the readme about garage
Copy file name to clipboardExpand all lines: README.md
+94-21Lines changed: 94 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -56,14 +56,14 @@ This will create 11 containers :
56
56
-`etherpad` : Container for the etherpad service
57
57
-`meilisearch` : Container for the meilisearch service
58
58
-`redis` : Redis instance to enable websockets
59
-
-`localstack` : Localstack instance use to fake S3 storage locally
60
-
-`localfile` : Simple static file server to get files stored in graasp when using the `local` storage option (see the [Utilities section](#utilities))
59
+
-`garage` : An s3-compatible service that works locally
60
+
-`localfile` : Simple static file server alternative to s3. Used currently for H5P in local development
61
61
-`iframely` : Iframely instance used to get embeds for links
62
62
-`mailer` : Simple mailer instance used to receive emails locally (see the [Utilities section](#utilities))
63
63
-`umami`: An analytics service used instead of Google Analytics
64
64
65
65
> **Important**
66
-
> To use localstack with the Docker installation, it is necessary to edit your `/etc/hosts` with the following line `127.0.0.1 localstack`. This is necessary because the backend creates signed urls with the localstack container hostname. Without changing the hosts, the development machine cannot resolve the `http://localstack` hostname.
66
+
> To use garage with the Docker installation, it is necessary to edit your `/etc/hosts` with the following line `127.0.0.1 .s3.garage.localhost`. This is necessary because the backend creates signed urls pointing to this subdomain. Without changing the hosts, the development machine cannot resolve urls like `http://s3.garage.localhost:3900`.
67
67
68
68
> **Troubleshoot**
69
69
> If during setup of the devcontainer you get an error like `nudenet Error pull access denied for public.ecr.aws/g...`
@@ -94,7 +94,7 @@ First a running and accessible instance of PostgreSQL is required.
94
94
95
95
To enable websockets capabilities, it is required to have a running instance of [Redis](https://redis.io).
96
96
97
-
To use the backend with S3, it is required to have a running instance of [localstack](https://github.com/localstack/localstack).
97
+
To use the backend with S3, it is required to have a running instance of [garage](https://git.deuxfleurs.fr/Deuxfleurs/garage).
98
98
99
99
Then open the folder locally and run the following command to install the required npm packages.
To log into umami in your local instance: [Umami login documentation](https://umami.is/docs/login)
@@ -241,7 +314,7 @@ You can also run `yarn seed` to feed the database with predefined mock data.
241
314
242
315
The development [docker-compose.yml](.devcontainer/docker-compose.yml) provides an instance of [mailcatcher](https://mailcatcher.me/), which emulates a SMTP server for sending e-mails. When using the email authentication flow, the mailbox web UI is accessible at [http://localhost:1080](http://localhost:1080).
243
316
244
-
The development [docker-compose.yml](.devcontainer/docker-compose.yml) provides a [static file server](https://static-web-server.net/) for serving files when using the `local` storage option (alternative to the `s3` option). This option has the added benefit of being persistent when used locally in opposition to localstack (see the [known issues section](#known-issues) for more informations). The server is available at `http://localhost:1081`.
317
+
The development [docker-compose.yml](.devcontainer/docker-compose.yml) provides a [s3-compatible service](https://garagehq.deuxfleurs.fr/) for serving files. Ensure you have setup your /etc/hosts so that it works.
245
318
246
319
## Testing
247
320
@@ -285,23 +358,23 @@ Each migration should have its own test to verify the `up` and `down` procedures
285
358
286
359
Up tests start from the previous migration state, insert mock data and apply the up procedure. Then each table should still contain the inserted data with necessary changes. The down tests have a similar approach.
287
360
288
-
## Known issues
361
+
## Troubleshooting
289
362
290
-
### Data persistence
363
+
### Nudenet Container can not be pulled
291
364
292
-
The development environnement uses `localstack` as a local alternative to AWS s3 storage. But persistence accross restarts is not supported without the premium license.
293
-
This means that it is expected that you see 404 on uploaded files after a restart of your computer.
294
-
In details:
365
+
It is possible that the nudenet container pull fails with a 403 status code. This is likely because you are authenticated to the public AWS ECR and trying to pull a public image. Log out of the public ECR with `docker logout public.ecr.aws` and try building the devContainer again.
In the future we might investigate different solutions to mocking s3 storage, or improve the local storage to provide a durable local storage option.
369
+
This upload error occurs when we try to upload a file to s3 (mocked by garage on local dev setup).
300
370
301
-
### Container installation
371
+
You need to check that you:
372
+
- have access and secret keys in your env
373
+
- have set the region to the same value as the ".devcontainer/garage/garage.toml" file (look under the `s3.api` section for the `s3_region` value.) By default it should be `garage` and not `us-east-1`. Update the value in your `.env.development` file.
302
374
303
-
It is possible that the nudenet container pull fails with a 403 status code. This is likely because you are authenticated to the public AWS ECR and trying to pull a public image. Log out of the public ECR with `docker logout public.ecr.aws` and try building the devContainer again.
375
+
### Uploading files throws with "Invalid signature"
304
376
377
+
This error indicated that the keys to access the buckets are not correct, ensure that you have copied the full key (beware line breaks) and that they are available from the process env.
Copy file name to clipboardExpand all lines: src/services/file/repositories/s3.ts
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -47,10 +47,10 @@ export class S3FileRepository implements FileRepository {
47
47
region,
48
48
useAccelerateEndpoint,
49
49
credentials: { accessKeyId, secretAccessKey },
50
-
// this is necessary because localstack doesn't support hostnames eg: <bucket>.s3.<region>.amazonaws.com/<key>
51
-
// so it we must use pathStyle buckets eg: localhost:4566/<bucket>/<key>
50
+
// This was required when we used localstack in development, now it is legacy.
51
+
// Previously localstack did not allow the use of subdomains for bucket names and instead we had to use path-style urls: localhost:4566/<bucket>/<key> Instead of <bucket>.s3.<region>.amazonaws.com/<key>
52
52
forcePathStyle: true,
53
-
// this is necessary to use the localstack instance running on graasp-localstack or localhost
53
+
// this is necessary to use the garage instance
54
54
// this overrides the default endpoint (amazonaws.com) with S3_FILE_ITEM_HOST
0 commit comments