Compare commits

..

266 Commits

Author SHA1 Message Date
f3182c1258 Use previous version of powerdns image, newer version is broken 2025-01-07 11:19:15 +10:00
9d3c06dbe4 Support containerized cpu limits 2024-12-02 08:44:28 +10:00
152b7666d8 New lint rules 2024-11-21 19:07:36 +10:00
4e6d65645f Fix cypress oauth test one more time 2024-11-13 14:21:16 +10:00
8434b9fce4 Fix unit test 2024-11-13 13:50:44 +10:00
f4bd65dd2c Fix oauth cypress test 2024-11-13 13:38:33 +10:00
a856c4d6e1 Use new instance of autentik db made in dev 2024-11-13 12:46:43 +10:00
2f334b5f9f Fix ci clearing users not clearing auth 2024-11-13 12:38:59 +10:00
2145df0dfb Use docker healthcheck for authentik 2024-11-13 10:28:02 +10:00
331c761a1c Wait for authentik to start in ci test 2024-11-13 08:51:24 +10:00
03b3b6379b Fix incorrect authentikm url in cypress test 2024-11-13 08:24:55 +10:00
050c087a51 Fix annoying joqqueue issue where jobs were blocked by unused channel 2024-11-13 08:03:10 +10:00
61c41b8ec3 Fixes for hanging jobs, more verbose ci output 2024-11-12 15:36:38 +10:00
47d7896301 Cypress tests for OAuth login 2024-11-12 10:38:56 +10:00
d048d1fc98 Back to go1.23 now that the bug is fixed 2024-11-08 19:48:20 +10:00
3774a40498 Add more unit tests 2024-11-07 13:00:07 +10:00
208037946f Oauth2 support 2024-11-07 07:24:38 +10:00
f23299f793 Downgrade to go 1.22 due to golang/go#68976 2024-11-04 22:54:23 +10:00
aa15052eea Fix multibuild 2024-11-04 14:40:37 +10:00
c556b8acef Cypress test for LDAP 2024-11-04 11:08:20 +10:00
4d60876394 Update cypress test suite 2024-11-04 07:59:06 +10:00
6e820a36ac CI stack for Authentik with ldap 2024-11-04 07:48:41 +10:00
a277a5d167 Adds LDAP auth support 2024-11-02 21:36:07 +10:00
8434a2d1fa Remove arm7 from supported archs. Update pebble to use newer image 2024-10-25 08:05:46 +10:00
bee6a83f33 CI tweaks 2024-10-01 14:14:33 +10:00
b37ef94c22 CI prints 2024-10-01 08:42:34 +10:00
3f6ac9a021 Add missing locale 2024-09-15 23:04:49 +10:00
1d5f390f9b Implements certificate delete ui 2024-09-15 23:00:49 +10:00
d2048e540d Add domain names to certificates table 2024-09-15 22:33:11 +10:00
d121de808c Fix SSE frontend auth 2024-09-15 21:51:51 +10:00
4d3d37eaed Update s6-overlay 2024-09-11 20:26:22 +10:00
0cd2e07fd3 Fix docker warnings 2024-09-11 20:24:31 +10:00
0a18a565c7 Remove cache from filters, was duplicating incorrect data 2024-09-11 20:21:15 +10:00
c4db4a2647 Fix quotes 2024-09-11 19:38:41 +10:00
e78dd069f1 Quote filter fields 2024-09-11 15:22:10 +10:00
9a2e5c92d5 Improvements to enforce middleware, linting, returning 404 properly 2024-09-11 15:03:00 +10:00
833dd23dce Support table names in filter tags 2024-09-11 15:01:28 +10:00
514520ce1a Linter hacks 2024-09-11 15:01:05 +10:00
21e3bce95d Adds tests for schema json 2024-09-11 15:00:49 +10:00
5dd81c071f Revert sqlite native update, gorm driver doesn't like it 2024-09-09 15:47:13 +10:00
269d088a60 Updates to sqlite fork 2024-09-09 09:27:07 +10:00
f73e09007a Updated deps 2024-09-09 08:42:30 +10:00
16c0276401 Fix flakey CI due to full stack network determination 2024-05-23 08:30:02 +10:00
1831fdff2d Fix CI 2024-05-21 13:52:10 +10:00
8474b1cdec Fix CI 2024-05-21 13:44:27 +10:00
6d2cf77fb2 Fix for CI cleanup 2024-05-21 13:17:09 +10:00
ac0074ea86 Cypress upgrade 2024-05-21 13:06:24 +10:00
52bd7b1d8f Bring CI in line with develop branch 2024-05-17 08:56:57 +10:00
70cfbfb1b0 Replace docs vuepress with vitepress 2024-05-17 08:46:00 +10:00
42cd1f2866 Fix rootfs location and update s6 2024-05-09 08:54:59 +10:00
ecc3b2b5b7 Fixed frontend issues, switched back to nginxproxymanager dockerhub space 2024-05-09 08:41:49 +10:00
ae9504584c Revert eslint upgrade, fix linting 2024-05-08 11:28:16 +10:00
fb880616c7 Updated frontend deps and use node:20 2024-05-08 09:41:32 +10:00
e1b757e177 Yarn audit fix 2024-05-07 21:48:01 +10:00
6a8197d156 Fix linting 2024-05-07 21:28:31 +10:00
be0ce673ff Adds compulsory test coverage, fix tests 2024-05-07 21:24:50 +10:00
6da020aab1 Add goleak in unit tests 2023-11-08 09:57:15 +10:00
689bcb0077 Disable golangci-lint for 1.21 release for now 2023-08-15 11:35:16 +10:00
fd041d9b3c Add more unit tests 2023-08-03 16:35:06 +10:00
9ac0e8c943 Add more unit tests 2023-08-02 15:32:16 +10:00
155e09407f Add more unit tests 2023-08-01 08:19:58 +10:00
db95a465c8 Add more unit tests 2023-07-31 13:49:11 +10:00
6584f87dd2 Add more unit tests 2023-07-31 11:27:10 +10:00
b076f5b3b6 Add more unit tests 2023-07-28 16:10:44 +10:00
e5ade3b4ea Add more unit tests 2023-07-28 15:01:54 +10:00
7f9a1f5a98 Add more backend unit tests 2023-07-27 21:17:08 +10:00
d94e304f31 Use go unit test results in ci 2023-07-27 16:15:30 +10:00
3379f3a665 Tweaks to html report 2023-07-27 15:44:30 +10:00
4ec1b4ed5a Missed a line in CI script 2023-07-27 14:31:40 +10:00
43d989474e Use Publish HTML in CI 2023-07-27 14:25:04 +10:00
1e0baa3911 Archive backend coverage in ci 2023-07-27 13:50:13 +10:00
d8a3726f3a Expose backend coverage in dev mode through web
Generate backend coverage in ci
2023-07-27 13:44:38 +10:00
9faa36315f More unit tests and html coverage report
also fixes a limit bug on listquery
2023-07-27 12:38:35 +10:00
e4e70ae6be Added some db unit tests 2023-07-26 13:29:12 +10:00
d555af68fe Fix acme.sh ci test 2023-07-25 12:15:58 +10:00
26f708d980 Fix acme.sh ci test 2023-07-25 12:12:27 +10:00
2ffb54a720 Fix acme.sh ci test 2023-07-25 12:07:33 +10:00
b123ca4fd0 Add backend unit tests 2023-07-25 11:59:02 +10:00
72b071dbaa Use govulncheck instead of nancy 2023-07-24 14:45:39 +10:00
fd277973cd Complete the removal of Sentry 2023-07-24 14:41:46 +10:00
aae95798b2 Refactor some reflection 2023-07-24 13:42:50 +10:00
d437c6b743 Fix test 2023-07-24 13:02:06 +10:00
f3018115ba Fix hosts index list 2023-07-24 11:50:13 +10:00
a0e17f9678 Better checking for api sort param to prevent sql injection
And moved filters out and cached object reflection
2023-07-24 11:49:08 +10:00
9b32329f41 Apply fixes from v2 2023-07-24 08:08:05 +10:00
001583b308 Fix test after removing error reporting 2023-07-20 16:39:37 +10:00
3df8e74bc8 Fix CI 2023-07-20 16:25:08 +10:00
042a74cc21 Updated go deps 2023-07-20 15:25:05 +10:00
fd7095ad88 Remove sentry and error reporting 2023-07-20 15:19:42 +10:00
6d6021c9bb Converted to Vite since create-react-app is no longer being developed 2023-07-20 15:11:41 +10:00
824a22efad Small tweaks 2023-07-19 11:52:47 +10:00
ed609f0bec Remove cypress color output 2023-06-01 11:37:45 +10:00
b437119535 Remove last use of v4 jwtauth 2023-06-01 11:37:25 +10:00
d5a75bb708 Move schema output to a running stack step 2023-05-31 22:10:57 +10:00
512f5109d4 Remove testing sleep 2023-05-31 21:58:34 +10:00
d300095ab5 Ignore nancy 2023-05-31 21:51:06 +10:00
8d8921a0dd Clean up users before each test,
as we don't know which order they run
2023-05-31 21:44:27 +10:00
ac8fa0d737 Cleanup CI file 2023-05-31 21:44:06 +10:00
b2592d9351 Testing 2023-05-31 21:34:05 +10:00
adf0030b1c Add missing json schema types 2023-05-31 16:34:20 +10:00
63845377d9 Another tweak for postgres sigh 2023-05-31 15:11:25 +10:00
4b4c7baea4 Updates 2023-05-31 13:52:58 +10:00
94b6971ef7 Test 2023-05-31 13:00:16 +10:00
b725153a5e Test 2023-05-31 12:46:46 +10:00
da82020be4 Cypress config for ci 2023-05-31 11:56:48 +10:00
e7791c2a0f Updated cypress entirely 2023-05-31 11:36:58 +10:00
0461689d65 Fix panic using wrong err object 2023-05-31 11:35:24 +10:00
aec0a606af Fix swagger bits 2023-05-31 11:35:09 +10:00
f55a7a792f Update testing packages, revert to nullable in swagger schema 2023-05-31 08:47:13 +10:00
4b0d901c93 Schema updates 2023-05-31 00:08:50 +10:00
4a57956093 More work to support nullable foreign keys
Adds nullable int/uint types
2023-05-30 22:26:44 +10:00
88f3953f92 Use null for optional foreign keys 2023-05-30 21:18:12 +10:00
0d3e152306 Add ON DELETE CASCADE for testing query 2023-05-30 18:11:48 +10:00
9234c2c007 Fix validation 2023-05-30 16:02:02 +10:00
98ff4a7dcc Fix inconsistencies between int and bool in db 2023-05-30 15:51:57 +10:00
7edcb8e3cc CI Fix 2023-05-30 14:15:33 +10:00
0387d36ebe Don't fully remove built images between tests 2023-05-30 13:58:36 +10:00
047c4bf6e6 CI Debug 2023-05-30 13:57:05 +10:00
8cefea916a CI Fix 2023-05-30 13:41:28 +10:00
3c1b4fdf34 Added migrations for mysql and postgres, added ci testing suites for them 2023-05-30 13:26:46 +10:00
e0773b1c06 Fix change password function 2023-05-29 15:26:28 +10:00
3301800f42 prevent panic when sse token is not found 2023-05-29 15:18:18 +10:00
4dd6fd06f4 Fix settings test 2023-05-29 15:01:41 +10:00
1c57a9b2a5 Prevent adding another user with the same email 2023-05-29 14:51:42 +10:00
a9d1ccde38 Fix inconsistency with settings storage 2023-05-29 14:45:00 +10:00
dde368f733 Skip auto dumping database migration
Fix user id from context
2023-05-29 14:33:58 +10:00
cbcb0cc0f8 Remove cruft 2023-05-29 14:26:45 +10:00
fd365dc8fd Remove debug 2023-05-29 14:19:40 +10:00
c849938da2 Fix schema responses not matching tests 2023-05-29 14:19:17 +10:00
4b39ef0eba Add entity filters back in for api 2023-05-29 13:53:16 +10:00
1ae247b2a6 Fix swagger doc and rename references for time db fields 2023-05-29 08:50:27 +10:00
a2f192280b Fix deleteall users sql 2023-05-29 08:29:53 +10:00
81c1a7eb16 Re-enable arm64 2023-05-27 12:43:40 +10:00
030f3c9d83 Switch to forked repos for Dbmate/Modernc-sqlite so that they use a non-cgo library for sqlite
thus hopefully enabling native compilation on arm/arm64
2023-05-27 12:43:07 +10:00
b4365f5c54 Enable Cgo again for use with embedded dbmate 2023-05-26 22:06:06 +10:00
e889714642 Avoid excess builds for now 2023-05-26 21:53:24 +10:00
e61cf52a65 Fix wrong chi version 2023-05-26 19:48:09 +10:00
e6ae25d081 Remove debug logs 2023-05-26 18:46:55 +10:00
ceb62fb0f2 Move jwt keys to database
Moved code for it to one place
Updated to chi v5
2023-05-26 14:50:41 +10:00
29990110b1 Convert db backend to use Gorm, with basis for support
for Mysql and Postgres in addition to existing Sqlite
2023-05-26 11:37:39 +10:00
b4e5b8b6db Remove cruft 2023-05-16 08:39:18 +10:00
d6e96dc3cb Fix ci build 2023-05-12 09:58:50 +10:00
ab772d645b Support for dynamic ip ranges from urls
- Adds ipranges command to fetch ip ranges from Cloudfront and Cloudflare
- Write the ipranges file on docker start
- Support disabling ipv4 as well as ipv6 now
- Prevent disabling both
2023-05-12 09:40:45 +10:00
f43e41d7d0 Fixes for npm user rename 2023-05-11 11:37:21 +10:00
fb8ca0b02f Bring up to recent v2 changes around s6 2023-05-11 10:55:30 +10:00
e7ef809b10 Remove cruft 2023-04-11 21:44:17 +10:00
798db6cb21 Fix formatting 2023-04-11 21:43:40 +10:00
7745f8242b Debug ci 2023-04-11 21:36:13 +10:00
00aaa024a6 Replace sqlite module with a non-cgo version. Removed usql from dev 2023-04-11 21:26:09 +10:00
a5166435ff Update all frontend libraries 2023-04-11 21:24:18 +10:00
e3ce8b4d12 Add missing folder 2023-04-11 09:55:19 +10:00
c0c89e5d15 Updates to user/group determination after recent changes to v2 branch 2023-04-11 09:12:48 +10:00
fe46da3355 Fix escaping in groovy 2023-03-15 16:08:04 +10:00
6ab5224353 Fix escaping in groovy 2023-03-15 16:06:42 +10:00
12909de3c1 Moved base images docker repo back to jc21, as
docker is sunsetting free teams and this open source project isn't prepared to pay 300 shmackaroos for a nicer image url
2023-03-15 15:28:28 +10:00
700518a0a2 Added fail2ban, though not sure its configured correctly yet 2023-03-09 22:11:28 +10:00
e959e54dc8 Strip colors in CI error outputs 2023-03-09 15:43:22 +10:00
471ffa8dff Fix syntax 2023-03-08 16:15:20 +10:00
35cc486fd7 Add comments to pr for failures 2023-03-08 16:12:57 +10:00
292a209195 Ported #2582 to v3 2023-03-08 08:37:43 +10:00
215083f6cf Certificates Renewal + SSE
- Certificate renewal is just a re-request as it's forced already
- Rejig the routes for readability
- Added Server Side Events so that the UI would invalidate the
cache when changes happen on the backend, such as certs being
provided or failing
- Added a SSE Token, which has the same shelf life as normal token
but can't be used interchangeably. The reason for this is, the
SSE endpoint needs a token for auth as a Query param, so it would
be stored in log files. If someone where to get a hold of that,
it's pretty useless as it can't be used to change anything, only
to listen for events until it expires
- Added test endpoint for SSE testing only availabe in debug mode
2023-03-07 16:42:26 +10:00
35550082bf Fix test 2023-03-06 08:59:36 +10:00
15e4900133 locales 2023-03-05 22:37:54 +10:00
6df4ea4d69 Cert creation fixes 2023-03-05 22:37:34 +10:00
cc9d556665 Fix wrong lang key 2023-03-05 22:37:06 +10:00
cb3f0ec9b4 Add locale picker to app header 2023-03-05 22:36:52 +10:00
0244187c29 Improved pdns dev config 2023-03-05 22:36:14 +10:00
0dd713e634 more help docs 2023-03-05 22:35:42 +10:00
972e53df71 More documentation 2023-03-01 19:06:46 +10:00
91fe448782 UI test for change password
Help docs
2023-03-01 16:34:52 +10:00
cfbd7f05d0 fix api doc 2023-02-28 21:29:13 +10:00
3ea9f805f4 fix localesg 2023-02-28 21:18:11 +10:00
fc2df47753 Add certificate model for http and dns
change is_ecc to boolean, its still stored as int in sqlite
2023-02-28 20:55:40 +10:00
7455accf58 Proper 404's for objects 2023-02-27 17:21:40 +10:00
83a9666807 Nicer cert type create select 2023-02-27 17:21:10 +10:00
6681da605e Remove extra debug 2023-02-26 01:30:49 +10:00
e433bdaeec Fix for pdns startup 2023-02-26 01:17:34 +10:00
5b4fe24957 Backend builds should use cgo 2023-02-26 00:14:35 +10:00
7166654215 CI docker logs without annoying docker-compose container name prefix 2023-02-25 23:12:11 +10:00
c8a255178e Archive acme.sh log file in CI 2023-02-25 23:08:24 +10:00
5f27b9243f Use json log format in ci 2023-02-25 22:58:38 +10:00
6b7ae48570 Fixes for start-dev and optimisations 2023-02-25 22:52:42 +10:00
bc3d9ec099 Skip build vcs lookups, go 1.20 thing 2023-02-24 21:21:14 +10:00
0eeed1695c ignore nancy warning 2023-02-24 21:16:17 +10:00
83e432793b Fix for locales error change 2023-02-24 21:12:11 +10:00
6cdfd9ebc1 Updates chakra-ui 2023-02-24 18:32:04 +10:00
ecbc55f318 Updated to latest s6-overlay 2023-02-24 18:31:46 +10:00
c288886fd4 Use eris for error management 2023-02-24 17:19:07 +10:00
80315bd50e Fix hot reloading backend with new updates to Task 2023-02-19 15:11:22 +10:00
a2b4fbc36f Basis for Certificate modal 2023-01-30 09:57:40 +10:00
df33db24bb Revert "Cypress debugging"
This reverts commit 437b06b64b.
2023-01-16 21:57:16 +10:00
437b06b64b Cypress debugging 2023-01-16 21:43:02 +10:00
f649e2946e Fix tests 2023-01-16 16:18:36 +10:00
1b61176818 Basis for create certificate dialog 2023-01-16 16:13:38 +10:00
374447ccc7 Locales cleanup 2023-01-16 15:50:40 +10:00
af9349d4a7 Conform hosts table 2023-01-16 15:33:04 +10:00
4ff911def0 Fix locales 2023-01-16 15:23:09 +10:00
e890bfcf10 Certificates table compliance and other stuff 2023-01-16 14:57:14 +10:00
9a5cbbba49 Updated go packages 2023-01-16 14:11:12 +10:00
b877bea86c Table improvements, add modals 2023-01-16 14:02:36 +10:00
306ac20457 Certificate table work, shows error message in popover 2023-01-16 11:32:45 +10:00
ba138581e1 Swagger/Lang additions 2023-01-14 09:50:32 +10:00
456c59c746 Improvements for certificates table, adds expansion object to certificates 2023-01-14 09:45:08 +10:00
6c76c041c4 Access lists basics 2023-01-13 15:03:28 +10:00
a239be993c Fix type in cypress test 2023-01-13 12:08:50 +10:00
a82df0d931 Fix cypress tests 2023-01-13 11:57:09 +10:00
e4595860f5 Fix unit test 2023-01-13 11:17:43 +10:00
18ecda7955 Ignore locales for acmesh-property. in checks 2023-01-13 11:12:02 +10:00
8ddb191a7a Adds ajv schema validation for acmesh dns provider meta data fields and formik error messages 2023-01-13 11:06:16 +10:00
cd6b772e72 Support unmodified meta objects in frontend api 2023-01-13 10:21:05 +10:00
29a4ac42d0 Added missing object type 2023-01-13 10:09:26 +10:00
5d3bc0fabd Refactor acme.sh dns providers
- updated chakra and typescript
- added locales for dns provider configs
2023-01-12 16:25:43 +10:00
1d5d3ecd7a Add user expansion to upstream model 2023-01-10 12:57:43 +10:00
8033d052fe Trim whitespace from names of objects on save 2023-01-10 12:50:46 +10:00
6d0bf1c68b fix failing test because of whitespace in randstring 2023-01-10 12:47:01 +10:00
560f3d9b29 Basis for Upstreams UI 2023-01-10 11:50:30 +10:00
7ea64c46e9 Prevent deleting certificate that is use 2023-01-09 23:31:47 +10:00
88b46ef9ef Prevent deleting upstream that is use 2023-01-09 23:29:16 +10:00
ef34f01914 Update readmes, change docker tag to v3 2023-01-09 21:36:54 +10:00
f5b3568893 Edit upstreams, added swagger docs 2023-01-09 16:19:23 +10:00
6147ee925e Tweak config content 2023-01-09 15:48:52 +10:00
5586d16afd Add endpoints to return nginx config from disk 2023-01-09 15:42:56 +10:00
ca4d92d793 better host upstream support 2023-01-09 13:18:11 +10:00
0a50672ab6 Fix for cypress randomstrings 2023-01-09 08:58:32 +10:00
f6b219772d Adds proxy host vars 2023-01-09 08:49:49 +10:00
ad848a6478 fix cypress dockerfile 2023-01-08 19:01:00 +10:00
0418264070 Reverted cypress 2023-01-07 13:48:56 +10:00
882674867c Added upstreams tests for cypress 2023-01-06 15:07:37 +10:00
e39f18b0d1 Udpate cypress 2023-01-06 15:02:40 +10:00
6efa4e2beb Nginx config files with suffixes for deleted/disabled/errors 2023-01-06 14:23:04 +10:00
17a108f75f Use upstream in host config 2023-01-06 11:42:02 +10:00
bc6825c148 Ignore vulnerability, can't fix until next golang version 2023-01-04 16:21:08 +10:00
395152c1ab Fix locales 2023-01-04 15:57:19 +10:00
5e5f0de0e2 - Added upstream objects
- Renamed host templates to nginx templates
- Generate upstream templates
- Better nginx error reporting when reloading
- Use tparse for golang test reporting
2023-01-04 15:53:52 +10:00
b3ae2f4dbb Fix dns provider name on dns providers page 2023-01-03 16:49:26 +10:00
726b6e69f7 Skip acceptable vuln 2022-11-08 10:40:15 +10:00
c00b690ed3 Updated deps, go.19 migration, nginx template work 2022-11-08 10:03:45 +10:00
8d37f5df8d Write host template on save 2022-07-21 18:02:07 +10:00
5b6dbaf43e Add nginx exec 2022-07-15 14:26:12 +10:00
b8008606fd Add locales 2022-07-15 08:58:52 +10:00
f51c12ed9a New JobQueue worker 2022-07-15 08:52:38 +10:00
3c0af95468 Fixes 2022-07-14 21:53:11 +10:00
ee4c6a3a8b broken dns provider edit modal 2022-06-14 11:02:25 +10:00
d44f75af1b Preliminary dns provider create working modal 2022-06-01 13:45:31 +04:00
b221446bb0 dns_conoha, dns_dpi, dns_euserv, dns_tele3 2022-06-01 13:23:56 +04:00
523449f050 dns_acmedns 2022-06-01 13:11:21 +04:00
322048d5af dns_loopia 2022-06-01 12:21:14 +04:00
671715042e dns_kinghost, dns_zilore 2022-06-01 12:14:16 +04:00
f37bb2e7dc dns_da 2022-06-01 12:09:35 +04:00
3267832fe5 Fix frontend build 2022-06-01 09:26:49 +04:00
e31b01b80e dns_dreamhost 2022-06-01 09:22:40 +04:00
0a18432860 Remove duplicate plugins that come with CRA 2022-06-01 09:20:34 +04:00
a2baa85b08 fix typo 2022-06-01 09:12:11 +04:00
3bfdc21256 dns_zonomi 2022-06-01 09:11:06 +04:00
49da5d7acc bump node for ci build 2022-06-01 09:10:34 +04:00
5bc2cd9be4 dns_selectel 2022-06-01 09:06:09 +04:00
07739ee84e dns_azure 2022-06-01 09:02:57 +04:00
91d23be4e3 dns_autodns 2022-06-01 08:57:20 +04:00
9dcb1e1c9c dns_namesilo 2022-06-01 08:54:21 +04:00
5729dddaf9 dns_servercow 2022-06-01 08:51:23 +04:00
d1bb22d768 dns_inwx 2022-06-01 08:49:31 +04:00
db61a9a175 Update packages, fix table page selector 2022-05-22 23:55:26 +10:00
e4a97d4813 Use node 16 2022-05-22 23:54:40 +10:00
8dd6880f8c Some dns additions 2022-05-20 22:43:52 +10:00
34dfbe2c36 Updated readme 2022-05-12 08:50:37 +10:00
2110ecc382 Moved v3 code from NginxProxyManager/nginx-proxy-manager-3 to NginxProxyManager/nginx-proxy-manager 2022-05-12 08:47:31 +10:00
1234 changed files with 55131 additions and 37373 deletions

8
.dockerignore Normal file
View File

@ -0,0 +1,8 @@
# Ignore everything
*
# Only allow the following for docker build:
!backend/
!docker/
!scripts/
!test/

View File

@ -1,21 +0,0 @@
name: 'Close stale issues and PRs'
on:
schedule:
- cron: '30 1 * * *'
workflow_dispatch:
jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v9
with:
stale-issue-label: 'stale'
stale-pr-label: 'stale'
stale-issue-message: 'Issue is now considered stale. If you want to keep it open, please comment :+1:'
stale-pr-message: 'PR is now considered stale. If you want to keep it open, please comment :+1:'
close-issue-message: 'Issue was closed due to inactivity.'
close-pr-message: 'PR was closed due to inactivity.'
days-before-stale: 182
days-before-close: 365
operations-per-run: 50

28
.gitignore vendored
View File

@ -1,9 +1,29 @@
git.idea
.env
.DS_Store
.idea
._*
.vscode
certbot-help.txt
*.code-workspace
vendor
bin/*
backend/config.json
backend/embed/assets
backend/.task
backend/coverage.out
backend/coverage.html
test/node_modules
*/node_modules
docker/dev/dnsrouter-config.json.tmp
docs/.vuepress/dist
frontend/build
frontend/yarn-error.log
frontend/.npmrc
frontend/src/locale/lang
test/cypress/fixtures/example.json
.vscode
docker-build
data
dist
backend/embed/acme.sh
docker/dev/resolv.conf
docker/dev/dnsrouter-config.json.tmp
thunder-tests
test/cypress/videos

View File

@ -1 +1 @@
2.11.3
3.0.0a

151
Jenkinsfile vendored
View File

@ -1,22 +1,33 @@
import groovy.transform.Field
@Field
def shOutput = ""
def buildxPushTags = ""
def getVersion() {
ver = sh(script: 'cat .version', returnStdout: true)
return ver.trim()
}
def getCommit() {
ver = sh(script: 'git log -n 1 --format=%h', returnStdout: true)
return ver.trim()
}
pipeline {
agent {
label 'docker-multiarch'
}
options {
buildDiscarder(logRotator(numToKeepStr: '5'))
buildDiscarder(logRotator(numToKeepStr: '10'))
disableConcurrentBuilds()
ansiColor('xterm')
}
environment {
DOCKER_ORG = 'jc21'
IMAGE = 'nginx-proxy-manager'
BUILD_VERSION = getVersion()
MAJOR_VERSION = '2'
BUILD_COMMIT = getCommit()
MAJOR_VERSION = '3'
BRANCH_LOWER = "${BRANCH_NAME.toLowerCase().replaceAll('\\\\', '-').replaceAll('/', '-').replaceAll('\\.', '-')}"
BUILDX_NAME = "npm_${BRANCH_LOWER}_${BUILD_NUMBER}"
COMPOSE_INTERACTIVE_NO_CLI = 1
@ -30,7 +41,9 @@ pipeline {
}
steps {
script {
buildxPushTags = "-t docker.io/jc21/${IMAGE}:${BUILD_VERSION} -t docker.io/jc21/${IMAGE}:${MAJOR_VERSION} -t docker.io/jc21/${IMAGE}:latest"
buildxPushTags = "-t docker.io/${DOCKER_ORG}/${IMAGE}:${BUILD_VERSION} -t docker.io/${DOCKER_ORG}/${IMAGE}:${MAJOR_VERSION} -t docker.io/${DOCKER_ORG}/${IMAGE}:latest"
echo 'Building on Master is disabled!'
sh 'exit 1'
}
}
}
@ -43,44 +56,44 @@ pipeline {
steps {
script {
// Defaults to the Branch name, which is applies to all branches AND pr's
buildxPushTags = "-t docker.io/jc21/${IMAGE}:github-${BRANCH_LOWER}"
// buildxPushTags = "-t docker.io/jc21/${IMAGE}:github-${BRANCH_LOWER}"
buildxPushTags = "-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('Builds') {
stage('Build') {
parallel {
stage('Project') {
steps {
script {
// Frontend and Backend
def shStatusCode = sh(label: 'Checking and Building', returnStatus: true, script: '''
set -e
./scripts/ci/frontend-build > ${WORKSPACE}/tmp-sh-build 2>&1
./scripts/ci/test-and-build > ${WORKSPACE}/tmp-sh-build 2>&1
''')
shOutput = readFile "${env.WORKSPACE}/tmp-sh-build"
if (shStatusCode != 0) {
error "${shOutput}"
}
}
sh './scripts/ci/build-frontend'
sh './scripts/ci/test-backend'
// Temporarily disable building backend binaries
// sh './scripts/ci/build-backend'
// Build the docker image used for testing below
sh '''docker build --pull --no-cache \\
-t "${IMAGE}:${BRANCH_LOWER}-ci-${BUILD_NUMBER}" \\
-f docker/Dockerfile \\
--build-arg BUILD_COMMIT="${BUILD_COMMIT}" \\
--build-arg BUILD_DATE="$(date '+%Y-%m-%d %T %Z')" \\
--build-arg BUILD_VERSION="${BUILD_VERSION}" \\
.
'''
}
post {
always {
sh 'rm -f ${WORKSPACE}/tmp-sh-build'
}
failure {
npmGithubPrComment("CI Error:\n\n```\n${shOutput}\n```", true)
success {
junit 'test/results/junit/*'
// archiveArtifacts allowEmptyArchive: false, artifacts: 'bin/*'
publishHTML([
allowMissing: false,
alwaysLinkToLastBuild: false,
keepAll: false,
reportDir: 'test/results/html-reports',
reportFiles: 'backend-coverage.html',
reportName: 'HTML Reports',
useWrapperFileDirectly: true
])
}
}
}
@ -97,7 +110,7 @@ pipeline {
stage('Test Sqlite') {
environment {
COMPOSE_PROJECT_NAME = "npm_${BRANCH_LOWER}_${BUILD_NUMBER}_sqlite"
COMPOSE_FILE = 'docker/docker-compose.ci.yml:docker/docker-compose.ci.sqlite.yml'
COMPOSE_FILE = 'docker/docker-compose.ci.yml'
}
when {
not {
@ -107,6 +120,8 @@ pipeline {
steps {
sh 'rm -rf ./test/results/junit/*'
sh './scripts/ci/fulltest-cypress'
// Adding this here as the schema needs to come from a running stack, but this will be used by docs later
sh 'docker-compose exec -T fullstack curl -s --output /temp-docs/api-schema.json "http://fullstack:81/api/schema"'
}
post {
always {
@ -150,6 +165,39 @@ pipeline {
}
}
}
stage('Test Postgres') {
environment {
COMPOSE_PROJECT_NAME = "npm_${BRANCH_LOWER}_${BUILD_NUMBER}_postgres"
COMPOSE_FILE = 'docker/docker-compose.ci.yml:docker/docker-compose.ci.postgres.yml'
}
when {
not {
equals expected: 'UNSTABLE', actual: currentBuild.result
}
}
steps {
sh 'rm -rf ./test/results/junit/*'
sh './scripts/ci/fulltest-cypress'
}
post {
always {
// Dumps to analyze later
sh 'mkdir -p debug/postgres'
sh 'docker logs $(docker-compose ps --all -q fullstack) > debug/postgres/docker_fullstack.log 2>&1'
sh 'docker logs $(docker-compose ps --all -q stepca) > debug/postgres/docker_stepca.log 2>&1'
sh 'docker logs $(docker-compose ps --all -q pdns) > debug/postgres/docker_pdns.log 2>&1'
sh 'docker logs $(docker-compose ps --all -q pdns-db) > debug/postgres/docker_pdns-db.log 2>&1'
sh 'docker logs $(docker-compose ps --all -q dnsrouter) > debug/postgres/docker_dnsrouter.log 2>&1'
sh 'docker logs $(docker-compose ps --all -q db-postgres) > debug/postgres/docker_db.log 2>&1'
sh 'docker logs $(docker-compose ps --all -q authentik) > debug/postgres/docker_authentik.log 2>&1'
sh 'docker logs $(docker-compose ps --all -q authentik-redis) > debug/postgres/docker_authentik-redis.log 2>&1'
sh 'docker logs $(docker-compose ps --all -q authentik-ldap) > debug/postgres/docker_authentik-ldap.log 2>&1'
junit 'test/results/junit/*'
sh 'docker-compose down --remove-orphans --volumes -t 30 || true'
}
}
}
stage('MultiArch Build') {
when {
not {
@ -160,6 +208,7 @@ pipeline {
withCredentials([usernamePassword(credentialsId: 'jc21-dockerhub', passwordVariable: 'dpass', usernameVariable: 'duser')]) {
sh 'docker login -u "${duser}" -p "${dpass}"'
sh "./scripts/buildx --push ${buildxPushTags}"
// sh './scripts/buildx -o type=local,dest=docker-build'
}
}
}
@ -168,7 +217,7 @@ pipeline {
stage('Docs Job') {
when {
allOf {
branch pattern: "^(develop|master)\$", comparator: "REGEXP"
branch pattern: "^(develop|master|v3)\$", comparator: "REGEXP"
not {
equals expected: 'UNSTABLE', actual: currentBuild.result
}
@ -198,32 +247,22 @@ pipeline {
}
post {
always {
sh 'echo Reverting ownership'
sh 'docker run --rm -v "$(pwd):/data" jc21/ci-tools chown -R "$(id -u):$(id -g)" /data'
}
success {
juxtapose event: 'success'
sh 'figlet "SUCCESS"'
sh './scripts/ci/build-cleanup'
echo 'Reverting ownership'
sh 'docker run --rm -v $(pwd):/data jc21/gotools:latest chown -R "$(id -u):$(id -g)" /data'
printResult()
}
failure {
archiveArtifacts(artifacts: 'debug/**/*.*', allowEmptyArchive: true)
juxtapose event: 'failure'
sh 'figlet "FAILURE"'
archiveArtifacts(artifacts: 'debug/**/*', allowEmptyArchive: true)
dir(path: 'test') {
archiveArtifacts allowEmptyArchive: true, artifacts: 'results/**/*', excludes: '**/*.xml'
}
}
unstable {
archiveArtifacts(artifacts: 'debug/**/*.*', allowEmptyArchive: true)
juxtapose event: 'unstable'
sh 'figlet "UNSTABLE"'
archiveArtifacts(artifacts: 'debug/**/*', allowEmptyArchive: true)
dir(path: 'test') {
archiveArtifacts allowEmptyArchive: true, artifacts: 'results/**/*', excludes: '**/*.xml'
}
}
}
}
def getVersion() {
ver = sh(script: 'cat .version', returnStdout: true)
return ver.trim()
}
def getCommit() {
ver = sh(script: 'git log -n 1 --format=%h', returnStdout: true)
return ver.trim()
}

View File

@ -1,7 +1,7 @@
<p align="center">
<img src="https://nginxproxymanager.com/github.png">
<br><br>
<img src="https://img.shields.io/badge/version-2.11.3-green.svg?style=for-the-badge">
<img src="https://img.shields.io/badge/version-2.9.19-green.svg?style=for-the-badge">
<a href="https://hub.docker.com/repository/docker/jc21/nginx-proxy-manager">
<img src="https://img.shields.io/docker/stars/jc21/nginx-proxy-manager.svg?style=for-the-badge">
</a>
@ -19,7 +19,7 @@ running at home or otherwise, including free SSL, without having to know too muc
## Project Goal
I created this project to fill a personal need to provide users with an easy way to accomplish reverse
I created this project to fill a personal need to provide users with a easy way to accomplish reverse
proxying hosts with SSL termination and it had to be so easy that a monkey could do it. This goal hasn't changed.
While there might be advanced options they are optional and the project should be as simple as possible
so that the barrier for entry here is low.
@ -29,7 +29,7 @@ so that the barrier for entry here is low.
## Features
- Beautiful and Secure Admin Interface based on [Tabler](https://tabler.github.io/)
- Beautiful and Secure Admin Interface based on [Chakra UI](https://chakra-ui.com/)
- 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
- Access Lists and basic HTTP Authentication for your hosts
@ -46,7 +46,8 @@ 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)
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
@ -56,9 +57,10 @@ I won't go in to too much detail here but here are the basics for someone new to
2. Create a docker-compose.yml file similar to this:
```yml
version: '3'
services:
app:
image: 'docker.io/jc21/nginx-proxy-manager:latest'
image: 'jc21/nginx-proxy-manager:v3'
restart: unless-stopped
ports:
- '80:80'
@ -66,11 +68,8 @@ services:
- '443:443'
volumes:
- ./data:/data
- ./letsencrypt:/etc/letsencrypt
```
This is the bare minimum configuration required. See the [documentation](https://nginxproxymanager.com/setup/) for more.
3. Bring up your stack by running
```bash
@ -78,43 +77,25 @@ docker-compose up -d
# If using docker-compose-plugin
docker compose up -d
```
4. Log in to the Admin UI
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)
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.
## Contributing
All are welcome to create pull requests for this project, against the `develop` branch. Official releases are created from the `master` branch.
CI is used in this project. All PR's must pass before being considered. After passing,
docker builds for PR's are available on dockerhub for manual verifications.
Documentation within the `develop` branch is available for preview at
[https://develop.nginxproxymanager.com](https://develop.nginxproxymanager.com)
### Contributors
## Contributors
Special thanks to [all of our contributors](https://github.com/NginxProxyManager/nginx-proxy-manager/graphs/contributors).
## Getting Support
1. [Found a bug?](https://github.com/NginxProxyManager/nginx-proxy-manager/issues)
2. [Discussions](https://github.com/NginxProxyManager/nginx-proxy-manager/discussions)
3. [Reddit](https://reddit.com/r/nginxproxymanager)
3. [Development Gitter](https://gitter.im/nginx-proxy-manager/community)
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).

8
backend/.editorconfig Normal file
View File

@ -0,0 +1,8 @@
root = true
[*]
indent_style = tab
indent_size = 4
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = false

View File

@ -1,73 +0,0 @@
{
"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
View File

@ -1,8 +0,0 @@
config/development.json
data/*
yarn-error.log
tmp
certbot.log
node_modules
core.*

166
backend/.golangci.yml Normal file
View File

@ -0,0 +1,166 @@
---
linters:
enable:
# Prevents against memory leaks in production caused by not closing
# file handle
- bodyclose
# Detects cloned code. DRY is good programming practice. Can cause issues
# with testing code where simplicity is preferred over duplication.
# Disabled for test code.
# - dupl
# Detects unchecked errors in go programs. These unchecked errors can be
# critical bugs in some cases.
- errcheck
# Simplifies go code.
- gosimple
# Controls Go package import order and makes it always deterministic.
- gci
# Reports suspicious constructs, maintained by goteam. e.g. Printf unused
# params not caught at compile time.
- govet
# Detect security issues with gocode. Use of secrets in code or obsolete
# security algorithms. It's imaged heuristic methods are used in finding
# problems. If issues with rules are found particular rules can be disabled
# as required. Could possibility cause issues with testing.
# Disabled for test code.
- gosec
# Detect repeated strings that could be replaced by a constant
- goconst
# Misc linters missing from other projects. Grouped into 3 categories
# diagnostics, style and performance
- gocritic
# Limits code cyclomatic complexity
- gocyclo
# Detects if code needs to be gofmt'd
- gofmt
# Detects unused go package imports
- goimports
# Detects style mistakes not correctness. Golint is meant to carry out the
# stylistic conventions put forth in Effective Go and CodeReviewComments.
# golint has false positives and false negatives and can be tweaked.
- revive
# Detects ineffectual assignments in code
- ineffassign
# Reports long lines
# - lll
# Detect commonly misspelled english words in comments
- misspell
# Detect naked returns on non-trivial functions, and conform with
# Go CodeReviewComments
- nakedret
# Detect slice allocations that can be preallocated
- prealloc
# Misc collection of static analysis tools
- staticcheck
# Detects unused struct fields
# - structcheck
# Parses and typechecks the code like the go compiler
- typecheck
# Detects unused constants, variables, functions and types
- unused
# Remove unnecessary type conversions
- unconvert
# Remove unnecessary(unused) function parameters
- unparam
linters-settings:
errcheck:
exclude-functions:
- fmt.Fprint
- fmt.Fprintf
gci:
sections:
- standard # Standard section: captures all standard packages.
- localmodule # Local module section: contains all local packages.
# - prefix(gogs.jc21.com) # Prefixed gerrit.lan packages (jumgo).
- default # Everything else (github.com, golang.org, etc).
- blank # Blank section: contains all blank imports.
custom-order: true
goconst:
# minimal length of string constant
# default: 3
min-len: 2
# minimum number of occurrences of string constant
# default: 3
min-occurences: 2
revive:
enable-all-rules: true
rules:
- name: unchecked-type-assertion
disabled: true
# handled by goconst
- name: add-constant
disabled: true
# cant limit this arbitrarily
- name: argument-limit
disabled: true
# handled by gocyclo
- name: cognitive-complexity
disabled: true
# false positive for Exported vs non-exported functions of the same name
- name: confusing-naming
disabled: true
# false positives for "" - which is the nil value of a string (also 0)
- name: confusing-results
disabled: true
# handled by gocyclo
- name: cyclomatic
disabled: true
# have comments on exported functions but not on vars/types/constants
- name: exported
arguments:
- "disableChecksOnConstants"
- "disableChecksOnTypes"
- "disableChecksOnVariables"
# false positives on bool params
- name: flag-parameter
disabled: true
# extreme verticalization can happen
- name: function-length
disabled: true
# can false positive for non-getters
- name: get-return
disabled: true
# only allows lowercase names
- name: import-alias-naming
disabled: true
# handled by lll
- name: line-length-limit
disabled: true
# don't want to arbitrarily limit this
# many places have specific model.go files to contain all structs
- name: max-public-structs
disabled: true
# disable package-comments
- name: package-comments
disabled: true
# this is handled by errcheck
- name: unhandled-error
disabled: true
- name: function-result-limit
disabled: true
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
# Test data can long
# - lll
run:
go: '1.23'

21
backend/.testcoverage.yml Normal file
View File

@ -0,0 +1,21 @@
---
# (mandatory)
# Path to coverprofile file (output of `go test -coverprofile` command).
profile: coverage.out
# (optional; but recommended to set)
# When specified reported file paths will not contain local prefix in the output
local-prefix: "npm"
# Holds coverage thresholds percentages, values should be in range [0-100]
threshold:
# (optional; default 0)
# The minimum coverage that each file should have
# file: 70
# (optional; default 0)
# The minimum coverage that each package should have
# package: 30
# (optional; default 0)
# The minimum total coverage project should have
total: 30

View File

@ -1,8 +0,0 @@
{
"editor.insertSpaces": false,
"editor.formatOnSave": true,
"files.trimTrailingWhitespace": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
}

6
backend/README.md Normal file
View File

@ -0,0 +1,6 @@
# Backend
## Guides and materials
- [Nginx Proxy Protocol](https://docs.nginx.com/nginx/admin-guide/load-balancer/using-proxy-protocol/)
-

70
backend/Taskfile.yml Normal file
View File

@ -0,0 +1,70 @@
version: "3"
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
force: true
- 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 -tags 'json1' -buildvcs=false -ldflags="-X main.commit={{.GIT_COMMIT}} -X main.version={{.VERSION}}" -o ../dist/bin/server ./cmd/server/main.go
silent: true
- cmd: go build -buildvcs=false -ldflags="-X main.commit={{.GIT_COMMIT}} -X main.version={{.VERSION}}" -o ../dist/bin/ipranges ./cmd/ipranges/main.go
silent: true
- cmd: rm -f /etc/nginx/conf.d/include/ipranges.conf && /app/dist/bin/ipranges > /etc/nginx/conf.d/include/ipranges.conf
- task: lint
vars:
GIT_COMMIT:
sh: git log -n 1 --format=%h
VERSION:
sh: cat ../.version
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

View File

@ -1,90 +0,0 @@
const express = require('express');
const bodyParser = require('body-parser');
const fileUpload = require('express-fileupload');
const compression = require('compression');
const config = require('./lib/config');
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 (config.debug()) {
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 (config.debug() || (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 (config.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;

View File

@ -0,0 +1,125 @@
package main
import (
"bufio"
"encoding/json"
"fmt"
"io"
"net/http"
"os"
"npm/internal/config"
"npm/internal/model"
"github.com/rotisserie/eris"
)
var commit string
var version string
var cloudfrontURL = "https://ip-ranges.amazonaws.com/ip-ranges.json"
var cloudflare4URL = "https://www.cloudflare.com/ips-v4"
var cloudflare6URL = "https://www.cloudflare.com/ips-v6"
func main() {
config.InitArgs(&version, &commit)
if err := config.InitIPRanges(&version, &commit); err != nil {
fmt.Printf("# Config ERROR: %v\n", err)
os.Exit(1)
}
exitCode := 0
// Cloudfront
fmt.Printf("# Cloudfront Ranges from: %s\n", cloudfrontURL)
if ranges, err := parseCloudfront(); err == nil {
for _, item := range ranges {
fmt.Printf("set_real_ip_from %s;\n", item)
}
} else {
fmt.Printf("# ERROR: %v\n", err)
}
// Cloudflare ipv4
if !config.Configuration.DisableIPV4 {
fmt.Printf("\n# Cloudflare Ranges from: %s\n", cloudflare4URL)
if ranges, err := parseCloudflare(cloudflare4URL); err == nil {
for _, item := range ranges {
fmt.Printf("set_real_ip_from %s;\n", item)
}
} else {
fmt.Printf("# ERROR: %v\n", err)
}
}
// Cloudflare ipv6
if !config.Configuration.DisableIPV6 {
fmt.Printf("\n# Cloudflare Ranges from: %s\n", cloudflare6URL)
if ranges, err := parseCloudflare(cloudflare6URL); err == nil {
for _, item := range ranges {
fmt.Printf("set_real_ip_from %s;\n", item)
}
} else {
fmt.Printf("# ERROR: %v\n", err)
}
}
// Done
os.Exit(exitCode)
}
func parseCloudfront() ([]string, error) {
// nolint: gosec
resp, err := http.Get(cloudfrontURL)
if err != nil {
return nil, eris.Wrapf(err, "Failed to download Cloudfront IP Ranges from %s", cloudfrontURL)
}
// nolint: errcheck, gosec
defer resp.Body.Close()
body, err := io.ReadAll(resp.Body)
if err != nil {
return nil, eris.Wrapf(err, "Failed to read Cloudfront IP Ranges body")
}
var result model.CloudfrontIPRanges
if err := json.Unmarshal(body, &result); err != nil {
return nil, eris.Wrapf(err, "Failed to unmarshal Cloudfront IP Ranges file")
}
ranges := make([]string, 0)
if !config.Configuration.DisableIPV4 {
for _, item := range result.IPV4Prefixes {
ranges = append(ranges, item.Value)
}
}
if !config.Configuration.DisableIPV6 {
for _, item := range result.IPV6Prefixes {
ranges = append(ranges, item.Value)
}
}
return ranges, nil
}
func parseCloudflare(url string) ([]string, error) {
// nolint: gosec
resp, err := http.Get(url)
if err != nil {
return nil, eris.Wrapf(err, "Failed to download Cloudflare IP Ranges from %s", url)
}
// nolint: errcheck, gosec
defer resp.Body.Close()
scanner := bufio.NewScanner(resp.Body)
scanner.Split(bufio.ScanLines)
ranges := make([]string, 0)
for scanner.Scan() {
if scanner.Text() != "" {
ranges = append(ranges, scanner.Text())
}
}
return ranges, nil
}

View File

@ -0,0 +1,87 @@
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/user"
"npm/internal/errors"
"npm/internal/jobqueue"
"npm/internal/jwt"
"npm/internal/logger"
// properly respect available cpu cores
_ "go.uber.org/automaxprocs"
)
var commit string
var version string
func main() {
config.InitArgs(&version, &commit)
config.Init(&version, &commit)
config.CreateDataFolders()
logger.Info("Build Version: %s (%s)", version, commit)
database.Migrate(func() {
if err := jwt.LoadKeys(); err != nil {
logger.Error("KeysError", err)
os.Exit(1)
}
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
sqlDB, _ := database.GetDB().DB()
err := sqlDB.Close()
if err != nil {
logger.Error("DatabaseCloseError", err)
}
// nolint
jobqueue.Shutdown()
break
}
}
})
}
// checkSetup Quick check by counting the number of users in the database
func checkSetup() {
db := database.GetDB()
var count int64
if db != nil {
db.Model(&user.Model{}).
Where("is_disabled = ?", false).
Where("is_system = ?", false).
Count(&count)
if count == 0 {
logger.Warn("No users found, starting in Setup Mode")
} else {
config.IsSetup = true
logger.Info("Application is setup")
}
} else {
logger.Error("DatabaseError", errors.ErrDatabaseUnavailable)
}
}

View File

@ -1,2 +0,0 @@
These files are use in development and are not deployed as part of the final product.

View File

@ -1,10 +0,0 @@
{
"database": {
"engine": "mysql",
"host": "db",
"name": "npm",
"user": "npm",
"password": "npm",
"port": 3306
}
}

View File

@ -1,26 +0,0 @@
{
"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"
}
}
}
}

View File

@ -1,27 +0,0 @@
const config = require('./lib/config');
if (!config.has('database')) {
throw new Error('Database config does not exist! Please read the instructions: https://nginxproxymanager.com/setup/');
}
function generateDbConfig() {
const cfg = config.get('database');
if (cfg.engine === 'knex-native') {
return cfg.knex;
}
return {
client: cfg.engine,
connection: {
host: cfg.host,
user: cfg.user,
password: cfg.password,
database: cfg.name,
port: cfg.port
},
migrations: {
tableName: 'migrations'
}
};
}
module.exports = require('knex')(generateDbConfig());

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,310 @@
{
"openapi": "3.0.0",
"info": {
"title": "Nginx Proxy Manager API",
"version": "{{VERSION}}"
},
"paths": {
"/": {
"get": {
"$ref": "file://./paths/get.json"
}
},
"/auth": {
"get": {
"$ref": "file://./paths/auth/get.json"
},
"post": {
"$ref": "file://./paths/auth/post.json"
}
},
"/auth/refresh": {
"post": {
"$ref": "file://./paths/auth/refresh/post.json"
}
},
"/auth/sse": {
"post": {
"$ref": "file://./paths/auth/sse/post.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"
}
},
"/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": {
"AuthConfigObject": {
"$ref": "file://./components/AuthConfigObject.json"
},
"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"
}
}
}
}

View File

@ -0,0 +1,13 @@
{
"type": "array",
"description": "AuthConfigObject",
"minItems": 1,
"items": {
"type": "string",
"enum": [
"local",
"ldap",
"oauth"
]
}
}

View File

@ -0,0 +1,40 @@
{
"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"
}
}
}
}

View File

@ -0,0 +1,57 @@
{
"type": "object",
"description": "CertificateAuthorityObject",
"additionalProperties": false,
"required": [
"id",
"created_at",
"updated_at",
"name",
"acmesh_server",
"ca_bundle",
"max_domains",
"is_wildcard_supported",
"is_readonly"
],
"properties": {
"id": {
"type": "integer",
"minimum": 1
},
"created_at": {
"type": "integer",
"minimum": 1,
"description": "Created Unix time with milliseconds"
},
"updated_at": {
"type": "integer",
"minimum": 1,
"description": "Updated Unix time with milliseconds"
},
"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"
}
}
}

View File

@ -0,0 +1,40 @@
{
"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"
}
}
}
}

View File

@ -0,0 +1,86 @@
{
"type": "object",
"description": "CertificateObject",
"additionalProperties": false,
"required": [
"id",
"created_at",
"updated_at",
"expires_on",
"type",
"user_id",
"certificate_authority_id",
"dns_provider_id",
"name",
"is_ecc",
"status",
"domain_names"
],
"properties": {
"id": {
"type": "integer",
"minimum": 1
},
"created_at": {
"type": "integer",
"minimum": 1,
"description": "Created Unix time with milliseconds"
},
"updated_at": {
"type": "integer",
"minimum": 1,
"description": "Updated Unix time with milliseconds"
},
"expires_on": {
"type": "integer",
"minimum": 0,
"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,
"nullable": true
},
"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": "boolean"
},
"error_message": {
"type": "string"
},
"user": {
"$ref": "#/components/schemas/UserObject"
}
}
}

View File

@ -0,0 +1,4 @@
{
"type": "object",
"description": "ConfigObject"
}

View File

@ -0,0 +1,40 @@
{
"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"
}
}
}
}

View File

@ -0,0 +1,51 @@
{
"type": "object",
"description": "DNSProviderObject",
"additionalProperties": false,
"required": [
"id",
"created_at",
"updated_at",
"user_id",
"name",
"acmesh_name",
"dns_sleep",
"meta"
],
"properties": {
"id": {
"type": "integer",
"minimum": 1
},
"created_at": {
"type": "integer",
"minimum": 1,
"description": "Created Unix time with milliseconds"
},
"updated_at": {
"type": "integer",
"minimum": 1,
"description": "Updated Unix time with milliseconds"
},
"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"
}
}
}

View File

@ -0,0 +1,15 @@
{
"type": "object",
"description": "DeletedItemResponse",
"additionalProperties": false,
"required": ["result"],
"properties": {
"result": {
"type": "boolean",
"nullable": true
},
"error": {
"$ref": "#/components/schemas/ErrorObject"
}
}
}

View File

@ -0,0 +1,17 @@
{
"type": "object",
"description": "ErrorObject",
"additionalProperties": false,
"required": ["code", "message"],
"properties": {
"code": {
"type": "integer",
"description": "Error code",
"minimum": 0
},
"message": {
"type": "string",
"description": "Error message"
}
}
}

View File

@ -0,0 +1,24 @@
{
"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"
}
}
}
}

View File

@ -0,0 +1,31 @@
{
"type": "object",
"description": "HealthObject",
"additionalProperties": false,
"required": ["version", "commit", "healthy", "setup"],
"properties": {
"version": {
"type": "string",
"description": "Version",
"minLength": 1
},
"commit": {
"type": "string",
"description": "Commit hash",
"minLength": 7
},
"healthy": {
"type": "boolean",
"description": "Healthy?"
},
"setup": {
"type": "boolean",
"description": "Is the application set up?"
},
"acme.sh": {
"type": "string",
"description": "Acme.sh version",
"minLength": 1
}
}
}

View File

@ -0,0 +1,40 @@
{
"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"
}
}
}
}

View File

@ -0,0 +1,55 @@
{
"type": "object",
"description": "HostObject",
"additionalProperties": false,
"required": [
"id",
"created_at",
"updated_at",
"user_id",
"provider",
"name",
"domain_names"
],
"properties": {
"id": {
"type": "integer",
"minimum": 1
},
"created_at": {
"type": "integer",
"minimum": 1,
"description": "Created Unix time with milliseconds"
},
"updated_at": {
"type": "integer",
"minimum": 1,
"description": "Updated Unix time with milliseconds"
},
"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"
}
}
}

View File

@ -0,0 +1,40 @@
{
"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"
}
}
}
}

View File

@ -0,0 +1,46 @@
{
"type": "object",
"description": "NginxTemplateObject",
"additionalProperties": false,
"required": [
"id",
"created_at",
"updated_at",
"user_id",
"name",
"type",
"template"
],
"properties": {
"id": {
"type": "integer",
"minimum": 1
},
"created_at": {
"type": "integer",
"minimum": 1,
"description": "Created Unix time with milliseconds"
},
"updated_at": {
"type": "integer",
"minimum": 1,
"description": "Updated Unix time with milliseconds"
},
"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
}
}
}

View File

@ -0,0 +1,40 @@
{
"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"
}
}
}
}

View File

@ -0,0 +1,51 @@
{
"type": "object",
"description": "SettingObject",
"additionalProperties": false,
"required": ["id", "created_at", "updated_at", "name", "value"],
"properties": {
"id": {
"type": "integer",
"minimum": 1
},
"created_at": {
"type": "integer",
"minimum": 1,
"description": "Created Unix time with milliseconds"
},
"updated_at": {
"type": "integer",
"minimum": 1,
"description": "Updated Unix time with milliseconds"
},
"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"
}
]
}
}
}

View File

@ -0,0 +1,17 @@
{
"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)$"
}
}
}

View File

@ -0,0 +1,40 @@
{
"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"
}
}
}
}

View File

@ -0,0 +1,57 @@
{
"type": "object",
"description": "StreamObject",
"additionalProperties": false,
"required": [
"id",
"created_at",
"updated_at",
"expires_on",
"user_id",
"provider",
"name",
"domain_names"
],
"properties": {
"id": {
"type": "integer",
"minimum": 1
},
"created_at": {
"type": "integer",
"minimum": 1,
"description": "Created Unix time with milliseconds"
},
"updated_at": {
"type": "integer",
"minimum": 1,
"description": "Updated Unix time with milliseconds"
},
"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
}
}
}
}

View File

@ -0,0 +1,17 @@
{
"type": "object",
"description": "TokenObject",
"additionalProperties": false,
"required": ["expires", "token"],
"properties": {
"expires": {
"type": "number",
"description": "Token Expiry Unix Time",
"minimum": 1
},
"token": {
"type": "string",
"description": "JWT Token"
}
}
}

View File

@ -0,0 +1,40 @@
{
"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"
}
}
}
}

View File

@ -0,0 +1,140 @@
{
"type": "object",
"description": "UpstreamObject",
"additionalProperties": false,
"required": [
"id",
"created_at",
"updated_at",
"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_at": {
"type": "integer",
"minimum": 1,
"description": "Created Unix time with milliseconds"
},
"updated_at": {
"type": "integer",
"minimum": 1,
"description": "Updated Unix time with milliseconds"
},
"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_at",
"updated_at",
"upstream_id",
"server",
"weight",
"max_conns",
"max_fails",
"fail_timeout",
"backup"
],
"properties": {
"id": {
"type": "integer",
"minimum": 1
},
"created_at": {
"type": "integer",
"minimum": 1,
"description": "Created Unix time with milliseconds"
},
"updated_at": {
"type": "integer",
"minimum": 1,
"description": "Updated Unix time with milliseconds"
},
"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"
}
}
}
}
}
}

View File

@ -0,0 +1,30 @@
{
"type": "object",
"description": "UserAuthObject",
"additionalProperties": false,
"required": ["id", "user_id", "type", "created_at", "updated_at"],
"properties": {
"id": {
"type": "integer",
"minimum": 1
},
"created_at": {
"type": "integer",
"minimum": 1,
"description": "Created Unix time with milliseconds"
},
"updated_at": {
"type": "integer",
"minimum": 1,
"description": "Updated Unix time with milliseconds"
},
"user_id": {
"type": "integer",
"minimum": 1
},
"type": {
"type": "string",
"pattern": "^(local|ldap|oauth)$"
}
}
}

View File

@ -0,0 +1,40 @@
{
"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"
}
}
}
}

View File

@ -0,0 +1,69 @@
{
"type": "object",
"description": "UserObject",
"additionalProperties": false,
"required": [
"id",
"created_at",
"updated_at",
"name",
"email",
"is_disabled"
],
"properties": {
"id": {
"type": "integer",
"minimum": 1
},
"created_at": {
"type": "integer",
"minimum": 1,
"description": "Created Unix time with milliseconds"
},
"updated_at": {
"type": "integer",
"minimum": 1,
"description": "Updated Unix time with milliseconds"
},
"name": {
"type": "string",
"minLength": 2,
"maxLength": 50
},
"email": {
"type": "string",
"minLength": 5,
"maxLength": 150
},
"gravatar_url": {
"type": "string"
},
"is_disabled": {
"type": "boolean"
},
"is_system": {
"type": "boolean"
},
"auth": {
"type": "object",
"required": ["type"],
"properties": {
"id": {
"type": "integer"
},
"type": {
"type": "string",
"pattern": "^(local|ldap|oauth)$"
}
}
},
"capabilities": {
"type": "array",
"minItems": 1,
"items": {
"type": "string",
"minLength": 1
}
}
}
}

View File

@ -0,0 +1,28 @@
{
"operationId": "getAuthConfig",
"summary": "Returns auth configuration",
"tags": ["Auth"],
"responses": {
"200": {
"description": "200 response",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": ["result"],
"properties": {
"result": {
"$ref": "#/components/schemas/AuthConfigObject"
}
}
},
"examples": {
"default": {
"value": "todo"
}
}
}
}
}
}
}

View File

@ -0,0 +1,75 @@
{
"operationId": "requestToken",
"summary": "Request a new access token from credentials",
"tags": ["Auth"],
"requestBody": {
"description": "Credentials Payload",
"required": true,
"content": {
"application/json": {
"schema": "{{schema.GetToken}}"
}
}
},
"responses": {
"200": {
"description": "200 response",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": ["result"],
"properties": {
"result": {
"$ref": "#/components/schemas/TokenObject"
}
}
},
"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": {
"type": "object",
"nullable": true
},
"error": {
"$ref": "#/components/schemas/ErrorObject"
}
}
},
"examples": {
"default": {
"value": {
"result": null,
"error": {
"code": 403,
"message": "Not available during setup phase"
}
}
}
}
}
}
}
}
}

View File

@ -0,0 +1,34 @@
{
"operationId": "refreshToken",
"summary": "Refresh your access token",
"tags": ["Auth"],
"responses": {
"200": {
"description": "200 response",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": ["result"],
"properties": {
"result": {
"$ref": "#/components/schemas/TokenObject"
}
}
},
"examples": {
"default": {
"value": {
"result": {
"expires": 1566540510,
"token": "eyJhbGciOiJSUzUxMiIsInR5cCI6IkpXVCJ9.ey...xaHKYr3Kk6MvkUjcC4",
"scope": "user"
}
}
}
}
}
}
}
}
}

View File

@ -0,0 +1,34 @@
{
"operationId": "requestSSEToken",
"summary": "Request a new SSE token",
"tags": ["Auth"],
"responses": {
"200": {
"description": "200 response",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": ["result"],
"properties": {
"result": {
"$ref": "#/components/schemas/TokenObject"
}
}
},
"examples": {
"default": {
"value": {
"result": {
"expires": 1566540510,
"token": "eyJhbGciOiJSUzUxMiIsInR5cCI6IkpXVCJ9.ey...xaHKYr3Kk6MvkUjcC4",
"scope": "user"
}
}
}
}
}
}
}
}
}

View File

@ -0,0 +1,39 @@
{
"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
}
}
}
}
}
}
}
}

View File

@ -0,0 +1,53 @@
{
"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": {
"type": "object",
"required": ["result"],
"properties": {
"result": {
"$ref": "#/components/schemas/CertificateAuthorityObject"
}
}
},
"examples": {
"default": {
"value": {
"result": {
"id": 1,
"created_at": 1627531400000,
"updated_at": 1627531400000,
"name": "ZeroSSL",
"acmesh_server": "zerossl",
"ca_bundle": "",
"max_domains": 10,
"is_wildcard_supported": true,
"is_readonly": false
}
}
}
}
}
}
}
}
}

View File

@ -0,0 +1,62 @@
{
"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": {
"type": "object",
"required": ["result"],
"properties": {
"result": {
"$ref": "#/components/schemas/CertificateAuthorityObject"
}
}
},
"examples": {
"default": {
"value": {
"result": {
"id": 1,
"created_at": 1627531400000,
"updated_at": 1627531400000,
"name": "ZeroSSL",
"acmesh_server": "zerossl",
"ca_bundle": "",
"max_domains": 10,
"is_wildcard_supported": true,
"is_readonly": false
}
}
}
}
}
}
}
}
}

View File

@ -0,0 +1,93 @@
{
"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": {
"type": "object",
"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_at": 1627531400000,
"updated_at": 1627531400000,
"name": "ZeroSSL",
"acmesh_server": "zerossl",
"ca_bundle": "",
"max_domains": 10,
"is_wildcard_supported": true,
"is_setup": true
},
{
"id": 2,
"created_at": 1627531400000,
"updated_at": 1627531400000,
"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
}
]
}
}
}
}
}
}
}
}
}

View File

@ -0,0 +1,49 @@
{
"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": {
"type": "object",
"required": ["result"],
"properties": {
"result": {
"$ref": "#/components/schemas/CertificateAuthorityObject"
}
}
},
"examples": {
"default": {
"value": {
"result": {
"id": 1,
"created_at": 1627531400000,
"updated_at": 1627531400000,
"name": "ZeroSSL",
"acmesh_server": "zerossl",
"ca_bundle": "",
"max_domains": 10,
"is_wildcard_supported": true,
"is_readonly": false
}
}
}
}
}
}
}
}
}

View File

@ -0,0 +1,60 @@
{
"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!"
}
}
}
}
}
}
}
}
}

View File

@ -0,0 +1,56 @@
{
"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": {
"type": "object",
"required": ["result"],
"properties": {
"result": {
"$ref": "#/components/schemas/CertificateObject"
}
}
},
"examples": {
"default": {
"value": {
"result": {
"id": 1,
"created_at": 1604536109000,
"updated_at": 1604536109000,
"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"
}
}
}
}
}
}
}
}
}

View File

@ -0,0 +1,65 @@
{
"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": {
"type": "object",
"required": ["result"],
"properties": {
"result": {
"$ref": "#/components/schemas/CertificateObject"
}
}
},
"examples": {
"default": {
"value": {
"result": {
"id": 1,
"created_at": 1604536109000,
"updated_at": 1604536109000,
"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"
}
}
}
}
}
}
}
}
}

View File

@ -0,0 +1,87 @@
{
"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": {
"type": "object",
"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_at": 1604536109000,
"updated_at": 1604536109000,
"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"
}
]
}
}
}
}
}
}
}
}
}

View File

@ -0,0 +1,52 @@
{
"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": {
"type": "object",
"required": ["result"],
"properties": {
"result": {
"$ref": "#/components/schemas/CertificateObject"
}
}
},
"examples": {
"default": {
"value": {
"result": {
"id": 1,
"created_at": 1604536109000,
"updated_at": 1604536109000,
"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"
}
}
}
}
}
}
}
}
}

View File

@ -0,0 +1,35 @@
{
"operationId": "config",
"summary": "Returns the API Service configuration",
"responses": {
"200": {
"description": "200 response",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": ["result"],
"properties": {
"result": {
"$ref": "#/components/schemas/ConfigObject"
}
}
},
"examples": {
"default": {
"value": {
"result": {
"data": "/data",
"log": {
"level": "debug",
"format": "nice"
}
}
}
}
}
}
}
}
}
}

View File

@ -0,0 +1,83 @@
{
"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": {
"type": "object",
"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_at": 1602593653000,
"updated_at": 1602593653000,
"user_id": 1,
"name": "Route53",
"acmesh_name": "dns_aws",
"meta": {
"AWS_ACCESS_KEY_ID": "abc123",
"AWS_SECRET_ACCESS_KEY": "def098"
}
}
]
}
}
}
}
}
}
}
}
}

View File

@ -0,0 +1,50 @@
{
"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": {
"type": "object",
"required": ["result"],
"properties": {
"result": {
"$ref": "#/components/schemas/DNSProviderObject"
}
}
},
"examples": {
"default": {
"value": {
"result": {
"id": 1,
"created_at": 1602593653000,
"updated_at": 1602593653000,
"user_id": 1,
"name": "Route53",
"acmesh_name": "dns_aws",
"meta": {
"AWS_ACCESS_KEY_ID": "abc123",
"AWS_SECRET_ACCESS_KEY": "def098"
}
}
}
}
}
}
}
}
}
}

View File

@ -0,0 +1,60 @@
{
"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!"
}
}
}
}
}
}
}
}
}

View File

@ -0,0 +1,54 @@
{
"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": {
"type": "object",
"required": ["result"],
"properties": {
"result": {
"$ref": "#/components/schemas/DNSProviderObject"
}
}
},
"examples": {
"default": {
"value": {
"result": {
"id": 1,
"created_at": 1602593653000,
"updated_at": 1602593653000,
"user_id": 1,
"name": "Route53",
"acmesh_name": "dns_aws",
"meta": {
"AWS_ACCESS_KEY_ID": "abc123",
"AWS_SECRET_ACCESS_KEY": "def098"
}
}
}
}
}
}
}
}
}
}

View File

@ -0,0 +1,65 @@
{
"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": {
"type": "object",
"required": ["result"],
"properties": {
"result": {
"$ref": "#/components/schemas/DNSProviderObject"
}
}
},
"examples": {
"default": {
"value": {
"result": {
"result": {
"id": 1,
"created_at": 1602593653000,
"updated_at": 1602593653000,
"user_id": 1,
"name": "Route53",
"acmesh_name": "dns_aws",
"meta": {
"AWS_ACCESS_KEY_ID": "abc123",
"AWS_SECRET_ACCESS_KEY": "def098"
}
}
}
}
}
}
}
}
}
}
}

View File

@ -0,0 +1,44 @@
{
"operationId": "health",
"summary": "Returns the API health status",
"responses": {
"200": {
"description": "200 response",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": ["result"],
"properties": {
"result": {
"$ref": "#/components/schemas/HealthObject"
}
}
},
"examples": {
"default": {
"value": {
"result": {
"version": "3.0.0",
"commit": "9f119b6",
"healthy": true,
"setup": true
}
}
},
"unhealthy": {
"value": {
"result": {
"version": "3.0.0",
"commit": "9f119b6",
"healthy": false,
"setup": true
}
}
}
}
}
}
}
}
}

View File

@ -0,0 +1,94 @@
{
"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": {
"type": "object",
"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_at": 1646279455000,
"updated_at": 1646279455000,
"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
}
]
}
}
}
}
}
}
}
}
}

View File

@ -0,0 +1,60 @@
{
"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!"
}
}
}
}
}
}
}
}
}

View File

@ -0,0 +1,65 @@
{
"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": {
"type": "object",
"required": ["result"],
"properties": {
"result": {
"$ref": "#/components/schemas/HostObject"
}
}
},
"examples": {
"default": {
"value": {
"result": {
"id": 1,
"created_at": 1646279455000,
"updated_at": 1646279455000,
"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
}
}
}
}
}
}
}
}
}

View File

@ -0,0 +1,43 @@
{
"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": {
"type": "object",
"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"
}
}
}
}
}
}
}
}

View File

@ -0,0 +1,74 @@
{
"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": {
"type": "object",
"required": ["result"],
"properties": {
"result": {
"$ref": "#/components/schemas/HostObject"
}
}
},
"examples": {
"default": {
"value": {
"result": {
"id": 1,
"created_at": 1646279455000,
"updated_at": 1646279455000,
"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
}
}
}
}
}
}
}
}
}

View File

@ -0,0 +1,61 @@
{
"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": {
"type": "object",
"required": ["result"],
"properties": {
"result": {
"$ref": "#/components/schemas/HostObject"
}
}
},
"examples": {
"default": {
"value": {
"result": {
"id": 1,
"created_at": 1645700556000,
"updated_at": 1645700556000,
"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
}
}
}
}
}
}
}
}
}

View File

@ -0,0 +1,80 @@
{
"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": {
"type": "object",
"required": ["result"],
"properties": {
"result": {
"$ref": "#/components/schemas/NginxTemplateList"
}
}
},
"examples": {
"default": {
"value": {
"result": {
"total": 1,
"offset": 0,
"limit": 10,
"sort": [
{
"field": "created_at",
"direction": "ASC"
}
],
"items": [
{
"id": 1,
"created_at": 1646218093000,
"updated_at": 1646218093000,
"user_id": 1,
"name": "Default Proxy Template",
"type": "proxy",
"template": "# this is a proxy template"
}
]
}
}
}
}
}
}
}
}
}

View File

@ -0,0 +1,47 @@
{
"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": {
"type": "object",
"required": ["result"],
"properties": {
"result": {
"$ref": "#/components/schemas/NginxTemplateObject"
}
}
},
"examples": {
"default": {
"value": {
"result": {
"id": 10,
"created_at": 1646218093000,
"updated_at": 1646218093000,
"user_id": 1,
"name": "My proxy template",
"type": "proxy",
"template": "# this is a proxy template"
}
}
}
}
}
}
}
}
}

View File

@ -0,0 +1,58 @@
{
"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!"
}
}
}
}
}
}
}
}
}

View File

@ -0,0 +1,51 @@
{
"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": {
"type": "object",
"required": ["result"],
"properties": {
"result": {
"$ref": "#/components/schemas/NginxTemplateObject"
}
}
},
"examples": {
"default": {
"value": {
"result": {
"id": 1,
"created_at": 1646218093000,
"updated_at": 1646218093000,
"user_id": 1,
"name": "Default Proxy Template",
"type": "proxy",
"template": "# this is a proxy template"
}
}
}
}
}
}
}
}
}

View File

@ -0,0 +1,60 @@
{
"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": {
"type": "object",
"required": ["result"],
"properties": {
"result": {
"$ref": "#/components/schemas/NginxTemplateObject"
}
}
},
"examples": {
"default": {
"value": {
"result": {
"id": 1,
"created_at": 1646218093000,
"updated_at": 1646218093000,
"user_id": 1,
"name": "My renamed proxy template",
"type": "proxy",
"template": "# this is a proxy template"
}
}
}
}
}
}
}
}
}

View File

@ -0,0 +1,9 @@
{
"operationId": "schema",
"summary": "Returns this swagger API schema",
"responses": {
"200": {
"description": "200 response"
}
}
}

View File

@ -0,0 +1,81 @@
{
"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": {
"type": "object",
"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_at": 1578010090000,
"updated_at": 1578010095000,
"name": "default-site",
"value": {
"html": "<p>not found</p>",
"type": "custom"
}
}
]
}
}
}
}
}
}
}
}
}

View File

@ -0,0 +1,52 @@
{
"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": {
"type": "object",
"required": ["result"],
"properties": {
"result": {
"$ref": "#/components/schemas/SettingObject"
}
}
},
"examples": {
"default": {
"value": {
"result": {
"id": 2,
"created_at": 1578010090000,
"updated_at": 1578010095000,
"name": "default-site",
"value": {
"html": "<p>not found</p>",
"type": "custom"
}
}
}
}
}
}
}
}
}
}

View File

@ -0,0 +1,61 @@
{
"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": {
"type": "object",
"required": ["result"],
"properties": {
"result": {
"$ref": "#/components/schemas/SettingObject"
}
}
},
"examples": {
"default": {
"value": {
"result": {
"id": 2,
"created_at": 1578010090000,
"updated_at": 1578010090000,
"name": "default-site",
"value": {
"html": "<p>not found</p>",
"type": "custom"
}
}
}
}
}
}
}
}
}
}

View File

@ -0,0 +1,48 @@
{
"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": {
"type": "object",
"required": ["result"],
"properties": {
"result": {
"$ref": "#/components/schemas/SettingObject"
}
}
},
"examples": {
"default": {
"value": {
"result": {
"id": 2,
"created_at": 1578010090000,
"updated_at": 1578010090000,
"name": "default-site",
"value": {
"html": "<p>not found</p>",
"type": "custom"
}
}
}
}
}
}
}
}
}
}

View File

@ -0,0 +1,70 @@
{
"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": {
"type": "object",
"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"]
}
}
}
}
}
}
}
}
}

View File

@ -0,0 +1,39 @@
{
"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": {
"type": "object",
"required": ["result"],
"properties": {
"result": {
"$ref": "#/components/schemas/StreamObject"
}
}
},
"examples": {
"default": {
"value": {
"result": "TODO"
}
}
}
}
}
}
}
}

View File

@ -0,0 +1,60 @@
{
"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!"
}
}
}
}
}
}
}
}
}

View File

@ -0,0 +1,43 @@
{
"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": {
"type": "object",
"required": ["result"],
"properties": {
"result": {
"$ref": "#/components/schemas/StreamObject"
}
}
},
"examples": {
"default": {
"value": {
"result": "TODO"
}
}
}
}
}
}
}
}

View File

@ -0,0 +1,52 @@
{
"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": {
"type": "object",
"required": ["result"],
"properties": {
"result": {
"$ref": "#/components/schemas/StreamObject"
}
}
},
"examples": {
"default": {
"value": {
"result": "TODO"
}
}
}
}
}
}
}
}

View File

@ -0,0 +1,286 @@
{
"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": {
"type": "object",
"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_at": 1672804124000,
"updated_at": 1672804124000,
"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_at": 1672804124000,
"updated_at": 1672804124000,
"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_at": 1672804124000,
"updated_at": 1672804124000,
"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_at": 1672804197000,
"updated_at": 1672804197000,
"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_at": 1672804197000,
"updated_at": 1672804197000,
"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_at": 1672804197000,
"updated_at": 1672804197000,
"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_at": 1672804200000,
"updated_at": 1672804200000,
"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_at": 1672804200000,
"updated_at": 1672804200000,
"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_at": 1672804200000,
"updated_at": 1672804200000,
"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_at": 1672804201000,
"updated_at": 1672804201000,
"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_at": 1672804201000,
"updated_at": 1672804201000,
"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_at": 1672804201000,
"updated_at": 1672804201000,
"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_at": 1672804201000,
"updated_at": 1672804201000,
"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_at": 1672804201000,
"updated_at": 1672804201000,
"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_at": 1672804201000,
"updated_at": 1672804201000,
"upstream_group_id": 5,
"server": "192.168.0.11:80",
"weight": 50,
"max_conns": 0,
"max_fails": 0,
"fail_timeout": 0,
"backup": false
}
]
}
]
}
}
}
}
}
}
}
}
}

View File

@ -0,0 +1,81 @@
{
"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": {
"type": "object",
"required": ["result"],
"properties": {
"result": {
"$ref": "#/components/schemas/UpstreamObject"
}
}
},
"examples": {
"default": {
"value": {
"result": {
"id": 6,
"created_at": 1672806857000,
"updated_at": 1672806857000,
"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_at": 1672806857000,
"updated_at": 1672806857000,
"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_at": 1672806857000,
"updated_at": 1672806857000,
"upstream_id": 6,
"server": "192.168.0.11:80",
"weight": 50,
"max_conns": 0,
"max_fails": 0,
"fail_timeout": 0,
"backup": false
}
]
}
}
}
}
}
}
}
}
}

View File

@ -0,0 +1,58 @@
{
"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!"
}
}
}
}
}
}
}
}
}

View File

@ -0,0 +1,82 @@
{
"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": {
"type": "object",
"required": ["result"],
"properties": {
"result": {
"$ref": "#/components/schemas/UpstreamObject"
}
}
},
"examples": {
"default": {
"value": {
"result": {
"id": 1,
"created_at": 1672786008000,
"updated_at": 1672786008000,
"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_at": 1672786009000,
"updated_at": 1672786009000,
"upstream_id": 1,
"server": "api1.localhost:1234",
"weight": 100,
"max_conns": 0,
"max_fails": 0,
"fail_timeout": 0,
"backup": false
},
{
"id": 2,
"created_at": 1672786009000,
"updated_at": 1672786009000,
"upstream_id": 1,
"server": "api2.localhost:1234",
"weight": 50,
"max_conns": 0,
"max_fails": 0,
"fail_timeout": 0,
"backup": true
}
]
}
}
}
}
}
}
}
}
}

View File

@ -0,0 +1,43 @@
{
"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": {
"type": "object",
"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"
}
}
}
}
}
}
}
}

View File

@ -0,0 +1,94 @@
{
"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": {
"type": "object",
"required": ["result"],
"properties": {
"result": {
"$ref": "#/components/schemas/UpstreamObject"
}
}
},
"examples": {
"default": {
"value": {
"result": {
"id": 1,
"created_at": 1673234177000,
"updated_at": 1673244559000,
"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_at": 1673234177000,
"updated_at": 1673244559000,
"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_at": 1673234177000,
"updated_at": 1673244559000,
"upstream_id": 1,
"server": "192.168.0.11:80",
"weight": 50,
"max_conns": 0,
"max_fails": 0,
"fail_timeout": 0,
"backup": false
}
]
}
}
}
}
}
}
}
}
}

View File

@ -0,0 +1,111 @@
{
"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,email.asc"
}
],
"responses": {
"200": {
"description": "200 response",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": ["result"],
"properties": {
"result": {
"$ref": "#/components/schemas/UserList"
}
}
},
"examples": {
"default": {
"value": {
"result": {
"total": 3,
"offset": 0,
"limit": 100,
"sort": [
{
"field": "name",
"direction": "ASC"
},
{
"field": "email",
"direction": "ASC"
}
],
"items": [
{
"id": 1,
"name": "Jamie Curnow",
"email": "jc@jc21.com",
"created_at": 1578010090000,
"updated_at": 1578010095000,
"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",
"email": "johdoe@example.com",
"created_at": 1578010100000,
"updated_at": 1578010105000,
"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",
"email": "janedoe@example.com",
"created_at": 1578010110000,
"updated_at": 1578010115000,
"gravatar_url": "https://www.gravatar.com/avatar/6193176330f8d38747f038c170ddb193?d=mm&r=pg&s=128",
"is_disabled": false,
"capabilities": [
"hosts.view",
"hosts.manage"
]
}
]
}
}
}
}
}
}
}
}
}

View File

@ -0,0 +1,81 @@
{
"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": {
"type": "object",
"required": ["result"],
"properties": {
"result": {
"$ref": "#/components/schemas/UserObject"
}
}
},
"examples": {
"default": {
"value": {
"result": {
"id": 1,
"name": "Jamie Curnow",
"email": "jc@jc21.com",
"created_at": 1578010100000,
"updated_at": 1578010100000,
"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": {
"type": "object",
"required": ["error"],
"properties": {
"result": {
"type": "object",
"nullable": true
},
"error": {
"$ref": "#/components/schemas/ErrorObject"
}
}
},
"examples": {
"default": {
"value": {
"error": {
"code": 400,
"message": "An user already exists with this email address"
}
}
}
}
}
}
}
}
}

Some files were not shown because too many files have changed in this diff Show More