implemented a lot of features
This commit is contained in:
1 parent
62f1767df3
commit
bcb9be5da9
141 files changed
+10705
-385
No files matched your search
@@ -32,6 +32,8 @@ export default await Env.create(new URL('../', import.meta.url), {
|
||||
DB_USER: Env.schema.string(),
|
||||
DB_PASSWORD: Env.schema.secret.optional(),
|
||||
DB_DATABASE: Env.schema.string(),
|
||||
DB_POOL_MAX: Env.schema.number.optional(),
|
||||
DB_SYNCHRONOUS_COMMIT: Env.schema.enum.optional(['on', 'off'] as const),
|
||||
|
||||
// Redis
|
||||
REDIS_HOST: Env.schema.string({ format: 'host' }),
|
||||
@@ -44,4 +46,32 @@ export default await Env.create(new URL('../', import.meta.url), {
|
||||
NNTP_USER: Env.schema.string(),
|
||||
NNTP_PASSWORD: Env.schema.secret(),
|
||||
NNTP_SECURE: Env.schema.boolean(),
|
||||
NNTP_POOL_SIZE: Env.schema.number.optional(),
|
||||
|
||||
// Indexer (config/indexer.ts)
|
||||
INDEX_INTERVAL_MS: Env.schema.number.optional(),
|
||||
INDEX_BATCH_SIZE: Env.schema.number.optional(),
|
||||
INDEX_MAX_BATCHES_PER_TICK: Env.schema.number.optional(),
|
||||
INDEX_INITIAL_BACKFILL: Env.schema.number.optional(),
|
||||
FETCH_CONCURRENCY: Env.schema.number.optional(),
|
||||
BODY_CONCURRENCY: Env.schema.number.optional(),
|
||||
COLLECTION_CONCURRENCY: Env.schema.number.optional(),
|
||||
DEFERRED_SETTLE_MS: Env.schema.number.optional(),
|
||||
DEFERRED_EXPAND_MAX_PARTS: Env.schema.number.optional(),
|
||||
DEFERRED_CONCURRENCY: Env.schema.number.optional(),
|
||||
SPOT_CONCURRENCY: Env.schema.number.optional(),
|
||||
|
||||
// Newznab API (/api): required as ?apikey= when set
|
||||
NEWZNAB_API_KEY: Env.schema.secret.optional(),
|
||||
|
||||
// Garbage collection (config/gc.ts)
|
||||
GC_INTERVAL_MS: Env.schema.number.optional(),
|
||||
GC_COMPLETED_AGE_SECONDS: Env.schema.number.optional(),
|
||||
GC_FAILED_AGE_SECONDS: Env.schema.number.optional(),
|
||||
GC_BINARY_STALE_SECONDS: Env.schema.number.optional(),
|
||||
GC_BODY_QUEUE_MAX: Env.schema.number.optional(),
|
||||
GC_DEFERRED_RETENTION_DAYS: Env.schema.number.optional(),
|
||||
GC_SINGLE_ARTICLE_SECONDS: Env.schema.number.optional(),
|
||||
GC_EMPTY_RELEASE_SECONDS: Env.schema.number.optional(),
|
||||
GC_DELETE_BUDGET_MS: Env.schema.number.optional(),
|
||||
})
|
||||
@@ -26,6 +26,7 @@ server.use([
|
||||
() => import('#middleware/force_json_response_middleware'),
|
||||
() => import('#middleware/container_bindings_middleware'),
|
||||
() => import('@adonisjs/cors/cors_middleware'),
|
||||
() => import('@adonisjs/static/static_middleware')
|
||||
])
|
||||
|
||||
/**
|
||||
|
||||
+15
-3
@@ -11,9 +11,21 @@ import { middleware } from '#start/kernel'
|
||||
import router from '@adonisjs/core/services/router'
|
||||
import { controllers } from '#generated/controllers'
|
||||
|
||||
router.get('/', () => {
|
||||
return { hello: 'world' }
|
||||
})
|
||||
const ReleasesController = () => import('#controllers/releases_controller')
|
||||
const NewznabController = () => import('#controllers/newznab_controller')
|
||||
|
||||
// Newznab API for Prowlarr / Sonarr / Radarr ("Generic Newznab", API path /api).
|
||||
router.get('/api', [NewznabController, 'handle'])
|
||||
|
||||
// Web interface: public/index.html is served by the static middleware at "/".
|
||||
router
|
||||
.group(() => {
|
||||
router.get('releases', [ReleasesController, 'index'])
|
||||
router.get('releases/:id', [ReleasesController, 'show']).where('id', router.matchers.number())
|
||||
router.get('releases/:id/nzb', [ReleasesController, 'nzb']).where('id', router.matchers.number())
|
||||
router.get('stats', [ReleasesController, 'stats'])
|
||||
})
|
||||
.prefix('/api/v1')
|
||||
|
||||
router
|
||||
.group(() => {
|
||||
|
||||
Reference in new issue
Block a user