Compare commits
57 Commits
v3
...
dependabot
Author | SHA1 | Date | |
---|---|---|---|
7ca3a9e7a6 | |||
fd30cfe98b | |||
6f281fef42 | |||
41bbfcf165 | |||
80a93e17fa | |||
4a1eebc54b | |||
264ba71462 | |||
e229fa89f8 | |||
d3b72ae07d | |||
b62b6b5112 | |||
c44f8c6155 | |||
0dfa3d9ca3 | |||
8c7c84906b | |||
662143cf21 | |||
c60fc7926e | |||
cfbdc6c340 | |||
2f6d8257ec | |||
b9a6b5d4f5 | |||
32f77dbcee | |||
052cb8f12d | |||
03b544023b | |||
5070499cfd | |||
e77b13d36e | |||
4bb237d7c2 | |||
aa5a7faa94 | |||
837f4dcbd4 | |||
d73a246b66 | |||
f85e82973d | |||
84afec567c | |||
e1525e5d56 | |||
d2688cf08c | |||
7372319568 | |||
60ffec5c64 | |||
23c88f6955 | |||
dd14207b63 | |||
103adfbb57 | |||
b673ebe2ca | |||
0e0c3df0cd | |||
8dbd482e08 | |||
ab5f7c0f26 | |||
191f493eb9 | |||
d1f4640a9c | |||
3d97f4578d | |||
fb0ef08fd8 | |||
0de78205b5 | |||
e0821bd927 | |||
e5966b54a8 | |||
d2f6b09901 | |||
5c8aa8517b | |||
1e5916db28 | |||
a3ae6956e2 | |||
518b84b38b | |||
932dc4bf02 | |||
bdc3a555b6 | |||
d4dcb61ee6 | |||
cce73beb2d | |||
063ac4619f |
@ -1,8 +0,0 @@
|
|||||||
# Ignore everything
|
|
||||||
*
|
|
||||||
|
|
||||||
# Only allow the following for docker build:
|
|
||||||
!backend/
|
|
||||||
!docker/
|
|
||||||
!scripts/
|
|
||||||
!test/
|
|
24
.gitignore
vendored
24
.gitignore
vendored
@ -1,25 +1,5 @@
|
|||||||
git.idea
|
|
||||||
.env
|
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
.idea
|
||||||
._*
|
._*
|
||||||
*.code-workspace
|
|
||||||
vendor
|
|
||||||
bin/*
|
|
||||||
backend/config.json
|
|
||||||
backend/embed/assets
|
|
||||||
test/node_modules
|
|
||||||
*/node_modules
|
|
||||||
docs/.vuepress/dist
|
|
||||||
frontend/build
|
|
||||||
frontend/yarn-error.log
|
|
||||||
frontend/.npmrc
|
|
||||||
frontend/src/locale/lang
|
|
||||||
test/cypress/fixtures/example.json
|
|
||||||
.vscode
|
.vscode
|
||||||
docker-build
|
certbot-help.txt
|
||||||
data
|
|
||||||
dist
|
|
||||||
backend/embed/acme.sh
|
|
||||||
docker/dev/resolv.conf
|
|
||||||
docker/dev/dnsrouter-config.json.tmp
|
|
||||||
|
|
||||||
|
@ -1,93 +0,0 @@
|
|||||||
# Development
|
|
||||||
|
|
||||||
```bash
|
|
||||||
git clone nginxproxymanager
|
|
||||||
cd nginxproxymanager
|
|
||||||
./scripts/start-dev
|
|
||||||
# wait a minute or 2 for the package to build after container start
|
|
||||||
curl http://127.0.0.1:3081/api/
|
|
||||||
```
|
|
||||||
|
|
||||||
## Using Local Test Certificate Authorities
|
|
||||||
|
|
||||||
It's handy to use these instead of hitting production or staging acme servers
|
|
||||||
when testing lots of stuff.
|
|
||||||
|
|
||||||
Firstly create your first user using the api:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
curl --request POST \
|
|
||||||
--url http://127.0.0.1:3081/api/users \
|
|
||||||
--header 'Content-Type: application/json' \
|
|
||||||
--data '{
|
|
||||||
"name": "Bobby Tables",
|
|
||||||
"nickname": "Bobby",
|
|
||||||
"email": "you@example.com",
|
|
||||||
"roles": ["admin"],
|
|
||||||
"is_disabled": false,
|
|
||||||
"auth": {
|
|
||||||
"type": "password",
|
|
||||||
"secret": "changeme"
|
|
||||||
}
|
|
||||||
}'
|
|
||||||
```
|
|
||||||
|
|
||||||
Then login in with those credentials to get your JWT token and set
|
|
||||||
that as an environment variable:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
NPM_TOKEN=$(curl --request POST \
|
|
||||||
--url http://127.0.0.1:3081/api/tokens \
|
|
||||||
--header 'Content-Type: application/json' \
|
|
||||||
--data '{
|
|
||||||
"type": "password",
|
|
||||||
"identity": "you@example.com",
|
|
||||||
"secret": "changeme"
|
|
||||||
}' | jq -r '.result.token')
|
|
||||||
```
|
|
||||||
|
|
||||||
Then choose one or both of the following CA's to set up.
|
|
||||||
|
|
||||||
### SmallStep Acme CA
|
|
||||||
|
|
||||||
[StepCA](https://github.com/smallstep/certificates) is SmallSteps's test CA server.
|
|
||||||
|
|
||||||
- ✅ HTTP Validation
|
|
||||||
- ✅ DNS Validation
|
|
||||||
|
|
||||||
Create a Certificate Authority that points to the Step CA:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
curl --request POST \
|
|
||||||
--url http://127.0.0.1:3081/api/certificate-authorities \
|
|
||||||
--header "Authorization: Bearer ${NPM_TOKEN}" \
|
|
||||||
--header 'Content-Type: application/json' \
|
|
||||||
--data '{
|
|
||||||
"name": "Step CA",
|
|
||||||
"acmesh_server": "https://ca.internal/acme/acme/directory",
|
|
||||||
"ca_bundle": "/etc/ssl/certs/NginxProxyManager.crt",
|
|
||||||
"max_domains": 2
|
|
||||||
}'
|
|
||||||
```
|
|
||||||
|
|
||||||
### Pebble Test Acme CA
|
|
||||||
|
|
||||||
[Pebble](https://github.com/letsencrypt/pebble) is Let's Encrypt's own test CA server.
|
|
||||||
|
|
||||||
- ✅ HTTP Validation
|
|
||||||
- ❌ DNS Validation
|
|
||||||
|
|
||||||
Create a Certificate Authority that points to the Pebble CA:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
curl --request POST \
|
|
||||||
--url http://127.0.0.1:3081/api/certificate-authorities \
|
|
||||||
--header "Authorization: Bearer ${NPM_TOKEN}" \
|
|
||||||
--header 'Content-Type: application/json' \
|
|
||||||
--data '{
|
|
||||||
"name": "Pebble CA",
|
|
||||||
"acmesh_server": "https://pebble/dir",
|
|
||||||
"ca_bundle": "/etc/ssl/certs/pebble.minica.pem",
|
|
||||||
"max_domains": 2
|
|
||||||
}'
|
|
||||||
```
|
|
166
Jenkinsfile
vendored
166
Jenkinsfile
vendored
@ -8,18 +8,14 @@ pipeline {
|
|||||||
ansiColor('xterm')
|
ansiColor('xterm')
|
||||||
}
|
}
|
||||||
environment {
|
environment {
|
||||||
DOCKER_ORG = 'jc21'
|
IMAGE = "nginx-proxy-manager"
|
||||||
IMAGE = 'nginx-proxy-manager'
|
|
||||||
BUILD_VERSION = getVersion()
|
BUILD_VERSION = getVersion()
|
||||||
BUILD_COMMIT = getCommit()
|
MAJOR_VERSION = "2"
|
||||||
MAJOR_VERSION = '3'
|
|
||||||
BRANCH_LOWER = "${BRANCH_NAME.toLowerCase().replaceAll('/', '-')}"
|
BRANCH_LOWER = "${BRANCH_NAME.toLowerCase().replaceAll('/', '-')}"
|
||||||
COMPOSE_PROJECT_NAME = "npm_${BRANCH_LOWER}_${BUILD_NUMBER}"
|
COMPOSE_PROJECT_NAME = "npm_${BRANCH_LOWER}_${BUILD_NUMBER}"
|
||||||
COMPOSE_FILE = 'docker/docker-compose.ci.yml'
|
COMPOSE_FILE = 'docker/docker-compose.ci.yml'
|
||||||
COMPOSE_INTERACTIVE_NO_CLI = 1
|
COMPOSE_INTERACTIVE_NO_CLI = 1
|
||||||
BUILDX_NAME = "${COMPOSE_PROJECT_NAME}"
|
BUILDX_NAME = "${COMPOSE_PROJECT_NAME}"
|
||||||
DOCS_BUCKET = 'jc21-npm-site-next' // TODO: change to prod when official
|
|
||||||
DOCS_CDN = 'E2Z0128EHS0Q23' // TODO: same
|
|
||||||
}
|
}
|
||||||
stages {
|
stages {
|
||||||
stage('Environment') {
|
stage('Environment') {
|
||||||
@ -30,9 +26,7 @@ pipeline {
|
|||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
env.BUILDX_PUSH_TAGS = "-t docker.io/${DOCKER_ORG}/${IMAGE}:${BUILD_VERSION} -t docker.io/${DOCKER_ORG}/${IMAGE}:${MAJOR_VERSION} -t docker.io/${DOCKER_ORG}/${IMAGE}:latest"
|
env.BUILDX_PUSH_TAGS = "-t docker.io/jc21/${IMAGE}:${BUILD_VERSION} -t docker.io/jc21/${IMAGE}:${MAJOR_VERSION} -t docker.io/jc21/${IMAGE}:latest"
|
||||||
echo 'Building on Master is disabled!'
|
|
||||||
sh 'exit 1'
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -45,77 +39,100 @@ pipeline {
|
|||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
// Defaults to the Branch name, which is applies to all branches AND pr's
|
// Defaults to the Branch name, which is applies to all branches AND pr's
|
||||||
// env.BUILDX_PUSH_TAGS = "-t docker.io/jc21/${IMAGE}:github-${BRANCH_LOWER}"
|
env.BUILDX_PUSH_TAGS = "-t docker.io/jc21/${IMAGE}:github-${BRANCH_LOWER}"
|
||||||
env.BUILDX_PUSH_TAGS = "-t docker.io/${DOCKER_ORG}/${IMAGE}:v3"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
stage('Versions') {
|
||||||
|
steps {
|
||||||
|
sh 'cat frontend/package.json | jq --arg BUILD_VERSION "${BUILD_VERSION}" \'.version = $BUILD_VERSION\' | sponge frontend/package.json'
|
||||||
|
sh 'echo -e "\\E[1;36mFrontend Version is:\\E[1;33m $(cat frontend/package.json | jq -r .version)\\E[0m"'
|
||||||
|
sh 'cat backend/package.json | jq --arg BUILD_VERSION "${BUILD_VERSION}" \'.version = $BUILD_VERSION\' | sponge backend/package.json'
|
||||||
|
sh 'echo -e "\\E[1;36mBackend Version is:\\E[1;33m $(cat backend/package.json | jq -r .version)\\E[0m"'
|
||||||
|
sh 'sed -i -E "s/(version-)[0-9]+\\.[0-9]+\\.[0-9]+(-green)/\\1${BUILD_VERSION}\\2/" README.md'
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Frontend') {
|
stage('Frontend') {
|
||||||
steps {
|
steps {
|
||||||
sh './scripts/ci/build-frontend'
|
sh './scripts/frontend-build'
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
post {
|
|
||||||
always {
|
|
||||||
junit 'frontend/eslint.xml'
|
|
||||||
junit 'frontend/junit.xml'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
stage('Backend') {
|
stage('Backend') {
|
||||||
steps {
|
steps {
|
||||||
withCredentials([string(credentialsId: 'npm-sentry-dsn', variable: 'SENTRY_DSN')]) {
|
echo 'Checking Syntax ...'
|
||||||
withCredentials([usernamePassword(credentialsId: 'oss-index-token', passwordVariable: 'NANCY_TOKEN', usernameVariable: 'NANCY_USER')]) {
|
sh 'docker pull nginxproxymanager/nginx-full:certbot-node'
|
||||||
sh './scripts/ci/test-backend'
|
// See: https://github.com/yarnpkg/yarn/issues/3254
|
||||||
}
|
sh '''docker run --rm \\
|
||||||
sh './scripts/ci/build-backend'
|
-v "$(pwd)/backend:/app" \\
|
||||||
sh '''docker build --pull --no-cache \\
|
-v "$(pwd)/global:/app/global" \\
|
||||||
-t "${IMAGE}:${BRANCH_LOWER}-ci-${BUILD_NUMBER}" \\
|
-w /app \\
|
||||||
|
nginxproxymanager/nginx-full:certbot-node \\
|
||||||
|
sh -c "yarn install && yarn eslint . && rm -rf node_modules"
|
||||||
|
'''
|
||||||
|
|
||||||
|
echo 'Docker Build ...'
|
||||||
|
sh '''docker build --pull --no-cache --squash --compress \\
|
||||||
|
-t "${IMAGE}:ci-${BUILD_NUMBER}" \\
|
||||||
-f docker/Dockerfile \\
|
-f docker/Dockerfile \\
|
||||||
|
--build-arg TARGETPLATFORM=linux/amd64 \\
|
||||||
|
--build-arg BUILDPLATFORM=linux/amd64 \\
|
||||||
|
--build-arg BUILD_VERSION="${BUILD_VERSION}" \\
|
||||||
--build-arg BUILD_COMMIT="${BUILD_COMMIT}" \\
|
--build-arg BUILD_COMMIT="${BUILD_COMMIT}" \\
|
||||||
--build-arg BUILD_DATE="$(date '+%Y-%m-%d %T %Z')" \\
|
--build-arg BUILD_DATE="$(date '+%Y-%m-%d %T %Z')" \\
|
||||||
--build-arg BUILD_VERSION="${BUILD_VERSION}" \\
|
|
||||||
.
|
.
|
||||||
'''
|
'''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
post {
|
stage('Integration Tests Sqlite') {
|
||||||
success {
|
|
||||||
archiveArtifacts allowEmptyArchive: false, artifacts: 'bin/*'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
stage('Test') {
|
|
||||||
when {
|
|
||||||
not {
|
|
||||||
equals expected: 'UNSTABLE', actual: currentBuild.result
|
|
||||||
}
|
|
||||||
}
|
|
||||||
steps {
|
steps {
|
||||||
// Docker image check
|
// Bring up a stack
|
||||||
/*
|
sh 'docker-compose up -d fullstack-sqlite'
|
||||||
sh '''docker run --rm \
|
sh './scripts/wait-healthy $(docker-compose ps -q fullstack-sqlite) 120'
|
||||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
|
||||||
-v "$(pwd)/docker:/app" \
|
// Run tests
|
||||||
-e CI=true \
|
sh 'rm -rf test/results'
|
||||||
wagoodman/dive:latest --ci-config /app/.dive-ci \
|
sh 'docker-compose up cypress-sqlite'
|
||||||
"${IMAGE}:${BRANCH_LOWER}-ci-${BUILD_NUMBER}"
|
// Get results
|
||||||
'''
|
sh 'docker cp -L "$(docker-compose ps -q cypress-sqlite):/test/results" test/'
|
||||||
*/
|
|
||||||
sh './scripts/ci/fulltest-cypress'
|
|
||||||
}
|
}
|
||||||
post {
|
post {
|
||||||
always {
|
always {
|
||||||
// Dumps to analyze later
|
// Dumps to analyze later
|
||||||
sh 'mkdir -p debug'
|
sh 'mkdir -p debug'
|
||||||
sh 'docker-compose logs fullstack > debug/docker_fullstack.log'
|
sh 'docker-compose logs fullstack-sqlite | gzip > debug/docker_fullstack_sqlite.log.gz'
|
||||||
sh 'docker-compose logs stepca > debug/docker_stepca.log'
|
sh 'docker-compose logs db | gzip > debug/docker_db.log.gz'
|
||||||
sh 'docker-compose logs pdns > debug/docker_pdns.log'
|
// Cypress videos and screenshot artifacts
|
||||||
sh 'docker-compose logs pdns-db > debug/docker_pdns-db.log'
|
dir(path: 'test/results') {
|
||||||
sh 'docker-compose logs dnsrouter > debug/docker_dnsrouter.log'
|
archiveArtifacts allowEmptyArchive: true, artifacts: '**/*', excludes: '**/*.xml'
|
||||||
|
}
|
||||||
|
junit 'test/results/junit/*'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage('Integration Tests Mysql') {
|
||||||
|
steps {
|
||||||
|
// Bring up a stack
|
||||||
|
sh 'docker-compose up -d fullstack-mysql'
|
||||||
|
sh './scripts/wait-healthy $(docker-compose ps -q fullstack-mysql) 120'
|
||||||
|
|
||||||
|
// Run tests
|
||||||
|
sh 'rm -rf test/results'
|
||||||
|
sh 'docker-compose up cypress-mysql'
|
||||||
|
// Get results
|
||||||
|
sh 'docker cp -L "$(docker-compose ps -q cypress-mysql):/test/results" test/'
|
||||||
|
}
|
||||||
|
post {
|
||||||
|
always {
|
||||||
|
// Dumps to analyze later
|
||||||
|
sh 'mkdir -p debug'
|
||||||
|
sh 'docker-compose logs fullstack-mysql | gzip > debug/docker_fullstack_mysql.log.gz'
|
||||||
|
sh 'docker-compose logs db | gzip > debug/docker_db.log.gz'
|
||||||
|
// Cypress videos and screenshot artifacts
|
||||||
|
dir(path: 'test/results') {
|
||||||
|
archiveArtifacts allowEmptyArchive: true, artifacts: '**/*', excludes: '**/*.xml'
|
||||||
|
}
|
||||||
junit 'test/results/junit/*'
|
junit 'test/results/junit/*'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -132,14 +149,11 @@ pipeline {
|
|||||||
sh 'yarn build'
|
sh 'yarn build'
|
||||||
}
|
}
|
||||||
|
|
||||||
// API Docs:
|
|
||||||
sh 'docker-compose exec -T fullstack curl -s --output /temp-docs/api-schema.json "http://fullstack:81/api/schema"'
|
|
||||||
sh 'mkdir -p "docs/.vuepress/dist/api"'
|
|
||||||
sh 'mv docs/api-schema.json docs/.vuepress/dist/api/'
|
|
||||||
|
|
||||||
dir(path: 'docs/.vuepress/dist') {
|
dir(path: 'docs/.vuepress/dist') {
|
||||||
sh 'tar -czf ../../docs.tgz *'
|
sh 'tar -czf ../../docs.tgz *'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
archiveArtifacts(artifacts: 'docs/docs.tgz', allowEmptyArchive: false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('MultiArch Build') {
|
stage('MultiArch Build') {
|
||||||
@ -149,19 +163,18 @@ pipeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
withCredentials([string(credentialsId: 'npm-sentry-dsn', variable: 'SENTRY_DSN')]) {
|
|
||||||
withCredentials([usernamePassword(credentialsId: 'jc21-dockerhub', passwordVariable: 'dpass', usernameVariable: 'duser')]) {
|
withCredentials([usernamePassword(credentialsId: 'jc21-dockerhub', passwordVariable: 'dpass', usernameVariable: 'duser')]) {
|
||||||
sh 'docker login -u "${duser}" -p "${dpass}"'
|
// Docker Login
|
||||||
sh './scripts/buildx --push ${BUILDX_PUSH_TAGS}'
|
sh "docker login -u '${duser}' -p '${dpass}'"
|
||||||
// sh './scripts/buildx -o type=local,dest=docker-build'
|
// Buildx with push from cache
|
||||||
}
|
sh "./scripts/buildx --push ${BUILDX_PUSH_TAGS}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Docs Deploy') {
|
stage('Docs Deploy') {
|
||||||
when {
|
when {
|
||||||
allOf {
|
allOf {
|
||||||
branch 'v3' // TOODO: change to master when ready
|
branch 'master'
|
||||||
not {
|
not {
|
||||||
equals expected: 'UNSTABLE', actual: currentBuild.result
|
equals expected: 'UNSTABLE', actual: currentBuild.result
|
||||||
}
|
}
|
||||||
@ -171,7 +184,7 @@ pipeline {
|
|||||||
withCredentials([[$class: 'AmazonWebServicesCredentialsBinding', accessKeyVariable: 'AWS_ACCESS_KEY_ID', credentialsId: 'npm-s3-docs', secretKeyVariable: 'AWS_SECRET_ACCESS_KEY']]) {
|
withCredentials([[$class: 'AmazonWebServicesCredentialsBinding', accessKeyVariable: 'AWS_ACCESS_KEY_ID', credentialsId: 'npm-s3-docs', secretKeyVariable: 'AWS_SECRET_ACCESS_KEY']]) {
|
||||||
sh """docker run --rm \\
|
sh """docker run --rm \\
|
||||||
--name \${COMPOSE_PROJECT_NAME}-docs-upload \\
|
--name \${COMPOSE_PROJECT_NAME}-docs-upload \\
|
||||||
-e S3_BUCKET=$DOCS_BUCKET \\
|
-e S3_BUCKET=jc21-npm-site \\
|
||||||
-e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \\
|
-e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \\
|
||||||
-e AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY \\
|
-e AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY \\
|
||||||
-v \$(pwd):/app \\
|
-v \$(pwd):/app \\
|
||||||
@ -185,7 +198,7 @@ pipeline {
|
|||||||
-e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \\
|
-e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \\
|
||||||
-e AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY \\
|
-e AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY \\
|
||||||
jc21/ci-tools \\
|
jc21/ci-tools \\
|
||||||
aws cloudfront create-invalidation --distribution-id $DOCS_CDN --paths '/*'
|
aws cloudfront create-invalidation --distribution-id EN1G6DEWZUTDT --paths '/*'
|
||||||
"""
|
"""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -201,34 +214,27 @@ pipeline {
|
|||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
def comment = pullRequest.comment("This is an automated message from CI:\n\nDocker Image for build ${BUILD_NUMBER} is available on [DockerHub](https://cloud.docker.com/repository/docker/${DOCKER_ORG}/${IMAGE}) as `${DOCKER_ORG}/${IMAGE}:github-${BRANCH_LOWER}`\n\n**Note:** ensure you backup your NPM instance before testing this PR image! Especially if this PR contains database changes.")
|
def comment = pullRequest.comment("This is an automated message from CI:\n\nDocker Image for build ${BUILD_NUMBER} is available on [DockerHub](https://cloud.docker.com/repository/docker/jc21/${IMAGE}) as `jc21/${IMAGE}:github-${BRANCH_LOWER}`\n\n**Note:** ensure you backup your NPM instance before testing this PR image! Especially if this PR contains database changes.")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
post {
|
post {
|
||||||
always {
|
always {
|
||||||
sh 'docker-compose down --rmi all --remove-orphans --volumes -t 30 || true'
|
sh 'docker-compose down --remove-orphans --volumes -t 30'
|
||||||
sh './scripts/ci/build-cleanup'
|
sh 'echo Reverting ownership'
|
||||||
echo 'Reverting ownership'
|
sh 'docker run --rm -v $(pwd):/data jc21/ci-tools chown -R $(id -u):$(id -g) /data'
|
||||||
sh 'docker run --rm -v $(pwd):/data jc21/gotools:latest chown -R "$(id -u):$(id -g)" /data'
|
|
||||||
}
|
}
|
||||||
success {
|
success {
|
||||||
juxtapose event: 'success'
|
juxtapose event: 'success'
|
||||||
sh 'figlet "SUCCESS"'
|
sh 'figlet "SUCCESS"'
|
||||||
}
|
}
|
||||||
failure {
|
failure {
|
||||||
dir(path: 'test') {
|
|
||||||
archiveArtifacts allowEmptyArchive: true, artifacts: 'results/**/*', excludes: '**/*.xml'
|
|
||||||
}
|
|
||||||
archiveArtifacts(artifacts: 'debug/**.*', allowEmptyArchive: true)
|
archiveArtifacts(artifacts: 'debug/**.*', allowEmptyArchive: true)
|
||||||
juxtapose event: 'failure'
|
juxtapose event: 'failure'
|
||||||
sh 'figlet "FAILURE"'
|
sh 'figlet "FAILURE"'
|
||||||
}
|
}
|
||||||
unstable {
|
unstable {
|
||||||
dir(path: 'test') {
|
|
||||||
archiveArtifacts allowEmptyArchive: true, artifacts: 'results/**/*', excludes: '**/*.xml'
|
|
||||||
}
|
|
||||||
archiveArtifacts(artifacts: 'debug/**.*', allowEmptyArchive: true)
|
archiveArtifacts(artifacts: 'debug/**.*', allowEmptyArchive: true)
|
||||||
juxtapose event: 'unstable'
|
juxtapose event: 'unstable'
|
||||||
sh 'figlet "UNSTABLE"'
|
sh 'figlet "UNSTABLE"'
|
||||||
|
24
README.md
24
README.md
@ -29,7 +29,7 @@ so that the barrier for entry here is low.
|
|||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
- Beautiful and Secure Admin Interface based on [Chakra UI](https://chakra-ui.com/)
|
- Beautiful and Secure Admin Interface based on [Tabler](https://tabler.github.io/)
|
||||||
- Easily create forwarding domains, redirections, streams and 404 hosts without knowing anything about Nginx
|
- Easily create forwarding domains, redirections, streams and 404 hosts without knowing anything about Nginx
|
||||||
- Free SSL using Let's Encrypt or provide your own custom SSL certificates
|
- Free SSL using Let's Encrypt or provide your own custom SSL certificates
|
||||||
- Access Lists and basic HTTP Authentication for your hosts
|
- Access Lists and basic HTTP Authentication for your hosts
|
||||||
@ -46,8 +46,7 @@ I won't go in to too much detail here but here are the basics for someone new to
|
|||||||
3. Configure your domain name details to point to your home, either with a static ip or a service like DuckDNS or [Amazon Route53](https://github.com/jc21/route53-ddns)
|
3. Configure your domain name details to point to your home, either with a static ip or a service like DuckDNS or [Amazon Route53](https://github.com/jc21/route53-ddns)
|
||||||
4. Use the Nginx Proxy Manager as your gateway to forward to your other web based services
|
4. Use the Nginx Proxy Manager as your gateway to forward to your other web based services
|
||||||
|
|
||||||
|
## Quick Setup
|
||||||
## Quickest Setup
|
|
||||||
|
|
||||||
1. Install Docker and Docker-Compose
|
1. Install Docker and Docker-Compose
|
||||||
|
|
||||||
@ -60,7 +59,7 @@ I won't go in to too much detail here but here are the basics for someone new to
|
|||||||
version: '3'
|
version: '3'
|
||||||
services:
|
services:
|
||||||
app:
|
app:
|
||||||
image: 'jc21/nginx-proxy-manager:v3'
|
image: 'jc21/nginx-proxy-manager:latest'
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
ports:
|
ports:
|
||||||
- '80:80'
|
- '80:80'
|
||||||
@ -68,6 +67,7 @@ services:
|
|||||||
- '443:443'
|
- '443:443'
|
||||||
volumes:
|
volumes:
|
||||||
- ./data:/data
|
- ./data:/data
|
||||||
|
- ./letsencrypt:/etc/letsencrypt
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Bring up your stack by running
|
3. Bring up your stack by running
|
||||||
@ -77,25 +77,33 @@ docker-compose up -d
|
|||||||
|
|
||||||
# If using docker-compose-plugin
|
# If using docker-compose-plugin
|
||||||
docker compose up -d
|
docker compose up -d
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
4. Log in to the Admin UI
|
4. Log in to the Admin UI
|
||||||
|
|
||||||
When your docker container is running, connect to it on port `81` for the admin interface.
|
When your docker container is running, connect to it on port `81` for the admin interface.
|
||||||
|
Sometimes this can take a little bit because of the entropy of keys.
|
||||||
|
|
||||||
[http://127.0.0.1:81](http://127.0.0.1:81)
|
[http://127.0.0.1:81](http://127.0.0.1:81)
|
||||||
|
|
||||||
|
Default Admin User:
|
||||||
|
```
|
||||||
|
Email: admin@example.com
|
||||||
|
Password: changeme
|
||||||
|
```
|
||||||
|
|
||||||
|
Immediately after logging in with this default user you will be asked to modify your details and change your password.
|
||||||
|
|
||||||
|
|
||||||
## Contributors
|
## Contributors
|
||||||
|
|
||||||
Special thanks to [all of our contributors](https://github.com/NginxProxyManager/nginx-proxy-manager/graphs/contributors).
|
Special thanks to [all of our contributors](https://github.com/NginxProxyManager/nginx-proxy-manager/graphs/contributors).
|
||||||
|
|
||||||
|
|
||||||
## Getting Support
|
## Getting Support
|
||||||
|
|
||||||
1. [Found a bug?](https://github.com/NginxProxyManager/nginx-proxy-manager/issues)
|
1. [Found a bug?](https://github.com/NginxProxyManager/nginx-proxy-manager/issues)
|
||||||
2. [Discussions](https://github.com/NginxProxyManager/nginx-proxy-manager/discussions)
|
2. [Discussions](https://github.com/NginxProxyManager/nginx-proxy-manager/discussions)
|
||||||
3. [Development Gitter](https://gitter.im/nginx-proxy-manager/community)
|
3. [Development Gitter](https://gitter.im/nginx-proxy-manager/community)
|
||||||
4. [Reddit](https://reddit.com/r/nginxproxymanager)
|
4. [Reddit](https://reddit.com/r/nginxproxymanager)
|
||||||
|
|
||||||
## Become a Contributor
|
|
||||||
|
|
||||||
A guide to setting up your own development environment [is found here](DEV-README.md).
|
|
||||||
|
@ -1,8 +0,0 @@
|
|||||||
root = true
|
|
||||||
|
|
||||||
[*]
|
|
||||||
indent_style = tab
|
|
||||||
indent_size = 4
|
|
||||||
charset = utf-8
|
|
||||||
trim_trailing_whitespace = true
|
|
||||||
insert_final_newline = false
|
|
73
backend/.eslintrc.json
Normal file
73
backend/.eslintrc.json
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
{
|
||||||
|
"env": {
|
||||||
|
"node": true,
|
||||||
|
"es6": true
|
||||||
|
},
|
||||||
|
"extends": [
|
||||||
|
"eslint:recommended"
|
||||||
|
],
|
||||||
|
"globals": {
|
||||||
|
"Atomics": "readonly",
|
||||||
|
"SharedArrayBuffer": "readonly"
|
||||||
|
},
|
||||||
|
"parserOptions": {
|
||||||
|
"ecmaVersion": 2018,
|
||||||
|
"sourceType": "module"
|
||||||
|
},
|
||||||
|
"plugins": [
|
||||||
|
"align-assignments"
|
||||||
|
],
|
||||||
|
"rules": {
|
||||||
|
"arrow-parens": [
|
||||||
|
"error",
|
||||||
|
"always"
|
||||||
|
],
|
||||||
|
"indent": [
|
||||||
|
"error",
|
||||||
|
"tab"
|
||||||
|
],
|
||||||
|
"linebreak-style": [
|
||||||
|
"error",
|
||||||
|
"unix"
|
||||||
|
],
|
||||||
|
"quotes": [
|
||||||
|
"error",
|
||||||
|
"single"
|
||||||
|
],
|
||||||
|
"semi": [
|
||||||
|
"error",
|
||||||
|
"always"
|
||||||
|
],
|
||||||
|
"key-spacing": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
"align": "value"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"comma-spacing": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
"before": false,
|
||||||
|
"after": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"func-call-spacing": [
|
||||||
|
"error",
|
||||||
|
"never"
|
||||||
|
],
|
||||||
|
"keyword-spacing": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
"before": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"no-irregular-whitespace": "error",
|
||||||
|
"no-unused-expressions": 0,
|
||||||
|
"align-assignments/align-assignments": [
|
||||||
|
2,
|
||||||
|
{
|
||||||
|
"requiresOnly": false
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
8
backend/.gitignore
vendored
Normal file
8
backend/.gitignore
vendored
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
config/development.json
|
||||||
|
data/*
|
||||||
|
yarn-error.log
|
||||||
|
tmp
|
||||||
|
certbot.log
|
||||||
|
node_modules
|
||||||
|
core.*
|
||||||
|
|
@ -1,56 +0,0 @@
|
|||||||
linters:
|
|
||||||
enable:
|
|
||||||
- bodyclose
|
|
||||||
- errcheck
|
|
||||||
- gosimple
|
|
||||||
- govet
|
|
||||||
- gosec
|
|
||||||
- goconst
|
|
||||||
- gocritic
|
|
||||||
- gocyclo
|
|
||||||
- gofmt
|
|
||||||
- goimports
|
|
||||||
- ineffassign
|
|
||||||
- misspell
|
|
||||||
- nakedret
|
|
||||||
- prealloc
|
|
||||||
#- revive
|
|
||||||
- staticcheck
|
|
||||||
- typecheck
|
|
||||||
- unused
|
|
||||||
- unconvert
|
|
||||||
- unparam
|
|
||||||
linters-settings:
|
|
||||||
goconst:
|
|
||||||
# minimal length of string constant
|
|
||||||
# default: 3
|
|
||||||
min-len: 2
|
|
||||||
# minimum number of occurrences of string constant
|
|
||||||
# default: 3
|
|
||||||
min-occurences: 2
|
|
||||||
misspell:
|
|
||||||
locale: UK
|
|
||||||
ignore-words:
|
|
||||||
- color
|
|
||||||
issues:
|
|
||||||
# Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
|
|
||||||
# We have chosen an arbitrary value that works based on practical usage.
|
|
||||||
max-same: 20
|
|
||||||
# See cmdline flag documentation for more info about default excludes --exclude-use-default
|
|
||||||
# Nothing is excluded by default
|
|
||||||
exclude-use-default: false
|
|
||||||
# Excluding configuration per-path, per-linter, per-text and per-source
|
|
||||||
exclude-rules:
|
|
||||||
# Exclude some linters from running on tests files. # TODO: Add examples why this is good
|
|
||||||
|
|
||||||
- path: _test\.go
|
|
||||||
linters:
|
|
||||||
# Tests should be simple? Add example why this is good?
|
|
||||||
- gocyclo
|
|
||||||
# Error checking adds verbosity and complexity for minimal value
|
|
||||||
- errcheck
|
|
||||||
# Table test encourage duplication in defining the table tests.
|
|
||||||
- dupl
|
|
||||||
# Hard coded example tokens, SQL injection and other bad practices may
|
|
||||||
# want to be tested
|
|
||||||
- gosec
|
|
@ -1,41 +0,0 @@
|
|||||||
# If you need to ignore any of nancy's warnings add them
|
|
||||||
|
|
||||||
# here with a reference to the package/version that
|
|
||||||
|
|
||||||
# triggers them and rational for ignoring it.
|
|
||||||
|
|
||||||
# pkg:golang/github.com/coreos/etcd@3.3.10
|
|
||||||
|
|
||||||
# etcd before versions 3.3.23 and 3.4.10 does not perform any password length validation
|
|
||||||
|
|
||||||
CVE-2020-15115
|
|
||||||
|
|
||||||
# pkg:golang/github.com/coreos/etcd@3.3.10
|
|
||||||
|
|
||||||
# In ectd before versions 3.4.10 and 3.3.23, gateway TLS authentication is only applied to endpoints detected in DNS SRV records
|
|
||||||
|
|
||||||
CVE-2020-15136
|
|
||||||
|
|
||||||
# pkg:golang/github.com/coreos/etcd@3.3.10
|
|
||||||
|
|
||||||
# In etcd before versions 3.3.23 and 3.4.10, the etcd gateway is a simple TCP proxy to allow for basic service discovery and access
|
|
||||||
|
|
||||||
CVE-2020-15114
|
|
||||||
|
|
||||||
# pkg:golang/github.com/gorilla/websocket@1.4.0
|
|
||||||
|
|
||||||
# Integer Overflow or Wraparound
|
|
||||||
|
|
||||||
CWE-190
|
|
||||||
|
|
||||||
# jwt-go before 4.0.0-preview1 allows attackers to bypass intended access restrict...
|
|
||||||
|
|
||||||
CVE-2020-26160
|
|
||||||
|
|
||||||
# https://ossindex.sonatype.org/vulnerability/sonatype-2021-1485
|
|
||||||
|
|
||||||
sonatype-2021-1485
|
|
||||||
|
|
||||||
# CWE-770: Allocation of Resources Without Limits or Throttling
|
|
||||||
|
|
||||||
CVE-2022-41717
|
|
@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"printWidth": 80,
|
"printWidth": 320,
|
||||||
"tabWidth": 2,
|
"tabWidth": 4,
|
||||||
"useTabs": true,
|
"useTabs": true,
|
||||||
"semi": true,
|
"semi": true,
|
||||||
"singleQuote": false,
|
"singleQuote": true,
|
||||||
"bracketSpacing": true,
|
"bracketSpacing": true,
|
||||||
"bracketSameLine": true,
|
"jsxBracketSameLine": true,
|
||||||
"trailingComma": "all",
|
"trailingComma": "all",
|
||||||
"proseWrap": "always"
|
"proseWrap": "always"
|
||||||
}
|
}
|
8
backend/.vscode/settings.json
vendored
Normal file
8
backend/.vscode/settings.json
vendored
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"editor.insertSpaces": false,
|
||||||
|
"editor.formatOnSave": true,
|
||||||
|
"files.trimTrailingWhitespace": true,
|
||||||
|
"editor.codeActionsOnSave": {
|
||||||
|
"source.fixAll.eslint": true
|
||||||
|
}
|
||||||
|
}
|
@ -1,6 +0,0 @@
|
|||||||
# Backend
|
|
||||||
|
|
||||||
## Guides and materials
|
|
||||||
|
|
||||||
- [Nginx Proxy Protocol](https://docs.nginx.com/nginx/admin-guide/load-balancer/using-proxy-protocol/)
|
|
||||||
-
|
|
@ -1,69 +0,0 @@
|
|||||||
version: "2"
|
|
||||||
|
|
||||||
tasks:
|
|
||||||
default:
|
|
||||||
cmds:
|
|
||||||
- task: run
|
|
||||||
|
|
||||||
run:
|
|
||||||
desc: Build and run
|
|
||||||
sources:
|
|
||||||
- internal/**/*.go
|
|
||||||
- cmd/**/*.go
|
|
||||||
- ../frontend/src/locale/src/*.json
|
|
||||||
cmds:
|
|
||||||
- task: locale
|
|
||||||
- task: build
|
|
||||||
- cmd: echo -e "==> Running..."
|
|
||||||
silent: true
|
|
||||||
- cmd: ../dist/bin/server
|
|
||||||
ignore_error: true
|
|
||||||
silent: true
|
|
||||||
env:
|
|
||||||
LOG_LEVEL: debug
|
|
||||||
|
|
||||||
build:
|
|
||||||
desc: Build the server
|
|
||||||
cmds:
|
|
||||||
- cmd: echo -e "==> Building..."
|
|
||||||
silent: true
|
|
||||||
- cmd: rm -f dist/bin/*
|
|
||||||
silent: true
|
|
||||||
- cmd: go build -ldflags="-X main.commit={{.GIT_COMMIT}} -X main.version={{.VERSION}}" -o ../dist/bin/server ./cmd/server/main.go
|
|
||||||
silent: true
|
|
||||||
- task: lint
|
|
||||||
vars:
|
|
||||||
GIT_COMMIT:
|
|
||||||
sh: git log -n 1 --format=%h
|
|
||||||
VERSION:
|
|
||||||
sh: cat ../.version
|
|
||||||
env:
|
|
||||||
GO111MODULE: on
|
|
||||||
CGO_ENABLED: 1
|
|
||||||
|
|
||||||
lint:
|
|
||||||
desc: Linting
|
|
||||||
cmds:
|
|
||||||
- cmd: echo -e "==> Linting..."
|
|
||||||
silent: true
|
|
||||||
- cmd: bash scripts/lint.sh
|
|
||||||
silent: true
|
|
||||||
|
|
||||||
test:
|
|
||||||
desc: Testing
|
|
||||||
cmds:
|
|
||||||
- cmd: echo -e "==> Testing..."
|
|
||||||
silent: true
|
|
||||||
- cmd: bash scripts/test.sh
|
|
||||||
silent: true
|
|
||||||
|
|
||||||
locale:
|
|
||||||
desc: Locale
|
|
||||||
dir: /app/frontend
|
|
||||||
cmds:
|
|
||||||
- cmd: yarn locale-compile
|
|
||||||
silent: true
|
|
||||||
ignore_error: true
|
|
||||||
- cmd: chown -R "$PUID:$PGID" src/locale/lang
|
|
||||||
silent: true
|
|
||||||
ignore_error: true
|
|
89
backend/app.js
Normal file
89
backend/app.js
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
const express = require('express');
|
||||||
|
const bodyParser = require('body-parser');
|
||||||
|
const fileUpload = require('express-fileupload');
|
||||||
|
const compression = require('compression');
|
||||||
|
const log = require('./logger').express;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* App
|
||||||
|
*/
|
||||||
|
const app = express();
|
||||||
|
app.use(fileUpload());
|
||||||
|
app.use(bodyParser.json());
|
||||||
|
app.use(bodyParser.urlencoded({extended: true}));
|
||||||
|
|
||||||
|
// Gzip
|
||||||
|
app.use(compression());
|
||||||
|
|
||||||
|
/**
|
||||||
|
* General Logging, BEFORE routes
|
||||||
|
*/
|
||||||
|
|
||||||
|
app.disable('x-powered-by');
|
||||||
|
app.enable('trust proxy', ['loopback', 'linklocal', 'uniquelocal']);
|
||||||
|
app.enable('strict routing');
|
||||||
|
|
||||||
|
// pretty print JSON when not live
|
||||||
|
if (process.env.NODE_ENV !== 'production') {
|
||||||
|
app.set('json spaces', 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
// CORS for everything
|
||||||
|
app.use(require('./lib/express/cors'));
|
||||||
|
|
||||||
|
// General security/cache related headers + server header
|
||||||
|
app.use(function (req, res, next) {
|
||||||
|
let x_frame_options = 'DENY';
|
||||||
|
|
||||||
|
if (typeof process.env.X_FRAME_OPTIONS !== 'undefined' && process.env.X_FRAME_OPTIONS) {
|
||||||
|
x_frame_options = process.env.X_FRAME_OPTIONS;
|
||||||
|
}
|
||||||
|
|
||||||
|
res.set({
|
||||||
|
'X-XSS-Protection': '1; mode=block',
|
||||||
|
'X-Content-Type-Options': 'nosniff',
|
||||||
|
'X-Frame-Options': x_frame_options,
|
||||||
|
'Cache-Control': 'no-cache, no-store, max-age=0, must-revalidate',
|
||||||
|
Pragma: 'no-cache',
|
||||||
|
Expires: 0
|
||||||
|
});
|
||||||
|
next();
|
||||||
|
});
|
||||||
|
|
||||||
|
app.use(require('./lib/express/jwt')());
|
||||||
|
app.use('/', require('./routes/api/main'));
|
||||||
|
|
||||||
|
// production error handler
|
||||||
|
// no stacktraces leaked to user
|
||||||
|
// eslint-disable-next-line
|
||||||
|
app.use(function (err, req, res, next) {
|
||||||
|
|
||||||
|
let payload = {
|
||||||
|
error: {
|
||||||
|
code: err.status,
|
||||||
|
message: err.public ? err.message : 'Internal Error'
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
if (process.env.NODE_ENV === 'development' || (req.baseUrl + req.path).includes('nginx/certificates')) {
|
||||||
|
payload.debug = {
|
||||||
|
stack: typeof err.stack !== 'undefined' && err.stack ? err.stack.split('\n') : null,
|
||||||
|
previous: err.previous
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
// Not every error is worth logging - but this is good for now until it gets annoying.
|
||||||
|
if (typeof err.stack !== 'undefined' && err.stack) {
|
||||||
|
if (process.env.NODE_ENV === 'development' || process.env.DEBUG) {
|
||||||
|
log.debug(err.stack);
|
||||||
|
} else if (typeof err.public == 'undefined' || !err.public) {
|
||||||
|
log.warn(err.message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
res
|
||||||
|
.status(err.status || 500)
|
||||||
|
.send(payload);
|
||||||
|
});
|
||||||
|
|
||||||
|
module.exports = app;
|
@ -1,54 +0,0 @@
|
|||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"os"
|
|
||||||
"os/signal"
|
|
||||||
"syscall"
|
|
||||||
|
|
||||||
"npm/internal/api"
|
|
||||||
"npm/internal/config"
|
|
||||||
"npm/internal/database"
|
|
||||||
"npm/internal/entity/certificate"
|
|
||||||
"npm/internal/entity/host"
|
|
||||||
"npm/internal/entity/setting"
|
|
||||||
"npm/internal/jobqueue"
|
|
||||||
"npm/internal/logger"
|
|
||||||
)
|
|
||||||
|
|
||||||
var commit string
|
|
||||||
var version string
|
|
||||||
var sentryDSN string
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
config.InitArgs(&version, &commit)
|
|
||||||
config.Init(&version, &commit, &sentryDSN)
|
|
||||||
|
|
||||||
database.Migrate(func() {
|
|
||||||
setting.ApplySettings()
|
|
||||||
database.CheckSetup()
|
|
||||||
|
|
||||||
// Internal Job Queue
|
|
||||||
jobqueue.Start()
|
|
||||||
certificate.AddPendingJobs()
|
|
||||||
host.AddPendingJobs()
|
|
||||||
|
|
||||||
// Http server
|
|
||||||
api.StartServer()
|
|
||||||
irqchan := make(chan os.Signal, 1)
|
|
||||||
signal.Notify(irqchan, syscall.SIGINT, syscall.SIGTERM)
|
|
||||||
|
|
||||||
for irq := range irqchan {
|
|
||||||
if irq == syscall.SIGINT || irq == syscall.SIGTERM {
|
|
||||||
logger.Info("Got ", irq, " shutting server down ...")
|
|
||||||
// Close db
|
|
||||||
err := database.GetInstance().Close()
|
|
||||||
if err != nil {
|
|
||||||
logger.Error("DatabaseCloseError", err)
|
|
||||||
}
|
|
||||||
// nolint
|
|
||||||
jobqueue.Shutdown()
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
2
backend/config/README.md
Normal file
2
backend/config/README.md
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
These files are use in development and are not deployed as part of the final product.
|
||||||
|
|
10
backend/config/default.json
Normal file
10
backend/config/default.json
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"database": {
|
||||||
|
"engine": "mysql",
|
||||||
|
"host": "db",
|
||||||
|
"name": "npm",
|
||||||
|
"user": "npm",
|
||||||
|
"password": "npm",
|
||||||
|
"port": 3306
|
||||||
|
}
|
||||||
|
}
|
26
backend/config/sqlite-test-db.json
Normal file
26
backend/config/sqlite-test-db.json
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
"database": {
|
||||||
|
"engine": "knex-native",
|
||||||
|
"knex": {
|
||||||
|
"client": "sqlite3",
|
||||||
|
"connection": {
|
||||||
|
"filename": "/app/config/mydb.sqlite"
|
||||||
|
},
|
||||||
|
"pool": {
|
||||||
|
"min": 0,
|
||||||
|
"max": 1,
|
||||||
|
"createTimeoutMillis": 3000,
|
||||||
|
"acquireTimeoutMillis": 30000,
|
||||||
|
"idleTimeoutMillis": 30000,
|
||||||
|
"reapIntervalMillis": 1000,
|
||||||
|
"createRetryIntervalMillis": 100,
|
||||||
|
"propagateCreateError": false
|
||||||
|
},
|
||||||
|
"migrations": {
|
||||||
|
"tableName": "migrations",
|
||||||
|
"stub": "src/backend/lib/migrate_template.js",
|
||||||
|
"directory": "src/backend/migrations"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
33
backend/db.js
Normal file
33
backend/db.js
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
const config = require('config');
|
||||||
|
|
||||||
|
if (!config.has('database')) {
|
||||||
|
throw new Error('Database config does not exist! Please read the instructions: https://github.com/jc21/nginx-proxy-manager/blob/master/doc/INSTALL.md');
|
||||||
|
}
|
||||||
|
|
||||||
|
function generateDbConfig() {
|
||||||
|
if (config.database.engine === 'knex-native') {
|
||||||
|
return config.database.knex;
|
||||||
|
} else
|
||||||
|
return {
|
||||||
|
client: config.database.engine,
|
||||||
|
connection: {
|
||||||
|
host: config.database.host,
|
||||||
|
user: config.database.user,
|
||||||
|
password: config.database.password,
|
||||||
|
database: config.database.name,
|
||||||
|
port: config.database.port
|
||||||
|
},
|
||||||
|
migrations: {
|
||||||
|
tableName: 'migrations'
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
let data = generateDbConfig();
|
||||||
|
|
||||||
|
if (typeof config.database.version !== 'undefined') {
|
||||||
|
data.version = config.database.version;
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = require('knex')(data);
|
1254
backend/doc/api.swagger.json
Normal file
1254
backend/doc/api.swagger.json
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,297 +0,0 @@
|
|||||||
{
|
|
||||||
"openapi": "3.0.0",
|
|
||||||
"info": {
|
|
||||||
"title": "Nginx Proxy Manager API",
|
|
||||||
"version": "{{VERSION}}"
|
|
||||||
},
|
|
||||||
"paths": {
|
|
||||||
"/": {
|
|
||||||
"get": {
|
|
||||||
"$ref": "file://./paths/get.json"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"/certificates": {
|
|
||||||
"get": {
|
|
||||||
"$ref": "file://./paths/certificates/get.json"
|
|
||||||
},
|
|
||||||
"post": {
|
|
||||||
"$ref": "file://./paths/certificates/post.json"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"/certificates/{certificateID}": {
|
|
||||||
"get": {
|
|
||||||
"$ref": "file://./paths/certificates/certificateID/get.json"
|
|
||||||
},
|
|
||||||
"put": {
|
|
||||||
"$ref": "file://./paths/certificates/certificateID/put.json"
|
|
||||||
},
|
|
||||||
"delete": {
|
|
||||||
"$ref": "file://./paths/certificates/certificateID/delete.json"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"/certificates-authorities": {
|
|
||||||
"get": {
|
|
||||||
"$ref": "file://./paths/certificates-authorities/get.json"
|
|
||||||
},
|
|
||||||
"post": {
|
|
||||||
"$ref": "file://./paths/certificates-authorities/post.json"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"/certificates-authorities/{caID}": {
|
|
||||||
"get": {
|
|
||||||
"$ref": "file://./paths/certificates-authorities/caID/get.json"
|
|
||||||
},
|
|
||||||
"put": {
|
|
||||||
"$ref": "file://./paths/certificates-authorities/caID/put.json"
|
|
||||||
},
|
|
||||||
"delete": {
|
|
||||||
"$ref": "file://./paths/certificates-authorities/caID/delete.json"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"/config": {
|
|
||||||
"get": {
|
|
||||||
"$ref": "file://./paths/config/get.json"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"/dns-providers": {
|
|
||||||
"get": {
|
|
||||||
"$ref": "file://./paths/dns-providers/get.json"
|
|
||||||
},
|
|
||||||
"post": {
|
|
||||||
"$ref": "file://./paths/dns-providers/post.json"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"/dns-providers/{providerID}": {
|
|
||||||
"get": {
|
|
||||||
"$ref": "file://./paths/dns-providers/providerID/get.json"
|
|
||||||
},
|
|
||||||
"put": {
|
|
||||||
"$ref": "file://./paths/dns-providers/providerID/put.json"
|
|
||||||
},
|
|
||||||
"delete": {
|
|
||||||
"$ref": "file://./paths/dns-providers/providerID/delete.json"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"/hosts": {
|
|
||||||
"get": {
|
|
||||||
"$ref": "file://./paths/hosts/get.json"
|
|
||||||
},
|
|
||||||
"post": {
|
|
||||||
"$ref": "file://./paths/hosts/post.json"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"/hosts/{hostID}": {
|
|
||||||
"get": {
|
|
||||||
"$ref": "file://./paths/hosts/hostID/get.json"
|
|
||||||
},
|
|
||||||
"put": {
|
|
||||||
"$ref": "file://./paths/hosts/hostID/put.json"
|
|
||||||
},
|
|
||||||
"delete": {
|
|
||||||
"$ref": "file://./paths/hosts/hostID/delete.json"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"/hosts/{hostID}/nginx-config": {
|
|
||||||
"get": {
|
|
||||||
"$ref": "file://./paths/hosts/hostID/nginx-config/get.json"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"/nginx-templates": {
|
|
||||||
"get": {
|
|
||||||
"$ref": "file://./paths/nginx-templates/get.json"
|
|
||||||
},
|
|
||||||
"post": {
|
|
||||||
"$ref": "file://./paths/nginx-templates/post.json"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"/nginx-templates/{templateID}": {
|
|
||||||
"get": {
|
|
||||||
"$ref": "file://./paths/nginx-templates/templateID/get.json"
|
|
||||||
},
|
|
||||||
"put": {
|
|
||||||
"$ref": "file://./paths/nginx-templates/templateID/put.json"
|
|
||||||
},
|
|
||||||
"delete": {
|
|
||||||
"$ref": "file://./paths/nginx-templates/templateID/delete.json"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"/schema": {
|
|
||||||
"get": {
|
|
||||||
"$ref": "file://./paths/schema/get.json"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"/settings": {
|
|
||||||
"get": {
|
|
||||||
"$ref": "file://./paths/settings/get.json"
|
|
||||||
},
|
|
||||||
"post": {
|
|
||||||
"$ref": "file://./paths/settings/post.json"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"/settings/{name}": {
|
|
||||||
"get": {
|
|
||||||
"$ref": "file://./paths/settings/name/get.json"
|
|
||||||
},
|
|
||||||
"put": {
|
|
||||||
"$ref": "file://./paths/settings/name/put.json"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"/streams": {
|
|
||||||
"get": {
|
|
||||||
"$ref": "file://./paths/streams/get.json"
|
|
||||||
},
|
|
||||||
"post": {
|
|
||||||
"$ref": "file://./paths/streams/post.json"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"/streams/{streamID}": {
|
|
||||||
"get": {
|
|
||||||
"$ref": "file://./paths/streams/streamID/get.json"
|
|
||||||
},
|
|
||||||
"put": {
|
|
||||||
"$ref": "file://./paths/streams/streamID/put.json"
|
|
||||||
},
|
|
||||||
"delete": {
|
|
||||||
"$ref": "file://./paths/streams/streamID/delete.json"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"/tokens": {
|
|
||||||
"get": {
|
|
||||||
"$ref": "file://./paths/tokens/get.json"
|
|
||||||
},
|
|
||||||
"post": {
|
|
||||||
"$ref": "file://./paths/tokens/post.json"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"/upstreams": {
|
|
||||||
"get": {
|
|
||||||
"$ref": "file://./paths/upstreams/get.json"
|
|
||||||
},
|
|
||||||
"post": {
|
|
||||||
"$ref": "file://./paths/upstreams/post.json"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"/upstreams/{upstreamID}": {
|
|
||||||
"get": {
|
|
||||||
"$ref": "file://./paths/upstreams/upstreamID/get.json"
|
|
||||||
},
|
|
||||||
"put": {
|
|
||||||
"$ref": "file://./paths/upstreams/upstreamID/put.json"
|
|
||||||
},
|
|
||||||
"delete": {
|
|
||||||
"$ref": "file://./paths/upstreams/upstreamID/delete.json"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"/upstreams/{upstreamID}/nginx-config": {
|
|
||||||
"get": {
|
|
||||||
"$ref": "file://./paths/upstreams/upstreamID/nginx-config/get.json"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"/users": {
|
|
||||||
"get": {
|
|
||||||
"$ref": "file://./paths/users/get.json"
|
|
||||||
},
|
|
||||||
"post": {
|
|
||||||
"$ref": "file://./paths/users/post.json"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"/users/{userID}": {
|
|
||||||
"get": {
|
|
||||||
"$ref": "file://./paths/users/userID/get.json"
|
|
||||||
},
|
|
||||||
"put": {
|
|
||||||
"$ref": "file://./paths/users/userID/put.json"
|
|
||||||
},
|
|
||||||
"delete": {
|
|
||||||
"$ref": "file://./paths/users/userID/delete.json"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"/users/{userID}/auth": {
|
|
||||||
"post": {
|
|
||||||
"$ref": "file://./paths/users/userID/auth/post.json"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"components": {
|
|
||||||
"schemas": {
|
|
||||||
"CertificateAuthorityList": {
|
|
||||||
"$ref": "file://./components/CertificateAuthorityList.json"
|
|
||||||
},
|
|
||||||
"CertificateAuthorityObject": {
|
|
||||||
"$ref": "file://./components/CertificateAuthorityObject.json"
|
|
||||||
},
|
|
||||||
"CertificateList": {
|
|
||||||
"$ref": "file://./components/CertificateList.json"
|
|
||||||
},
|
|
||||||
"CertificateObject": {
|
|
||||||
"$ref": "file://./components/CertificateObject.json"
|
|
||||||
},
|
|
||||||
"ConfigObject": {
|
|
||||||
"$ref": "file://./components/ConfigObject.json"
|
|
||||||
},
|
|
||||||
"DeletedItemResponse": {
|
|
||||||
"$ref": "file://./components/DeletedItemResponse.json"
|
|
||||||
},
|
|
||||||
"DNSProviderList": {
|
|
||||||
"$ref": "file://./components/DNSProviderList.json"
|
|
||||||
},
|
|
||||||
"DNSProviderObject": {
|
|
||||||
"$ref": "file://./components/DNSProviderObject.json"
|
|
||||||
},
|
|
||||||
"ErrorObject": {
|
|
||||||
"$ref": "file://./components/ErrorObject.json"
|
|
||||||
},
|
|
||||||
"FilterObject": {
|
|
||||||
"$ref": "file://./components/FilterObject.json"
|
|
||||||
},
|
|
||||||
"HealthObject": {
|
|
||||||
"$ref": "file://./components/HealthObject.json"
|
|
||||||
},
|
|
||||||
"HostList": {
|
|
||||||
"$ref": "file://./components/HostList.json"
|
|
||||||
},
|
|
||||||
"HostObject": {
|
|
||||||
"$ref": "file://./components/HostObject.json"
|
|
||||||
},
|
|
||||||
"NginxTemplateList": {
|
|
||||||
"$ref": "file://./components/NginxTemplateList.json"
|
|
||||||
},
|
|
||||||
"NginxTemplateObject": {
|
|
||||||
"$ref": "file://./components/NginxTemplateObject.json"
|
|
||||||
},
|
|
||||||
"SettingList": {
|
|
||||||
"$ref": "file://./components/SettingList.json"
|
|
||||||
},
|
|
||||||
"SettingObject": {
|
|
||||||
"$ref": "file://./components/SettingObject.json"
|
|
||||||
},
|
|
||||||
"SortObject": {
|
|
||||||
"$ref": "file://./components/SortObject.json"
|
|
||||||
},
|
|
||||||
"StreamList": {
|
|
||||||
"$ref": "file://./components/StreamList.json"
|
|
||||||
},
|
|
||||||
"StreamObject": {
|
|
||||||
"$ref": "file://./components/StreamObject.json"
|
|
||||||
},
|
|
||||||
"TokenObject": {
|
|
||||||
"$ref": "file://./components/TokenObject.json"
|
|
||||||
},
|
|
||||||
"UpstreamList": {
|
|
||||||
"$ref": "file://./components/UpstreamList.json"
|
|
||||||
},
|
|
||||||
"UpstreamObject": {
|
|
||||||
"$ref": "file://./components/UpstreamObject.json"
|
|
||||||
},
|
|
||||||
"UserAuthObject": {
|
|
||||||
"$ref": "file://./components/UserAuthObject.json"
|
|
||||||
},
|
|
||||||
"UserList": {
|
|
||||||
"$ref": "file://./components/UserList.json"
|
|
||||||
},
|
|
||||||
"UserObject": {
|
|
||||||
"$ref": "file://./components/UserObject.json"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,40 +0,0 @@
|
|||||||
{
|
|
||||||
"type": "object",
|
|
||||||
"description": "CertificateAuthorityList",
|
|
||||||
"additionalProperties": false,
|
|
||||||
"required": ["total", "offset", "limit", "sort"],
|
|
||||||
"properties": {
|
|
||||||
"total": {
|
|
||||||
"type": "integer",
|
|
||||||
"description": "Total number of rows"
|
|
||||||
},
|
|
||||||
"offset": {
|
|
||||||
"type": "integer",
|
|
||||||
"description": "Pagination Offset"
|
|
||||||
},
|
|
||||||
"limit": {
|
|
||||||
"type": "integer",
|
|
||||||
"description": "Pagination Limit"
|
|
||||||
},
|
|
||||||
"sort": {
|
|
||||||
"type": "array",
|
|
||||||
"description": "Sorting",
|
|
||||||
"items": {
|
|
||||||
"$ref": "#/components/schemas/SortObject"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"filter": {
|
|
||||||
"type": "array",
|
|
||||||
"description": "Filters",
|
|
||||||
"items": {
|
|
||||||
"$ref": "#/components/schemas/FilterObject"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"items": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"$ref": "#/components/schemas/CertificateAuthorityObject"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,55 +0,0 @@
|
|||||||
{
|
|
||||||
"type": "object",
|
|
||||||
"description": "CertificateAuthorityObject",
|
|
||||||
"additionalProperties": false,
|
|
||||||
"required": [
|
|
||||||
"id",
|
|
||||||
"created_on",
|
|
||||||
"modified_on",
|
|
||||||
"name",
|
|
||||||
"acmesh_server",
|
|
||||||
"ca_bundle",
|
|
||||||
"max_domains",
|
|
||||||
"is_wildcard_supported",
|
|
||||||
"is_readonly"
|
|
||||||
],
|
|
||||||
"properties": {
|
|
||||||
"id": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"created_on": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"modified_on": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"name": {
|
|
||||||
"type": "string",
|
|
||||||
"minLength": 1,
|
|
||||||
"maxLength": 100
|
|
||||||
},
|
|
||||||
"acmesh_server": {
|
|
||||||
"type": "string",
|
|
||||||
"minLength": 2,
|
|
||||||
"maxLength": 255
|
|
||||||
},
|
|
||||||
"ca_bundle": {
|
|
||||||
"type": "string",
|
|
||||||
"minLength": 0,
|
|
||||||
"maxLength": 255
|
|
||||||
},
|
|
||||||
"max_domains": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"is_wildcard_supported": {
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"is_readonly": {
|
|
||||||
"type": "boolean"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,40 +0,0 @@
|
|||||||
{
|
|
||||||
"type": "object",
|
|
||||||
"description": "CertificateList",
|
|
||||||
"additionalProperties": false,
|
|
||||||
"required": ["total", "offset", "limit", "sort"],
|
|
||||||
"properties": {
|
|
||||||
"total": {
|
|
||||||
"type": "integer",
|
|
||||||
"description": "Total number of rows"
|
|
||||||
},
|
|
||||||
"offset": {
|
|
||||||
"type": "integer",
|
|
||||||
"description": "Pagination Offset"
|
|
||||||
},
|
|
||||||
"limit": {
|
|
||||||
"type": "integer",
|
|
||||||
"description": "Pagination Limit"
|
|
||||||
},
|
|
||||||
"sort": {
|
|
||||||
"type": "array",
|
|
||||||
"description": "Sorting",
|
|
||||||
"items": {
|
|
||||||
"$ref": "#/components/schemas/SortObject"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"filter": {
|
|
||||||
"type": "array",
|
|
||||||
"description": "Filters",
|
|
||||||
"items": {
|
|
||||||
"$ref": "#/components/schemas/FilterObject"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"items": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"$ref": "#/components/schemas/CertificateObject"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,85 +0,0 @@
|
|||||||
{
|
|
||||||
"type": "object",
|
|
||||||
"description": "CertificateObject",
|
|
||||||
"additionalProperties": false,
|
|
||||||
"required": [
|
|
||||||
"id",
|
|
||||||
"created_on",
|
|
||||||
"modified_on",
|
|
||||||
"expires_on",
|
|
||||||
"type",
|
|
||||||
"user_id",
|
|
||||||
"certificate_authority_id",
|
|
||||||
"dns_provider_id",
|
|
||||||
"name",
|
|
||||||
"is_ecc",
|
|
||||||
"status",
|
|
||||||
"domain_names"
|
|
||||||
],
|
|
||||||
"properties": {
|
|
||||||
"id": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"created_on": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"modified_on": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"expires_on": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1,
|
|
||||||
"nullable": true
|
|
||||||
},
|
|
||||||
"type": {
|
|
||||||
"type": "string",
|
|
||||||
"enum": ["custom", "http", "dns"]
|
|
||||||
},
|
|
||||||
"user_id": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"certificate_authority_id": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 0
|
|
||||||
},
|
|
||||||
"certificate_authority": {
|
|
||||||
"$ref": "#/components/schemas/CertificateAuthorityObject"
|
|
||||||
},
|
|
||||||
"dns_provider_id": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 0
|
|
||||||
},
|
|
||||||
"name": {
|
|
||||||
"type": "string",
|
|
||||||
"minLength": 1,
|
|
||||||
"maxLength": 100
|
|
||||||
},
|
|
||||||
"domain_names": {
|
|
||||||
"type": "array",
|
|
||||||
"minItems": 1,
|
|
||||||
"items": {
|
|
||||||
"type": "string",
|
|
||||||
"minLength": 4
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"status": {
|
|
||||||
"type": "string",
|
|
||||||
"enum": ["ready", "requesting", "failed", "provided"]
|
|
||||||
},
|
|
||||||
"is_ecc": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 0,
|
|
||||||
"maximum": 1
|
|
||||||
},
|
|
||||||
"error_message": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"user": {
|
|
||||||
"$ref": "#/components/schemas/UserObject"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"type": "object",
|
|
||||||
"description": "ConfigObject"
|
|
||||||
}
|
|
@ -1,40 +0,0 @@
|
|||||||
{
|
|
||||||
"type": "object",
|
|
||||||
"description": "DNSProviderList",
|
|
||||||
"additionalProperties": false,
|
|
||||||
"required": ["total", "offset", "limit", "sort"],
|
|
||||||
"properties": {
|
|
||||||
"total": {
|
|
||||||
"type": "integer",
|
|
||||||
"description": "Total number of rows"
|
|
||||||
},
|
|
||||||
"offset": {
|
|
||||||
"type": "integer",
|
|
||||||
"description": "Pagination Offset"
|
|
||||||
},
|
|
||||||
"limit": {
|
|
||||||
"type": "integer",
|
|
||||||
"description": "Pagination Limit"
|
|
||||||
},
|
|
||||||
"sort": {
|
|
||||||
"type": "array",
|
|
||||||
"description": "Sorting",
|
|
||||||
"items": {
|
|
||||||
"$ref": "#/components/schemas/SortObject"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"filter": {
|
|
||||||
"type": "array",
|
|
||||||
"description": "Filters",
|
|
||||||
"items": {
|
|
||||||
"$ref": "#/components/schemas/FilterObject"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"items": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"$ref": "#/components/schemas/DNSProviderObject"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,49 +0,0 @@
|
|||||||
{
|
|
||||||
"type": "object",
|
|
||||||
"description": "DNSProviderObject",
|
|
||||||
"additionalProperties": false,
|
|
||||||
"required": [
|
|
||||||
"id",
|
|
||||||
"created_on",
|
|
||||||
"modified_on",
|
|
||||||
"user_id",
|
|
||||||
"name",
|
|
||||||
"acmesh_name",
|
|
||||||
"dns_sleep",
|
|
||||||
"meta"
|
|
||||||
],
|
|
||||||
"properties": {
|
|
||||||
"id": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"created_on": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"modified_on": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"user_id": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"name": {
|
|
||||||
"type": "string",
|
|
||||||
"minLength": 1,
|
|
||||||
"maxLength": 100
|
|
||||||
},
|
|
||||||
"acmesh_name": {
|
|
||||||
"type": "string",
|
|
||||||
"minLength": 4,
|
|
||||||
"maxLength": 50
|
|
||||||
},
|
|
||||||
"dns_sleep": {
|
|
||||||
"type": "integer"
|
|
||||||
},
|
|
||||||
"meta": {
|
|
||||||
"type": "object"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,15 +0,0 @@
|
|||||||
{
|
|
||||||
"type": "object",
|
|
||||||
"description": "DeletedItemResponse",
|
|
||||||
"additionalProperties": false,
|
|
||||||
"required": ["result"],
|
|
||||||
"properties": {
|
|
||||||
"result": {
|
|
||||||
"type": "boolean",
|
|
||||||
"nullable": true
|
|
||||||
},
|
|
||||||
"error": {
|
|
||||||
"$ref": "#/components/schemas/ErrorObject"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,17 +0,0 @@
|
|||||||
{
|
|
||||||
"type": "object",
|
|
||||||
"description": "ErrorObject",
|
|
||||||
"additionalProperties": false,
|
|
||||||
"required": ["code", "message"],
|
|
||||||
"properties": {
|
|
||||||
"code": {
|
|
||||||
"type": "integer",
|
|
||||||
"description": "Error code",
|
|
||||||
"minimum": 0
|
|
||||||
},
|
|
||||||
"message": {
|
|
||||||
"type": "string",
|
|
||||||
"description": "Error message"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,24 +0,0 @@
|
|||||||
{
|
|
||||||
"type": "object",
|
|
||||||
"description": "FilterObject",
|
|
||||||
"additionalProperties": false,
|
|
||||||
"required": ["field", "modifier", "value"],
|
|
||||||
"properties": {
|
|
||||||
"field": {
|
|
||||||
"type": "string",
|
|
||||||
"description": "Field to filter with"
|
|
||||||
},
|
|
||||||
"modifier": {
|
|
||||||
"type": "string",
|
|
||||||
"description": "Filter modifier",
|
|
||||||
"pattern": "^(equals|not|min|max|greater|lesser|contains|starts|ends|in|notin)$"
|
|
||||||
},
|
|
||||||
"value": {
|
|
||||||
"type": "array",
|
|
||||||
"description": "Values used for filtering",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,41 +0,0 @@
|
|||||||
{
|
|
||||||
"type": "object",
|
|
||||||
"description": "HealthObject",
|
|
||||||
"additionalProperties": false,
|
|
||||||
"required": ["version", "commit", "healthy", "setup", "error_reporting"],
|
|
||||||
"properties": {
|
|
||||||
"version": {
|
|
||||||
"type": "string",
|
|
||||||
"description": "Version",
|
|
||||||
"example": "3.0.0",
|
|
||||||
"minLength": 1
|
|
||||||
},
|
|
||||||
"commit": {
|
|
||||||
"type": "string",
|
|
||||||
"description": "Commit hash",
|
|
||||||
"example": "946b88f",
|
|
||||||
"minLength": 7
|
|
||||||
},
|
|
||||||
"healthy": {
|
|
||||||
"type": "boolean",
|
|
||||||
"description": "Healthy?",
|
|
||||||
"example": true
|
|
||||||
},
|
|
||||||
"setup": {
|
|
||||||
"type": "boolean",
|
|
||||||
"description": "Is the application set up?",
|
|
||||||
"example": true
|
|
||||||
},
|
|
||||||
"error_reporting": {
|
|
||||||
"type": "boolean",
|
|
||||||
"description": "Will the application send any error reporting?",
|
|
||||||
"example": true
|
|
||||||
},
|
|
||||||
"acme.sh": {
|
|
||||||
"type": "string",
|
|
||||||
"description": "Acme.sh version",
|
|
||||||
"example": "v3.0.0",
|
|
||||||
"minLength": 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,40 +0,0 @@
|
|||||||
{
|
|
||||||
"type": "object",
|
|
||||||
"description": "HostList",
|
|
||||||
"additionalProperties": false,
|
|
||||||
"required": ["total", "offset", "limit", "sort"],
|
|
||||||
"properties": {
|
|
||||||
"total": {
|
|
||||||
"type": "integer",
|
|
||||||
"description": "Total number of rows"
|
|
||||||
},
|
|
||||||
"offset": {
|
|
||||||
"type": "integer",
|
|
||||||
"description": "Pagination Offset"
|
|
||||||
},
|
|
||||||
"limit": {
|
|
||||||
"type": "integer",
|
|
||||||
"description": "Pagination Limit"
|
|
||||||
},
|
|
||||||
"sort": {
|
|
||||||
"type": "array",
|
|
||||||
"description": "Sorting",
|
|
||||||
"items": {
|
|
||||||
"$ref": "#/components/schemas/SortObject"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"filter": {
|
|
||||||
"type": "array",
|
|
||||||
"description": "Filters",
|
|
||||||
"items": {
|
|
||||||
"$ref": "#/components/schemas/FilterObject"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"items": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"$ref": "#/components/schemas/HostObject"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,58 +0,0 @@
|
|||||||
{
|
|
||||||
"type": "object",
|
|
||||||
"description": "HostObject",
|
|
||||||
"additionalProperties": false,
|
|
||||||
"required": [
|
|
||||||
"id",
|
|
||||||
"created_on",
|
|
||||||
"modified_on",
|
|
||||||
"expires_on",
|
|
||||||
"user_id",
|
|
||||||
"provider",
|
|
||||||
"name",
|
|
||||||
"domain_names"
|
|
||||||
],
|
|
||||||
"properties": {
|
|
||||||
"id": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"created_on": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"modified_on": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"expires_on": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"user_id": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"provider": {
|
|
||||||
"type": "string",
|
|
||||||
"minLength": 1,
|
|
||||||
"maxLength": 100
|
|
||||||
},
|
|
||||||
"name": {
|
|
||||||
"type": "string",
|
|
||||||
"minLength": 1,
|
|
||||||
"maxLength": 100
|
|
||||||
},
|
|
||||||
"domain_names": {
|
|
||||||
"type": "array",
|
|
||||||
"minItems": 1,
|
|
||||||
"items": {
|
|
||||||
"type": "string",
|
|
||||||
"minLength": 4
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"user": {
|
|
||||||
"$ref": "#/components/schemas/UserObject"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,40 +0,0 @@
|
|||||||
{
|
|
||||||
"type": "object",
|
|
||||||
"description": "NginxTemplateList",
|
|
||||||
"additionalProperties": false,
|
|
||||||
"required": ["total", "offset", "limit", "sort"],
|
|
||||||
"properties": {
|
|
||||||
"total": {
|
|
||||||
"type": "integer",
|
|
||||||
"description": "Total number of rows"
|
|
||||||
},
|
|
||||||
"offset": {
|
|
||||||
"type": "integer",
|
|
||||||
"description": "Pagination Offset"
|
|
||||||
},
|
|
||||||
"limit": {
|
|
||||||
"type": "integer",
|
|
||||||
"description": "Pagination Limit"
|
|
||||||
},
|
|
||||||
"sort": {
|
|
||||||
"type": "array",
|
|
||||||
"description": "Sorting",
|
|
||||||
"items": {
|
|
||||||
"$ref": "#/components/schemas/SortObject"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"filter": {
|
|
||||||
"type": "array",
|
|
||||||
"description": "Filters",
|
|
||||||
"items": {
|
|
||||||
"$ref": "#/components/schemas/FilterObject"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"items": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"$ref": "#/components/schemas/NginxTemplateObject"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,44 +0,0 @@
|
|||||||
{
|
|
||||||
"type": "object",
|
|
||||||
"description": "NginxTemplateObject",
|
|
||||||
"additionalProperties": false,
|
|
||||||
"required": [
|
|
||||||
"id",
|
|
||||||
"created_on",
|
|
||||||
"modified_on",
|
|
||||||
"user_id",
|
|
||||||
"name",
|
|
||||||
"type",
|
|
||||||
"template"
|
|
||||||
],
|
|
||||||
"properties": {
|
|
||||||
"id": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"created_on": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"modified_on": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"user_id": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"name": {
|
|
||||||
"type": "string",
|
|
||||||
"minLength": 1
|
|
||||||
},
|
|
||||||
"type": {
|
|
||||||
"type": "string",
|
|
||||||
"pattern": "^proxy|redirect|dead|stream|upstream$"
|
|
||||||
},
|
|
||||||
"template": {
|
|
||||||
"type": "string",
|
|
||||||
"minLength": 20
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,40 +0,0 @@
|
|||||||
{
|
|
||||||
"type": "object",
|
|
||||||
"description": "SettingList",
|
|
||||||
"additionalProperties": false,
|
|
||||||
"required": ["total", "offset", "limit", "sort"],
|
|
||||||
"properties": {
|
|
||||||
"total": {
|
|
||||||
"type": "integer",
|
|
||||||
"description": "Total number of rows"
|
|
||||||
},
|
|
||||||
"offset": {
|
|
||||||
"type": "integer",
|
|
||||||
"description": "Pagination Offset"
|
|
||||||
},
|
|
||||||
"limit": {
|
|
||||||
"type": "integer",
|
|
||||||
"description": "Pagination Limit"
|
|
||||||
},
|
|
||||||
"sort": {
|
|
||||||
"type": "array",
|
|
||||||
"description": "Sorting",
|
|
||||||
"items": {
|
|
||||||
"$ref": "#/components/schemas/SortObject"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"filter": {
|
|
||||||
"type": "array",
|
|
||||||
"description": "Filters",
|
|
||||||
"items": {
|
|
||||||
"$ref": "#/components/schemas/FilterObject"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"items": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"$ref": "#/components/schemas/SettingObject"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,49 +0,0 @@
|
|||||||
{
|
|
||||||
"type": "object",
|
|
||||||
"description": "SettingObject",
|
|
||||||
"additionalProperties": false,
|
|
||||||
"required": ["id", "name", "value"],
|
|
||||||
"properties": {
|
|
||||||
"id": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"created_on": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"modified_on": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"name": {
|
|
||||||
"type": "string",
|
|
||||||
"minLength": 2,
|
|
||||||
"maxLength": 100
|
|
||||||
},
|
|
||||||
"description": {
|
|
||||||
"type": "string",
|
|
||||||
"minLength": 0,
|
|
||||||
"maxLength": 100
|
|
||||||
},
|
|
||||||
"value": {
|
|
||||||
"oneOf": [
|
|
||||||
{
|
|
||||||
"type": "array"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "object"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "integer"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,17 +0,0 @@
|
|||||||
{
|
|
||||||
"type": "object",
|
|
||||||
"description": "SortObject",
|
|
||||||
"additionalProperties": false,
|
|
||||||
"required": ["field", "direction"],
|
|
||||||
"properties": {
|
|
||||||
"field": {
|
|
||||||
"type": "string",
|
|
||||||
"description": "Field for sorting on"
|
|
||||||
},
|
|
||||||
"direction": {
|
|
||||||
"type": "string",
|
|
||||||
"description": "Sort order",
|
|
||||||
"pattern": "^(ASC|DESC)$"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,40 +0,0 @@
|
|||||||
{
|
|
||||||
"type": "object",
|
|
||||||
"description": "StreamList",
|
|
||||||
"additionalProperties": false,
|
|
||||||
"required": ["total", "offset", "limit", "sort"],
|
|
||||||
"properties": {
|
|
||||||
"total": {
|
|
||||||
"type": "integer",
|
|
||||||
"description": "Total number of rows"
|
|
||||||
},
|
|
||||||
"offset": {
|
|
||||||
"type": "integer",
|
|
||||||
"description": "Pagination Offset"
|
|
||||||
},
|
|
||||||
"limit": {
|
|
||||||
"type": "integer",
|
|
||||||
"description": "Pagination Limit"
|
|
||||||
},
|
|
||||||
"sort": {
|
|
||||||
"type": "array",
|
|
||||||
"description": "Sorting",
|
|
||||||
"items": {
|
|
||||||
"$ref": "#/components/schemas/SortObject"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"filter": {
|
|
||||||
"type": "array",
|
|
||||||
"description": "Filters",
|
|
||||||
"items": {
|
|
||||||
"$ref": "#/components/schemas/FilterObject"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"items": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"$ref": "#/components/schemas/StreamObject"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,55 +0,0 @@
|
|||||||
{
|
|
||||||
"type": "object",
|
|
||||||
"description": "StreamObject",
|
|
||||||
"additionalProperties": false,
|
|
||||||
"required": [
|
|
||||||
"id",
|
|
||||||
"created_on",
|
|
||||||
"modified_on",
|
|
||||||
"expires_on",
|
|
||||||
"user_id",
|
|
||||||
"provider",
|
|
||||||
"name",
|
|
||||||
"domain_names"
|
|
||||||
],
|
|
||||||
"properties": {
|
|
||||||
"id": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"created_on": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"modified_on": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"expires_on": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"user_id": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"provider": {
|
|
||||||
"type": "string",
|
|
||||||
"minLength": 1,
|
|
||||||
"maxLength": 100
|
|
||||||
},
|
|
||||||
"name": {
|
|
||||||
"type": "string",
|
|
||||||
"minLength": 1,
|
|
||||||
"maxLength": 100
|
|
||||||
},
|
|
||||||
"domain_names": {
|
|
||||||
"type": "array",
|
|
||||||
"minItems": 1,
|
|
||||||
"items": {
|
|
||||||
"type": "string",
|
|
||||||
"minLength": 4
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,19 +0,0 @@
|
|||||||
{
|
|
||||||
"type": "object",
|
|
||||||
"description": "TokenObject",
|
|
||||||
"additionalProperties": false,
|
|
||||||
"required": ["expires", "token"],
|
|
||||||
"properties": {
|
|
||||||
"expires": {
|
|
||||||
"type": "number",
|
|
||||||
"description": "Token Expiry Unix Time",
|
|
||||||
"example": 1566540249,
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"token": {
|
|
||||||
"type": "string",
|
|
||||||
"description": "JWT Token",
|
|
||||||
"example": "eyJhbGciOiJSUzUxMiIsInR5cCI6IkpXVCJ9.ey...xaHKYr3Kk6MvkUjcC4"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,40 +0,0 @@
|
|||||||
{
|
|
||||||
"type": "object",
|
|
||||||
"description": "UpstreamList",
|
|
||||||
"additionalProperties": false,
|
|
||||||
"required": ["total", "offset", "limit", "sort"],
|
|
||||||
"properties": {
|
|
||||||
"total": {
|
|
||||||
"type": "integer",
|
|
||||||
"description": "Total number of rows"
|
|
||||||
},
|
|
||||||
"offset": {
|
|
||||||
"type": "integer",
|
|
||||||
"description": "Pagination Offset"
|
|
||||||
},
|
|
||||||
"limit": {
|
|
||||||
"type": "integer",
|
|
||||||
"description": "Pagination Limit"
|
|
||||||
},
|
|
||||||
"sort": {
|
|
||||||
"type": "array",
|
|
||||||
"description": "Sorting",
|
|
||||||
"items": {
|
|
||||||
"$ref": "#/components/schemas/SortObject"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"filter": {
|
|
||||||
"type": "array",
|
|
||||||
"description": "Filters",
|
|
||||||
"items": {
|
|
||||||
"$ref": "#/components/schemas/FilterObject"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"items": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"$ref": "#/components/schemas/UpstreamObject"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,136 +0,0 @@
|
|||||||
{
|
|
||||||
"type": "object",
|
|
||||||
"description": "UpstreamObject",
|
|
||||||
"additionalProperties": false,
|
|
||||||
"required": [
|
|
||||||
"id",
|
|
||||||
"created_on",
|
|
||||||
"modified_on",
|
|
||||||
"user_id",
|
|
||||||
"name",
|
|
||||||
"nginx_template_id",
|
|
||||||
"ip_hash",
|
|
||||||
"ntlm",
|
|
||||||
"keepalive",
|
|
||||||
"keepalive_requests",
|
|
||||||
"keepalive_time",
|
|
||||||
"keepalive_timeout",
|
|
||||||
"advanced_config",
|
|
||||||
"status",
|
|
||||||
"error_message",
|
|
||||||
"servers"
|
|
||||||
],
|
|
||||||
"properties": {
|
|
||||||
"id": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"created_on": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"modified_on": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"user_id": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"name": {
|
|
||||||
"type": "string",
|
|
||||||
"minLength": 1,
|
|
||||||
"maxLength": 100
|
|
||||||
},
|
|
||||||
"nginx_template_id": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"ip_hash": {
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"ntlm": {
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"keepalive": {
|
|
||||||
"type": "integer"
|
|
||||||
},
|
|
||||||
"keepalive_requests": {
|
|
||||||
"type": "integer"
|
|
||||||
},
|
|
||||||
"keepalive_time": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"keepalive_timeout": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"advanced_config": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"status": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"error_message": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"user": {
|
|
||||||
"$ref": "#/components/schemas/UserObject"
|
|
||||||
},
|
|
||||||
"servers": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "object",
|
|
||||||
"additionalProperties": false,
|
|
||||||
"required": [
|
|
||||||
"id",
|
|
||||||
"created_on",
|
|
||||||
"modified_on",
|
|
||||||
"upstream_id",
|
|
||||||
"server",
|
|
||||||
"weight",
|
|
||||||
"max_conns",
|
|
||||||
"max_fails",
|
|
||||||
"fail_timeout",
|
|
||||||
"backup"
|
|
||||||
],
|
|
||||||
"properties": {
|
|
||||||
"id": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"created_on": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"modified_on": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"upstream_id": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"server": {
|
|
||||||
"type": "string",
|
|
||||||
"minLength": 2
|
|
||||||
},
|
|
||||||
"weight": {
|
|
||||||
"type": "integer"
|
|
||||||
},
|
|
||||||
"max_conns": {
|
|
||||||
"type": "integer"
|
|
||||||
},
|
|
||||||
"max_fails": {
|
|
||||||
"type": "integer"
|
|
||||||
},
|
|
||||||
"fail_timeout": {
|
|
||||||
"type": "integer"
|
|
||||||
},
|
|
||||||
"backup": {
|
|
||||||
"type": "boolean"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,28 +0,0 @@
|
|||||||
{
|
|
||||||
"type": "object",
|
|
||||||
"description": "UserAuthObject",
|
|
||||||
"additionalProperties": false,
|
|
||||||
"required": ["id", "user_id", "type", "created_on", "modified_on"],
|
|
||||||
"properties": {
|
|
||||||
"id": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"user_id": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"type": {
|
|
||||||
"type": "string",
|
|
||||||
"pattern": "^password$"
|
|
||||||
},
|
|
||||||
"created_on": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"modified_on": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,40 +0,0 @@
|
|||||||
{
|
|
||||||
"type": "object",
|
|
||||||
"description": "UserList",
|
|
||||||
"additionalProperties": false,
|
|
||||||
"required": ["total", "offset", "limit", "sort"],
|
|
||||||
"properties": {
|
|
||||||
"total": {
|
|
||||||
"type": "integer",
|
|
||||||
"description": "Total number of rows"
|
|
||||||
},
|
|
||||||
"offset": {
|
|
||||||
"type": "integer",
|
|
||||||
"description": "Pagination Offset"
|
|
||||||
},
|
|
||||||
"limit": {
|
|
||||||
"type": "integer",
|
|
||||||
"description": "Pagination Limit"
|
|
||||||
},
|
|
||||||
"sort": {
|
|
||||||
"type": "array",
|
|
||||||
"description": "Sorting",
|
|
||||||
"items": {
|
|
||||||
"$ref": "#/components/schemas/SortObject"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"filter": {
|
|
||||||
"type": "array",
|
|
||||||
"description": "Filters",
|
|
||||||
"items": {
|
|
||||||
"$ref": "#/components/schemas/FilterObject"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"items": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"$ref": "#/components/schemas/UserObject"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,73 +0,0 @@
|
|||||||
{
|
|
||||||
"type": "object",
|
|
||||||
"description": "UserObject",
|
|
||||||
"additionalProperties": false,
|
|
||||||
"required": [
|
|
||||||
"id",
|
|
||||||
"name",
|
|
||||||
"nickname",
|
|
||||||
"email",
|
|
||||||
"created_on",
|
|
||||||
"modified_on",
|
|
||||||
"is_disabled"
|
|
||||||
],
|
|
||||||
"properties": {
|
|
||||||
"id": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"name": {
|
|
||||||
"type": "string",
|
|
||||||
"minLength": 2,
|
|
||||||
"maxLength": 100
|
|
||||||
},
|
|
||||||
"nickname": {
|
|
||||||
"type": "string",
|
|
||||||
"minLength": 2,
|
|
||||||
"maxLength": 100
|
|
||||||
},
|
|
||||||
"email": {
|
|
||||||
"type": "string",
|
|
||||||
"minLength": 5,
|
|
||||||
"maxLength": 150
|
|
||||||
},
|
|
||||||
"created_on": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"modified_on": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"gravatar_url": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"is_disabled": {
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"is_deleted": {
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"auth": {
|
|
||||||
"type": "object",
|
|
||||||
"required": ["type"],
|
|
||||||
"properties": {
|
|
||||||
"id": {
|
|
||||||
"type": "integer"
|
|
||||||
},
|
|
||||||
"type": {
|
|
||||||
"type": "string",
|
|
||||||
"pattern": "^password$"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"capabilities": {
|
|
||||||
"type": "array",
|
|
||||||
"minItems": 1,
|
|
||||||
"items": {
|
|
||||||
"type": "string",
|
|
||||||
"minLength": 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,10 +0,0 @@
|
|||||||
package doc
|
|
||||||
|
|
||||||
import "embed"
|
|
||||||
|
|
||||||
// SwaggerFiles contain all the files used for swagger schema generation
|
|
||||||
//
|
|
||||||
//go:embed api.swagger.json
|
|
||||||
//go:embed components
|
|
||||||
//go:embed paths
|
|
||||||
var SwaggerFiles embed.FS
|
|
@ -1,39 +0,0 @@
|
|||||||
{
|
|
||||||
"operationId": "deleteCertificateAuthority",
|
|
||||||
"summary": "Delete a Certificate Authority",
|
|
||||||
"tags": [
|
|
||||||
"Certificate Authorities"
|
|
||||||
],
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"in": "path",
|
|
||||||
"name": "caID",
|
|
||||||
"schema": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"required": true,
|
|
||||||
"description": "Numeric ID of the Certificate Authority",
|
|
||||||
"example": 1
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"responses": {
|
|
||||||
"200": {
|
|
||||||
"description": "200 response",
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/components/schemas/DeletedItemResponse"
|
|
||||||
},
|
|
||||||
"examples": {
|
|
||||||
"default": {
|
|
||||||
"value": {
|
|
||||||
"result": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,52 +0,0 @@
|
|||||||
{
|
|
||||||
"operationId": "getCertificateAuthority",
|
|
||||||
"summary": "Get a Certificate Authority object by ID",
|
|
||||||
"tags": ["Certificate Authorities"],
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"in": "path",
|
|
||||||
"name": "caID",
|
|
||||||
"schema": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"required": true,
|
|
||||||
"description": "ID of the Certificate Authority",
|
|
||||||
"example": 1
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"responses": {
|
|
||||||
"200": {
|
|
||||||
"description": "200 response",
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"required": ["result"],
|
|
||||||
"properties": {
|
|
||||||
"result": {
|
|
||||||
"$ref": "#/components/schemas/CertificateAuthorityObject"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"examples": {
|
|
||||||
"default": {
|
|
||||||
"value": {
|
|
||||||
"result": {
|
|
||||||
"id": 1,
|
|
||||||
"created_on": 1627531400,
|
|
||||||
"modified_on": 1627531400,
|
|
||||||
"name": "ZeroSSL",
|
|
||||||
"acmesh_server": "zerossl",
|
|
||||||
"ca_bundle": "",
|
|
||||||
"max_domains": 10,
|
|
||||||
"is_wildcard_supported": true,
|
|
||||||
"is_readonly": false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,61 +0,0 @@
|
|||||||
{
|
|
||||||
"operationId": "updateCertificateAuthority",
|
|
||||||
"summary": "Update an existing Certificate Authority",
|
|
||||||
"tags": ["Certificate Authorities"],
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"in": "path",
|
|
||||||
"name": "caID",
|
|
||||||
"schema": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"required": true,
|
|
||||||
"description": "ID of the Certificate Authority",
|
|
||||||
"example": 1
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"requestBody": {
|
|
||||||
"description": "Certificate Authority details to update",
|
|
||||||
"required": true,
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": "{{schema.UpdateCertificateAuthority}}"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"responses": {
|
|
||||||
"200": {
|
|
||||||
"description": "200 response",
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"required": ["result"],
|
|
||||||
"properties": {
|
|
||||||
"result": {
|
|
||||||
"$ref": "#/components/schemas/CertificateAuthorityObject"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"examples": {
|
|
||||||
"default": {
|
|
||||||
"value": {
|
|
||||||
"result": {
|
|
||||||
"id": 1,
|
|
||||||
"created_on": 1627531400,
|
|
||||||
"modified_on": 1627531400,
|
|
||||||
"name": "ZeroSSL",
|
|
||||||
"acmesh_server": "zerossl",
|
|
||||||
"ca_bundle": "",
|
|
||||||
"max_domains": 10,
|
|
||||||
"is_wildcard_supported": true,
|
|
||||||
"is_readonly": false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,92 +0,0 @@
|
|||||||
{
|
|
||||||
"operationId": "getCertificateAuthorities",
|
|
||||||
"summary": "Get a list of Certificate Authorities",
|
|
||||||
"tags": ["Certificate Authorities"],
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"in": "query",
|
|
||||||
"name": "offset",
|
|
||||||
"schema": {
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"description": "The pagination row offset, default 0",
|
|
||||||
"example": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"in": "query",
|
|
||||||
"name": "limit",
|
|
||||||
"schema": {
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"description": "The pagination row limit, default 10",
|
|
||||||
"example": 10
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"in": "query",
|
|
||||||
"name": "sort",
|
|
||||||
"schema": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"description": "The sorting of the list",
|
|
||||||
"example": "id,name.asc,value.desc"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"responses": {
|
|
||||||
"200": {
|
|
||||||
"description": "200 response",
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"required": ["result"],
|
|
||||||
"properties": {
|
|
||||||
"result": {
|
|
||||||
"$ref": "#/components/schemas/CertificateAuthorityList"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"examples": {
|
|
||||||
"default": {
|
|
||||||
"value": {
|
|
||||||
"result": {
|
|
||||||
"total": 2,
|
|
||||||
"offset": 0,
|
|
||||||
"limit": 10,
|
|
||||||
"sort": [
|
|
||||||
{
|
|
||||||
"field": "name",
|
|
||||||
"direction": "ASC"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"items": [
|
|
||||||
{
|
|
||||||
"id": 1,
|
|
||||||
"created_on": 1627531400,
|
|
||||||
"modified_on": 1627531400,
|
|
||||||
"name": "ZeroSSL",
|
|
||||||
"acmesh_server": "zerossl",
|
|
||||||
"ca_bundle": "",
|
|
||||||
"max_domains": 10,
|
|
||||||
"is_wildcard_supported": true,
|
|
||||||
"is_setup": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 2,
|
|
||||||
"created_on": 1627531400,
|
|
||||||
"modified_on": 1627531400,
|
|
||||||
"name": "Let's Encrypt",
|
|
||||||
"acmesh_server": "https://acme-v02.api.letsencrypt.org/directory",
|
|
||||||
"ca_bundle": "",
|
|
||||||
"max_domains": 10,
|
|
||||||
"is_wildcard_supported": true,
|
|
||||||
"is_setup": true
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,48 +0,0 @@
|
|||||||
{
|
|
||||||
"operationId": "createCertificateAuthority",
|
|
||||||
"summary": "Create a new Certificate Authority",
|
|
||||||
"tags": ["Certificate Authorities"],
|
|
||||||
"requestBody": {
|
|
||||||
"description": "Certificate Authority to Create",
|
|
||||||
"required": true,
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": "{{schema.CreateCertificateAuthority}}"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"responses": {
|
|
||||||
"201": {
|
|
||||||
"description": "201 response",
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"required": ["result"],
|
|
||||||
"properties": {
|
|
||||||
"result": {
|
|
||||||
"$ref": "#/components/schemas/CertificateAuthorityObject"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"examples": {
|
|
||||||
"default": {
|
|
||||||
"value": {
|
|
||||||
"result": {
|
|
||||||
"id": 1,
|
|
||||||
"created_on": 1627531400,
|
|
||||||
"modified_on": 1627531400,
|
|
||||||
"name": "ZeroSSL",
|
|
||||||
"acmesh_server": "zerossl",
|
|
||||||
"ca_bundle": "",
|
|
||||||
"max_domains": 10,
|
|
||||||
"is_wildcard_supported": true,
|
|
||||||
"is_readonly": false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,60 +0,0 @@
|
|||||||
{
|
|
||||||
"operationId": "deleteCertificate",
|
|
||||||
"summary": "Delete a Certificate",
|
|
||||||
"tags": [
|
|
||||||
"Certificates"
|
|
||||||
],
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"in": "path",
|
|
||||||
"name": "certificateID",
|
|
||||||
"schema": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"required": true,
|
|
||||||
"description": "Numeric ID of the certificate",
|
|
||||||
"example": 1
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"responses": {
|
|
||||||
"200": {
|
|
||||||
"description": "200 response",
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/components/schemas/DeletedItemResponse"
|
|
||||||
},
|
|
||||||
"examples": {
|
|
||||||
"default": {
|
|
||||||
"value": {
|
|
||||||
"result": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"400": {
|
|
||||||
"description": "400 response",
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/components/schemas/DeletedItemResponse"
|
|
||||||
},
|
|
||||||
"examples": {
|
|
||||||
"default": {
|
|
||||||
"value": {
|
|
||||||
"result": null,
|
|
||||||
"error": {
|
|
||||||
"code": 400,
|
|
||||||
"message": "You cannot delete a certificate that is in use!"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,61 +0,0 @@
|
|||||||
{
|
|
||||||
"operationId": "getCertificate",
|
|
||||||
"summary": "Get a certificate object by ID",
|
|
||||||
"tags": [
|
|
||||||
"Certificates"
|
|
||||||
],
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"in": "path",
|
|
||||||
"name": "certificateID",
|
|
||||||
"schema": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"required": true,
|
|
||||||
"description": "ID of the certificate",
|
|
||||||
"example": 1
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"responses": {
|
|
||||||
"200": {
|
|
||||||
"description": "200 response",
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"required": [
|
|
||||||
"result"
|
|
||||||
],
|
|
||||||
"properties": {
|
|
||||||
"result": {
|
|
||||||
"$ref": "#/components/schemas/CertificateObject"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"examples": {
|
|
||||||
"default": {
|
|
||||||
"value": {
|
|
||||||
"result": {
|
|
||||||
"id": 1,
|
|
||||||
"created_on": 1604536109,
|
|
||||||
"modified_on": 1604536109,
|
|
||||||
"expires_on": null,
|
|
||||||
"type": "dns",
|
|
||||||
"user_id": 1,
|
|
||||||
"certificate_authority_id": 2,
|
|
||||||
"dns_provider_id": 1,
|
|
||||||
"name": "test1.jc21.com.au",
|
|
||||||
"domain_names": [
|
|
||||||
"test1.jc21.com.au"
|
|
||||||
],
|
|
||||||
"is_ecc": 0,
|
|
||||||
"status": "ready"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,70 +0,0 @@
|
|||||||
{
|
|
||||||
"operationId": "updateCertificate",
|
|
||||||
"summary": "Update an existing Certificate",
|
|
||||||
"tags": [
|
|
||||||
"Certificates"
|
|
||||||
],
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"in": "path",
|
|
||||||
"name": "certificateID",
|
|
||||||
"schema": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"required": true,
|
|
||||||
"description": "ID of the certificate",
|
|
||||||
"example": 1
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"requestBody": {
|
|
||||||
"description": "Certificate details to update",
|
|
||||||
"required": true,
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": "{{schema.UpdateCertificate}}"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"responses": {
|
|
||||||
"200": {
|
|
||||||
"description": "200 response",
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"required": [
|
|
||||||
"result"
|
|
||||||
],
|
|
||||||
"properties": {
|
|
||||||
"result": {
|
|
||||||
"$ref": "#/components/schemas/CertificateObject"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"examples": {
|
|
||||||
"default": {
|
|
||||||
"value": {
|
|
||||||
"result": {
|
|
||||||
"id": 1,
|
|
||||||
"created_on": 1604536109,
|
|
||||||
"modified_on": 1604536109,
|
|
||||||
"expires_on": null,
|
|
||||||
"type": "dns",
|
|
||||||
"user_id": 1,
|
|
||||||
"certificate_authority_id": 2,
|
|
||||||
"dns_provider_id": 1,
|
|
||||||
"name": "test1.jc21.com.au",
|
|
||||||
"domain_names": [
|
|
||||||
"test1.jc21.com.au"
|
|
||||||
],
|
|
||||||
"is_ecc": 0,
|
|
||||||
"status": "ready"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,90 +0,0 @@
|
|||||||
{
|
|
||||||
"operationId": "getCertificates",
|
|
||||||
"summary": "Get a list of certificates",
|
|
||||||
"tags": [
|
|
||||||
"Certificates"
|
|
||||||
],
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"in": "query",
|
|
||||||
"name": "offset",
|
|
||||||
"schema": {
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"description": "The pagination row offset, default 0",
|
|
||||||
"example": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"in": "query",
|
|
||||||
"name": "limit",
|
|
||||||
"schema": {
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"description": "The pagination row limit, default 10",
|
|
||||||
"example": 10
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"in": "query",
|
|
||||||
"name": "sort",
|
|
||||||
"schema": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"description": "The sorting of the list",
|
|
||||||
"example": "id,name.asc,value.desc"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"responses": {
|
|
||||||
"200": {
|
|
||||||
"description": "200 response",
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"required": [
|
|
||||||
"result"
|
|
||||||
],
|
|
||||||
"properties": {
|
|
||||||
"result": {
|
|
||||||
"$ref": "#/components/schemas/CertificateList"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"examples": {
|
|
||||||
"default": {
|
|
||||||
"value": {
|
|
||||||
"result": {
|
|
||||||
"total": 1,
|
|
||||||
"offset": 0,
|
|
||||||
"limit": 10,
|
|
||||||
"sort": [
|
|
||||||
{
|
|
||||||
"field": "name",
|
|
||||||
"direction": "ASC"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"items": [
|
|
||||||
{
|
|
||||||
"id": 1,
|
|
||||||
"created_on": 1604536109,
|
|
||||||
"modified_on": 1604536109,
|
|
||||||
"expires_on": null,
|
|
||||||
"type": "dns",
|
|
||||||
"user_id": 1,
|
|
||||||
"certificate_authority_id": 2,
|
|
||||||
"dns_provider_id": 1,
|
|
||||||
"name": "test1.jc21.com.au",
|
|
||||||
"domain_names": [
|
|
||||||
"test1.jc21.com.au"
|
|
||||||
],
|
|
||||||
"is_ecc": 0,
|
|
||||||
"status": "ready"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,57 +0,0 @@
|
|||||||
{
|
|
||||||
"operationId": "createCertificate",
|
|
||||||
"summary": "Create a new Certificate",
|
|
||||||
"tags": [
|
|
||||||
"Certificates"
|
|
||||||
],
|
|
||||||
"requestBody": {
|
|
||||||
"description": "Certificate to create",
|
|
||||||
"required": true,
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": "{{schema.CreateCertificate}}"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"responses": {
|
|
||||||
"201": {
|
|
||||||
"description": "201 response",
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"required": [
|
|
||||||
"result"
|
|
||||||
],
|
|
||||||
"properties": {
|
|
||||||
"result": {
|
|
||||||
"$ref": "#/components/schemas/CertificateObject"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"examples": {
|
|
||||||
"default": {
|
|
||||||
"value": {
|
|
||||||
"result": {
|
|
||||||
"id": 1,
|
|
||||||
"created_on": 1604536109,
|
|
||||||
"modified_on": 1604536109,
|
|
||||||
"expires_on": null,
|
|
||||||
"type": "dns",
|
|
||||||
"user_id": 1,
|
|
||||||
"certificate_authority_id": 2,
|
|
||||||
"dns_provider_id": 1,
|
|
||||||
"name": "test1.jc21.com.au",
|
|
||||||
"domain_names": [
|
|
||||||
"test1.jc21.com.au"
|
|
||||||
],
|
|
||||||
"is_ecc": 0,
|
|
||||||
"status": "ready"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,36 +0,0 @@
|
|||||||
{
|
|
||||||
"operationId": "config",
|
|
||||||
"summary": "Returns the API Service configuration",
|
|
||||||
"responses": {
|
|
||||||
"200": {
|
|
||||||
"description": "200 response",
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"required": [
|
|
||||||
"result"
|
|
||||||
],
|
|
||||||
"properties": {
|
|
||||||
"result": {
|
|
||||||
"$ref": "#/components/schemas/ConfigObject"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"examples": {
|
|
||||||
"default": {
|
|
||||||
"value": {
|
|
||||||
"result": {
|
|
||||||
"data": "/data",
|
|
||||||
"log": {
|
|
||||||
"level": "debug",
|
|
||||||
"format": "nice"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,82 +0,0 @@
|
|||||||
{
|
|
||||||
"operationId": "getDNSProviders",
|
|
||||||
"summary": "Get a list of DNS Providers",
|
|
||||||
"tags": ["DNS Providers"],
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"in": "query",
|
|
||||||
"name": "offset",
|
|
||||||
"schema": {
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"description": "The pagination row offset, default 0",
|
|
||||||
"example": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"in": "query",
|
|
||||||
"name": "limit",
|
|
||||||
"schema": {
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"description": "The pagination row limit, default 10",
|
|
||||||
"example": 10
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"in": "query",
|
|
||||||
"name": "sort",
|
|
||||||
"schema": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"description": "The sorting of the list",
|
|
||||||
"example": "id,name.asc,value.desc"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"responses": {
|
|
||||||
"200": {
|
|
||||||
"description": "200 response",
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"required": ["result"],
|
|
||||||
"properties": {
|
|
||||||
"result": {
|
|
||||||
"$ref": "#/components/schemas/DNSProviderList"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"examples": {
|
|
||||||
"default": {
|
|
||||||
"value": {
|
|
||||||
"result": {
|
|
||||||
"total": 1,
|
|
||||||
"offset": 0,
|
|
||||||
"limit": 10,
|
|
||||||
"sort": [
|
|
||||||
{
|
|
||||||
"field": "name",
|
|
||||||
"direction": "ASC"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"items": [
|
|
||||||
{
|
|
||||||
"id": 1,
|
|
||||||
"created_on": 1602593653,
|
|
||||||
"modified_on": 1602593653,
|
|
||||||
"user_id": 1,
|
|
||||||
"name": "Route53",
|
|
||||||
"acmesh_name": "dns_aws",
|
|
||||||
"meta": {
|
|
||||||
"AWS_ACCESS_KEY_ID": "abc123",
|
|
||||||
"AWS_SECRET_ACCESS_KEY": "def098"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,49 +0,0 @@
|
|||||||
{
|
|
||||||
"operationId": "createDNSProvider",
|
|
||||||
"summary": "Create a new DNS Provider",
|
|
||||||
"tags": ["DNS Providers"],
|
|
||||||
"requestBody": {
|
|
||||||
"description": "DNS Provider to Create",
|
|
||||||
"required": true,
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": "{{schema.CreateDNSProvider}}"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"responses": {
|
|
||||||
"201": {
|
|
||||||
"description": "201 response",
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"required": ["result"],
|
|
||||||
"properties": {
|
|
||||||
"result": {
|
|
||||||
"$ref": "#/components/schemas/DNSProviderObject"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"examples": {
|
|
||||||
"default": {
|
|
||||||
"value": {
|
|
||||||
"result": {
|
|
||||||
"id": 1,
|
|
||||||
"created_on": 1602593653,
|
|
||||||
"modified_on": 1602593653,
|
|
||||||
"user_id": 1,
|
|
||||||
"name": "Route53",
|
|
||||||
"acmesh_name": "dns_aws",
|
|
||||||
"meta": {
|
|
||||||
"AWS_ACCESS_KEY_ID": "abc123",
|
|
||||||
"AWS_SECRET_ACCESS_KEY": "def098"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,60 +0,0 @@
|
|||||||
{
|
|
||||||
"operationId": "deleteDNSProvider",
|
|
||||||
"summary": "Delete a DNS Provider",
|
|
||||||
"tags": [
|
|
||||||
"DNS Providers"
|
|
||||||
],
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"in": "path",
|
|
||||||
"name": "providerID",
|
|
||||||
"schema": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"required": true,
|
|
||||||
"description": "Numeric ID of the DNS Provider",
|
|
||||||
"example": 1
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"responses": {
|
|
||||||
"200": {
|
|
||||||
"description": "200 response",
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/components/schemas/DeletedItemResponse"
|
|
||||||
},
|
|
||||||
"examples": {
|
|
||||||
"default": {
|
|
||||||
"value": {
|
|
||||||
"result": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"400": {
|
|
||||||
"description": "400 response",
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/components/schemas/DeletedItemResponse"
|
|
||||||
},
|
|
||||||
"examples": {
|
|
||||||
"default": {
|
|
||||||
"value": {
|
|
||||||
"result": null,
|
|
||||||
"error": {
|
|
||||||
"code": 400,
|
|
||||||
"message": "You cannot delete a DNS Provider that is in use!"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,53 +0,0 @@
|
|||||||
{
|
|
||||||
"operationId": "getDNSProvider",
|
|
||||||
"summary": "Get a DNS Provider object by ID",
|
|
||||||
"tags": ["DNS Providers"],
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"in": "path",
|
|
||||||
"name": "providerID",
|
|
||||||
"schema": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"required": true,
|
|
||||||
"description": "ID of the DNS Provider",
|
|
||||||
"example": 1
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"responses": {
|
|
||||||
"200": {
|
|
||||||
"description": "200 response",
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"required": ["result"],
|
|
||||||
"properties": {
|
|
||||||
"result": {
|
|
||||||
"$ref": "#/components/schemas/DNSProviderObject"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"examples": {
|
|
||||||
"default": {
|
|
||||||
"value": {
|
|
||||||
"result": {
|
|
||||||
"id": 1,
|
|
||||||
"created_on": 1602593653,
|
|
||||||
"modified_on": 1602593653,
|
|
||||||
"user_id": 1,
|
|
||||||
"name": "Route53",
|
|
||||||
"acmesh_name": "dns_aws",
|
|
||||||
"meta": {
|
|
||||||
"AWS_ACCESS_KEY_ID": "abc123",
|
|
||||||
"AWS_SECRET_ACCESS_KEY": "def098"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,64 +0,0 @@
|
|||||||
{
|
|
||||||
"operationId": "updateDNSProvider",
|
|
||||||
"summary": "Update an existing DNS Provider",
|
|
||||||
"tags": ["DNS Providers"],
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"in": "path",
|
|
||||||
"name": "providerID",
|
|
||||||
"schema": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"required": true,
|
|
||||||
"description": "ID of the DNS Provider",
|
|
||||||
"example": 1
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"requestBody": {
|
|
||||||
"description": "DNS Provider details to update",
|
|
||||||
"required": true,
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": "{{schema.UpdateDNSProvider}}"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"responses": {
|
|
||||||
"200": {
|
|
||||||
"description": "200 response",
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"required": ["result"],
|
|
||||||
"properties": {
|
|
||||||
"result": {
|
|
||||||
"$ref": "#/components/schemas/DNSProviderObject"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"examples": {
|
|
||||||
"default": {
|
|
||||||
"value": {
|
|
||||||
"result": {
|
|
||||||
"result": {
|
|
||||||
"id": 1,
|
|
||||||
"created_on": 1602593653,
|
|
||||||
"modified_on": 1602593653,
|
|
||||||
"user_id": 1,
|
|
||||||
"name": "Route53",
|
|
||||||
"acmesh_name": "dns_aws",
|
|
||||||
"meta": {
|
|
||||||
"AWS_ACCESS_KEY_ID": "abc123",
|
|
||||||
"AWS_SECRET_ACCESS_KEY": "def098"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,47 +0,0 @@
|
|||||||
{
|
|
||||||
"operationId": "health",
|
|
||||||
"summary": "Returns the API health status",
|
|
||||||
"responses": {
|
|
||||||
"200": {
|
|
||||||
"description": "200 response",
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"required": [
|
|
||||||
"result"
|
|
||||||
],
|
|
||||||
"properties": {
|
|
||||||
"result": {
|
|
||||||
"$ref": "#/components/schemas/HealthObject"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"examples": {
|
|
||||||
"default": {
|
|
||||||
"value": {
|
|
||||||
"result": {
|
|
||||||
"version": "3.0.0",
|
|
||||||
"commit": "9f119b6",
|
|
||||||
"healthy": true,
|
|
||||||
"setup": true,
|
|
||||||
"error_reporting": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"unhealthy": {
|
|
||||||
"value": {
|
|
||||||
"result": {
|
|
||||||
"version": "3.0.0",
|
|
||||||
"commit": "9f119b6",
|
|
||||||
"healthy": false,
|
|
||||||
"setup": true,
|
|
||||||
"error_reporting": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,93 +0,0 @@
|
|||||||
{
|
|
||||||
"operationId": "getHosts",
|
|
||||||
"summary": "Get a list of Hosts",
|
|
||||||
"tags": ["Hosts"],
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"in": "query",
|
|
||||||
"name": "offset",
|
|
||||||
"schema": {
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"description": "The pagination row offset, default 0",
|
|
||||||
"example": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"in": "query",
|
|
||||||
"name": "limit",
|
|
||||||
"schema": {
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"description": "The pagination row limit, default 10",
|
|
||||||
"example": 10
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"in": "query",
|
|
||||||
"name": "sort",
|
|
||||||
"schema": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"description": "The sorting of the list",
|
|
||||||
"example": "id,name.asc,value.desc"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"responses": {
|
|
||||||
"200": {
|
|
||||||
"description": "200 response",
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"required": ["result"],
|
|
||||||
"properties": {
|
|
||||||
"result": {
|
|
||||||
"$ref": "#/components/schemas/HostList"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"examples": {
|
|
||||||
"default": {
|
|
||||||
"value": {
|
|
||||||
"result": {
|
|
||||||
"total": 1,
|
|
||||||
"offset": 0,
|
|
||||||
"limit": 10,
|
|
||||||
"sort": [
|
|
||||||
{
|
|
||||||
"field": "domain_names",
|
|
||||||
"direction": "ASC"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"items": [
|
|
||||||
{
|
|
||||||
"id": 1,
|
|
||||||
"created_on": 1646279455,
|
|
||||||
"modified_on": 1646279455,
|
|
||||||
"user_id": 2,
|
|
||||||
"type": "proxy",
|
|
||||||
"nginx_template_id": 1,
|
|
||||||
"listen_interface": "",
|
|
||||||
"domain_names": ["jc21.com"],
|
|
||||||
"upstream_id": 0,
|
|
||||||
"certificate_id": 0,
|
|
||||||
"access_list_id": 0,
|
|
||||||
"ssl_forced": false,
|
|
||||||
"caching_enabled": false,
|
|
||||||
"block_exploits": false,
|
|
||||||
"allow_websocket_upgrade": false,
|
|
||||||
"http2_support": false,
|
|
||||||
"hsts_enabled": false,
|
|
||||||
"hsts_subdomains": false,
|
|
||||||
"paths": "",
|
|
||||||
"advanced_config": "",
|
|
||||||
"is_disabled": false
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,60 +0,0 @@
|
|||||||
{
|
|
||||||
"operationId": "deleteHost",
|
|
||||||
"summary": "Delete a Host",
|
|
||||||
"tags": [
|
|
||||||
"Hosts"
|
|
||||||
],
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"in": "path",
|
|
||||||
"name": "hostID",
|
|
||||||
"schema": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"required": true,
|
|
||||||
"description": "Numeric ID of the Host",
|
|
||||||
"example": 1
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"responses": {
|
|
||||||
"200": {
|
|
||||||
"description": "200 response",
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/components/schemas/DeletedItemResponse"
|
|
||||||
},
|
|
||||||
"examples": {
|
|
||||||
"default": {
|
|
||||||
"value": {
|
|
||||||
"result": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"400": {
|
|
||||||
"description": "400 response",
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/components/schemas/DeletedItemResponse"
|
|
||||||
},
|
|
||||||
"examples": {
|
|
||||||
"default": {
|
|
||||||
"value": {
|
|
||||||
"result": null,
|
|
||||||
"error": {
|
|
||||||
"code": 400,
|
|
||||||
"message": "You cannot delete a host that is in use!"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,64 +0,0 @@
|
|||||||
{
|
|
||||||
"operationId": "getHost",
|
|
||||||
"summary": "Get a Host object by ID",
|
|
||||||
"tags": ["Hosts"],
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"in": "path",
|
|
||||||
"name": "hostID",
|
|
||||||
"schema": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"required": true,
|
|
||||||
"description": "ID of the Host",
|
|
||||||
"example": 1
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"responses": {
|
|
||||||
"200": {
|
|
||||||
"description": "200 response",
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"required": ["result"],
|
|
||||||
"properties": {
|
|
||||||
"result": {
|
|
||||||
"$ref": "#/components/schemas/HostObject"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"examples": {
|
|
||||||
"default": {
|
|
||||||
"value": {
|
|
||||||
"result": {
|
|
||||||
"id": 1,
|
|
||||||
"created_on": 1646279455,
|
|
||||||
"modified_on": 1646279455,
|
|
||||||
"user_id": 2,
|
|
||||||
"type": "proxy",
|
|
||||||
"nginx_template_id": 1,
|
|
||||||
"listen_interface": "",
|
|
||||||
"domain_names": ["jc21.com"],
|
|
||||||
"upstream_id": 0,
|
|
||||||
"certificate_id": 0,
|
|
||||||
"access_list_id": 0,
|
|
||||||
"ssl_forced": false,
|
|
||||||
"caching_enabled": false,
|
|
||||||
"block_exploits": false,
|
|
||||||
"allow_websocket_upgrade": false,
|
|
||||||
"http2_support": false,
|
|
||||||
"hsts_enabled": false,
|
|
||||||
"hsts_subdomains": false,
|
|
||||||
"paths": "",
|
|
||||||
"advanced_config": "",
|
|
||||||
"is_disabled": false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,42 +0,0 @@
|
|||||||
{
|
|
||||||
"operationId": "getHostNginxConfig",
|
|
||||||
"summary": "Get a Host Nginx Config object by ID",
|
|
||||||
"tags": ["Hosts"],
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"in": "path",
|
|
||||||
"name": "hostID",
|
|
||||||
"schema": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"required": true,
|
|
||||||
"description": "ID of the Host",
|
|
||||||
"example": 1
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"responses": {
|
|
||||||
"200": {
|
|
||||||
"description": "200 response",
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"required": ["result"],
|
|
||||||
"properties": {
|
|
||||||
"result": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"examples": {
|
|
||||||
"default": {
|
|
||||||
"value": {
|
|
||||||
"result": "# ------------------------------------------------------------\n# a.example.com\n# ------------------------------------------------------------\nserver {\n listen 80;\n server_name a.example.com ;\n access_log /data/logs/host-1_access.log proxy;\n error_log /data/logs/host-1_error.log warn;\n # locations ?\n # default location:\n location / {\n # Access Rules ? todo\n # Access checks must...? todo\n # Proxy!\n add_header X-Served-By $host;\n proxy_set_header Host $host;\n proxy_set_header X-Forwarded-Scheme $scheme;\n proxy_set_header X-Forwarded-Proto $scheme;\n proxy_set_header X-Forwarded-For $remote_addr;\n proxy_http_version 1.1;\n # proxy a single host\n proxy_pass http://192.168.0.10:80;\n }\n # Legacy Custom Configuration\n include /data/nginx/custom/server_proxy[.]conf;\n}\n"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,73 +0,0 @@
|
|||||||
{
|
|
||||||
"operationId": "updateHost",
|
|
||||||
"summary": "Update an existing Host",
|
|
||||||
"tags": ["Hosts"],
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"in": "path",
|
|
||||||
"name": "hostID",
|
|
||||||
"schema": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"required": true,
|
|
||||||
"description": "ID of the Host",
|
|
||||||
"example": 1
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"requestBody": {
|
|
||||||
"description": "Host details to update",
|
|
||||||
"required": true,
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": "{{schema.UpdateHost}}"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"responses": {
|
|
||||||
"200": {
|
|
||||||
"description": "200 response",
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"required": ["result"],
|
|
||||||
"properties": {
|
|
||||||
"result": {
|
|
||||||
"$ref": "#/components/schemas/HostObject"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"examples": {
|
|
||||||
"default": {
|
|
||||||
"value": {
|
|
||||||
"result": {
|
|
||||||
"id": 1,
|
|
||||||
"created_on": 1646279455,
|
|
||||||
"modified_on": 1646279455,
|
|
||||||
"user_id": 2,
|
|
||||||
"type": "proxy",
|
|
||||||
"nginx_template_id": 1,
|
|
||||||
"listen_interface": "",
|
|
||||||
"domain_names": ["jc21.com"],
|
|
||||||
"upstream_id": 0,
|
|
||||||
"certificate_id": 0,
|
|
||||||
"access_list_id": 0,
|
|
||||||
"ssl_forced": false,
|
|
||||||
"caching_enabled": false,
|
|
||||||
"block_exploits": false,
|
|
||||||
"allow_websocket_upgrade": false,
|
|
||||||
"http2_support": false,
|
|
||||||
"hsts_enabled": false,
|
|
||||||
"hsts_subdomains": false,
|
|
||||||
"paths": "",
|
|
||||||
"advanced_config": "",
|
|
||||||
"is_disabled": false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,60 +0,0 @@
|
|||||||
{
|
|
||||||
"operationId": "createHost",
|
|
||||||
"summary": "Create a new Host",
|
|
||||||
"tags": ["Hosts"],
|
|
||||||
"requestBody": {
|
|
||||||
"description": "Host to Create",
|
|
||||||
"required": true,
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": "{{schema.CreateHost}}"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"responses": {
|
|
||||||
"201": {
|
|
||||||
"description": "201 response",
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"required": ["result"],
|
|
||||||
"properties": {
|
|
||||||
"result": {
|
|
||||||
"$ref": "#/components/schemas/HostObject"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"examples": {
|
|
||||||
"default": {
|
|
||||||
"value": {
|
|
||||||
"result": {
|
|
||||||
"id": 1,
|
|
||||||
"created_on": 1645700556,
|
|
||||||
"modified_on": 1645700556,
|
|
||||||
"user_id": 2,
|
|
||||||
"type": "proxy",
|
|
||||||
"nginx_template_id": 1,
|
|
||||||
"listen_interface": "",
|
|
||||||
"domain_names": ["jc21.com"],
|
|
||||||
"upstream_id": 0,
|
|
||||||
"certificate_id": 0,
|
|
||||||
"access_list_id": 0,
|
|
||||||
"ssl_forced": false,
|
|
||||||
"caching_enabled": false,
|
|
||||||
"block_exploits": false,
|
|
||||||
"allow_websocket_upgrade": false,
|
|
||||||
"http2_support": false,
|
|
||||||
"hsts_enabled": false,
|
|
||||||
"hsts_subdomains": false,
|
|
||||||
"paths": "",
|
|
||||||
"advanced_config": "",
|
|
||||||
"is_disabled": false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,79 +0,0 @@
|
|||||||
{
|
|
||||||
"operationId": "getNginxTemplates",
|
|
||||||
"summary": "Get a list of Nginx Templates",
|
|
||||||
"tags": ["Nginx Templates"],
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"in": "query",
|
|
||||||
"name": "offset",
|
|
||||||
"schema": {
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"description": "The pagination row offset, default 0",
|
|
||||||
"example": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"in": "query",
|
|
||||||
"name": "limit",
|
|
||||||
"schema": {
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"description": "The pagination row limit, default 10",
|
|
||||||
"example": 10
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"in": "query",
|
|
||||||
"name": "sort",
|
|
||||||
"schema": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"description": "The sorting of the list",
|
|
||||||
"example": "id,name.asc,value.desc"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"responses": {
|
|
||||||
"200": {
|
|
||||||
"description": "200 response",
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"required": ["result"],
|
|
||||||
"properties": {
|
|
||||||
"result": {
|
|
||||||
"$ref": "#/components/schemas/NginxTemplateList"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"examples": {
|
|
||||||
"default": {
|
|
||||||
"value": {
|
|
||||||
"result": {
|
|
||||||
"total": 1,
|
|
||||||
"offset": 0,
|
|
||||||
"limit": 10,
|
|
||||||
"sort": [
|
|
||||||
{
|
|
||||||
"field": "created_on",
|
|
||||||
"direction": "ASC"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"items": [
|
|
||||||
{
|
|
||||||
"id": 1,
|
|
||||||
"created_on": 1646218093,
|
|
||||||
"modified_on": 1646218093,
|
|
||||||
"user_id": 1,
|
|
||||||
"name": "Default Proxy Template",
|
|
||||||
"type": "proxy",
|
|
||||||
"template": "# this is a proxy template"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,46 +0,0 @@
|
|||||||
{
|
|
||||||
"operationId": "createNginxTemplate",
|
|
||||||
"summary": "Create a new Nginx Template",
|
|
||||||
"tags": ["Nginx Templates"],
|
|
||||||
"requestBody": {
|
|
||||||
"description": "Template to Create",
|
|
||||||
"required": true,
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": "{{schema.CreateNginxTemplate}}"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"responses": {
|
|
||||||
"201": {
|
|
||||||
"description": "201 response",
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"required": ["result"],
|
|
||||||
"properties": {
|
|
||||||
"result": {
|
|
||||||
"$ref": "#/components/schemas/NginxTemplateObject"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"examples": {
|
|
||||||
"default": {
|
|
||||||
"value": {
|
|
||||||
"result": {
|
|
||||||
"id": 10,
|
|
||||||
"created_on": 1646218093,
|
|
||||||
"modified_on": 1646218093,
|
|
||||||
"user_id": 1,
|
|
||||||
"name": "My proxy template",
|
|
||||||
"type": "proxy",
|
|
||||||
"template": "# this is a proxy template"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,58 +0,0 @@
|
|||||||
{
|
|
||||||
"operationId": "deleteNginxTemplate",
|
|
||||||
"summary": "Delete a Nginx Template",
|
|
||||||
"tags": ["Nginx Templates"],
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"in": "path",
|
|
||||||
"name": "templateID",
|
|
||||||
"schema": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"required": true,
|
|
||||||
"description": "Numeric ID of the Template",
|
|
||||||
"example": 1
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"responses": {
|
|
||||||
"200": {
|
|
||||||
"description": "200 response",
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/components/schemas/DeletedItemResponse"
|
|
||||||
},
|
|
||||||
"examples": {
|
|
||||||
"default": {
|
|
||||||
"value": {
|
|
||||||
"result": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"400": {
|
|
||||||
"description": "400 response",
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/components/schemas/DeletedItemResponse"
|
|
||||||
},
|
|
||||||
"examples": {
|
|
||||||
"default": {
|
|
||||||
"value": {
|
|
||||||
"result": null,
|
|
||||||
"error": {
|
|
||||||
"code": 400,
|
|
||||||
"message": "You cannot delete a template that is in use!"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,50 +0,0 @@
|
|||||||
{
|
|
||||||
"operationId": "getNginxTemplate",
|
|
||||||
"summary": "Get a Nginx Template object by ID",
|
|
||||||
"tags": ["Nginx Templates"],
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"in": "path",
|
|
||||||
"name": "templateID",
|
|
||||||
"schema": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"required": true,
|
|
||||||
"description": "ID of the Host Template",
|
|
||||||
"example": 1
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"responses": {
|
|
||||||
"200": {
|
|
||||||
"description": "200 response",
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"required": ["result"],
|
|
||||||
"properties": {
|
|
||||||
"result": {
|
|
||||||
"$ref": "#/components/schemas/NginxTemplateObject"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"examples": {
|
|
||||||
"default": {
|
|
||||||
"value": {
|
|
||||||
"result": {
|
|
||||||
"id": 1,
|
|
||||||
"created_on": 1646218093,
|
|
||||||
"modified_on": 1646218093,
|
|
||||||
"user_id": 1,
|
|
||||||
"name": "Default Proxy Template",
|
|
||||||
"type": "proxy",
|
|
||||||
"template": "# this is a proxy template"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,59 +0,0 @@
|
|||||||
{
|
|
||||||
"operationId": "updateNginxTemplate",
|
|
||||||
"summary": "Update an existing Nginx Template",
|
|
||||||
"tags": ["Nginx Templates"],
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"in": "path",
|
|
||||||
"name": "templateID",
|
|
||||||
"schema": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"required": true,
|
|
||||||
"description": "ID of the Template",
|
|
||||||
"example": 1
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"requestBody": {
|
|
||||||
"description": "Template details to update",
|
|
||||||
"required": true,
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": "{{schema.UpdateNginxTemplate}}"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"responses": {
|
|
||||||
"200": {
|
|
||||||
"description": "200 response",
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"required": ["result"],
|
|
||||||
"properties": {
|
|
||||||
"result": {
|
|
||||||
"$ref": "#/components/schemas/NginxTemplateObject"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"examples": {
|
|
||||||
"default": {
|
|
||||||
"value": {
|
|
||||||
"result": {
|
|
||||||
"id": 1,
|
|
||||||
"created_on": 1646218093,
|
|
||||||
"modified_on": 1646218093,
|
|
||||||
"user_id": 1,
|
|
||||||
"name": "My renamed proxy template",
|
|
||||||
"type": "proxy",
|
|
||||||
"template": "# this is a proxy template"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,9 +0,0 @@
|
|||||||
{
|
|
||||||
"operationId": "schema",
|
|
||||||
"summary": "Returns this swagger API schema",
|
|
||||||
"responses": {
|
|
||||||
"200": {
|
|
||||||
"description": "200 response"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,84 +0,0 @@
|
|||||||
{
|
|
||||||
"operationId": "getSettings",
|
|
||||||
"summary": "Get a list of settings",
|
|
||||||
"tags": [
|
|
||||||
"Settings"
|
|
||||||
],
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"in": "query",
|
|
||||||
"name": "offset",
|
|
||||||
"schema": {
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"description": "The pagination row offset, default 0",
|
|
||||||
"example": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"in": "query",
|
|
||||||
"name": "limit",
|
|
||||||
"schema": {
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"description": "The pagination row limit, default 10",
|
|
||||||
"example": 10
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"in": "query",
|
|
||||||
"name": "sort",
|
|
||||||
"schema": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"description": "The sorting of the list",
|
|
||||||
"example": "id,name.asc,value.desc"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"responses": {
|
|
||||||
"200": {
|
|
||||||
"description": "200 response",
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"required": [
|
|
||||||
"result"
|
|
||||||
],
|
|
||||||
"properties": {
|
|
||||||
"result": {
|
|
||||||
"$ref": "#/components/schemas/SettingList"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"examples": {
|
|
||||||
"default": {
|
|
||||||
"value": {
|
|
||||||
"result": {
|
|
||||||
"total": 1,
|
|
||||||
"offset": 0,
|
|
||||||
"limit": 10,
|
|
||||||
"sort": [
|
|
||||||
{
|
|
||||||
"field": "name",
|
|
||||||
"direction": "ASC"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"items": [
|
|
||||||
{
|
|
||||||
"id": 1,
|
|
||||||
"created_on": 1578010090,
|
|
||||||
"modified_on": 1578010095,
|
|
||||||
"name": "default-site",
|
|
||||||
"value": {
|
|
||||||
"html": "<p>not found</p>",
|
|
||||||
"type": "custom"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,55 +0,0 @@
|
|||||||
{
|
|
||||||
"operationId": "getSetting",
|
|
||||||
"summary": "Get a setting object by name",
|
|
||||||
"tags": [
|
|
||||||
"Settings"
|
|
||||||
],
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"in": "path",
|
|
||||||
"name": "name",
|
|
||||||
"schema": {
|
|
||||||
"type": "string",
|
|
||||||
"minLength": 2
|
|
||||||
},
|
|
||||||
"required": true,
|
|
||||||
"description": "Name of the setting",
|
|
||||||
"example": "default-site"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"responses": {
|
|
||||||
"200": {
|
|
||||||
"description": "200 response",
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"required": [
|
|
||||||
"result"
|
|
||||||
],
|
|
||||||
"properties": {
|
|
||||||
"result": {
|
|
||||||
"$ref": "#/components/schemas/SettingObject"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"examples": {
|
|
||||||
"default": {
|
|
||||||
"value": {
|
|
||||||
"result": {
|
|
||||||
"id": 2,
|
|
||||||
"created_on": 1578010090,
|
|
||||||
"modified_on": 1578010095,
|
|
||||||
"name": "default-site",
|
|
||||||
"value": {
|
|
||||||
"html": "<p>not found</p>",
|
|
||||||
"type": "custom"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,64 +0,0 @@
|
|||||||
{
|
|
||||||
"operationId": "updateSetting",
|
|
||||||
"summary": "Update an existing Setting",
|
|
||||||
"tags": [
|
|
||||||
"Settings"
|
|
||||||
],
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"in": "path",
|
|
||||||
"name": "name",
|
|
||||||
"schema": {
|
|
||||||
"type": "string",
|
|
||||||
"minLength": 2
|
|
||||||
},
|
|
||||||
"required": true,
|
|
||||||
"description": "Name of the setting",
|
|
||||||
"example": "default-site"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"requestBody": {
|
|
||||||
"description": "Setting details to update",
|
|
||||||
"required": true,
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": "{{schema.UpdateSetting}}"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"responses": {
|
|
||||||
"200": {
|
|
||||||
"description": "200 response",
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"required": [
|
|
||||||
"result"
|
|
||||||
],
|
|
||||||
"properties": {
|
|
||||||
"result": {
|
|
||||||
"$ref": "#/components/schemas/SettingObject"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"examples": {
|
|
||||||
"default": {
|
|
||||||
"value": {
|
|
||||||
"result": {
|
|
||||||
"id": 2,
|
|
||||||
"created_on": 1578010090,
|
|
||||||
"modified_on": 1578010090,
|
|
||||||
"name": "default-site",
|
|
||||||
"value": {
|
|
||||||
"html": "<p>not found</p>",
|
|
||||||
"type": "custom"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,51 +0,0 @@
|
|||||||
{
|
|
||||||
"operationId": "createSetting",
|
|
||||||
"summary": "Create a new Setting",
|
|
||||||
"tags": [
|
|
||||||
"Settings"
|
|
||||||
],
|
|
||||||
"requestBody": {
|
|
||||||
"description": "Setting to Create",
|
|
||||||
"required": true,
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": "{{schema.CreateSetting}}"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"responses": {
|
|
||||||
"201": {
|
|
||||||
"description": "201 response",
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"required": [
|
|
||||||
"result"
|
|
||||||
],
|
|
||||||
"properties": {
|
|
||||||
"result": {
|
|
||||||
"$ref": "#/components/schemas/SettingObject"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"examples": {
|
|
||||||
"default": {
|
|
||||||
"value": {
|
|
||||||
"result": {
|
|
||||||
"id": 2,
|
|
||||||
"created_on": 1578010090,
|
|
||||||
"modified_on": 1578010090,
|
|
||||||
"name": "default-site",
|
|
||||||
"value": {
|
|
||||||
"html": "<p>not found</p>",
|
|
||||||
"type": "custom"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,75 +0,0 @@
|
|||||||
{
|
|
||||||
"operationId": "getStreams",
|
|
||||||
"summary": "Get a list of Streams",
|
|
||||||
"tags": [
|
|
||||||
"Streams"
|
|
||||||
],
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"in": "query",
|
|
||||||
"name": "offset",
|
|
||||||
"schema": {
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"description": "The pagination row offset, default 0",
|
|
||||||
"example": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"in": "query",
|
|
||||||
"name": "limit",
|
|
||||||
"schema": {
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"description": "The pagination row limit, default 10",
|
|
||||||
"example": 10
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"in": "query",
|
|
||||||
"name": "sort",
|
|
||||||
"schema": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"description": "The sorting of the list",
|
|
||||||
"example": "id,name.asc,value.desc"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"responses": {
|
|
||||||
"200": {
|
|
||||||
"description": "200 response",
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"required": [
|
|
||||||
"result"
|
|
||||||
],
|
|
||||||
"properties": {
|
|
||||||
"result": {
|
|
||||||
"$ref": "#/components/schemas/StreamList"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"examples": {
|
|
||||||
"default": {
|
|
||||||
"value": {
|
|
||||||
"result": {
|
|
||||||
"total": 1,
|
|
||||||
"offset": 0,
|
|
||||||
"limit": 10,
|
|
||||||
"sort": [
|
|
||||||
{
|
|
||||||
"field": "name",
|
|
||||||
"direction": "ASC"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"items": [
|
|
||||||
"TODO"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,38 +0,0 @@
|
|||||||
{
|
|
||||||
"operationId": "createStream",
|
|
||||||
"summary": "Create a new Stream",
|
|
||||||
"tags": ["Streams"],
|
|
||||||
"requestBody": {
|
|
||||||
"description": "Stream to Create",
|
|
||||||
"required": true,
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": "{{schema.CreateStream}}"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"responses": {
|
|
||||||
"201": {
|
|
||||||
"description": "201 response",
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"required": ["result"],
|
|
||||||
"properties": {
|
|
||||||
"result": {
|
|
||||||
"$ref": "#/components/schemas/StreamObject"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"examples": {
|
|
||||||
"default": {
|
|
||||||
"value": {
|
|
||||||
"result": "TODO"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,60 +0,0 @@
|
|||||||
{
|
|
||||||
"operationId": "deleteStream",
|
|
||||||
"summary": "Delete a Stream",
|
|
||||||
"tags": [
|
|
||||||
"Streams"
|
|
||||||
],
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"in": "path",
|
|
||||||
"name": "streamID",
|
|
||||||
"schema": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"required": true,
|
|
||||||
"description": "Numeric ID of the Stream",
|
|
||||||
"example": 1
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"responses": {
|
|
||||||
"200": {
|
|
||||||
"description": "200 response",
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/components/schemas/DeletedItemResponse"
|
|
||||||
},
|
|
||||||
"examples": {
|
|
||||||
"default": {
|
|
||||||
"value": {
|
|
||||||
"result": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"400": {
|
|
||||||
"description": "400 response",
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/components/schemas/DeletedItemResponse"
|
|
||||||
},
|
|
||||||
"examples": {
|
|
||||||
"default": {
|
|
||||||
"value": {
|
|
||||||
"result": null,
|
|
||||||
"error": {
|
|
||||||
"code": 400,
|
|
||||||
"message": "You cannot delete a Stream that is in use!"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,46 +0,0 @@
|
|||||||
{
|
|
||||||
"operationId": "getStream",
|
|
||||||
"summary": "Get a Stream object by ID",
|
|
||||||
"tags": [
|
|
||||||
"Streams"
|
|
||||||
],
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"in": "path",
|
|
||||||
"name": "streamID",
|
|
||||||
"schema": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"required": true,
|
|
||||||
"description": "ID of the Stream",
|
|
||||||
"example": 1
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"responses": {
|
|
||||||
"200": {
|
|
||||||
"description": "200 response",
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"required": [
|
|
||||||
"result"
|
|
||||||
],
|
|
||||||
"properties": {
|
|
||||||
"result": {
|
|
||||||
"$ref": "#/components/schemas/StreamObject"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"examples": {
|
|
||||||
"default": {
|
|
||||||
"value": {
|
|
||||||
"result": "TODO"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,55 +0,0 @@
|
|||||||
{
|
|
||||||
"operationId": "updateStream",
|
|
||||||
"summary": "Update an existing Stream",
|
|
||||||
"tags": [
|
|
||||||
"Streams"
|
|
||||||
],
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"in": "path",
|
|
||||||
"name": "streamID",
|
|
||||||
"schema": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"required": true,
|
|
||||||
"description": "ID of the Stream",
|
|
||||||
"example": 1
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"requestBody": {
|
|
||||||
"description": "Stream details to update",
|
|
||||||
"required": true,
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": "{{schema.UpdateStream}}"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"responses": {
|
|
||||||
"200": {
|
|
||||||
"description": "200 response",
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"required": [
|
|
||||||
"result"
|
|
||||||
],
|
|
||||||
"properties": {
|
|
||||||
"result": {
|
|
||||||
"$ref": "#/components/schemas/StreamObject"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"examples": {
|
|
||||||
"default": {
|
|
||||||
"value": {
|
|
||||||
"result": "TODO"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,37 +0,0 @@
|
|||||||
{
|
|
||||||
"operationId": "refreshToken",
|
|
||||||
"summary": "Refresh your access token",
|
|
||||||
"tags": [
|
|
||||||
"Tokens"
|
|
||||||
],
|
|
||||||
"responses": {
|
|
||||||
"200": {
|
|
||||||
"description": "200 response",
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"required": [
|
|
||||||
"result"
|
|
||||||
],
|
|
||||||
"properties": {
|
|
||||||
"result": {
|
|
||||||
"$ref": "#/components/schemas/StreamObject"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"examples": {
|
|
||||||
"default": {
|
|
||||||
"value": {
|
|
||||||
"result": {
|
|
||||||
"expires": 1566540510,
|
|
||||||
"token": "eyJhbGciOiJSUzUxMiIsInR5cCI6IkpXVCJ9.ey...xaHKYr3Kk6MvkUjcC4",
|
|
||||||
"scope": "user"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,79 +0,0 @@
|
|||||||
{
|
|
||||||
"operationId": "requestToken",
|
|
||||||
"summary": "Request a new access token from credentials",
|
|
||||||
"tags": [
|
|
||||||
"Tokens"
|
|
||||||
],
|
|
||||||
"requestBody": {
|
|
||||||
"description": "Credentials Payload",
|
|
||||||
"required": true,
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": "{{schema.GetToken}}"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"responses": {
|
|
||||||
"200": {
|
|
||||||
"description": "200 response",
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"required": [
|
|
||||||
"result"
|
|
||||||
],
|
|
||||||
"properties": {
|
|
||||||
"result": {
|
|
||||||
"$ref": "#/components/schemas/StreamObject"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"examples": {
|
|
||||||
"default": {
|
|
||||||
"value": {
|
|
||||||
"result": {
|
|
||||||
"expires": 1566540510,
|
|
||||||
"token": "eyJhbGciOiJSUzUxMiIsInR5cCI6IkpXVCJ9.ey...xaHKYr3Kk6MvkUjcC4",
|
|
||||||
"scope": "user"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"403": {
|
|
||||||
"description": "403 response",
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"type": "object",
|
|
||||||
"additionalProperties": false,
|
|
||||||
"required": [
|
|
||||||
"error"
|
|
||||||
],
|
|
||||||
"properties": {
|
|
||||||
"result": {
|
|
||||||
"nullable": true
|
|
||||||
},
|
|
||||||
"error": {
|
|
||||||
"$ref": "#/components/schemas/ErrorObject"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"examples": {
|
|
||||||
"default": {
|
|
||||||
"value": {
|
|
||||||
"result": null,
|
|
||||||
"error": {
|
|
||||||
"code": 403,
|
|
||||||
"message": "Not available during setup phase"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,285 +0,0 @@
|
|||||||
{
|
|
||||||
"operationId": "getUpstreams",
|
|
||||||
"summary": "Get a list of Upstreams",
|
|
||||||
"tags": ["Upstreams"],
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"in": "query",
|
|
||||||
"name": "offset",
|
|
||||||
"schema": {
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"description": "The pagination row offset, default 0",
|
|
||||||
"example": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"in": "query",
|
|
||||||
"name": "limit",
|
|
||||||
"schema": {
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"description": "The pagination row limit, default 10",
|
|
||||||
"example": 10
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"in": "query",
|
|
||||||
"name": "sort",
|
|
||||||
"schema": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"description": "The sorting of the list",
|
|
||||||
"example": "id,name.asc,value.desc"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"responses": {
|
|
||||||
"200": {
|
|
||||||
"description": "200 response",
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"required": ["result"],
|
|
||||||
"properties": {
|
|
||||||
"result": {
|
|
||||||
"$ref": "#/components/schemas/UpstreamList"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"examples": {
|
|
||||||
"default": {
|
|
||||||
"value": {
|
|
||||||
"result": {
|
|
||||||
"total": 5,
|
|
||||||
"offset": 0,
|
|
||||||
"limit": 10,
|
|
||||||
"sort": [
|
|
||||||
{
|
|
||||||
"field": "name",
|
|
||||||
"direction": "ASC"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"items": [
|
|
||||||
{
|
|
||||||
"id": 1,
|
|
||||||
"created_on": 1672804124,
|
|
||||||
"modified_on": 1672804124,
|
|
||||||
"user_id": 2,
|
|
||||||
"name": "API servers",
|
|
||||||
"nginx_template_id": 5,
|
|
||||||
"ip_hash": true,
|
|
||||||
"ntlm": false,
|
|
||||||
"keepalive": 10,
|
|
||||||
"keepalive_requests": 10,
|
|
||||||
"keepalive_time": "60s",
|
|
||||||
"keepalive_timeout": "3s",
|
|
||||||
"advanced_config": "",
|
|
||||||
"status": "ok",
|
|
||||||
"error_message": "",
|
|
||||||
"servers": [
|
|
||||||
{
|
|
||||||
"id": 1,
|
|
||||||
"created_on": 1672804124,
|
|
||||||
"modified_on": 1672804124,
|
|
||||||
"upstream_group_id": 1,
|
|
||||||
"server": "192.168.0.10:80",
|
|
||||||
"weight": 100,
|
|
||||||
"max_conns": 0,
|
|
||||||
"max_fails": 0,
|
|
||||||
"fail_timeout": 0,
|
|
||||||
"backup": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 2,
|
|
||||||
"created_on": 1672804124,
|
|
||||||
"modified_on": 1672804124,
|
|
||||||
"upstream_group_id": 1,
|
|
||||||
"server": "192.168.0.11:80",
|
|
||||||
"weight": 50,
|
|
||||||
"max_conns": 0,
|
|
||||||
"max_fails": 0,
|
|
||||||
"fail_timeout": 0,
|
|
||||||
"backup": false
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 2,
|
|
||||||
"created_on": 1672804197,
|
|
||||||
"modified_on": 1672804197,
|
|
||||||
"user_id": 2,
|
|
||||||
"name": "API servers 2",
|
|
||||||
"nginx_template_id": 5,
|
|
||||||
"ip_hash": false,
|
|
||||||
"ntlm": false,
|
|
||||||
"keepalive": 0,
|
|
||||||
"keepalive_requests": 0,
|
|
||||||
"keepalive_time": "",
|
|
||||||
"keepalive_timeout": "",
|
|
||||||
"advanced_config": "",
|
|
||||||
"status": "ok",
|
|
||||||
"error_message": "",
|
|
||||||
"servers": [
|
|
||||||
{
|
|
||||||
"id": 3,
|
|
||||||
"created_on": 1672804197,
|
|
||||||
"modified_on": 1672804197,
|
|
||||||
"upstream_group_id": 2,
|
|
||||||
"server": "192.168.0.10:80",
|
|
||||||
"weight": 100,
|
|
||||||
"max_conns": 0,
|
|
||||||
"max_fails": 0,
|
|
||||||
"fail_timeout": 0,
|
|
||||||
"backup": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 4,
|
|
||||||
"created_on": 1672804197,
|
|
||||||
"modified_on": 1672804197,
|
|
||||||
"upstream_group_id": 2,
|
|
||||||
"server": "192.168.0.11:80",
|
|
||||||
"weight": 50,
|
|
||||||
"max_conns": 0,
|
|
||||||
"max_fails": 0,
|
|
||||||
"fail_timeout": 0,
|
|
||||||
"backup": false
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 3,
|
|
||||||
"created_on": 1672804200,
|
|
||||||
"modified_on": 1672804200,
|
|
||||||
"user_id": 2,
|
|
||||||
"name": "API servers 2",
|
|
||||||
"nginx_template_id": 5,
|
|
||||||
"ip_hash": false,
|
|
||||||
"ntlm": false,
|
|
||||||
"keepalive": 0,
|
|
||||||
"keepalive_requests": 0,
|
|
||||||
"keepalive_time": "",
|
|
||||||
"keepalive_timeout": "",
|
|
||||||
"advanced_config": "",
|
|
||||||
"status": "ok",
|
|
||||||
"error_message": "",
|
|
||||||
"servers": [
|
|
||||||
{
|
|
||||||
"id": 5,
|
|
||||||
"created_on": 1672804200,
|
|
||||||
"modified_on": 1672804200,
|
|
||||||
"upstream_group_id": 3,
|
|
||||||
"server": "192.168.0.10:80",
|
|
||||||
"weight": 100,
|
|
||||||
"max_conns": 0,
|
|
||||||
"max_fails": 0,
|
|
||||||
"fail_timeout": 0,
|
|
||||||
"backup": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 6,
|
|
||||||
"created_on": 1672804200,
|
|
||||||
"modified_on": 1672804200,
|
|
||||||
"upstream_group_id": 3,
|
|
||||||
"server": "192.168.0.11:80",
|
|
||||||
"weight": 50,
|
|
||||||
"max_conns": 0,
|
|
||||||
"max_fails": 0,
|
|
||||||
"fail_timeout": 0,
|
|
||||||
"backup": false
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 4,
|
|
||||||
"created_on": 1672804201,
|
|
||||||
"modified_on": 1672804201,
|
|
||||||
"user_id": 2,
|
|
||||||
"name": "API servers 2",
|
|
||||||
"nginx_template_id": 5,
|
|
||||||
"ip_hash": false,
|
|
||||||
"ntlm": false,
|
|
||||||
"keepalive": 0,
|
|
||||||
"keepalive_requests": 0,
|
|
||||||
"keepalive_time": "",
|
|
||||||
"keepalive_timeout": "",
|
|
||||||
"advanced_config": "",
|
|
||||||
"status": "ok",
|
|
||||||
"error_message": "",
|
|
||||||
"servers": [
|
|
||||||
{
|
|
||||||
"id": 7,
|
|
||||||
"created_on": 1672804201,
|
|
||||||
"modified_on": 1672804201,
|
|
||||||
"upstream_group_id": 4,
|
|
||||||
"server": "192.168.0.10:80",
|
|
||||||
"weight": 100,
|
|
||||||
"max_conns": 0,
|
|
||||||
"max_fails": 0,
|
|
||||||
"fail_timeout": 0,
|
|
||||||
"backup": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 8,
|
|
||||||
"created_on": 1672804201,
|
|
||||||
"modified_on": 1672804201,
|
|
||||||
"upstream_group_id": 4,
|
|
||||||
"server": "192.168.0.11:80",
|
|
||||||
"weight": 50,
|
|
||||||
"max_conns": 0,
|
|
||||||
"max_fails": 0,
|
|
||||||
"fail_timeout": 0,
|
|
||||||
"backup": false
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 5,
|
|
||||||
"created_on": 1672804201,
|
|
||||||
"modified_on": 1672804201,
|
|
||||||
"user_id": 2,
|
|
||||||
"name": "API servers 2",
|
|
||||||
"nginx_template_id": 5,
|
|
||||||
"ip_hash": false,
|
|
||||||
"ntlm": false,
|
|
||||||
"keepalive": 0,
|
|
||||||
"keepalive_requests": 0,
|
|
||||||
"keepalive_time": "",
|
|
||||||
"keepalive_timeout": "",
|
|
||||||
"advanced_config": "",
|
|
||||||
"status": "ok",
|
|
||||||
"error_message": "",
|
|
||||||
"servers": [
|
|
||||||
{
|
|
||||||
"id": 9,
|
|
||||||
"created_on": 1672804201,
|
|
||||||
"modified_on": 1672804201,
|
|
||||||
"upstream_group_id": 5,
|
|
||||||
"server": "192.168.0.10:80",
|
|
||||||
"weight": 100,
|
|
||||||
"max_conns": 0,
|
|
||||||
"max_fails": 0,
|
|
||||||
"fail_timeout": 0,
|
|
||||||
"backup": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 10,
|
|
||||||
"created_on": 1672804201,
|
|
||||||
"modified_on": 1672804201,
|
|
||||||
"upstream_group_id": 5,
|
|
||||||
"server": "192.168.0.11:80",
|
|
||||||
"weight": 50,
|
|
||||||
"max_conns": 0,
|
|
||||||
"max_fails": 0,
|
|
||||||
"fail_timeout": 0,
|
|
||||||
"backup": false
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,80 +0,0 @@
|
|||||||
{
|
|
||||||
"operationId": "createUpstream",
|
|
||||||
"summary": "Create a new Upstream",
|
|
||||||
"tags": ["Upstreams"],
|
|
||||||
"requestBody": {
|
|
||||||
"description": "Upstream to Create",
|
|
||||||
"required": true,
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": "{{schema.CreateUpstream}}"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"responses": {
|
|
||||||
"201": {
|
|
||||||
"description": "201 response",
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"required": ["result"],
|
|
||||||
"properties": {
|
|
||||||
"result": {
|
|
||||||
"$ref": "#/components/schemas/UpstreamObject"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"examples": {
|
|
||||||
"default": {
|
|
||||||
"value": {
|
|
||||||
"result": {
|
|
||||||
"id": 6,
|
|
||||||
"created_on": 1672806857,
|
|
||||||
"modified_on": 1672806857,
|
|
||||||
"user_id": 2,
|
|
||||||
"name": "API servers 2",
|
|
||||||
"nginx_template_id": 5,
|
|
||||||
"ip_hash": false,
|
|
||||||
"ntlm": false,
|
|
||||||
"keepalive": 0,
|
|
||||||
"keepalive_requests": 0,
|
|
||||||
"keepalive_time": "",
|
|
||||||
"keepalive_timeout": "",
|
|
||||||
"advanced_config": "",
|
|
||||||
"status": "ready",
|
|
||||||
"error_message": "",
|
|
||||||
"servers": [
|
|
||||||
{
|
|
||||||
"id": 11,
|
|
||||||
"created_on": 1672806857,
|
|
||||||
"modified_on": 1672806857,
|
|
||||||
"upstream_id": 6,
|
|
||||||
"server": "192.168.0.10:80",
|
|
||||||
"weight": 100,
|
|
||||||
"max_conns": 0,
|
|
||||||
"max_fails": 0,
|
|
||||||
"fail_timeout": 0,
|
|
||||||
"backup": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 12,
|
|
||||||
"created_on": 1672806857,
|
|
||||||
"modified_on": 1672806857,
|
|
||||||
"upstream_id": 6,
|
|
||||||
"server": "192.168.0.11:80",
|
|
||||||
"weight": 50,
|
|
||||||
"max_conns": 0,
|
|
||||||
"max_fails": 0,
|
|
||||||
"fail_timeout": 0,
|
|
||||||
"backup": false
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,58 +0,0 @@
|
|||||||
{
|
|
||||||
"operationId": "deleteUpstream",
|
|
||||||
"summary": "Delete a Upstream",
|
|
||||||
"tags": ["Upstreams"],
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"in": "path",
|
|
||||||
"name": "upstreamID",
|
|
||||||
"schema": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"required": true,
|
|
||||||
"description": "Numeric ID of the Upstream",
|
|
||||||
"example": 1
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"responses": {
|
|
||||||
"200": {
|
|
||||||
"description": "200 response",
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/components/schemas/DeletedItemResponse"
|
|
||||||
},
|
|
||||||
"examples": {
|
|
||||||
"default": {
|
|
||||||
"value": {
|
|
||||||
"result": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"400": {
|
|
||||||
"description": "400 response",
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/components/schemas/DeletedItemResponse"
|
|
||||||
},
|
|
||||||
"examples": {
|
|
||||||
"default": {
|
|
||||||
"value": {
|
|
||||||
"result": null,
|
|
||||||
"error": {
|
|
||||||
"code": 400,
|
|
||||||
"message": "You cannot delete a Upstream that is in use!"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,81 +0,0 @@
|
|||||||
{
|
|
||||||
"operationId": "getUpstream",
|
|
||||||
"summary": "Get a Upstream object by ID",
|
|
||||||
"tags": ["Upstreams"],
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"in": "path",
|
|
||||||
"name": "upstreamID",
|
|
||||||
"schema": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"required": true,
|
|
||||||
"description": "ID of the Upstream",
|
|
||||||
"example": 1
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"responses": {
|
|
||||||
"200": {
|
|
||||||
"description": "200 response",
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"required": ["result"],
|
|
||||||
"properties": {
|
|
||||||
"result": {
|
|
||||||
"$ref": "#/components/schemas/UpstreamObject"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"examples": {
|
|
||||||
"default": {
|
|
||||||
"value": {
|
|
||||||
"result": {
|
|
||||||
"id": 1,
|
|
||||||
"created_on": 1672786008,
|
|
||||||
"modified_on": 1672786008,
|
|
||||||
"user_id": 2,
|
|
||||||
"name": "API servers 3",
|
|
||||||
"ip_hash": true,
|
|
||||||
"ntlm": false,
|
|
||||||
"keepalive": 10,
|
|
||||||
"keepalive_requests": 10,
|
|
||||||
"keepalive_time": "60s",
|
|
||||||
"keepalive_timeout": "3s",
|
|
||||||
"advanced_config": "",
|
|
||||||
"servers": [
|
|
||||||
{
|
|
||||||
"id": 1,
|
|
||||||
"created_on": 1672786009,
|
|
||||||
"modified_on": 1672786009,
|
|
||||||
"upstream_id": 1,
|
|
||||||
"server": "api1.localhost:1234",
|
|
||||||
"weight": 100,
|
|
||||||
"max_conns": 0,
|
|
||||||
"max_fails": 0,
|
|
||||||
"fail_timeout": 0,
|
|
||||||
"backup": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 2,
|
|
||||||
"created_on": 1672786009,
|
|
||||||
"modified_on": 1672786009,
|
|
||||||
"upstream_id": 1,
|
|
||||||
"server": "api2.localhost:1234",
|
|
||||||
"weight": 50,
|
|
||||||
"max_conns": 0,
|
|
||||||
"max_fails": 0,
|
|
||||||
"fail_timeout": 0,
|
|
||||||
"backup": true
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,42 +0,0 @@
|
|||||||
{
|
|
||||||
"operationId": "getUpstreamNginxConfig",
|
|
||||||
"summary": "Get a Upstream Nginx Config object by ID",
|
|
||||||
"tags": ["Upstreams"],
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"in": "path",
|
|
||||||
"name": "upstreamID",
|
|
||||||
"schema": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"required": true,
|
|
||||||
"description": "ID of the Upstream",
|
|
||||||
"example": 1
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"responses": {
|
|
||||||
"200": {
|
|
||||||
"description": "200 response",
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"required": ["result"],
|
|
||||||
"properties": {
|
|
||||||
"result": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"examples": {
|
|
||||||
"default": {
|
|
||||||
"value": {
|
|
||||||
"result": "# ------------------------------------------------------------\n# Upstream 1: API servers\n# ------------------------------------------------------------\nupstream npm_upstream_1 {\nserver 192.168.0.10:80 weight=100 ;\n server 192.168.0.11:80 weight=50 ;\n}\n"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,93 +0,0 @@
|
|||||||
{
|
|
||||||
"operationId": "updateUpstream",
|
|
||||||
"summary": "Update an existing Upstream",
|
|
||||||
"tags": ["Upstreams"],
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"in": "path",
|
|
||||||
"name": "upstreamID",
|
|
||||||
"schema": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"required": true,
|
|
||||||
"description": "ID of the Upstream",
|
|
||||||
"example": 1
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"requestBody": {
|
|
||||||
"description": "Upstream details to update",
|
|
||||||
"required": true,
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": "{{schema.UpdateUpstream}}"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"responses": {
|
|
||||||
"200": {
|
|
||||||
"description": "200 response",
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"required": ["result"],
|
|
||||||
"properties": {
|
|
||||||
"result": {
|
|
||||||
"$ref": "#/components/schemas/UpstreamObject"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"examples": {
|
|
||||||
"default": {
|
|
||||||
"value": {
|
|
||||||
"result": {
|
|
||||||
"id": 1,
|
|
||||||
"created_on": 1673234177,
|
|
||||||
"modified_on": 1673244559,
|
|
||||||
"user_id": 2,
|
|
||||||
"name": "API servers 2",
|
|
||||||
"nginx_template_id": 5,
|
|
||||||
"ip_hash": false,
|
|
||||||
"ntlm": false,
|
|
||||||
"keepalive": 0,
|
|
||||||
"keepalive_requests": 0,
|
|
||||||
"keepalive_time": "",
|
|
||||||
"keepalive_timeout": "",
|
|
||||||
"advanced_config": "",
|
|
||||||
"status": "ready",
|
|
||||||
"error_message": "",
|
|
||||||
"servers": [
|
|
||||||
{
|
|
||||||
"id": 1,
|
|
||||||
"created_on": 1673234177,
|
|
||||||
"modified_on": 1673244559,
|
|
||||||
"upstream_id": 1,
|
|
||||||
"server": "192.168.0.10:80",
|
|
||||||
"weight": 100,
|
|
||||||
"max_conns": 0,
|
|
||||||
"max_fails": 0,
|
|
||||||
"fail_timeout": 0,
|
|
||||||
"backup": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 2,
|
|
||||||
"created_on": 1673234177,
|
|
||||||
"modified_on": 1673244559,
|
|
||||||
"upstream_id": 1,
|
|
||||||
"server": "192.168.0.11:80",
|
|
||||||
"weight": 50,
|
|
||||||
"max_conns": 0,
|
|
||||||
"max_fails": 0,
|
|
||||||
"fail_timeout": 0,
|
|
||||||
"backup": false
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,117 +0,0 @@
|
|||||||
{
|
|
||||||
"operationId": "getUsers",
|
|
||||||
"summary": "Get a list of users",
|
|
||||||
"tags": ["Users"],
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"in": "query",
|
|
||||||
"name": "offset",
|
|
||||||
"schema": {
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"description": "The pagination row offset, default 0",
|
|
||||||
"example": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"in": "query",
|
|
||||||
"name": "limit",
|
|
||||||
"schema": {
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"description": "The pagination row limit, default 10",
|
|
||||||
"example": 10
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"in": "query",
|
|
||||||
"name": "sort",
|
|
||||||
"schema": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"description": "The sorting of the list",
|
|
||||||
"example": "name,nickname.desc,email.asc"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"responses": {
|
|
||||||
"200": {
|
|
||||||
"description": "200 response",
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"required": ["result"],
|
|
||||||
"properties": {
|
|
||||||
"result": {
|
|
||||||
"$ref": "#/components/schemas/UserList"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"examples": {
|
|
||||||
"default": {
|
|
||||||
"value": {
|
|
||||||
"result": {
|
|
||||||
"total": 3,
|
|
||||||
"offset": 0,
|
|
||||||
"limit": 100,
|
|
||||||
"sort": [
|
|
||||||
{
|
|
||||||
"field": "name",
|
|
||||||
"direction": "ASC"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"field": "nickname",
|
|
||||||
"direction": "DESC"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"field": "email",
|
|
||||||
"direction": "ASC"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"items": [
|
|
||||||
{
|
|
||||||
"id": 1,
|
|
||||||
"name": "Jamie Curnow",
|
|
||||||
"nickname": "James",
|
|
||||||
"email": "jc@jc21.com",
|
|
||||||
"created_on": 1578010090,
|
|
||||||
"modified_on": 1578010095,
|
|
||||||
"gravatar_url": "https://www.gravatar.com/avatar/6193176330f8d38747f038c170ddb193?d=mm&r=pg&s=128",
|
|
||||||
"is_disabled": false,
|
|
||||||
"capabilities": ["full-admin"]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 2,
|
|
||||||
"name": "John Doe",
|
|
||||||
"nickname": "John",
|
|
||||||
"email": "johdoe@example.com",
|
|
||||||
"created_on": 1578010100,
|
|
||||||
"modified_on": 1578010105,
|
|
||||||
"gravatar_url": "https://www.gravatar.com/avatar/6193176330f8d38747f038c170ddb193?d=mm&r=pg&s=128",
|
|
||||||
"is_disabled": false,
|
|
||||||
"capabilities": [
|
|
||||||
"hosts.view",
|
|
||||||
"hosts.manage"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 3,
|
|
||||||
"name": "Jane Doe",
|
|
||||||
"nickname": "Jane",
|
|
||||||
"email": "janedoe@example.com",
|
|
||||||
"created_on": 1578010110,
|
|
||||||
"modified_on": 1578010115,
|
|
||||||
"gravatar_url": "https://www.gravatar.com/avatar/6193176330f8d38747f038c170ddb193?d=mm&r=pg&s=128",
|
|
||||||
"is_disabled": false,
|
|
||||||
"capabilities": [
|
|
||||||
"hosts.view",
|
|
||||||
"hosts.manage"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,79 +0,0 @@
|
|||||||
{
|
|
||||||
"operationId": "createUser",
|
|
||||||
"summary": "Create a new User",
|
|
||||||
"tags": ["Users"],
|
|
||||||
"requestBody": {
|
|
||||||
"description": "User to Create",
|
|
||||||
"required": true,
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": "{{schema.CreateUser}}"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"responses": {
|
|
||||||
"201": {
|
|
||||||
"description": "201 response",
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"required": ["result"],
|
|
||||||
"properties": {
|
|
||||||
"result": {
|
|
||||||
"$ref": "#/components/schemas/UserObject"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"examples": {
|
|
||||||
"default": {
|
|
||||||
"value": {
|
|
||||||
"result": {
|
|
||||||
"id": 1,
|
|
||||||
"name": "Jamie Curnow",
|
|
||||||
"nickname": "James",
|
|
||||||
"email": "jc@jc21.com",
|
|
||||||
"created_on": 1578010100,
|
|
||||||
"modified_on": 1578010100,
|
|
||||||
"gravatar_url": "https://www.gravatar.com/avatar/6193176330f8d38747f038c170ddb193?d=mm&r=pg&s=128",
|
|
||||||
"is_disabled": false,
|
|
||||||
"auth": {
|
|
||||||
"$ref": "#/components/schemas/UserAuthObject"
|
|
||||||
},
|
|
||||||
"capabilities": ["full-admin"]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"400": {
|
|
||||||
"description": "400 response",
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"required": ["error"],
|
|
||||||
"properties": {
|
|
||||||
"result": {
|
|
||||||
"nullable": true
|
|
||||||
},
|
|
||||||
"error": {
|
|
||||||
"$ref": "#/components/schemas/ErrorObject"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"examples": {
|
|
||||||
"default": {
|
|
||||||
"value": {
|
|
||||||
"error": {
|
|
||||||
"code": 400,
|
|
||||||
"message": "An user already exists with this email address"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,65 +0,0 @@
|
|||||||
{
|
|
||||||
"operationId": "setPassword",
|
|
||||||
"summary": "Set a User's password",
|
|
||||||
"tags": ["Users"],
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"in": "path",
|
|
||||||
"name": "userID",
|
|
||||||
"schema": {
|
|
||||||
"oneOf": [
|
|
||||||
{
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string",
|
|
||||||
"pattern": "^me$"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"required": true,
|
|
||||||
"description": "Numeric ID of the user or 'me' to set yourself",
|
|
||||||
"example": 1
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"requestBody": {
|
|
||||||
"description": "Credentials to set",
|
|
||||||
"required": true,
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": "{{schema.SetAuth}}"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"responses": {
|
|
||||||
"200": {
|
|
||||||
"description": "200 response",
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"required": ["result"],
|
|
||||||
"properties": {
|
|
||||||
"result": {
|
|
||||||
"$ref": "#/components/schemas/UserAuthObject"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"examples": {
|
|
||||||
"default": {
|
|
||||||
"value": {
|
|
||||||
"result": {
|
|
||||||
"id": 2,
|
|
||||||
"user_id": 3,
|
|
||||||
"type": "password",
|
|
||||||
"created_on": 1648422222,
|
|
||||||
"modified_on": 1648423979
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,60 +0,0 @@
|
|||||||
{
|
|
||||||
"operationId": "deleteUser",
|
|
||||||
"summary": "Delete a User",
|
|
||||||
"tags": [
|
|
||||||
"Users"
|
|
||||||
],
|
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"in": "path",
|
|
||||||
"name": "userID",
|
|
||||||
"schema": {
|
|
||||||
"type": "integer",
|
|
||||||
"minimum": 1
|
|
||||||
},
|
|
||||||
"required": true,
|
|
||||||
"description": "Numeric ID of the user",
|
|
||||||
"example": 1
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"responses": {
|
|
||||||
"200": {
|
|
||||||
"description": "200 response",
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/components/schemas/DeletedItemResponse"
|
|
||||||
},
|
|
||||||
"examples": {
|
|
||||||
"default": {
|
|
||||||
"value": {
|
|
||||||
"result": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"400": {
|
|
||||||
"description": "400 response",
|
|
||||||
"content": {
|
|
||||||
"application/json": {
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/components/schemas/DeletedItemResponse"
|
|
||||||
},
|
|
||||||
"examples": {
|
|
||||||
"default": {
|
|
||||||
"value": {
|
|
||||||
"result": null,
|
|
||||||
"error": {
|
|
||||||
"code": 400,
|
|
||||||
"message": "You cannot delete yourself!"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user