660 Commits

Author SHA1 Message Date
valadaptive
9c850b0b0c Fix double file extension on uploaded images 2023-12-06 17:29:10 -05:00
valadaptive
66da13b1bb Use withFileTypes instead of stat'ing each file 2023-12-06 17:22:37 -05:00
valadaptive
5096e70c11 Move client-relative path logic to helper function 2023-12-06 17:22:37 -05:00
valadaptive
39d771cc4a Replace path "\" with "/" server-side 2023-12-06 17:22:37 -05:00
valadaptive
795ca2247b Return filename validation messages 2023-12-06 17:22:37 -05:00
valadaptive
41d427f4a8 Move sanitize call inside validation function
Also rename it (again) to validateAssetFileName.
2023-12-06 16:46:52 -05:00
Cohee
100dae5fd0
Merge pull request #1444 from valadaptive/characters-endpoint
Move character endpoints into their own module
2023-12-06 23:45:14 +02:00
Cohee
d0a35deeec Fix OpenAI presets extension 2023-12-06 21:46:08 +02:00
Cohee
60909cef1f Fix server crash on import. Fix possible undefined warning 2023-12-06 01:02:48 +02:00
valadaptive
4faa20bb1f Remove "upload" endpoint from assets API
I accidentally reintroduced this when splitting up the commits, I think
2023-12-05 15:02:30 -05:00
valadaptive
c00df4f45b Clean up file name sanitization
- Checking for null bytes is unnecessary because the check for illegal
characters directly below it will catch them.
- We can use the path.extname method to get the file extension more
cleanly. It returns the *last* extension (e.g.
path.extname('file.foo.js') === '.js'), so behavior is preserved.
- Normalizing the path is unnecessary. We don't allow any path
separators in the file name, so it does nothing.
- Stripping '..', path separators, and '$' is unnecessary because of the
earlier illegal character check.
2023-12-05 09:25:45 -05:00
valadaptive
a457484c2d Move character endpoints into their own module 2023-12-04 17:35:06 -05:00
Cohee
1ade0fda11 Merge branch 'staging' into stable-diffusion-router 2023-12-05 00:25:24 +02:00
Cohee
b287d5f3bd Merge branch 'staging' into tokenizers-router 2023-12-05 00:19:44 +02:00
Cohee
21e19674b4 Merge branch 'staging' into vectors-router 2023-12-05 00:15:36 +02:00
Cohee
444f67e930 Merge branch 'staging' into translate-router 2023-12-05 00:11:06 +02:00
Cohee
eb273ced59 Merge branch 'staging' into thumbnails-router 2023-12-05 00:08:15 +02:00
Cohee
9d0a0bc139 Merge branch 'staging' into sprites-router 2023-12-05 00:01:03 +02:00
Cohee
2acb7d1ae5 Merge branch 'staging' into serpapi-router 2023-12-04 23:57:23 +02:00
Cohee
1eb6f33e8b Merge branch 'staging' into secrets-router 2023-12-04 23:54:54 +02:00
Cohee
6fc0e485cd Merge branch 'staging' into presets-router 2023-12-04 23:51:08 +02:00
Cohee
32c3c34e4b Merge branch 'staging' into openai-router 2023-12-04 23:45:50 +02:00
Cohee
dca470c9e9 Merge branch 'staging' into novelai-router 2023-12-04 22:14:46 +02:00
Cohee
6fd6d4fc4d Merge branch 'staging' into horde-router 2023-12-04 22:07:39 +02:00
Cohee
aff821aa07 Fix discovery endpoint route 2023-12-04 21:54:03 +02:00
Cohee
3085dbe12c Merge branch 'staging' into extensions-router 2023-12-04 21:51:00 +02:00
Cohee
d22d0c7cc2 Merge branch 'staging' into content-manager-router 2023-12-04 21:46:25 +02:00
Cohee
a2387130f3 Merge branch 'staging' into classify-router 2023-12-04 21:39:39 +02:00
Cohee
1d4ac50fd7 Merge branch 'staging' into caption-router 2023-12-04 21:31:01 +02:00
valadaptive
68049afd84 Use Express router for vectors endpoint 2023-12-04 13:01:52 -05:00
valadaptive
15ba2441ce Use Express router for translate endpoint 2023-12-04 13:00:59 -05:00
valadaptive
4e073250a2 Use Express router for tokenizers endpoint 2023-12-04 13:00:13 -05:00
valadaptive
2d54a67a1f Use Express router for thumbnails endpoint 2023-12-04 12:59:24 -05:00
valadaptive
7f129df7b8 Use Express router for stable diffusion endpoint 2023-12-04 12:58:02 -05:00
valadaptive
173bc5975f Use Express router for sprites endpoint 2023-12-04 12:57:13 -05:00
valadaptive
35ce955b00 Use Express router for serpapi endpoint 2023-12-04 12:56:22 -05:00
valadaptive
091255d451 Use Express router for secrets endpoint 2023-12-04 12:55:13 -05:00
valadaptive
ba74288e4a Use Express router for presets endpoint 2023-12-04 12:54:18 -05:00
valadaptive
2d19645c4e Use Express router for openai endpoint 2023-12-04 12:53:17 -05:00
valadaptive
e6b549bc48 Use Express router for novelai endpoint 2023-12-04 12:52:27 -05:00
valadaptive
2e990bf336 Use Express router for horde endpoint 2023-12-04 12:51:02 -05:00
valadaptive
babe9abbe9 Use Express router for extensions endpoint 2023-12-04 12:48:29 -05:00
valadaptive
4c911d3155 Use Express router for content endpoint 2023-12-04 12:47:38 -05:00
valadaptive
0ad753f317 Use Express router for classify endpoint 2023-12-04 12:45:17 -05:00
valadaptive
d2e1577acb Use Express router for caption endpoint 2023-12-04 12:43:37 -05:00
valadaptive
d24c1dde10 Use Express router for assets + "files" endpoints
I've split out the "file/upload" endpoint into its own module, and
renamed it to "files" to be consistent with the existing naming scheme.
2023-12-04 12:40:53 -05:00
Cohee
893ca25199 lint: format 2023-12-04 19:12:41 +02:00
Cohee
95ef108e84 Merge branch 'staging' into express-common 2023-12-04 19:09:20 +02:00
Cohee
fcbfdc70af Merge branch 'staging' into sd-next-upscalers 2023-12-04 19:07:34 +02:00
Cohee
8476ec7570 Merge branch 'staging' into tokenizer-renames 2023-12-04 19:01:38 +02:00