Skip to content

Commit

Permalink
feat(storage): add MinIO to Render blueprint and minio adapter #5
Browse files Browse the repository at this point in the history
  • Loading branch information
TillaTheHun0 committed Aug 24, 2023
1 parent 77684c0 commit bd66743
Show file tree
Hide file tree
Showing 6 changed files with 311 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ Using the `render.yaml` file, 6 `docker` services are provisioned:
- [x] The hyper Service, using the RESTful api, so that you may consume your services over Http.
- [x] MongoDB to power hyper data
- [x] Redis to power hyper cache
- [ ] Elasticsearch to power hyper search
- [ ] Minio to power hyper storage
- [x] Elasticsearch to power hyper search
- [x] Minio to power hyper storage
- [ ] RabbitMQ to power hyper queue

Where needed a [Render Disk](https://render.com/docs/disks) is mounted on the service, for
Expand Down
3 changes: 2 additions & 1 deletion app/deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ export { default as app } from 'https://raw.githubusercontent.com/hyper63/hyper/
// hyper driven adapters
export { default as mongodb } from 'https://raw.githubusercontent.com/hyper63/hyper-adapter-mongodb/v3.1.3/mod.ts';
export { default as redis } from 'https://raw.githubusercontent.com/hyper63/hyper-adapter-redis/v3.0.0/mod.js';
export { default as hooks } from 'https://raw.githubusercontent.com/hyper63/hyper-adapter-hooks/v1.0.6/mod.js';
export { default as elasticsearch } from 'https://raw.githubusercontent.com/hyper63/hyper-adapter-elasticsearch/v2.0.2/mod.js';
export { default as minio } from 'https://raw.githubusercontent.com/hyper63/hyper-adapter-minio/v1.0.1/mod.js';
export { default as hooks } from 'https://raw.githubusercontent.com/hyper63/hyper-adapter-hooks/v1.0.6/mod.js';
15 changes: 14 additions & 1 deletion app/mod.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { app, elasticsearch, type express, hyper, mongodb, redis } from './deps.ts';
import { app, elasticsearch, type express, hyper, minio, mongodb, redis } from './deps.ts';
import { env, verifyAuthorizationHeader } from './utils.ts';

/**
Expand Down Expand Up @@ -54,6 +54,19 @@ export default hyper({
],
},
{ port: 'search', plugins: [elasticsearch({ url: `http://${env('ELASTICSEARCH_HOST')}` })] },
// Use the public url, so presigned url signatures match
{
port: 'storage',
plugins: [
minio({
url: `https://${env('MINIO_USERNAME')}:${env('MINIO_PASSWORD')}@${
env('MINIO_HOST')
}.onrender.com`,
bucketPrefix: 'hyper',
useNamespacedBucket: false,
}),
],
},
],
middleware: [authMiddleware({ sub: env('SUB'), secret: env('SECRET') })],
});
Loading

0 comments on commit bd66743

Please sign in to comment.