mirror of
https://github.com/cupcakearmy/morphus.git
synced 2024-12-21 23:56:27 +00:00
stuff
This commit is contained in:
parent
9500bcf68c
commit
a47d5974e4
@ -3,6 +3,8 @@ FROM node:16-alpine as base
|
||||
|
||||
WORKDIR /app
|
||||
RUN npm -g i pnpm@7
|
||||
# Needed for node-gyp
|
||||
RUN apk add --no-cache python3
|
||||
|
||||
# BUILDER
|
||||
FROM base as builder
|
||||
|
4
docker/local/morphus.yaml
Normal file
4
docker/local/morphus.yaml
Normal file
@ -0,0 +1,4 @@
|
||||
logLevel: warn
|
||||
|
||||
allowedDomains:
|
||||
- example.org
|
@ -2,9 +2,10 @@ import { config, StorageType } from '../dist/src/config.js'
|
||||
|
||||
const schema = config._def
|
||||
|
||||
function stringAsMarkdownCode(string) {
|
||||
return '`' + string + '`'
|
||||
}
|
||||
const asInlineCode = (s) => '`' + s + '`'
|
||||
const formatInline = (s, empty = '') => (s === undefined ? empty : asInlineCode(s))
|
||||
const formatEnv = (s) => formatInline(s, 'not supported')
|
||||
const formatDefault = (s) => formatInline(s, '')
|
||||
|
||||
for (const storage of Object.values(StorageType)) {
|
||||
const storageType = schema[storage]
|
||||
@ -13,7 +14,21 @@ for (const storage of Object.values(StorageType)) {
|
||||
| ---------------- | ------------------ | ------- | ------------------------ |
|
||||
`
|
||||
for (const [key, value] of Object.entries(storageType)) {
|
||||
table += `| \`${storage}.${key}\` | \`${value.env}\` | ${value.default} | ${value.doc} |\n`
|
||||
table += `| \`${storage}.${key}\` | ${formatEnv(value.env)} | ${formatDefault(value.default)} | ${value.doc} |\n`
|
||||
}
|
||||
|
||||
console.log(table)
|
||||
}
|
||||
|
||||
{
|
||||
let table = `
|
||||
| Config | Environment | Default | Description |
|
||||
| ------- | ----------- | ------- | ------------ |
|
||||
`
|
||||
|
||||
for (const [key, value] of Object.entries(schema)) {
|
||||
if (Object.values(StorageType).includes(key)) continue
|
||||
table += `| ${asInlineCode(key)} | ${formatEnv(value.env)} | ${formatDefault(value.default)} | ${value.doc} |\n`
|
||||
}
|
||||
|
||||
console.log(table)
|
||||
|
@ -83,14 +83,14 @@ export const config = convict({
|
||||
format: formatNullableStringOrRegexpArray,
|
||||
default: null as NullableStringOrRegexpArray,
|
||||
nullable: true,
|
||||
env: 'ALLOWED_DOMAINS',
|
||||
// env: 'ALLOWED_DOMAINS', // See: https://github.com/mozilla/node-convict/issues/399
|
||||
},
|
||||
allowedHosts: {
|
||||
doc: 'The hosts that are allowed to access the images',
|
||||
format: formatNullableStringOrRegexpArray,
|
||||
default: null as NullableStringOrRegexpArray,
|
||||
nullable: true,
|
||||
env: 'ALLOWED_HOSTS',
|
||||
// env: 'ALLOWED_HOSTS', // See: https://github.com/mozilla/node-convict/issues/399
|
||||
},
|
||||
cleanUrls: {
|
||||
doc: 'Whether to clean URLs',
|
||||
|
Loading…
Reference in New Issue
Block a user