Compare commits

..

322 Commits

Author SHA1 Message Date
diced 725ce50608 feat(V3.6.2): version 2022-12-01 09:47:09 -08:00
diced 78e884e97e feat: default expiration/ttl (#237) 2022-12-01 09:42:16 -08:00
diced cb123cb575 fix: formatting 2022-12-01 09:31:29 -08:00
diced 6f3081cb8e feat: headless mode 2022-12-01 09:27:14 -08:00
dicedtomato 231f734fd5 Update README.md 2022-11-28 20:47:24 -08:00
TacticalCoderJay fce7325a24 fix: add onDelete to all relations (#236) 2022-11-28 20:39:20 -08:00
diced 2bec45411f feat: overhaul upload frontend 2022-11-28 19:58:21 -08:00
diced 577195b578 fix: serve favicon.ico always 2022-11-27 20:06:22 -08:00
diced a402227c4f fix: custom placeholder 2022-11-27 19:55:14 -08:00
TacticalCoderJay a75b790654 fix: allow root route & remove swift refs (#235) (#214)
* fix:
 - readd root route for uploads only
 - catch 1 edge case for root route (/dashboard)

* fix: spelt dashboard right

* fix: include the dot for the extension

* fix: remove any possible references of swift

* fix: missed a spot

* Update .env.local.example

Co-authored-by: Jonathan <axis@axis.moe>

* Update .env.local.example

* Update validateConfig.ts

* format

Co-authored-by: dicedtomato <35403473+diced@users.noreply.github.com>
Co-authored-by: Jonathan <axis@axis.moe>
2022-11-27 18:20:29 -08:00
TacticalCoderJay f07cbeac52 fix: small bug & no file ext (#234)
* fix: allow empty file extensions

* fix: Add a button to show non-media files

* fix: Looks better

* Update FilePagation.tsx

Co-authored-by: dicedtomato <35403473+diced@users.noreply.github.com>
2022-11-26 16:15:09 -08:00
diced dcfcce7803 update readme with stuff 2022-11-26 14:33:42 -08:00
diced 659868181d feat: supabase datasource & remove swift 2022-11-25 14:30:18 -08:00
diced d76e6444e0 fix: dumb cors headers 2022-11-24 14:34:24 -08:00
diced 0dbbf4840c fix: CORS not working because of auth headers 2022-11-24 14:17:46 -08:00
diced 1b6af9fc08 fix: OPTIONS being blocked 2022-11-24 10:35:06 -08:00
karlmanait 8e1541ea56 feat: add configuration for default upload format (#232)
* feat: add configuration for default upload format

* fix: change default back to original
2022-11-22 20:36:49 -08:00
diced fd9908833a fix: link on files 2022-11-20 00:01:31 -08:00
diced 24f8300b2c fix: delete invites that expired or are used 2022-11-19 17:16:46 -08:00
diced 8d510f5d90 fix: typo 2022-11-19 17:05:15 -08:00
diced 6457680065 feat: exif metadata & remove gps 2022-11-19 13:58:14 -08:00
diced 3175911105 feat: totp 2022-11-17 22:13:23 -08:00
dicedtomato 00f26bdc75 fix: delete suggestion issues, use discussions 2022-11-17 16:04:08 -08:00
Winter 9db95bb772 fix: README spelling errors (#224) 2022-11-17 15:30:49 -08:00
diced e1ba96784c feat(v3.6.1): version 2022-11-16 21:35:32 -08:00
diced f67d1d41cb feat: bunch of stuff 2022-11-13 19:34:38 -08:00
diced bb7367615d fix: remove extra administrator in set-user 2022-11-10 20:13:40 -08:00
diced f8be8fb583 feat: new icons 2022-11-10 19:52:08 -08:00
diced e00393936f fix: invites 3d (#218) 2022-11-10 19:37:23 -08:00
diced 3c782de64d fix: update views after serving (#213) 2022-11-10 19:37:23 -08:00
diced 678dc9ef6b fix: remove build:server on scripts 2022-11-10 19:37:23 -08:00
diced 67bb9cd4a5 feat: list-users & set-user script 2022-11-10 19:37:23 -08:00
diced 51cfb9062a fix: notifs disappear on large files (#219) 2022-11-10 19:37:23 -08:00
TacticalCoderJay 1ecf979721 fix: housekeeping (#215)
* chore: remove console.log

* chore: update error message to env file
2022-11-06 10:29:42 -08:00
diced 642b0fdc95 fix: await uploader middleware 2022-11-06 09:24:14 -08:00
Max bc64d6886a fix: grammar (#212)
* Grammar fix

* Grammar fix, again

* Last commit

Co-authored-by: dicedtomato <35403473+diced@users.noreply.github.com>
2022-11-03 20:45:48 -07:00
diced 81399c59f7 fix: oauth 2022-11-03 20:42:43 -07:00
diced 69d10ef429 refactor: api 2022-11-03 20:40:47 -07:00
diced 3c616f4f6f fix: views increasing on /r 2022-11-02 09:22:01 -07:00
dicedtomato 988b61e459 fix: config.yml contact_links 2022-11-01 20:52:35 -07:00
TacticalCoderJay 3d4e0b8fc0 Include the discord server for a place to get help :D (#210)
* Create config.yml

* feat: Contact link w/ Discord!

* Update config.yml

Co-authored-by: dicedtomato <35403473+diced@users.noreply.github.com>
2022-11-01 20:50:19 -07:00
diced 564fcfca61 fix: crash when clicking on images 2022-11-01 18:25:51 -07:00
diced 709e1da768 fix: invites when user_registration false 2022-11-01 18:19:07 -07:00
diced a1f281d8b4 feat(v3.6.0): version 2022-10-31 20:02:55 -07:00
diced d2f3999cf1 fix: expires/expired text change 2022-10-31 16:43:12 -07:00
TacticalCoderJay 87fc9f2fb9 feat: v3.6.0-rc4 (#207)
* feat: oauth reform for potential improvements

* fix: update avatars with new pfp

* fix: remove redundant include

* feat: v3.6.0-rc4

Co-authored-by: dicedtomato <diced@users.noreply.github.com>

* fix: remove console log

Co-authored-by: dicedtomato <diced@users.noreply.github.com>
2022-10-30 21:42:39 -07:00
diced 8c9064fd93 fix: rework image serving 2022-10-29 22:43:42 -07:00
diced 561849ae5b feat: ability to link existing accounts to oauth 2022-10-29 20:02:54 -07:00
diced 0847802ce4 fix: remove console.log 2022-10-29 14:59:26 -07:00
diced d5a8b3f1fb chore: update workflows node@18 2022-10-29 10:53:21 -07:00
diced e6cebd8c46 fix: update node@18, fix views aggregation, force update stats 2022-10-29 10:52:35 -07:00
TacticalCoderJay f2be036bac feat: issue template (#202)
* feat: new issue templates

* fix: unique ids

* fix: typo

* fix: tabbing

* Update bug.yml

* Update suggest.yml

Co-authored-by: dicedtomato <35403473+diced@users.noreply.github.com>
2022-10-29 09:56:39 -07:00
diced f14448d40d fix: add id to version 2022-10-28 21:14:34 -07:00
diced bf719808f2 fix: merge changes to release 2022-10-28 21:09:41 -07:00
diced 9dd82c91d7 fix: actions outputs maybe 2022-10-28 21:08:40 -07:00
diced 535f84064a fix: actions outputs 2022-10-28 21:05:44 -07:00
diced 0c0a55d766 fix: update actions/cache 2022-10-28 21:01:49 -07:00
diced 6e3ee29eb4 fix: upgrade checkout action 2022-10-28 21:01:02 -07:00
diced 6a7a5dc7a3 fix: migrate from save-state to env 2022-10-28 20:57:01 -07:00
diced e78d2d79d0 feat: upgrade docker actions 2022-10-28 20:53:13 -07:00
diced 451027eaf3 feat: add cache to releawes 2022-10-28 20:44:43 -07:00
diced e4491610fb feat: add trunk-(version) to tag & test cache 2022-10-28 20:41:39 -07:00
diced f30e10f235 feat: try adding docker caching 2022-10-28 19:37:09 -07:00
diced f9249b1380 feat: even more for URLs 2022-10-28 17:41:46 -07:00
diced 3df94526b0 feat: add more info to cards & relative time 2022-10-28 17:28:15 -07:00
diced b30b7b1bd3 fix: #204 2022-10-28 16:47:16 -07:00
dicedtomato a9defd67d6 feat: add screenshots to readme 2022-10-27 21:53:12 -07:00
diced 68d346e69d fix: stuff 2022-10-27 21:26:54 -07:00
diced e2fd27cbba feat(3.6.0-rc3): version & bump deps 2022-10-27 21:09:14 -07:00
diced 4c0532006c fix: resolve multiple el in titles 2022-10-27 21:07:44 -07:00
diced 7ac574b230 fix: support .env file 2022-10-27 19:38:54 -07:00
diced 7eb855de8f feat: new file serving method & max views for files 2022-10-27 19:34:20 -07:00
diced d5984f4141 chore: make things work on next 13 2022-10-26 18:20:56 -07:00
diced b7c0c85639 chore: bump nextjs 2022-10-25 17:52:04 -07:00
diced 84ba166aea feat: file chunking for large uploads 2022-10-24 18:31:49 -07:00
diced bd79858681 feat(3.6.0-rc2): version 2022-10-24 11:39:42 -07:00
diced 0f10fa3991 fix: uniform margins 2022-10-24 11:38:38 -07:00
diced 74b1799d21 feat: user registration without oauth 2022-10-24 11:28:06 -07:00
diced 4552643ff8 feat: more options for text uploads & password protect them 2022-10-24 11:10:32 -07:00
diced d432b388f6 feat: preview text uploads 2022-10-24 10:57:13 -07:00
diced a8475602c7 feat: add port config opt for s3 2022-10-23 12:33:04 -07:00
diced f58d33af9e fix: recurse for entryPoints 2022-10-23 12:16:59 -07:00
diced 0150ea5e70 fix: spacing between main dashboard elements 2022-10-23 11:57:24 -07:00
diced 3bf43f1606 fix: maybe fix exports 2022-10-23 10:36:38 -07:00
diced b8729a6ec7 fix: save imported files to datasource 2022-10-23 10:14:29 -07:00
diced 1f44aa7e85 fix: await on prisma.image.createMany 2022-10-23 10:09:48 -07:00
diced 2bd5352fc5 feat: import-dir script 2022-10-23 10:08:21 -07:00
diced a90130e8bf feat(v3.6.0-rc1): small fixes 2022-10-22 23:42:52 -07:00
diced 642e8796f0 feat: oauth info in user dropdown 2022-10-22 16:10:31 -07:00
diced 615cbddc89 feat: ability to edit/delete users with master administrator 2022-10-22 14:50:53 -07:00
diced 4ef82bdff4 fix: prettier 2022-10-22 14:30:50 -07:00
diced dafde04c2c fix: config validation for discord is null 2022-10-22 14:26:34 -07:00
diced 1be61b8d89 chore: update deps & tsx -> esbuild 2022-10-22 14:23:23 -07:00
diced c3215c7425 fix: add oauth to readme 2022-10-19 19:49:25 -07:00
Jonathan af0cd26ea0 feat: prettier run (#200)
* feat: prettier run

* fix: whatever that was

* chore: format more files

* chore: make format command better
2022-10-19 19:43:01 -07:00
Jonathan cb7dacd089 perf: config validation improvements (#192)
* perf: improve config validation

* chore: remove extra space in package.json

* fix: actually update file

* fix: `datasource.local` not providing a default value

* fix: small oversight in readConfig & better error

Co-authored-by: diced <pranaco2@gmail.com>
2022-10-18 22:15:15 -07:00
TacticalCoderJay 8c04971094 fix: create -> save (edit user) (#199) 2022-10-18 20:19:40 -07:00
diced 3a4802f09a fix: checks for export & refresh button 2022-10-17 17:20:54 -07:00
TacticalCoderJay d78db306c5 fix: use os.tmpdir instead of hardcoded /tmp (#198) 2022-10-17 17:05:38 -07:00
TacticalCoderJay 3f8790ece1 fix: only display exports that are your own (#197) 2022-10-17 16:48:01 -07:00
TacticalCoderJay f9e6158144 hotfix: change text to adjusted limit (#196) 2022-10-17 07:59:33 -07:00
TacticalCoderJay 05de3fed15 feat: ability to create many invites (#194) (#183)
* feat: Create many invites added.

* Update src/pages/api/auth/invite.ts

Co-authored-by: Jonathan <axis@axis.moe>

* fix: Lowered limit.

Co-authored-by: Jonathan <axis@axis.moe>
2022-10-16 20:18:21 -07:00
TacticalCoderJay 38cba9cb39 fix: Follow proper linebreak style. (#191) 2022-10-16 20:10:52 -07:00
diced a4af980e11 fix: password strength not showing up on invites (#186) 2022-10-16 14:32:27 -07:00
diced 940b844857 feat: admins can't edit/delete other admins 2022-10-16 14:12:44 -07:00
diced 41b766216e feat: naming & views on files #187 #181 2022-10-16 14:06:32 -07:00
Jonathan 402987baba fix(dashboard): error when fetching stats (#193)
Handles an edge case where stats.data is a 1 length array since there's no before data
2022-10-16 13:44:46 -07:00
Winter 3cb08c73d3 feat: add S3 SSL as an env variable (#188)
Co-authored-by: dicedtomato <35403473+diced@users.noreply.github.com>
2022-10-15 12:33:37 -07:00
Derock 4cb92a7257 fix: NaN on stat card (#179)
* fix: NaN % change

* ref: format

Co-authored-by: Jonathan <axis@axis.moe>

Co-authored-by: Jonathan <axis@axis.moe>
Co-authored-by: dicedtomato <35403473+diced@users.noreply.github.com>
2022-10-15 12:22:57 -07:00
diced a095768eae ref: change look of oauth 2022-10-13 21:47:56 -07:00
diced 1a5925d7e8 fix: add minWidth to user dropdown 2022-10-08 21:28:36 -07:00
diced 9147847710 fix: make line graph tooltips work everywhere 2022-10-08 21:24:05 -07:00
diced 05fe8bcaca fix: remove debug logs 2022-10-08 21:07:55 -07:00
diced b0c3c6f45a feat: oauth sign up 2022-10-08 17:58:56 -07:00
diced 0f641aa852 fix: make last icon flat 2022-10-02 16:01:33 -07:00
diced 2651bbe50c fix: change readme 2022-10-02 16:01:05 -07:00
diced d31371eb6c feat: configurable invites & disable_media_preview config 2022-10-02 15:39:59 -07:00
diced ec0e7e5ec7 feat: edit users (admin-only) 2022-10-01 14:04:18 -07:00
diced feb75a8a42 fix(config): add env for UPLOADER_DATE_FORMAT 2022-10-01 13:34:41 -07:00
diced d4369d2503 refactor: redux -> recoil 2022-10-01 11:09:07 -07:00
diced d236589644 fix: tidy up stuff 2022-10-01 11:09:07 -07:00
diced 8044b7f623 refactor: move clientUtils into utils/ 2022-10-01 11:09:07 -07:00
dicedtomato 9f0697dd34 feat: add contributing.md 2022-09-30 16:16:08 -07:00
diced 78a6f3122d fix: escape . in regexes 2022-09-28 20:45:50 -07:00
diced b460da74dd refactor: change bool() -> boolean() 2022-09-28 20:30:24 -07:00
Wolfy0615 75a8bb7962 fix: change outdated url (#172)
* Fix outdated url

Updated to resolve merge conflicts

* Update index.tsx

Fix #2
2022-09-28 19:50:01 -07:00
diced 9ac876e30a feat: ability to view non-media views 2022-09-24 14:25:34 -07:00
diced 26cb4ea034 fix: placeholder and red buttons 2022-09-24 10:43:23 -07:00
diced 0d65ee1a32 feat: flameshot generator 2022-09-24 10:41:03 -07:00
Erik Bender 4a753376b7 feat: add password field in file upload ui (#169) 2022-09-24 10:14:36 -07:00
Derock dc926e9f5a feat: overhaul a lot of stuff (#171)
* feat: ssr for /code/[id], fix: syntax highlighting

* feat: cache responses

* ref: eslint

* wip

* Create .gitattributes

* wip again

* redesign dashboard

* ref: use react-query for url
ref: break into components
feat: loading animation for delete
feat: no url image

* feat: use react-query mutation for files

* ref: update sizing on code input

* chore(deps): update mantine

* feat: overhaul stats page

* fix: incorrectly calculating stat % change

* fix: use latest data in stats per day

* feat: add validation on stats amount query string

* refactor: clean up imports & code

* fix: remove prettier (fixes eslint)

* ref: run eslint autofix

* ref: more eslint

* ref: replace undraw on homepage with react-feather

* refactor: remove tailwind & add responsiveness to stuff

* fix: colors on file placeholder

* fix: make actions work

* feat: new sharex configuration generator

Co-authored-by: diced <pranaco2@gmail.com>
2022-09-23 18:19:27 -07:00
diced 722372c7f6 fix: #173 2022-09-11 12:08:38 -07:00
diced 4589c6ee0a fix: #166 2022-09-05 15:06:07 -07:00
diced 67ff93e640 fix: remove useless webpack cofnig 2022-08-26 20:38:31 -07:00
diced bd055d704b fix: domain duplication 2022-08-26 20:35:25 -07:00
diced 2e8bee931c feat: add a debug read-config script 2022-08-26 20:06:57 -07:00
diced a454a4f4a8 feat: external links & bug fixes 2022-08-26 20:04:25 -07:00
diced 45541a3cdd feat: add version to appshell 2022-08-24 20:37:57 -07:00
diced 1d42d922bd feat: discord webhook notifs 2022-08-23 09:38:29 -07:00
diced 4f631fbd0e feat: more ways to expire 2022-08-21 22:24:56 -07:00
diced e911db4c1a fix: image table on dashboard 2022-08-17 15:01:23 -07:00
diced 9b60147e11 feat(v3.5.0): version 2022-08-16 15:25:44 -07:00
diced acd0cabdff feat: update prisma binaries 2022-08-16 15:24:09 -07:00
diced d41f6058f7 feat: user avatars 2022-08-16 14:50:59 -07:00
diced 8f835eec4e feat: add image compression 2022-08-16 14:04:11 -07:00
diced ecab525ffd fix: text & video embed 2022-08-15 20:55:46 -07:00
diced 7c887e8ec1 fix: vanities can be overwritten 2022-07-28 14:03:29 -07:00
diced f3a23a528b feat: expiring images 2022-07-28 13:53:46 -07:00
diced cdcb31130b feat: switch to tsx (typescript execute) 2022-07-28 11:30:14 -07:00
diced 3ea24ddf0c feat: switch to mantine v5 2022-07-28 11:03:22 -07:00
dicedtomato 12baadd563 fix: revert version 2022-07-15 21:29:44 +00:00
dicedtomato f5ae36d4e7 feat: version 3.4.9 2022-07-15 21:28:27 +00:00
dicedtomato 04ca738fb1 feat: add more mimetypes! 2022-07-15 21:27:01 +00:00
dicedtomato 95e09e51e1 fix: add title to Layout 2022-07-15 17:34:32 +00:00
dicedtomato 2f0af385c7 feat: add content-length headers 2022-07-15 17:20:24 +00:00
dicedtomato 786e6d5799 feat: new configuration options 2022-07-14 03:05:16 +00:00
dicedtomato 61c5df750a feat: invitations to create accounts 2022-07-14 02:31:23 +00:00
dicedtomato eb30afcb83 remove: meta config (will be added another day) 2022-07-13 16:32:56 +00:00
dicedtomato cdf0f6e96c feat: versioned docker images 2022-07-13 04:32:52 +00:00
dicedtomato 54158c5dbe refactor: remove config file in favor for env variables 2022-07-13 02:50:25 +00:00
dicedtomato 56ff86db44 feat: revamp file gallery 2022-07-12 22:09:57 +00:00
dicedtomato b7560c80aa fix: make dropzone larger 2022-07-10 05:43:19 +00:00
dicedtomato 03379943de fix: clean up upload components 2022-07-10 05:38:53 +00:00
dicedtomato 2376fd8968 feat: switch from radix-icons to feathericons 2022-07-10 00:46:15 +00:00
dicedtomato 2f90193d7e feat: add text uplading 2022-07-09 23:54:55 +00:00
dicedtomato 964199f8a9 fix(config): make s3/swift optional and not error out 2022-07-09 20:35:21 +00:00
dicedtomato 678ea20004 fix(docker): build 2022-07-08 02:57:31 +00:00
dicedtomato ea27fd8a45 feat(3.4.8): fix bug where you can crash zipline 2022-07-08 02:52:19 +00:00
dicedtomato 38eef3f0ad feat(v3.4.7): version 2022-07-06 17:03:44 +00:00
dicedtomato 22615e9ce9 fix: build 2022-07-06 17:01:12 +00:00
dicedtomato a999abfbf8 feat: a bunch of changes 2022-07-06 16:57:39 +00:00
dicedtomato 20c1d3ef08 Merge branch 'trunk' of https://github.com/diced/zipline into trunk 2022-06-26 17:58:14 +00:00
Adil Mohiuddin b06c8e4918 fix: add link to xsel (#157) 2022-06-25 21:41:42 -07:00
dicedtomato 6edfdcefcc fix(s3): use smaller libraries 2022-06-25 17:07:19 +00:00
dicedtomato 10b145b006 fix(docker): use prebuilt binaries 2022-06-25 00:01:23 +00:00
dicedtomato 0ba9a9659d fix(docker): build prisma so it works on alpine arm64 2022-06-24 18:27:35 +00:00
cstef 2dfa1b6b14 feat: add Openstack Swift support (#154)
* Add Openstack support

* Fix datasource getting

* Restore example config + remove useless vscode dir

* Restore example config + remove useless vscode dir

* Add config.ts to the entryPoints list

* Fix indenting problems with switch-case

* Replace openstack-swift-client

* Add openstack to the config validator

* Rename Openstack to Swift

* Better error handling for swift

* More error handling

* Update Swift.ts

Co-authored-by: dicedtomato <35403473+diced@users.noreply.github.com>
2022-06-21 17:54:05 -07:00
dicedtomato 7a3f9f1fa4 fix: maybe fix action idk 2022-06-20 22:43:21 -07:00
diced f276fdc6a0 feat(docker): remove arm docker stuff in favor of cross arch dockerfile 2022-06-20 22:29:33 -07:00
diced 7963bdd1e4 feat(v3.4.6): version & fixes 2022-06-20 17:40:36 -07:00
diced 195c57edc3 refactor(server): clean up server code 2022-06-20 17:09:52 -07:00
diced 4442c85dc1 fix(server): prisma migrations dont exit (high cpu) 2022-06-20 17:08:43 -07:00
diced 5bcac2a2b0 refactor(readme): more info 2022-06-20 15:07:15 -07:00
diced 5303b67d11 fix(pages): add blur to password modal 2022-06-20 14:35:26 -07:00
diced af59e9abb8 fix(pages): videos supported on embeded uploads 2022-06-20 14:33:10 -07:00
diced fb098c9147 feat(page): add preview on hover & progress bar 2022-06-20 14:12:57 -07:00
diced 739974bef4 refactor(config): move into directory 2022-06-20 10:55:43 -07:00
diced d21e48a1a3 fix(api): improve ratelimits 2022-06-20 10:49:24 -07:00
diced 8fea0cbe77 refactor: clean up datasource stuff 2022-06-20 10:25:22 -07:00
diced 1e2b8efb13 feat(v3.4.5): version 2022-06-19 17:46:45 -07:00
diced 8495963094 feat(v3.4.5): exporting images and more stuff 2022-06-19 17:46:20 -07:00
diced 06d1c0bc3b fix(api): make delete user with images actually delete their images from the datasource 2022-06-19 17:26:52 -07:00
diced 5965c2e237 fix(config): extention -> extension 2022-06-19 16:44:55 -07:00
diced fb34dfadb0 fix(config): make endpoint nullable 2022-06-18 13:47:59 -07:00
diced 13b0ac737b feat(datasource): s3 path styles 2022-06-18 13:39:12 -07:00
diced 300430b3ec Merge branch 'trunk' of github.com:diced/zipline into trunk 2022-06-18 12:38:42 -07:00
NebulaBC cf6f154e6e fix: add env vars for s3 endpoint (#153) 2022-06-17 19:05:20 -07:00
diced 2ddf8c0cdb fix(api): password protected images wont show up on root 2022-06-17 15:35:29 -07:00
NebulaBC 2a402f77b5 feat(api): S3 endpoint support (#152)
* S3 endpoint support

Adding endpoint support to S3 allows for other S3-compatible uploaders to be used

* Fix formatting error
2022-06-17 14:29:34 -07:00
Han Cen 7b2c31658a feat(api): root uploader route (#150) 2022-06-17 14:20:21 -07:00
Han Cen 7a91a60af9 fix: fix build (#149) 2022-06-17 08:35:53 -07:00
diced bfa6c70bf3 chore(deps): update stuff 2022-06-16 14:22:26 -07:00
Jonathan 73eff05180 feat: use yarn v3 (#136)
* feat: use yarn v3

* chore: bump yarn to 3.2.1
2022-06-06 16:38:15 -07:00
relaxtakenotes 74f3b3f13d fix: image width not being set properly (#143)
* Fix image width not being set properly

Sometimes it got set to 0 because the original image wasn't loaded yet.

* fix: eslint

Co-authored-by: dicedtomato <35403473+diced@users.noreply.github.com>
2022-06-04 22:18:07 -07:00
diced 181833d768 Merge branch 'trunk' of github.com:diced/zipline into trunk 2022-06-04 22:05:26 -07:00
diced be9523304a feat(v3.4.4): fix many bugs and password protected uploads 2022-06-04 22:05:08 -07:00
dicedtomato b26fef3ad4 fix(docker): add restart policy for postgres 2022-03-26 20:37:02 +00:00
diced 9f86674bbe fix: update security policy 2022-03-14 20:31:18 -07:00
diced 095e57a037 fix(actions): arm -> arm64 2022-03-14 20:22:39 -07:00
diced 66a8e3bb79 feat: arm docker-compose file 2022-03-13 20:05:41 -07:00
diced 473137abdf fix(actions): fix arm action path 2022-03-13 19:36:28 -07:00
diced 740f1605e7 fix(actions): maybe fix actions 2022-03-13 19:30:37 -07:00
diced 0922ec020e fix: revert to node 16 on actions 2022-03-13 19:27:32 -07:00
diced dbe8291f55 fix(actions): maybe fix arm action 2022-03-13 19:26:33 -07:00
diced 9dcc16277e refactor(actions): update to v2 of build-push-action & push arm image 2022-03-13 19:25:11 -07:00
diced aa611fa6ba feat(v3.4.3): cleanup, fix memory leak, arm support 2022-03-13 19:13:18 -07:00
diced 083040e300 feat(v3.4.2): random domain selection #129 2022-03-03 17:52:34 -08:00
diced 99e92e4594 feat(v3.4.1): datasource api, for S3 functionality 2022-03-02 22:04:56 -08:00
diced 870f6e88b1 fix(prisma): add removal of custom theme migration 2022-02-26 17:27:37 -08:00
dicedtomato 16d2014bfb feat(v3.4.0): switch from Material-UI to Mantine! (#127) 2022-02-26 17:19:02 -08:00
diced 4d9a22e82c fix(api): data not defined 2022-02-21 09:28:32 -08:00
diced 42d77e445b feat(v3.3.2): image formats 2022-02-21 09:27:10 -08:00
diced 6506846207 fix: cleanup 2022-02-21 09:26:26 -08:00
diced 2b9af0e0de feat(api): formats for uploaded images 2022-02-20 22:01:31 -08:00
diced 762d2927f7 Merge branch 'trunk' of github.com:diced/zipline into trunk 2022-02-19 20:17:53 -08:00
diced d9561f3b12 feat(v3.3.1): bug fixes and new features 2022-02-19 20:17:02 -08:00
dicedtomato dde24848d4 fix: domains in readme 2022-02-17 16:31:12 -08:00
diced e786482902 fix: multiple issues & new features 2022-02-12 20:35:36 -08:00
diced 4e64922b70 feat(v3.3): release 3.3 2022-01-03 19:00:51 -08:00
diced 15042b16d1 feat(v3.3): ctrl+v to upload image 2022-01-03 19:00:20 -08:00
diced 5e4c4fc6c9 feat(v3.3): faster stats 2022-01-03 15:56:33 -08:00
diced 7194c53891 feat(v3.3): ratelimit 2022-01-03 15:17:47 -08:00
Nguyen Thanh Quang 7eff77ccc4 refactor(api): cors duplication (#109)
* refactor(api): cors duplication

* refactor(middleware): moved content-type setter to top
2021-11-27 15:00:18 -08:00
Nguyen Thanh Quang 1b78ffaa91 fix(prisma): make sure migrations are migrated in the first run (#105)
* fix(prisma): make sure migrations are migrated in the first run

* chore: removed redundant parentheses
2021-11-27 14:39:57 -08:00
dicedtomato 8e8bfd68d1 Update README.md 2021-11-23 18:31:26 -08:00
diced b029505cdd feat(api): add cors 2021-11-04 17:09:18 -07:00
Kyle c5c862bee3 fix: readme links (#104) 2021-10-03 11:42:27 -07:00
Nguyen Thanh Quang 3c38d008f1 fix(config): updated example config file (#103) 2021-10-03 11:41:50 -07:00
diced dc52b00a00 feat(v3.2.5): update mui & embed vars 2021-10-02 20:16:23 -07:00
diced b5d2e7040e fix: multi 1000 to expires 2021-09-25 18:03:06 -07:00
diced 5818440721 feat(pages): add create url 2021-09-25 18:00:00 -07:00
diced f1c46da47d feat(pages): add urls page 2021-09-25 17:30:23 -07:00
diced 212c69d303 fix: add comma dangles 2021-09-25 09:39:51 -07:00
diced 9e4152e298 fix: github actions build 2021-09-24 20:41:26 -07:00
diced 307f023e47 fix: github actions build 2021-09-24 20:39:43 -07:00
diced 3451bd8762 feat(v3.2.4): url shortenning 2021-09-24 20:31:45 -07:00
diced a9d0be8aae fix: revert arm stuff 2021-09-18 21:34:02 -07:00
diced d83f720631 fix(actions): add custom prisma engines 2021-09-18 21:28:24 -07:00
diced 1f3d396296 fix(actions): make action use v2 2021-09-18 20:59:03 -07:00
diced 48f771f344 fix(actions): make action use v2 2021-09-18 20:42:47 -07:00
diced 555bc6aa26 fix(docker): make action target linux/arm64 2021-09-18 20:33:25 -07:00
diced 8bd0eaac1e fix(docker): make action target linux/arm64 2021-09-18 20:19:50 -07:00
diced 3280c77002 fix(docker): make action target linux/arm64 2021-09-18 20:18:04 -07:00
diced b39743a53a fix(docker): make action target linux/arm64 2021-09-18 20:16:33 -07:00
diced 9a73da56e9 feat(docker): add arm64 compatible images 2021-09-18 20:10:22 -07:00
diced c9b0d2664f feat(v3.2.3): new config validation 2021-09-17 21:38:24 -07:00
dicedtomato 6063c9efac Update README.md 2021-09-17 20:40:38 -07:00
diced dd6f192d4a fix: many things 2021-09-17 20:39:20 -07:00
diced d956f4ed3d fix(api): fix recent images showing other users images 2021-09-12 21:31:43 -07:00
diced 4728258750 feat: v3.2.2 new file management & viewing 2021-09-12 21:17:27 -07:00
diced ece3e16459 fix(api): fixed being able to override user (#98) 2021-09-08 20:56:47 -07:00
Nguyen Thanh Quang 9208dbe2f3 fix(api): fixed being able to override user (#98)
* fix(api): fixed being able to override user

* Update index.ts
2021-09-08 20:56:10 -07:00
diced 636de18642 feat(pages): add recent images to dashboard 2021-09-06 15:58:01 -07:00
diced ee48456291 fix(api): change cookie max-age from 10m seconds to 1 week 2021-09-06 15:32:39 -07:00
diced a06d5ffaed fix(api): sort images count and types count 2021-09-06 15:22:36 -07:00
diced 606821a2c0 fix(components): add skeleton placeholders to dashboard 2021-09-06 14:54:25 -07:00
diced 5c980c21e5 feat(api): allow bulk uploading (#97) 2021-09-05 11:23:52 -07:00
diced 771cc380df fix(api): maybe fix default user not being created 2021-09-05 09:14:19 -07:00
diced 38217870fe fix(api): maybe fix default user not being created 2021-09-05 09:13:13 -07:00
dicedtomato 5b82c96a43 Update README.md 2021-09-04 15:01:08 -07:00
diced 6f5f9869ad refactor(assets): update assets to v3 2021-09-04 14:42:38 -07:00
diced b29bfeb8b1 fix(api): new way to handle non-embedded images to overwrite nextjs & supports discord now 2021-09-03 17:20:43 -07:00
diced cb40559e49 fix(server): some changes 2021-09-03 17:03:47 -07:00
diced 90c72f7ffe fix(api): small images height strech fix 2021-09-03 16:50:14 -07:00
diced 002bd2e6f7 refactor(api): redirect non-embedded images to /r 2021-09-03 16:40:50 -07:00
diced 7b44f17a64 refactor(api): /raw -> /r 2021-09-03 16:26:04 -07:00
diced b5c83f92e3 fix(api): fix images not showing 2021-09-02 21:46:10 -07:00
diced 51b4d64a93 fix(build): fix some docker stuff 2021-09-02 21:27:12 -07:00
diced 62c9e0a22f feat(api): add support for invisible images 2021-09-02 21:00:16 -07:00
diced 3daac34d3e feat(api): add support for invisible images 2021-09-02 20:59:30 -07:00
dependabot[bot] d80d5d1632 build(deps): bump next from 11.1.0 to 11.1.1 (#95)
Bumps [next](https://github.com/vercel/next.js) from 11.1.0 to 11.1.1.
- [Release notes](https://github.com/vercel/next.js/releases)
- [Changelog](https://github.com/vercel/next.js/blob/canary/release.js)
- [Commits](https://github.com/vercel/next.js/compare/v11.1.0...v11.1.1)

---
updated-dependencies:
- dependency-name: next
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-02 06:51:13 -07:00
diced 912f716362 feat(api): add support for zws images 2021-08-30 20:56:34 -07:00
diced 16ecdf41af feat(components): added sharex config generator (#93) 2021-08-30 13:58:06 -07:00
Nguyen Thanh Quang f0bb6b08fa feat(components): added sharex config generator (#93) 2021-08-30 07:59:08 -07:00
Nguyen Thanh Quang efb4e2ce9a feat(sharex): added sharex config generator 2021-08-30 20:19:12 +07:00
diced 03238d10bf fix(config): notify which vars are missing 2021-08-28 21:41:04 -07:00
diced e71590b9fb fix(config): new opts: admin_limit, user_limit, disabled_extensions (#68) 2021-08-28 21:02:04 -07:00
diced 4728f1cc46 fix(api): accidently sending images as a part of the user object 2021-08-28 19:37:38 -07:00
diced 794778dee2 feat(config): database section removed 2021-08-28 11:32:09 -07:00
Nguyen Thanh Quang b5e882f07e feat(themes): added dracula theme (#92)
* added dracula theme

* change border color from white

Co-authored-by: dicedtomato <35403473+diced@users.noreply.github.com>
2021-08-27 15:33:32 -07:00
dicedtomato e7c58a4847 licence 2021-08-27 15:24:37 -07:00
dicedtomato bdb44db25e security policy 2021-08-27 15:23:28 -07:00
diced e8b82ffe62 feat(api): image favoriting (#67) 2021-08-27 13:48:22 -07:00
diced 53c53c009e fix(components): white text on links when light theme 2021-08-26 21:41:30 -07:00
Nguyen Thanh Quang 7e8cda4605 feat(components): ayu_mirage, ayu_light, nord, polar themes (#90) 2021-08-26 19:44:04 -07:00
diced dfa0419a0a fix(api): fix many bugs 2021-08-26 15:18:14 -07:00
diced aeb2638d1e feat: v3.2.0 - custom themes & curated themes 2021-08-26 12:33:18 -07:00
diced c5cef56e2a feat: v3.2.0 - custom themes & curated themes 2021-08-26 12:32:51 -07:00
Nguyen Thanh Quang b9c9d98252 removed redundant code (#86) 2021-08-25 19:41:49 -07:00
Nguyen Thanh Quang 30083b6705 fixed the menu doesn't close when clicking outside (#87) 2021-08-25 19:41:32 -07:00
diced 47db6cf1bd fix(build): prisma not being copied over 2021-08-25 15:16:39 -07:00
diced f929f6ad7d fix(build): schema.shared.prisma -> schema.prisma 2021-08-25 10:10:23 -07:00
diced 7e16e0f30c fix(build): add migrations to gitignore 2021-08-25 10:05:35 -07:00
diced b2be4e51cc fix(build): remove schema from gitignore 2021-08-25 10:01:57 -07:00
diced 2c871be8c5 feat(prisma): remove multi-db support in favor of psql \w easier setup 2021-08-25 09:58:48 -07:00
diced 8c03e74979 fix(build): fix 2021-08-24 10:27:20 -07:00
diced d5c0355fd4 fix(build): maybe fix 2021-08-24 10:20:47 -07:00
diced 386cad0474 feat(components): copy url to clipboard when uploading image 2021-08-24 10:17:04 -07:00
Nguyen Thanh Quang 474024ea55 Fixed error/url not showing properly (#85)
* Fixed error not showing.

* Update Upload.tsx
2021-08-23 08:39:31 -07:00
diced dacf13e46d fix(docker): docker image 2021-08-21 14:57:54 -07:00
dependabot[bot] f37b4bb2ee build(deps): bump next from 11.0.0 to 11.1.0 (#83)
* build(deps): bump next from 11.0.0 to 11.1.0

Bumps [next](https://github.com/vercel/next.js) from 11.0.0 to 11.1.0.
- [Release notes](https://github.com/vercel/next.js/releases)
- [Changelog](https://github.com/vercel/next.js/blob/canary/release.js)
- [Commits](https://github.com/vercel/next.js/compare/v11.0.0...v11.1.0)

---
updated-dependencies:
- dependency-name: next
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix(deps): nextjs 11 -> 11.1

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: diced <pranaco2@gmail.com>
2021-08-13 12:57:05 -07:00
diced 034398e9fb fix(api): no admin user creat 2021-08-07 20:38:45 -07:00
diced 2c605cb176 fix(api): no admin user creat 2021-08-07 20:38:15 -07:00
dicedtomato 9a6673fe6d Update README.md 2021-07-22 16:23:42 -07:00
diced 6733c9adba fix(pages): fix embed route not loading images 2021-06-23 21:44:01 -07:00
diced 9d3443ceac fix(server): add mimetype for non db entries 2021-06-23 21:34:38 -07:00
diced d628424b35 fix(pages): fix average size of uploads 2021-06-23 14:24:42 -07:00
diced dab444040e fix(api): fix broken uploads 2021-06-23 14:21:34 -07:00
diced ecef854d23 fix(pages): stats being null 2021-06-23 12:18:10 -07:00
diced 166087e33c fix: make migrations use readConfig 2021-06-23 11:47:05 -07:00
diced e9e30c4c46 fix: change compose to use dockerhub image 2021-06-23 11:40:52 -07:00
diced fd400aa850 Release 3.0.0 2021-06-23 11:20:20 -07:00
655 changed files with 23311 additions and 58626 deletions
+7 -7
View File
@@ -1,7 +1,7 @@
.github
build
node_modules
uploads*
.env
.eslintcache
src/prisma
node_modules/
.next/
uploads/
.git/
.yarn/*
!.yarn/releases
!.yarn/plugins
+46
View File
@@ -0,0 +1,46 @@
# every field in here is optional except, CORE_SECRET and CORE_DATABASE_URL.
# if CORE_SECRET is still "changethis" then zipline will exit and tell you to change it.
# if using s3/supabase make sure to comment out the other datasources
CORE_HTTPS=true
CORE_SECRET="changethis"
CORE_HOST=0.0.0.0
CORE_PORT=3000
CORE_DATABASE_URL="postgres://postgres:postgres@localhost/zip10"
CORE_LOGGER=false
CORE_STATS_INTERVAL=1800
# default
DATASOURCE_TYPE=local
DATASOURCE_LOCAL_DIRECTORY=./uploads
# or you can choose to use s3
DATASOURCE_TYPE=s3
DATASOURCE_S3_ACCESS_KEY_ID=key
DATASOURCE_S3_SECRET_ACCESS_KEY=secret
DATASOURCE_S3_BUCKET=bucket
DATASOURCE_S3_ENDPOINT=s3.amazonaws.com
DATASOURCE_S3_REGION=us-west-2
DATASOURCE_S3_FORCE_S3_PATH=false
DATASOURCE_S3_USE_SSL=false
# or supabase
DATASOURCE_TYPE=supabase
DATASOURCE_SUPABASE_KEY=xxx
# remember: no leading slash
DATASOURCE_SUPABASE_URL=https://something.supabase.co
DATASOURCE_SUPABASE_BUCKET=zipline
UPLOADER_DEFAULT_FORMAT=RANDOM
UPLOADER_ROUTE=/u
UPLOADER_LENGTH=6
UPLOADER_ADMIN_LIMIT=104900000
UPLOADER_USER_LIMIT=104900000
UPLOADER_DISABLED_EXTENSIONS=someext
URLS_ROUTE=/go
URLS_LENGTH=6
RATELIMIT_USER = 5
RATELIMIT_ADMIN = 3
-1
View File
@@ -1 +0,0 @@
use flake . --no-pure-eval
+33
View File
@@ -0,0 +1,33 @@
{
"extends": ["next", "next/core-web-vitals", "plugin:prettier/recommended"],
"rules": {
"linebreak-style": ["error", "unix"],
"quotes": [
"error",
"single",
{
"avoidEscape": true
}
],
"semi": ["error", "always"],
"comma-dangle": ["error", "always-multiline"],
"jsx-quotes": ["error", "prefer-single"],
"indent": "off",
"react/prop-types": "off",
"react-hooks/rules-of-hooks": "off",
"react-hooks/exhaustive-deps": "off",
"react/jsx-uses-react": "warn",
"react/jsx-uses-vars": "warn",
"react/no-danger-with-children": "warn",
"react/no-deprecated": "warn",
"react/no-direct-mutation-state": "warn",
"react/no-is-mounted": "warn",
"react/no-typos": "error",
"react/react-in-jsx-scope": "off",
"react/require-render-return": "error",
"react/style-prop-object": "warn",
"@next/next/no-img-element": "off",
"jsx-a11y/alt-text": "off",
"react/display-name": "off"
}
}
+14
View File
@@ -0,0 +1,14 @@
# Set the default behavior, in case people don't have core.autocrlf set.
* text eol=lf
# Explicitly declare text files you want to always be normalized and converted
# to native line endings on checkout.
*.c text
*.h text
# Declare files that will always have CRLF line endings on checkout.
*.sln text eol=crlf
# Denote all files that are truly binary and should not be modified.
*.png binary
*.jpg binary
-1
View File
@@ -1 +0,0 @@
github: diced
+30 -48
View File
@@ -1,70 +1,52 @@
name: Bug Report
description: Report a reproducible bug in Zipline
title: 'Bug: [short description of the issue]'
name: Bug
description: File a bug report
title: 'Bug: '
labels: ['bug']
body:
- type: textarea
id: what-happened
attributes:
label: Bug description
description: |
Describe in detail what you were doing and what happened.
Please include screenshots, logs, or error messages if possible, as they help diagnose the issue faster.
label: What happened?
description: Provide steps to reproduce the bug, and some context.
value: 'A bug happened!'
validations:
required: true
- type: dropdown
id: runtime-type
id: version
attributes:
label: How is Zipline being run?
description:
label: Version
description: What version of Zipline are you using?
options:
- On docker (docker, docker compose, etc.)
- Built from source (running it through `pnpm start` or `node`, etc.)
- Other (please specify in the "Zipline Version" section)
- upstream (ghcr.io/diced/zipline:trunk)
- latest (ghcr.io/diced/zipline:latest)
- other (provide version in additional info)
validations:
required: true
- type: textarea
id: runtime-version
attributes:
label: Zipline Version
description: |
Provide the version of Zipline you are using:
- If version checking is enabled (it is by default): paste the response from `http://<domain>/api/version`
- If using docker (and can't do the above): specify the tag you are using (`latest`, `trunk`, or a tag digest)
- A simple version number (e.g. "4.2.1") may also suffice
placeholder: '4.2.1'
validations:
required: true
- type: dropdown
id: browsers
attributes:
label: If applicable, what browsers are you seeing this issue on?
label: What browser(s) are you seeing the problem on?
multiple: true
options:
- Chromium based (Chrome, Brave, Edge, Opera, etc.)
- Firefox based (Firefox, Zen Browser, Waterfox, etc.)
- Safari (On macOS and/or iOS)
- Chromium based on Android/iOS
- Firefox based on Android/iOS
- Other (Please specify in the "Steps to Reproduce" section)
- Firefox
- Chromium-based (Chrome, Edge, Brave, Opera, mobile chrome/chromium based, etc)
- Safari
- Firefox Mobile
- Safari Mobile
- type: textarea
id: zipline-logs
attributes:
label: Relevant Logs
description: |
Paste any relevant logs from Zipline or the browser (if applicable).
If logs don't look useful, you can enable debug mode by setting the environment variable `DEBUG=zipline` when starting Zipline.
Then reproduce the issue and copy the logs here.
**Note:** Debug logs may contain sensitive information.
label: Zipline Logs
description: Please copy and paste any relevant log output. Not seeing anything interesting? Try adding the `DEBUG=true` environment variable to see more logs, make sure to review the output and remove any sensitive information as it can be VERY verbose at times.
render: shell
- type: textarea
id: reproduction
id: browser-logs
attributes:
label: Steps to Reproduce
description: |
Please list the exact steps required to reproduce the issue.
Include any relevant configuration options, settings, or external services that may affect Ziplines functionality.
label: Browser Logs
description: Please copy and paste any relevant log output.
render: shell
- type: textarea
id: additional-info
attributes:
label: Additional Info
description: Anything else that could be used to narrow down the issue, like your config.
+3 -6
View File
@@ -1,11 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: Feature Request
url: https://github.com/diced/zipline/discussions/new?category=ideas&title=Your%20brief%20description%20here&labels=feature
about: Ask for a new feature
- name: Documentation
url: https://zipline.diced.sh
about: Maybe take a look a the docs?
- name: Zipline Discord
url: https://discord.gg/EAhCRfGxCF
about: Ask for help with anything related to Zipline!
- name: Zipline Docs
url: https://zipline.diced.tech
about: Maybe take a look a the docs?
+20 -32
View File
@@ -2,49 +2,37 @@ name: 'Build'
on:
push:
branches: [v4, trunk]
branches: [ trunk ]
pull_request:
branches: [v4, trunk]
branches: [ trunk ]
workflow_dispatch:
jobs:
build:
strategy:
matrix:
node: [22.x, 24.x]
arch: [amd64, arm64]
runs-on: ubuntu-24.04${{ matrix.arch == 'arm64' && '-arm' || '' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use node@${{ matrix.node }}
uses: actions/setup-node@v4
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- uses: pnpm/action-setup@v4
with:
run_install: false
- name: Get pnpm store directory
shell: bash
id: pnpm-cache
run: |
echo "store_path=$(pnpm store path --silent)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
node-version: '18.x'
- name: 'Restore dependency cache'
id: cache-restore
uses: actions/cache@v3
with:
path: |
${{ steps.pnpm-cache.outputs.store_path }}
key: ${{ runner.os }}-${{ matrix.arch }}-${{ matrix.node }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
node_modules
${{ github.workspace }}/.next/cache
key: ${{ runner.os }}-node${{ matrix.node }}-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
restore-keys: |
${{ runner.os }}-${{ matrix.arch }}-${{ matrix.node }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}-
${{ runner.os }}-node${{ matrix.node }}-${{ hashFiles('**/yarn.lock') }}-
- name: Install
run: pnpm install
- name: Install dependencies
if: steps.cache-restore.outputs.cache-hit != 'true'
run: yarn install
- name: Build
run: yarn build
env:
ZIPLINE_BUILD: 'true'
run: pnpm build
ZIPLINE_DOCKER_BUILD: true
+27 -88
View File
@@ -2,111 +2,50 @@ name: 'Push Release Docker Images'
on:
push:
tags:
- 'v4.*.*'
tags:
- 'v*.*.*'
paths:
- 'src/**'
- 'server/**'
- 'prisma/**'
- '.github/**'
- 'Dockerfile'
workflow_dispatch:
jobs:
push:
strategy:
matrix:
arch: [amd64, arm64]
name: push release
runs-on: ubuntu-24.04${{ matrix.arch == 'arm64' && '-arm' || '' }}
push_to_ghcr:
name: Push Release Image to GitHub Packages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check out the repo
uses: actions/checkout@v3
- name: Get version
id: version
run: |
echo "zipline_version=$(jq .version package.json -r)" >> $GITHUB_OUTPUT
- name: Get commit sha
id: sha
run: |
echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Setup QEMU
uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Login to Github Packages
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: docker/build-push-action@v6
- name: Build Docker Image
uses: docker/build-push-action@v3
with:
push: true
platforms: linux/${{ matrix.arch }}
platforms: linux/amd64,linux/arm64
tags: |
ghcr.io/diced/zipline:latest
ghcr.io/diced/zipline:${{ steps.version.outputs.zipline_version }}
cache-from: type=gha
cache-to: type=gha,mode=max
provenance: false
build-args: |
ZIPLINE_GIT_SHA=${{ steps.sha.outputs.short_sha }}
tags: |
ghcr.io/diced/zipline:${{ steps.version.outputs.zipline_version }}-${{ matrix.arch }}
ghcr.io/diced/zipline:${{ steps.version.outputs.zipline_version }}-${{ steps.sha.outputs.short_sha }}-${{ matrix.arch }}
${{ secrets.DOCKERHUB_USERNAME }}/zipline:${{ steps.version.outputs.zipline_version }}-${{ matrix.arch }}
${{ secrets.DOCKERHUB_USERNAME }}/zipline:${{ steps.version.outputs.zipline_version }}-${{ steps.sha.outputs.short_sha }}-${{ matrix.arch }}
amend-builds:
runs-on: ubuntu-24.04
needs: push
steps:
- uses: actions/checkout@v4
- name: Get version
id: version
run: |
echo "zipline_version=$(jq .version package.json -r)" >> $GITHUB_OUTPUT
- name: Get commit sha
id: sha
run: |
echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: pull images
run: |
docker pull --platform=linux/amd64 ghcr.io/diced/zipline:${{ steps.version.outputs.zipline_version }}-amd64
docker pull --platform=linux/arm64 ghcr.io/diced/zipline:${{ steps.version.outputs.zipline_version }}-arm64
docker pull --platform=linux/amd64 ${{ secrets.DOCKERHUB_USERNAME }}/zipline:${{ steps.version.outputs.zipline_version }}-amd64
docker pull --platform=linux/arm64 ${{ secrets.DOCKERHUB_USERNAME }}/zipline:${{ steps.version.outputs.zipline_version }}-arm64
- name: create manifests
run: |
docker manifest create ghcr.io/diced/zipline:${{ steps.version.outputs.zipline_version }} \
--amend ghcr.io/diced/zipline:${{ steps.version.outputs.zipline_version }}-amd64 \
--amend ghcr.io/diced/zipline:${{ steps.version.outputs.zipline_version }}-arm64 && \
docker manifest create ghcr.io/diced/zipline:latest \
--amend ghcr.io/diced/zipline:${{ steps.version.outputs.zipline_version }}-amd64 \
--amend ghcr.io/diced/zipline:${{ steps.version.outputs.zipline_version }}-arm64 && \
docker manifest create ${{ secrets.DOCKERHUB_USERNAME }}/zipline:${{ steps.version.outputs.zipline_version }} \
--amend ${{ secrets.DOCKERHUB_USERNAME }}/zipline:${{ steps.version.outputs.zipline_version }}-amd64 \
--amend ${{ secrets.DOCKERHUB_USERNAME }}/zipline:${{ steps.version.outputs.zipline_version }}-arm64 && \
docker manifest create ${{ secrets.DOCKERHUB_USERNAME }}/zipline:latest \
--amend ${{ secrets.DOCKERHUB_USERNAME }}/zipline:${{ steps.version.outputs.zipline_version }}-amd64 \
--amend ${{ secrets.DOCKERHUB_USERNAME }}/zipline:${{ steps.version.outputs.zipline_version }}-arm64
- name: push manifests
run: |
docker manifest push ghcr.io/diced/zipline:${{ steps.version.outputs.zipline_version }}
docker manifest push ghcr.io/diced/zipline:latest
docker manifest push ${{ secrets.DOCKERHUB_USERNAME }}/zipline:${{ steps.version.outputs.zipline_version }}
docker manifest push ${{ secrets.DOCKERHUB_USERNAME }}/zipline:latest
+30 -84
View File
@@ -2,103 +2,49 @@ name: 'Push Docker Images'
on:
push:
branches: [v4, trunk]
branches: [ trunk ]
paths:
- 'src/**'
- 'server/**'
- 'prisma/**'
- '.github/**'
- 'Dockerfile'
workflow_dispatch:
jobs:
push:
strategy:
matrix:
arch: [amd64, arm64]
name: push
runs-on: ubuntu-24.04${{ matrix.arch == 'arm64' && '-arm' || '' }}
push_to_ghcr:
name: Push Image to GitHub Packages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check out the repo
uses: actions/checkout@v3
- name: Get commit sha
id: sha
- name: Get version
id: version
run: |
echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
echo "zipline_version=$(jq .version package.json -r)" >> $GITHUB_OUTPUT
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
- name: Setup QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Login to Github Packages
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: docker/build-push-action@v6
- name: Build Docker Image
uses: docker/build-push-action@v3
with:
push: true
platforms: linux/${{ matrix.arch }}
platforms: linux/amd64,linux/arm64
tags: |
ghcr.io/diced/zipline:trunk
ghcr.io/diced/zipline:trunk-${{ steps.version.outputs.zipline_version }}
cache-from: type=gha
cache-to: type=gha,mode=max
provenance: false
build-args: |
ZIPLINE_GIT_SHA=${{ steps.sha.outputs.short_sha }}
tags: |
ghcr.io/diced/zipline:trunk-${{ matrix.arch }}
ghcr.io/diced/zipline:trunk-${{ steps.sha.outputs.short_sha }}-${{ matrix.arch }}
${{ secrets.DOCKERHUB_USERNAME }}/zipline:trunk-${{ matrix.arch }}
${{ secrets.DOCKERHUB_USERNAME }}/zipline:trunk-${{ steps.sha.outputs.short_sha }}-${{ matrix.arch }}
amend-builds:
runs-on: ubuntu-24.04
needs: push
steps:
- uses: actions/checkout@v4
- name: Get commit sha
id: sha
run: |
echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: pull images
run: |
docker pull --platform=linux/amd64 ghcr.io/diced/zipline:trunk-${{ steps.sha.outputs.short_sha }}-amd64
docker pull --platform=linux/arm64 ghcr.io/diced/zipline:trunk-${{ steps.sha.outputs.short_sha }}-arm64
docker pull --platform=linux/amd64 ${{ secrets.DOCKERHUB_USERNAME }}/zipline:trunk-${{ steps.sha.outputs.short_sha }}-amd64
docker pull --platform=linux/arm64 ${{ secrets.DOCKERHUB_USERNAME }}/zipline:trunk-${{ steps.sha.outputs.short_sha }}-arm64
- name: create manifests
run: |
docker manifest create ghcr.io/diced/zipline:trunk-${{ steps.sha.outputs.short_sha }} \
--amend ghcr.io/diced/zipline:trunk-${{ steps.sha.outputs.short_sha }}-amd64 \
--amend ghcr.io/diced/zipline:trunk-${{ steps.sha.outputs.short_sha }}-arm64 && \
docker manifest create ghcr.io/diced/zipline:trunk \
--amend ghcr.io/diced/zipline:trunk-${{ steps.sha.outputs.short_sha }}-amd64 \
--amend ghcr.io/diced/zipline:trunk-${{ steps.sha.outputs.short_sha }}-arm64
docker manifest create ghcr.io/diced/zipline:v4 \
--amend ghcr.io/diced/zipline:trunk-${{ steps.sha.outputs.short_sha }}-amd64 \
--amend ghcr.io/diced/zipline:trunk-${{ steps.sha.outputs.short_sha }}-arm64
docker manifest create ${{ secrets.DOCKERHUB_USERNAME }}/zipline:trunk \
--amend ${{ secrets.DOCKERHUB_USERNAME }}/zipline:trunk-${{ steps.sha.outputs.short_sha }}-amd64 \
--amend ${{ secrets.DOCKERHUB_USERNAME }}/zipline:trunk-${{ steps.sha.outputs.short_sha }}-arm64
docker manifest create ${{ secrets.DOCKERHUB_USERNAME }}/zipline:trunk-${{ steps.sha.outputs.short_sha }} \
--amend ${{ secrets.DOCKERHUB_USERNAME }}/zipline:trunk-${{ steps.sha.outputs.short_sha }}-amd64 \
--amend ${{ secrets.DOCKERHUB_USERNAME }}/zipline:trunk-${{ steps.sha.outputs.short_sha }}-arm64
- name: push manifests
run: |
docker manifest push ghcr.io/diced/zipline:trunk-${{ steps.sha.outputs.short_sha }}
docker manifest push ghcr.io/diced/zipline:trunk
docker manifest push ghcr.io/diced/zipline:v4
docker manifest push ${{ secrets.DOCKERHUB_USERNAME }}/zipline:trunk
docker manifest push ${{ secrets.DOCKERHUB_USERNAME }}/zipline:trunk-${{ steps.sha.outputs.short_sha }}
-99
View File
@@ -1,99 +0,0 @@
name: Generate OpenAPI Spec
on:
push:
branches: [v4, trunk]
pull_request:
branches: [v4, trunk]
workflow_dispatch:
jobs:
gen-openapi:
strategy:
matrix:
node: [24.x]
arch: [amd64]
runs-on: ubuntu-24.04
services:
postgres:
image: postgres:16
ports:
- 5432:5432
env:
POSTGRES_USER: zipline
POSTGRES_PASSWORD: zipline
POSTGRES_DB: zipline
options: >-
--health-cmd="pg_isready -U zipline -d zipline"
--health-interval=5s
--health-timeout=5s
--health-retries=10
steps:
- uses: actions/checkout@v4
- name: Use node@${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- uses: pnpm/action-setup@v4
with:
run_install: false
- name: Get pnpm store directory
shell: bash
id: pnpm-cache
run: |
echo "store_path=$(pnpm store path --silent)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
with:
path: |
${{ steps.pnpm-cache.outputs.store_path }}
key: ${{ runner.os }}-${{ matrix.arch }}-${{ matrix.node }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
restore-keys: |
${{ runner.os }}-${{ matrix.arch }}-${{ matrix.node }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}-
- name: Install
run: pnpm install
- name: Build
env:
ZIPLINE_BUILD: 'true'
run: pnpm build
- name: Generate secret
id: secret
run: |
SECRET=$(openssl rand -base64 48 | tr -dc 'a-zA-Z0-9')
echo "secret=$SECRET" >> $GITHUB_OUTPUT
- name: Wait for Postgres
run: |
until pg_isready -h localhost -p 5432 -U zipline; do
echo "Waiting for postgres..."
sleep 2
done
- name: Run generator
env:
DATABASE_URL: postgres://zipline:zipline@localhost:5432/zipline
CORE_SECRET: ${{ steps.secret.outputs.secret }}
NODE_ENV: production
run: pnpm openapi
- name: Verify openapi.json exists
run: |
if [ ! -f "./openapi.json" ]; then
echo "openapi.json not found"
exit 1
fi
- name: Upload openapi.json
uses: actions/upload-artifact@v4
with:
name: openapi-json
path: ./openapi.json
+12 -20
View File
@@ -13,14 +13,17 @@
# testing
/coverage
# next.js
/.next/
/out/
# production
build/
/build
# misc
.DS_Store
*.pem
.idea
.vscode
# debug
npm-debug.log*
@@ -28,26 +31,15 @@ yarn-debug.log*
yarn-error.log*
# local env files
.env*
.env.local
.env.development.local
.env.test.local
.env.production.local
# vercel
.vercel
# typescript
*.tsbuildinfo
# eslint
.eslintcache
# nix dev env
!.envrc
.direnv
.devenv
# zipline
uploads*/
*.crt
*.key
src/prisma
.memory.log*
openapi.json
config.toml
uploads/
dist/
+1
View File
@@ -0,0 +1 @@
18.12.0
-1
View File
@@ -1 +0,0 @@
pnpm-lock.yaml
+5
View File
@@ -0,0 +1,5 @@
{
"singleQuote": true,
"jsxSingleQuote": true,
"printWidth": 110
}
+5
View File
@@ -0,0 +1,5 @@
{
"editor.tabSize": 2,
"files.eol": "\n",
"typescript.tsdk": "node_modules/typescript/lib"
}
File diff suppressed because one or more lines are too long
+801
View File
File diff suppressed because one or more lines are too long
+9
View File
@@ -0,0 +1,9 @@
checksumBehavior: update
nodeLinker: node-modules
plugins:
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: "@yarnpkg/plugin-interactive-tools"
yarnPath: .yarn/releases/yarn-3.2.4.cjs
+23
View File
@@ -0,0 +1,23 @@
# Contributing
## Bug reports
Create an issue on GitHub, please include the following (if one of them is not applicable to the issue then it's not needed):
- The steps to reproduce the bug
- Logs of Zipline
- The version of Zipline
- Your OS & Browser including server OS
- What you were expecting to see
## Feature requests
Create an issue on GitHub, please include the following:
- Breif explanation of the feature in the title (very breif please)
- How it would work (detailed, but optional)
## Pull Requests (contributions to the codebase)
Create a pull request on GitHub. If your PR does not pass the action checks, then please fix the errors. If your PR was submitted before a release, and I have pushed a new release, please make sure to update your PR to reflect any changes, usually this is handled by GitHub.
Please make sure your code also reflects the style of the rest of the code.
+53 -53
View File
@@ -1,64 +1,64 @@
FROM node:22-alpine3.21 AS base
FROM ghcr.io/diced/prisma-binaries:4.5.x as prisma
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
FROM node:alpine3.16 AS deps
RUN mkdir -p /prisma-engines
WORKDIR /build
RUN corepack enable
COPY .yarn .yarn
COPY package.json yarn.lock .yarnrc.yml ./
RUN apk add --no-cache ffmpeg tzdata
RUN yarn install --immutable
FROM node:alpine3.16 AS builder
WORKDIR /build
COPY --from=prisma /prisma-engines /prisma-engines
ENV PRISMA_QUERY_ENGINE_BINARY=/prisma-engines/query-engine \
PRISMA_MIGRATION_ENGINE_BINARY=/prisma-engines/migration-engine \
PRISMA_INTROSPECTION_ENGINE_BINARY=/prisma-engines/introspection-engine \
PRISMA_FMT_BINARY=/prisma-engines/prisma-fmt \
PRISMA_CLI_QUERY_ENGINE_TYPE=binary \
PRISMA_CLIENT_ENGINE_TYPE=binary
RUN apk add --no-cache openssl openssl-dev
COPY --from=deps /build/node_modules ./node_modules
COPY src ./src
COPY prisma ./prisma
COPY .yarn .yarn
COPY package.json yarn.lock .yarnrc.yml esbuild.config.js next.config.js next-env.d.ts zip-env.d.ts tsconfig.json mimes.json ./
ENV ZIPLINE_DOCKER_BUILD 1
ENV NEXT_TELEMETRY_DISABLED 1
RUN yarn build
FROM node:alpine3.16 AS runner
WORKDIR /zipline
COPY prisma ./prisma
COPY package.json .
COPY pnpm-lock.yaml .
COPY --from=prisma /prisma-engines /prisma-engines
ENV PRISMA_QUERY_ENGINE_BINARY=/prisma-engines/query-engine \
PRISMA_MIGRATION_ENGINE_BINARY=/prisma-engines/migration-engine \
PRISMA_INTROSPECTION_ENGINE_BINARY=/prisma-engines/introspection-engine \
PRISMA_FMT_BINARY=/prisma-engines/prisma-fmt \
PRISMA_CLI_QUERY_ENGINE_TYPE=binary \
PRISMA_CLIENT_ENGINE_TYPE=binary
FROM base AS deps
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile
RUN apk add --no-cache openssl openssl-dev
FROM base AS builder
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
ENV NODE_ENV production
ENV NEXT_TELEMETRY_DISABLED 1
COPY src ./src
COPY .gitignore ./.gitignore
COPY --from=builder /build/.next ./.next
COPY --from=builder /build/node_modules ./node_modules
COPY postcss.config.cjs ./postcss.config.cjs
COPY prettier.config.cjs ./prettier.config.cjs
COPY eslint.config.mjs ./eslint.config.mjs
COPY vite.config.ts ./vite.config.ts
COPY tsup.config.ts ./tsup.config.ts
COPY tsconfig.json ./tsconfig.json
COPY mimes.json ./mimes.json
COPY code.json ./code.json
COPY vite-env.d.ts ./vite-env.d.ts
COPY scripts ./scripts
COPY --from=builder /build/next.config.js ./next.config.js
COPY --from=builder /build/esbuild.config.js ./esbuild.config.js
COPY --from=builder /build/src ./src
COPY --from=builder /build/dist ./dist
COPY --from=builder /build/prisma ./prisma
COPY --from=builder /build/tsconfig.json ./tsconfig.json
COPY --from=builder /build/package.json ./package.json
COPY --from=builder /build/mimes.json ./mimes.json
RUN ZIPLINE_BUILD=true pnpm run build
FROM base
COPY --from=deps /zipline/node_modules ./node_modules
COPY --from=builder /zipline/build ./build
COPY --from=builder /zipline/mimes.json ./mimes.json
COPY --from=builder /zipline/code.json ./code.json
RUN pnpm prisma generate
# clean
RUN rm -rf /tmp/* /root/*
ENV NODE_ENV=production
ENV ZIPLINE_ROOT=/zipline
ARG ZIPLINE_GIT_SHA
ENV ZIPLINE_GIT_SHA=${ZIPLINE_GIT_SHA:-"unknown"}
# add scripts
COPY docker/entrypoint.sh /zipline/entrypoint
COPY docker/ziplinectl.sh /zipline/ziplinectl
RUN ln -s /zipline/ziplinectl /usr/local/bin/ziplinectl
ENTRYPOINT ["/zipline/entrypoint"]
CMD ["node", "--enable-source-maps", "dist/server"]
+1 -1
View File
@@ -1,6 +1,6 @@
MIT License
Copyright (c) 2023 dicedtomato
Copyright (c) 2022 dicedtomato
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
+111 -285
View File
@@ -1,333 +1,159 @@
<div align="center">
<img src="https://raw.githubusercontent.com/diced/zipline/trunk/public/zipline_small.png"/>
The next generation ShareX / File upload server
A ShareX/file upload server that is easy to use, packed with features, and with an easy setup!
![Stars](https://img.shields.io/github/stars/diced/zipline?logo=github&style=for-the-badge)
![Version](https://img.shields.io/github/package-json/v/diced/zipline?logo=git&logoColor=white&style=for-the-badge)
![GitHub last commit (branch)](https://img.shields.io/github/last-commit/diced/zipline/trunk?logo=git&logoColor=white&style=for-the-badge)
[![Discord](https://img.shields.io/discord/729771078196527176?color=%23777ed3&label=discord&logo=discord&logoColor=white&style=for-the-badge)](https://discord.gg/EAhCRfGxCF)
![Stars](https://img.shields.io/github/stars/diced/zipline?logo=github&style=flat)
![Version](https://img.shields.io/github/package-json/v/diced/zipline?logo=git&logoColor=white&style=flat)
![GitHub last commit (branch)](https://img.shields.io/github/last-commit/diced/zipline/trunk?logo=git&logoColor=white&style=flat)
[![Discord](https://img.shields.io/discord/729771078196527176?color=%23777ed3&label=discord&logo=discord&logoColor=white&style=flat)](https://discord.gg/EAhCRfGxCF)
![Build](https://img.shields.io/github/actions/workflow/status/diced/zipline/build.yml?logo=github&style=for-the-badge&branch=trunk)
Documentation: [zipline.diced.sh](https://zipline.diced.sh)
![Build](https://img.shields.io/github/workflow/status/diced/zipline/Build?logo=github&style=flat)
[![Docker Image (trunk)](https://img.shields.io/github/workflow/status/diced/zipline/Push%20Docker%20Images?label=Docker%20%28trunk%29&logo=github&style=flat)](https://github.com/diced/zipline/pkgs/container/zipline/?tag=trunk)
[![Docker Image (release)](https://img.shields.io/github/workflow/status/diced/zipline/Push%20Release%20Docker%20Images?label=Docker%20%28release%29&logo=github&style=flat)](https://github.com/diced/zipline/pkgs/container/zipline/?tag=latest)
</div>
## Features
- Setup Quickly: [Get Started with Docker](https://zipline.diced.sh/docs/get-started/docker)
- Configure
- Upload any file
- Folders
- Tags
- Configurable
- Fast
- Built with Next.js & React
- Token protected uploading
- Image uploading
- Image compression
- Password Protected Uploads
- URL shortening
- Embeds
- Discord Webhooks
- HTTP Webhooks
- OAuth2
- 2FA
- Passkeys
- Password Protection
- Image Compression
- Video Thumbnails
- API
- PWA
- Partial Uploads
- Invites
- Quotas
- Custom Themes
- ... and more!
- Text uploading
- URL Formats (uuid, dates, random alphanumeric, original name, zws)
- Discord embeds (OG metadata)
- Gallery viewer, and multiple file format support
- Code highlighting
- Fully customizable Discord webhook notifications
- OAuth2 registration (Discord and GitHub)
- Two-Factor authentication with Google Authenticator, Authy, etc (totp services).
- User invites
- File Chunking (for large files)
- File deletion once it reaches a certain amount of views
- Easy setup instructions on [docs](https://zipl.vercel.app/) (One command install `docker-compose up -d`)
<details>
<summary><h2>Screenshots (click)</h2></summary>
View full album at [imgur](https://imgur.com/a/GzyowZ7)
![Login Page](https://i.imgur.com/14Er7qt.png)
![Dashboard](https://i.imgur.com/3JK5bp6.png)
![Files Page](https://i.imgur.com/grIaDs8.png)
</details>
# Usage
Visit [the docs](https://zipline.diced.sh/docs/get-started/docker) for a more in-depth guide on how to get started.
## Install & run with Docker
## Install and Run with Docker
This section requires [Docker](https://docs.docker.com/get-docker/) and [docker-compose](https://docs.docker.com/compose/install/).
This is the recommended way to run Zipline:
```shell
git clone https://github.com/diced/zipline
cd zipline
```yml
services:
postgresql:
image: postgres:16
restart: unless-stopped
env_file:
- .env
environment:
POSTGRES_USER: ${POSTGRESQL_USER:-zipline}
POSTGRES_PASSWORD: ${POSTGRESQL_PASSWORD:?POSTGRESSQL_PASSWORD is required}
POSTGRES_DB: ${POSTGRESQL_DB:-zipline}
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ['CMD', 'pg_isready', '-U', 'zipline']
interval: 10s
timeout: 5s
retries: 5
zipline:
image: ghcr.io/diced/zipline
ports:
- '3000:3000'
env_file:
- .env
environment:
- DATABASE_URL=postgres://${POSTGRESQL_USER:-zipline}:${POSTGRESQL_PASSWORD}@postgresql:5432/${POSTGRESQL_DB:-zipline}
depends_on:
postgresql:
condition: service_healthy
volumes:
- './uploads:/zipline/uploads'
- './public:/zipline/public'
- './themes:/zipline/themes'
healthcheck:
test: ['CMD', 'wget', '-q', '--spider', 'http://localhost:3000/api/healthcheck']
interval: 15s
timeout: 2s
retries: 2
volumes:
pgdata:
docker-compose up -d
```
### Volumes
### After installing
- `./uploads` - The folder where all the user uploads are stored (the default is `./uploads`)
- `./public` - The folder where all the public assets are stored (must mount to `/zipline/public`)
- `./themes` - The folder where all the custom themes are stored (must mount to `/zipline/themes`)
After installing, please edit the `docker-compose.yml` file and find the line that says `SECRET=changethis` and replace `changethis` with a random string.
Ways you could generate the string could be from a password managers generator, or you could just slam your keyboard and hope for the best.
### Generating Secrets
## Building & running from source
```bash
echo "POSTGRESQL_PASSWORD=$(openssl rand -base64 42 | tr -dc A-Za-z0-9 | cut -c -32 | tr -d '\n')" > .env
echo "CORE_SECRET=$(openssl rand -base64 42 | tr -dc A-Za-z0-9 | cut -c -32 | tr -d '\n')" >> .env
This section requires [nodejs](https://nodejs.org), [yarn](https://yarnpkg.com/) or [npm](https://npmjs.com).
```shell
git clone https://github.com/diced/zipline
cd zipline
# npm install
yarn install
# npm run build
yarn build
# npm start
yarn start
```
Without the `CORE_SECRET` environment variable, Zipline will not start.
# NGINX Proxy
### Changing where uploads are stored
This section requires [NGINX](https://nginx.org/).
By default, Zipline will default to the `./uploads` folder, which is also reflected in the `docker-compose.yml` above. If you want to change this, you can set the `DATASOURCE_LOCAL_DIRECTORY` environment variable to a different path.
```bash
DATASOURCE_LOCAL_DIRECTORY=/path/to/your/local/files
# or relative to the working directory
DATASOURCE_LOCAL_DIRECTORY=./relative/path/to/files
```nginx
server {
listen 80 default_server;
client_max_body_size 100M;
server_name <your domain (optional)>;
location / {
proxy_pass http://localhost:3000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
```
> [!NOTE]
> Remember to change volume mappings in the docker-compose.yml file if you change this.
# Website
### Changing the port and hostname
The default port is `3000`, once you have accessed it you can see a login screen. The default credentials are "administrator" and "password". Once you login please immediately change the details to something more secure. You can do this by clicking on the top right corner where it says "administrator" with a gear icon and clicking Manage Account.
By default, Zipline binds to `0.0.0.0:3000`, which is also reflected in the `docker-compose.yml` above. If you want to change this, you can set the `CORE_PORT` and `CORE_HOSTNAME` environment variables to a different port and hostname.
# ShareX (Windows)
```bash
CORE_PORT=80
CORE_HOSTNAME=localhost
This section requires [ShareX](https://www.getsharex.com/).
After navigating to Zipline, click on the top right corner where it says your username and click Manage Account. Scroll down to see "ShareX Config", select the one you would prefer using. After this you can import the .sxcu into sharex. [More information here](https://zipl.vercel.app/docs/guides/uploaders/sharex)
# Flameshot (Linux)
This section requires [Flameshot](https://www.flameshot.org/), [jq](https://stedolan.github.io/jq/), and [xsel](https://github.com/kfish/xsel).
<details>
<summary>Wayland instructions</summary>
If using wayland you will need to have [wl-clipboard](https://github.com/bugaevc/wl-clipboard) installed, for the `wl-copy` command.
If you are not using GNOME/KDE/Qtile/Sway, and are using something like a wlroots-based compositor (ex. [Hyprland](https://github.com/hyprwm/Hyprland/), [River](https://github.com/riverwm/river), etc), you will need to set the `XDG_CURRENT_DESKTOP` environment variable to `sway`, which will just override it for this script. Adding `export XDG_CURRENT_DESKTOP=sway` to the start of the script will work.
After this, replace the `xsel -ib` with `wl-copy` in the script.
</details>
You can either use the script below, or generate one directly from Zipline (just like how you can generate a ShareX config).
To upload files using flameshot we will use a script. Replace $TOKEN and $HOST with your own values, you probably know how to do this if you use linux.
```shell
DATE=$(date '+%h_%Y_%d_%I_%m_%S.png');
flameshot gui -r > ~/Pictures/$DATE;
curl -H "Content-Type: multipart/form-data" -H "authorization: $TOKEN" -F file=@$1 $HOST/api/upload | jq -r 'files[0].url' | xsel -ib
```
> [!NOTE]
> If you change the port, you will need to update the `ports` section in the `docker-compose.yml` file.
### Using S3
If you want to use S3 instead of the local filesystem, you can set the following environment variables:
```bash
DATASOURCE_TYPE=s3
DATASOURCE_S3_ACCESS_KEY_ID=access_key_id
DATASOURCE_S3_SECRET_ACCESS_KEY=secret
DATASOURCE_S3_BUCKET=zipline
DATASOURCE_S3_REGION=us-west-2
```
For more information, like other providers, see the [docs](https://zipline.diced.sh/docs/config/datasource#s3-datasource).
### Starting Zipline
Simply run the following command to start the server:
```bash
docker compose up -d
```
You should be able to access the website at `http://localhost:3000` or the port you specified.
## Manual Install
See [docs](https://zipline.diced.sh/docs/get-started/source) for more information.
# Migrating from v3
Zipline v4 was a complete rewrite, and as such, there is no upgrade path from v3 to v4. You will need to export your data from v3 and import it into v4. This process is made easier by the fact that v4 has a built-in importer to import data from v3.
See [migration](https://zipline.diced.sh/docs/migrate) for more information.
# Contributing
Contributions of any kind are welcome, whether they are bug reports, pull requests, or feature requests.
## Bug Reports
## Bug reports
Create an issue on GitHub and use the template, please include the following (if one of them is not applicable to the issue then it's not needed):
- The steps to reproduce the bug
- Logs of Zipline
- The version of Zipline, and whether or not you are using Docker (include the image digest/tag if possible)
- The version of Zipline
- Your OS & Browser including server OS
- What you were expecting to see
- How it can be fixed (if you know)
## Feature Requests
## Feature requests
Create a discussion on GitHub, and please include the following:
Create an issue on GitHub, please include the following:
- Brief explanation of your feature in the title (very brief)
- How it would work (be detailed)
- Brief explanation of the feature in the title (very brief please)
- How it would work (detailed, but optional)
## Pull Requests
## Pull Requests (contributions to the codebase)
Create a pull request on GitHub. If your PR does not pass the action checks, then please fix the errors. If your PR was submitted before a release, and I have pushed a new release, please make sure to update your PR to reflect any changes, usually this is handled by GitHub.
### Development
Here's how to setup Zipline for development
#### Nix
If you have [Nix](https://nixos.org) and [direnv](https://direnv.net/) installed, you can simply cd into the cloned directory and run the following command:
```bash
direnv allow
```
After doing so, your shell will be setup for development.
If you aren't using direnv, you can run the following command to enter the nix shell:
```bash
nix develop --no-pure-eval
```
Useful commands regarding the postgres server:
| Command | Description |
| --------------- | --------------------------------------------- |
| `pgup` | Starts the postgres server in the background. |
| `pg_ctl status` | See if the postgres server is running |
| `minioup` | Start a Minio server for testing S3 |
| `downall` | Stops any running postgres or minio service. |
After familiarizing yourself with the environment, you can continue below (skipping the prerequisites since they are already installed).
#### Prerequisites
- nodejs (lts -> 20.x, 22.x)
- pnpm (10.x)
- a postgresql server
#### Setup
You should probably use a `.env` file to manage your environment variables, here is an example .env file with every available environment variable:
```bash
DEBUG=zipline
# required
CORE_SECRET="a secret that is 32 characters long"
# required
DATABASE_URL="postgresql://postgres:postgres@localhost:5432/zipline?schema=public"
# these are optional
CORE_PORT=3000
CORE_HOSTNAME=0.0.0.0
# one of these is required
DATASOURCE_TYPE="local"
# DATASOURCE_TYPE="s3"
# if DATASOURCE_TYPE=local
DATASOURCE_LOCAL_DIRECTORY="/path/to/your/local/files"
# if DATASOURCE_TYPE=s3
# DATASOURCE_S3_ACCESS_KEY_ID="your-access-key-id"
# DATASOURCE_S3_SECRET_ACCESS_KEY="your-secret-access-key"
# DATASOURCE_S3_REGION="your-region"
# DATASOURCE_S3_BUCKET="your-bucket"
# DATASOURCE_S3_ENDPOINT="your-endpoint"
# ^ if using a custom endpoint other than aws s3
```
Install dependencies:
```bash
pnpm install
```
Finally you may start the development server:
```bash
pnpm dev
```
If you wish to build the production version of Zipline, you can run the following command:
```bash
pnpm build
```
And to run the production version of Zipline:
```bash
pnpm start
```
#### Making changes to the database schema
Zipline uses [prisma](https://www.prisma.io/) as its ORM, and as such, you will need to use the prisma CLI to facilitate any changes to the database schema.
Once you have made a change to `prisma.schema`, you can run the script `db:migrate` to generate a migration file. This script doesn't apply the migration, as Zipline handles applying migrations itself on startup.
```bash
pnpm db:migrate
```
If you wish to push changes to the database without generating a migration file, you can run the script `db:prototype`. This is only recommended for testing purposes, and should not be used in production.
```bash
pnpm db:prototype
```
#### Linting and Formatting
Zipline will fail to build unless the code is properly formatted and linted. To format the code, you can run the following command:
```bash
pnpm validate
```
#### Testing `zipline-ctl`
To build the ctl, you can run the following command:
```bash
pnpm build:server
```
then run any command you want
```bash
pnpm ctl help
```
# Documentation
Documentation is located at [zipline.diced.sh](https://zipline.diced.sh) and the source is located at [github.com/diced/zipline-docs](https://github.com/diced/zipline-docs).
# Security
Security issues are taken seriously, and should be reported via [GitHub Advisories](https://github.com/diced/zipline/security/advisories). For more information see the [security policy](SECURITY.md).
+2 -4
View File
@@ -4,12 +4,10 @@
| Version | Supported |
| ------- | ------------------ |
| 4.4.x | :white_check_mark: |
| 3.4.8 | :white_check_mark: |
| < 3 | :x: |
| < 2 | :x: |
## Reporting a Vulnerability
Report a Vulnerability [here](https://github.com/diced/zipline/security/advisories) (click Report a Vulnerability). Please include exact details with how to reproduce the vulnerability, and if possible, a proof of concept that demonstrates the vulnerability.
<- Go [back](README.md#SECURITY)
Report a Vulnerability by issuing a bug report, with exact details with how the vulnerability happened, what "exploits" can happen, and possible fixes (optional). Vulnerability reports are treated with high priority and will be resolved most of the time quickly.
-212
View File
@@ -1,212 +0,0 @@
[
{
"ext": "html",
"mime": "text/x-zipline-html",
"name": "HTML"
},
{
"ext": "css",
"mime": "text/x-zipline-css",
"name": "CSS"
},
{
"ext": "cpp",
"mime": "text/x-zipline-c++src",
"name": "C++"
},
{
"ext": "js",
"mime": "text/x-zipline-javascript",
"name": "JavaScript"
},
{
"ext": "py",
"mime": "text/x-zipline-python",
"name": "Python"
},
{
"ext": "rb",
"mime": "text/x-zipline-ruby",
"name": "Ruby"
},
{
"ext": "java",
"mime": "text/x-zipline-java",
"name": "Java"
},
{
"ext": "md",
"mime": "text/x-zipline-markdown",
"name": "Markdown"
},
{
"ext": "c",
"mime": "text/x-zipline-csrc",
"name": "C"
},
{
"ext": "php",
"mime": "text/x-zipline-httpd-php",
"name": "PHP"
},
{
"ext": "sass",
"mime": "text/x-zipline-sass",
"name": "Sass"
},
{
"ext": "scss",
"mime": "text/x-zipline-scss",
"name": "SCSS"
},
{
"ext": "swift",
"mime": "text/x-zipline-swift",
"name": "Swift"
},
{
"ext": "ts",
"mime": "text/x-zipline-typescript",
"name": "TypeScript"
},
{
"ext": "go",
"mime": "text/x-zipline-go",
"name": "Go"
},
{
"ext": "rs",
"mime": "text/x-zipline-rustsrc",
"name": "Rust"
},
{
"ext": "sh",
"mime": "text/x-zipline-sh",
"name": "Bash"
},
{
"ext": "json",
"mime": "text/x-zipline-json",
"name": "JSON"
},
{
"ext": "ps1",
"mime": "text/x-zipline-powershell",
"name": "PowerShell"
},
{
"ext": "sql",
"mime": "text/x-zipline-sql",
"name": "SQL"
},
{
"ext": "yaml",
"mime": "text/x-zipline-yaml",
"name": "YAML"
},
{
"ext": "dockerfile",
"mime": "text/x-zipline-dockerfile",
"name": "Dockerfile"
},
{
"ext": "lua",
"mime": "text/x-zipline-lua",
"name": "Lua"
},
{
"ext": "conf",
"mime": "text/x-zipline-nginx-conf",
"name": "NGINX Config File"
},
{
"ext": "pl",
"mime": "text/x-zipline-perl",
"name": "Perl"
},
{
"ext": "r",
"mime": "text/x-zipline-rsrc",
"name": "R"
},
{
"ext": "scala",
"mime": "text/x-zipline-scala",
"name": "Scala"
},
{
"ext": "groovy",
"mime": "text/x-zipline-groovy",
"name": "Groovy"
},
{
"ext": "kt",
"mime": "text/x-zipline-kotlin",
"name": "Kotlin"
},
{
"ext": "hs",
"mime": "text/x-zipline-haskell",
"name": "Haskell"
},
{
"ext": "ex",
"mime": "text/x-zipline-elixir",
"name": "Elixir"
},
{
"ext": "vim",
"mime": "text/x-zipline-vim",
"name": "Vim"
},
{
"ext": "m",
"mime": "text/x-zipline-matlab",
"name": "MATLAB"
},
{
"ext": "dart",
"mime": "text/x-zipline-dart",
"name": "Dart"
},
{
"ext": "hbs",
"mime": "text/x-zipline-handlebars-template",
"name": "Handlebars"
},
{
"ext": "hcl",
"mime": "text/x-zipline-hcl",
"name": "HCL"
},
{
"ext": "http",
"mime": "text/x-zipline-http",
"name": "HTTP"
},
{
"ext": "ini",
"mime": "text/x-zipline-ini",
"name": "INI"
},
{
"ext": "jsx",
"mime": "text/x-zipline-jsx",
"name": "JSX"
},
{
"ext": "coffee",
"mime": "text/x-zipline-coffeescript",
"name": "CoffeeScript"
},
{
"ext": "tex",
"mime": "text/x-zipline-latex",
"name": "LaTeX (KaTeX)"
},
{
"name": "Plain Text",
"mime": "text/x-zipline-plain",
"ext": "txt"
}
]
+13 -15
View File
@@ -1,15 +1,16 @@
version: '3'
services:
postgres:
image: postgres:16
restart: unless-stopped
image: postgres
restart: always
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DATABASE=postgres2
- POSTGRES_DATABASE=postgres
volumes:
- pgdata:/var/lib/postgresql/data
- pg_data:/var/lib/postgresql/data
healthcheck:
test: ['CMD', 'pg_isready', '-U', 'postgres']
test: ['CMD-SHELL', 'pg_isready -U postgres']
interval: 10s
timeout: 5s
retries: 5
@@ -20,17 +21,14 @@ services:
dockerfile: Dockerfile
ports:
- '3000:3000'
restart: unless-stopped
env_file:
- .env
environment:
- DATABASE_URL=postgres://postgres:postgres@postgres/postgres2
- CORE_HOSTNAME=0.0.0.0
depends_on:
- postgres
- .env.local
volumes:
- './uploads:/zipline/uploads'
- './public:/zipline/public'
- './themes:/zipline/themes'
- '$PWD/uploads:/zipline/uploads'
- '$PWD/public:/zipline/public'
depends_on:
- 'postgres'
volumes:
pgdata:
pg_data:
+21 -26
View File
@@ -1,42 +1,37 @@
version: '3'
services:
postgresql:
image: postgres:16
restart: unless-stopped
env_file:
- .env
postgres:
image: postgres
restart: always
environment:
POSTGRES_USER: ${POSTGRESQL_USER:-zipline}
POSTGRES_PASSWORD: ${POSTGRESQL_PASSWORD:?POSTGRESQL_PASSWORD is required}
POSTGRES_DB: ${POSTGRESQL_DB:-zipline}
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DATABASE=postgres
volumes:
- pgdata:/var/lib/postgresql/data
- pg_data:/var/lib/postgresql/data
healthcheck:
test: ['CMD', 'pg_isready', '-U', 'zipline']
test: ['CMD-SHELL', 'pg_isready -U postgres']
interval: 10s
timeout: 5s
retries: 5
zipline:
image: ghcr.io/diced/zipline:latest
restart: unless-stopped
image: ghcr.io/diced/zipline
ports:
- '3000:3000'
env_file:
- .env
restart: always
environment:
- DATABASE_URL=postgres://${POSTGRESQL_USER:-zipline}:${POSTGRESQL_PASSWORD}@postgresql:5432/${POSTGRESQL_DB:-zipline}
depends_on:
postgresql:
condition: service_healthy
- CORE_HTTPS=false
- CORE_SECRET=changethis
- CORE_HOST=0.0.0.0
- CORE_PORT=3000
- CORE_DATABASE_URL=postgres://postgres:postgres@postgres/postgres
- CORE_LOGGER=true
volumes:
- './uploads:/zipline/uploads'
- './public:/zipline/public'
- './themes:/zipline/themes'
healthcheck:
test: ['CMD', 'wget', '-q', '--spider', 'http://0.0.0.0:3000/api/healthcheck']
interval: 15s
timeout: 2s
retries: 2
- '$PWD/public:/zipline/public'
depends_on:
- 'postgres'
volumes:
pgdata:
pg_data:
-5
View File
@@ -1,5 +0,0 @@
#!/usr/bin/env sh
set -e
cd ${ZIPLINE_ROOT:-/zipline}
exec node --enable-source-maps build/server
-6
View File
@@ -1,6 +0,0 @@
#!/usr/bin/env sh
set -e
cd ${ZIPLINE_ROOT:-/zipline}
exec node --enable-source-maps build/ctl "$@"
+23
View File
@@ -0,0 +1,23 @@
const esbuild = require('esbuild');
const { existsSync } = require('fs');
const { rm } = require('fs/promises');
const { recursiveReadDir } = require('next/dist/lib/recursive-readdir');
(async () => {
if (existsSync('./dist')) {
await rm('./dist', { recursive: true });
}
const entryPoints = await recursiveReadDir('./src', /.*\.(ts)$/, /(themes|queries|pages)/);
await esbuild.build({
tsconfig: 'tsconfig.json',
outdir: 'dist',
platform: 'node',
entryPoints,
format: 'cjs',
resolveExtensions: ['.ts', '.js'],
write: true,
sourcemap: true,
});
})();
-107
View File
@@ -1,107 +0,0 @@
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import fs from 'node:fs';
import tseslint from 'typescript-eslint';
import reactPlugin from 'eslint-plugin-react';
import reactHooksPlugin from 'eslint-plugin-react-hooks';
import reactRefreshPlugin from 'eslint-plugin-react-refresh';
import jsxA11yPlugin from 'eslint-plugin-jsx-a11y';
import prettier from 'eslint-plugin-prettier';
import prettierConfig from 'eslint-config-prettier';
import unusedImports from 'eslint-plugin-unused-imports';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const gitignorePath = path.resolve(__dirname, '.gitignore');
const gitignoreContent = fs.readFileSync(gitignorePath, 'utf8');
const gitignorePatterns = gitignoreContent
.split('\n')
.filter((line) => line.trim() && !line.startsWith('#'))
.map((pattern) => pattern.trim());
import { defineConfig } from 'eslint/config';
export default defineConfig(
tseslint.configs.recommended,
jsxA11yPlugin.flatConfigs.recommended,
reactPlugin.configs.flat.recommended,
reactHooksPlugin.configs.flat.recommended,
reactRefreshPlugin.configs.vite,
{ ignores: gitignorePatterns },
{
files: ['**/*.{js,mjs,cjs,ts,tsx}'],
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
parserOptions: {
ecmaFeatures: { jsx: true },
},
},
plugins: {
react: reactPlugin,
'react-hooks': reactHooksPlugin,
prettier,
'unused-imports': unusedImports,
},
rules: {
...prettierConfig.rules,
'prettier/prettier': ['error', {}, { fileInfoOptions: { withNodeModules: false } }],
'linebreak-style': ['error', 'unix'],
quotes: ['error', 'single', { avoidEscape: true }],
semi: ['error', 'always'],
'jsx-quotes': ['error', 'prefer-single'],
indent: 'off',
'react/prop-types': 'off',
'react-hooks/rules-of-hooks': 'off',
'react-hooks/exhaustive-deps': 'off',
'react-hooks/set-state-in-effect': 'warn',
'react-refresh/only-export-components': 'off',
'react/jsx-uses-react': 'warn',
'react/jsx-uses-vars': 'warn',
'react/no-danger-with-children': 'warn',
'react/no-deprecated': 'warn',
'react/no-direct-mutation-state': 'warn',
'react/no-is-mounted': 'warn',
'react/no-typos': 'error',
'react/react-in-jsx-scope': 'off',
'react/require-render-return': 'error',
'react/style-prop-object': 'warn',
'react/display-name': 'off',
'jsx-a11y/alt-text': 'off',
'jsx-a11y/no-autofocus': 'off',
'jsx-a11y/click-events-have-key-events': 'off',
'jsx-a11y/no-static-element-interactions': 'off',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'unused-imports/no-unused-imports': 'error',
'unused-imports/no-unused-vars': [
'warn',
{ vars: 'all', varsIgnorePattern: '^_', args: 'after-used', argsIgnorePattern: '^_' },
],
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-expressions': 'off',
},
settings: {
react: { version: 'detect' },
},
},
);
Generated
-254
View File
@@ -1,254 +0,0 @@
{
"nodes": {
"cachix": {
"inputs": {
"devenv": [
"devenv"
],
"flake-compat": [
"devenv"
],
"git-hooks": [
"devenv",
"git-hooks"
],
"nixpkgs": [
"devenv",
"nixpkgs"
]
},
"locked": {
"lastModified": 1748883665,
"narHash": "sha256-R0W7uAg+BLoHjMRMQ8+oiSbTq8nkGz5RDpQ+ZfxxP3A=",
"owner": "cachix",
"repo": "cachix",
"rev": "f707778d902af4d62d8dd92c269f8e70de09acbe",
"type": "github"
},
"original": {
"owner": "cachix",
"ref": "latest",
"repo": "cachix",
"type": "github"
}
},
"devenv": {
"inputs": {
"cachix": "cachix",
"flake-compat": "flake-compat",
"git-hooks": "git-hooks",
"nix": "nix",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1753888869,
"narHash": "sha256-VRYrrUmvXnBzfzuJVoI3os1H/0l8cJQ2KnrrxWkTB3E=",
"owner": "cachix",
"repo": "devenv",
"rev": "bdf26a4453eff6bae835f33d519a36f77e0ca257",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "devenv",
"type": "github"
}
},
"devenv-root": {
"flake": false,
"locked": {
"narHash": "sha256-d6xi4mKdjkX2JFicDIv5niSzpyI0m/Hnm8GGAIU04kY=",
"type": "file",
"url": "file:///dev/null"
},
"original": {
"type": "file",
"url": "file:///dev/null"
}
},
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1747046372,
"narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-parts": {
"inputs": {
"nixpkgs-lib": [
"devenv",
"nix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1733312601,
"narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-parts_2": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1753121425,
"narHash": "sha256-TVcTNvOeWWk1DXljFxVRp+E0tzG1LhrVjOGGoMHuXio=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "644e0fc48951a860279da645ba77fe4a6e814c5e",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"git-hooks": {
"inputs": {
"flake-compat": [
"devenv",
"flake-compat"
],
"gitignore": "gitignore",
"nixpkgs": [
"devenv",
"nixpkgs"
]
},
"locked": {
"lastModified": 1750779888,
"narHash": "sha256-wibppH3g/E2lxU43ZQHC5yA/7kIKLGxVEnsnVK1BtRg=",
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "16ec914f6fb6f599ce988427d9d94efddf25fe6d",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "git-hooks.nix",
"type": "github"
}
},
"gitignore": {
"inputs": {
"nixpkgs": [
"devenv",
"git-hooks",
"nixpkgs"
]
},
"locked": {
"lastModified": 1709087332,
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"nix": {
"inputs": {
"flake-compat": [
"devenv",
"flake-compat"
],
"flake-parts": "flake-parts",
"git-hooks-nix": [
"devenv",
"git-hooks"
],
"nixpkgs": [
"devenv",
"nixpkgs"
],
"nixpkgs-23-11": [
"devenv"
],
"nixpkgs-regression": [
"devenv"
]
},
"locked": {
"lastModified": 1752773918,
"narHash": "sha256-dOi/M6yNeuJlj88exI+7k154z+hAhFcuB8tZktiW7rg=",
"owner": "cachix",
"repo": "nix",
"rev": "031c3cf42d2e9391eee373507d8c12e0f9606779",
"type": "github"
},
"original": {
"owner": "cachix",
"ref": "devenv-2.30",
"repo": "nix",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1752827260,
"narHash": "sha256-noFjJbm/uWRcd2Lotr7ovedfhKVZT+LeJs9rU416lKQ=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "b527e89270879aaaf584c41f26b2796be634bc9d",
"type": "github"
},
"original": {
"owner": "nixos",
"repo": "nixpkgs",
"rev": "b527e89270879aaaf584c41f26b2796be634bc9d",
"type": "github"
}
},
"nixpkgs-lib": {
"locked": {
"lastModified": 1751159883,
"narHash": "sha256-urW/Ylk9FIfvXfliA1ywh75yszAbiTEVgpPeinFyVZo=",
"owner": "nix-community",
"repo": "nixpkgs.lib",
"rev": "14a40a1d7fb9afa4739275ac642ed7301a9ba1ab",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixpkgs.lib",
"type": "github"
}
},
"root": {
"inputs": {
"devenv": "devenv",
"devenv-root": "devenv-root",
"flake-parts": "flake-parts_2",
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}
-128
View File
@@ -1,128 +0,0 @@
{
inputs = {
# required for some reason when entering the shell for devenv
devenv-root = {
url = "file+file:///dev/null";
flake = false;
};
# node 24.4.1, postgres 17
nixpkgs.url = "github:nixos/nixpkgs/b527e89270879aaaf584c41f26b2796be634bc9d";
flake-parts.url = "github:hercules-ci/flake-parts";
devenv.url = "github:cachix/devenv";
devenv.inputs.nixpkgs.follows = "nixpkgs";
};
nixConfig = {
extra-trusted-public-keys = "devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw=";
extra-substituters = "https://devenv.cachix.org";
};
outputs =
inputs@{ flake-parts, devenv-root, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
imports = [
inputs.devenv.flakeModule
];
systems = [
"x86_64-linux"
"x86_64-darwin"
"aarch64-linux"
"aarch64-darwin"
];
perSystem =
{
config,
self',
inputs',
pkgs,
system,
...
}:
let
psqlConfig = {
username = "postgres";
password = "postgres";
database = "zipline";
};
in
{
devenv.shells.default = {
packages = with pkgs; [
git
# to generate thumbnails
ffmpeg
# for testing docker
colima
docker
docker-compose
];
scripts = {
pgup.exec = ''
process-compose up postgres -D
'';
minioup.exec = ''
process-compose up minio -D
'';
downall.exec = ''
process-compose down
'';
# ensure that volumes are mounted with write access for docker containers
start_colima.exec = ''
colima start --mount $PWD/themes:w --mount $PWD/uploads:w --mount $PWD/public:w
'';
};
enterShell = ''
export name="zipline-env";
echo -e "\n[$name]: run 'pgup' to start services, 'pgdown' to stop services";
'';
languages.javascript = {
enable = true;
package = pkgs.nodejs_24;
corepack.enable = true;
};
services = {
postgres = {
enable = true;
package = pkgs.postgresql_17;
initialScript = ''
CREATE ROLE "${psqlConfig.username}" WITH LOGIN PASSWORD '${psqlConfig.password}' SUPERUSER;
'';
initialDatabases = [
{
name = psqlConfig.database;
user = psqlConfig.username;
}
];
listen_addresses = "0.0.0.0";
port = 5432;
};
minio = {
enable = true;
};
};
process.managers.process-compose = {
tui.enable = false;
};
};
};
};
}
-1
View File
@@ -122,7 +122,6 @@
["calx", ["application/vnd.ms-office.calx"]],
["cap", ["application/vnd.tcpdump.pcap"]],
["car", ["application/vnd.curl.car"]],
["cast", ["application/x-asciicast"]],
["cat", ["application/vnd.ms-pki.seccat"]],
["cb7", ["application/x-cbr"]],
["cba", ["application/x-cbr"]],
+5
View File
@@ -0,0 +1,5 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
+26
View File
@@ -0,0 +1,26 @@
/**
* @type {import('next').NextConfig}
**/
module.exports = {
async redirects() {
return [
{
source: '/',
destination: '/dashboard',
permanent: true,
},
];
},
images: {
domains: [
// For sharex icon in manage user
'getsharex.com',
// For flameshot icon, and maybe in the future other stuff from github
'raw.githubusercontent.com',
// Google Icon
'madeby.google.com',
],
},
poweredByHeader: false,
reactStrictMode: true,
};
+80 -118
View File
@@ -1,130 +1,92 @@
{
"name": "zipline",
"private": true,
"version": "3.6.2",
"license": "MIT",
"version": "4.4.2",
"scripts": {
"build": "tsx scripts/build.ts",
"dev": "cross-env NODE_ENV=development DEBUG=zipline tsx --require dotenv/config --enable-source-maps ./src/server",
"dev:nd": "cross-env NODE_ENV=development tsx --require dotenv/config --enable-source-maps ./src/server",
"dev:inspector": "cross-env NODE_ENV=development DEBUG=zipline tsx --require dotenv/config --inspect=0.0.0.0:9229 --enable-source-maps ./src/server",
"start": "cross-env NODE_ENV=production node --trace-warnings --require dotenv/config ./build/server",
"start:inspector": "cross-env NODE_ENV=production node --require dotenv/config --inspect=0.0.0.0:9229 --enable-source-maps ./build/server",
"ctl": "NODE_ENV=production node --require dotenv/config --enable-source-maps ./build/ctl",
"validate": "tsx scripts/validate.ts",
"openapi": "tsx scripts/openapi.ts",
"db:prototype": "prisma db push --skip-generate && prisma generate --no-hints",
"db:migrate": "prisma migrate dev --create-only",
"docker:engine": "colima start --mount $PWD/themes:w --mount $PWD/uploads:w --mount $PWD/public:w",
"docker:compose:dev:build": "docker compose --file docker-compose.dev.yml build --build-arg ZIPLINE_GIT_SHA=$(git rev-parse HEAD)",
"docker:compose:dev:up": "docker compose --file docker-compose.dev.yml up -d",
"docker:compose:dev:down": "docker compose --file docker-compose.dev.yml down",
"docker:compose:dev:logs": "docker compose --file docker-compose.dev.yml logs -f"
"dev": "npm-run-all build:server dev:run",
"dev:run": "cross-env DEBUG=true REACT_EDITOR=code NODE_ENV=development RECOIL_DUPLICATE_ATOM_KEY_CHECKING_ENABLED=false node --enable-source-maps dist/server",
"build": "npm-run-all build:server build:schema build:next",
"build-ci": "cross-env ZIPLINE_DOCKER_BUILD=1 npm-run-all build:server build:schema build:next",
"build:server": "node esbuild.config.js",
"build:next": "next build",
"build:schema": "prisma generate --schema=prisma/schema.prisma",
"format": "prettier --write ./src/**/*.{ts,tsx} ./*.{md,js,json,yml}",
"migrate:dev": "prisma migrate dev --create-only",
"start": "node dist/server",
"lint": "next lint",
"docker:run": "docker-compose up -d",
"docker:down": "docker-compose down",
"docker:build-dev": "docker-compose --file docker-compose.dev.yml up --build",
"scripts:read-config": "node dist/scripts/read-config",
"scripts:import-dir": "node dist/scripts/import-dir",
"scripts:list-users": "node dist/scripts/list-users",
"scripts:set-user": "node dist/scripts/set-user"
},
"dependencies": {
"@aws-sdk/client-s3": "3.726.1",
"@aws-sdk/lib-storage": "3.726.1",
"@dnd-kit/core": "^6.3.1",
"@dnd-kit/sortable": "^10.0.0",
"@dnd-kit/utilities": "^3.2.2",
"@fastify/cookie": "^11.0.2",
"@fastify/cors": "^11.1.0",
"@fastify/multipart": "^9.3.0",
"@fastify/rate-limit": "^10.3.0",
"@fastify/sensible": "^6.0.4",
"@fastify/static": "^8.3.0",
"@fastify/swagger": "^9.6.1",
"@mantine/charts": "^8.3.9",
"@mantine/code-highlight": "^8.3.9",
"@mantine/core": "^8.3.9",
"@mantine/dates": "^8.3.9",
"@mantine/dropzone": "^8.3.9",
"@mantine/form": "^8.3.9",
"@mantine/hooks": "^8.3.9",
"@mantine/modals": "^8.3.9",
"@mantine/notifications": "^8.3.9",
"@prisma/adapter-pg": "6.13.0",
"@prisma/client": "6.13.0",
"@prisma/engines": "6.13.0",
"@prisma/internals": "6.13.0",
"@prisma/migrate": "6.13.0",
"@simplewebauthn/browser": "^13.2.2",
"@simplewebauthn/server": "^13.2.2",
"@smithy/node-http-handler": "^4.1.1",
"@tabler/icons-react": "^3.35.0",
"archiver": "^7.0.1",
"argon2": "^0.44.0",
"asciinema-player": "^3.12.1",
"bytes": "^3.1.2",
"clsx": "^2.1.1",
"colorette": "^2.0.20",
"commander": "^14.0.2",
"cookie": "^1.1.1",
"cross-env": "^10.1.0",
"dayjs": "^1.11.19",
"detect-browser": "^5.3.0",
"dotenv": "^17.2.3",
"fast-glob": "^3.3.3",
"fastify": "^5.6.2",
"fastify-plugin": "^5.1.0",
"fastify-type-provider-zod": "^6.1.0",
"fluent-ffmpeg": "^2.1.3",
"highlight.js": "^11.11.1",
"iron-session": "^8.0.4",
"isomorphic-dompurify": "^2.33.0",
"katex": "^0.16.27",
"mantine-datatable": "^8.3.9",
"ms": "^2.1.3",
"multer": "2.0.2",
"@dicedtomato/mantine-data-grid": "0.0.23",
"@emotion/react": "^11.10.5",
"@emotion/server": "^11.10.0",
"@mantine/core": "^5.6.3",
"@mantine/dropzone": "^5.6.3",
"@mantine/form": "^5.6.3",
"@mantine/hooks": "^5.6.3",
"@mantine/modals": "^5.6.3",
"@mantine/next": "^5.6.3",
"@mantine/notifications": "^5.6.3",
"@mantine/nprogress": "^5.6.3",
"@mantine/prism": "^5.6.3",
"@prisma/client": "^4.5.0",
"@prisma/internals": "^4.5.0",
"@prisma/migrate": "^4.5.0",
"@sapphire/shapeshift": "^3.7.0",
"@tanstack/react-query": "^4.13.0",
"argon2": "^0.30.1",
"chart.js": "^3.9.1",
"chartjs-plugin-datalabels": "^2.1.0",
"color-hash": "^2.0.1",
"colorette": "^2.0.19",
"cookie": "^0.5.0",
"dayjs": "^1.11.6",
"dotenv": "^16.0.3",
"dotenv-expand": "^9.0.0",
"exiftool-vendored": "^18.6.0",
"fflate": "^0.7.4",
"find-my-way": "^7.3.1",
"minio": "^7.0.32",
"ms": "canary",
"multer": "^1.4.5-lts.1",
"next": "^13.0.0",
"otplib": "^12.0.1",
"prisma": "6.13.0",
"qrcode": "^1.5.4",
"react": "^19.2.1",
"react-dom": "^19.2.1",
"react-markdown": "^10.1.0",
"react-router-dom": "^7.10.1",
"react-window": "1.8.11",
"remark-gfm": "^4.0.1",
"sharp": "^0.34.5",
"swr": "^2.3.7",
"typescript-eslint": "^8.48.1",
"vite": "^7.2.7",
"zod": "^4.1.13",
"zustand": "^5.0.9"
"prisma": "^4.5.0",
"qrcode": "^1.5.1",
"react": "^18.2.0",
"react-chartjs-2": "^4.3.1",
"react-dom": "^18.2.0",
"react-feather": "^2.0.10",
"recoil": "^0.7.6",
"sharp": "^0.31.1"
},
"devDependencies": {
"@types/archiver": "^7.0.0",
"@types/bytes": "^3.1.5",
"@types/fluent-ffmpeg": "^2.1.28",
"@types/katex": "^0.16.7",
"@types/ms": "^2.1.0",
"@types/multer": "^2.0.0",
"@types/node": "^24.10.1",
"@types/qrcode": "^1.5.6",
"@types/react": "^19.2.7",
"@types/react-dom": "^19.2.3",
"@types/react-window": "^1.8.8",
"@vitejs/plugin-react": "^5.1.1",
"eslint": "^9.39.1",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-jsx-a11y": "^6.10.2",
"eslint-plugin-prettier": "^5.5.4",
"eslint-plugin-react": "^7.37.5",
"eslint-plugin-react-hooks": "^7.0.1",
"eslint-plugin-react-refresh": "^0.4.24",
"eslint-plugin-unused-imports": "^4.3.0",
"postcss": "^8.5.6",
"postcss-preset-mantine": "^1.18.0",
"postcss-simple-vars": "^7.0.1",
"prettier": "^3.7.4",
"sass": "^1.94.2",
"tsc-alias": "^1.8.16",
"tsup": "^8.5.1",
"tsx": "^4.21.0",
"typescript": "^5.9.3"
"@types/cookie": "^0.5.1",
"@types/minio": "^7.0.14",
"@types/multer": "^1.4.7",
"@types/node": "^18.11.7",
"@types/qrcode": "^1.5.0",
"@types/react": "^18.0.24",
"@types/sharp": "^0.31.0",
"cross-env": "^7.0.3",
"esbuild": "^0.15.12",
"eslint": "^8.26.0",
"eslint-config-next": "^13.0.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.2.1",
"npm-run-all": "^4.1.5",
"prettier": "^2.7.1",
"typescript": "^4.8.4"
},
"engines": {
"node": ">=22"
"repository": {
"type": "git",
"url": "https://github.com/diced/zipline.git"
},
"packageManager": "pnpm@10.30.1+sha512.3590e550d5384caa39bd5c7c739f72270234b2f6059e13018f975c313b1eb9fefcc09714048765d4d9efe961382c312e624572c0420762bdc5d5940cdf9be73a"
"packageManager": "yarn@3.2.4"
}
-11198
View File
File diff suppressed because it is too large Load Diff
-10
View File
@@ -1,10 +0,0 @@
ignoredBuiltDependencies:
- unrs-resolver
onlyBuiltDependencies:
- '@parcel/watcher'
- '@prisma/client'
- '@prisma/engines'
- argon2
- esbuild
- prisma
- sharp
-14
View File
@@ -1,14 +0,0 @@
module.exports = {
plugins: {
'postcss-preset-mantine': {},
'postcss-simple-vars': {
variables: {
'mantine-breakpoint-xs': '36em',
'mantine-breakpoint-sm': '48em',
'mantine-breakpoint-md': '62em',
'mantine-breakpoint-lg': '75em',
'mantine-breakpoint-xl': '88em',
},
},
},
};
-6
View File
@@ -1,6 +0,0 @@
/** @type {import('prettier').Config} */
module.exports = {
singleQuote: true,
jsxSingleQuote: true,
printWidth: 110,
};
@@ -0,0 +1,71 @@
-- CreateTable
CREATE TABLE "User" (
"id" SERIAL NOT NULL,
"username" TEXT NOT NULL,
"password" TEXT NOT NULL,
"token" TEXT NOT NULL,
"administrator" BOOLEAN NOT NULL DEFAULT false,
"embedTitle" TEXT,
"embedColor" TEXT NOT NULL DEFAULT E'#2f3136',
PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "Image" (
"id" SERIAL NOT NULL,
"file" TEXT NOT NULL,
"mimetype" TEXT NOT NULL DEFAULT E'image/png',
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"views" INTEGER NOT NULL DEFAULT 0,
"userId" INTEGER NOT NULL,
PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "InvisibleImage" (
"id" INTEGER NOT NULL,
"invis" TEXT NOT NULL
);
-- CreateTable
CREATE TABLE "Url" (
"id" SERIAL NOT NULL,
"to" TEXT NOT NULL,
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"views" INTEGER NOT NULL DEFAULT 0,
"userId" INTEGER NOT NULL,
PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "InvisibleUrl" (
"id" INTEGER NOT NULL,
"invis" TEXT NOT NULL
);
-- CreateIndex
CREATE UNIQUE INDEX "InvisibleImage.invis_unique" ON "InvisibleImage"("invis");
-- CreateIndex
CREATE UNIQUE INDEX "InvisibleImage_id_unique" ON "InvisibleImage"("id");
-- CreateIndex
CREATE UNIQUE INDEX "InvisibleUrl.invis_unique" ON "InvisibleUrl"("invis");
-- CreateIndex
CREATE UNIQUE INDEX "InvisibleUrl_id_unique" ON "InvisibleUrl"("id");
-- AddForeignKey
ALTER TABLE "Image" ADD FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "InvisibleImage" ADD FOREIGN KEY ("id") REFERENCES "Image"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "Url" ADD FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "InvisibleUrl" ADD FOREIGN KEY ("id") REFERENCES "Url"("id") ON DELETE CASCADE ON UPDATE CASCADE;
@@ -0,0 +1,25 @@
-- AlterTable
ALTER TABLE "User" ADD COLUMN "systemTheme" TEXT NOT NULL DEFAULT E'dark_blue';
-- CreateTable
CREATE TABLE "Theme" (
"id" SERIAL NOT NULL,
"type" TEXT NOT NULL,
"primary" TEXT NOT NULL,
"secondary" TEXT NOT NULL,
"error" TEXT NOT NULL,
"warning" TEXT NOT NULL,
"info" TEXT NOT NULL,
"border" TEXT NOT NULL,
"mainBackground" TEXT NOT NULL,
"paperBackground" TEXT NOT NULL,
"userId" INTEGER NOT NULL,
PRIMARY KEY ("id")
);
-- CreateIndex
CREATE UNIQUE INDEX "Theme_userId_unique" ON "Theme"("userId");
-- AddForeignKey
ALTER TABLE "Theme" ADD FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "Image" ADD COLUMN "favorite" BOOLEAN NOT NULL DEFAULT false;
@@ -0,0 +1,25 @@
/*
Warnings:
- A unique constraint covering the columns `[imageId]` on the table `InvisibleImage` will be added. If there are existing duplicate values, this will fail.
- Added the required column `imageId` to the `InvisibleImage` table without a default value. This is not possible if the table is not empty.
*/
-- DropForeignKey
ALTER TABLE "InvisibleImage" DROP CONSTRAINT "InvisibleImage_id_fkey";
-- DropIndex
DROP INDEX "InvisibleImage_id_unique";
-- AlterTable
CREATE SEQUENCE "invisibleimage_id_seq";
ALTER TABLE "InvisibleImage" ADD COLUMN "imageId" INTEGER NOT NULL,
ALTER COLUMN "id" SET DEFAULT nextval('invisibleimage_id_seq'),
ADD PRIMARY KEY ("id");
ALTER SEQUENCE "invisibleimage_id_seq" OWNED BY "InvisibleImage"."id";
-- CreateIndex
CREATE UNIQUE INDEX "InvisibleImage_imageId_unique" ON "InvisibleImage"("imageId");
-- AddForeignKey
ALTER TABLE "InvisibleImage" ADD FOREIGN KEY ("imageId") REFERENCES "Image"("id") ON DELETE CASCADE ON UPDATE CASCADE;
@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "Image" ADD COLUMN "embed" BOOLEAN NOT NULL DEFAULT false;
@@ -0,0 +1,39 @@
/*
Warnings:
- You are about to drop the `InvisibleUrl` table. If the table is not empty, all the data it contains will be lost.
- You are about to drop the `Url` table. If the table is not empty, all the data it contains will be lost.
*/
-- DropForeignKey
ALTER TABLE "Image" DROP CONSTRAINT "Image_userId_fkey";
-- DropForeignKey
ALTER TABLE "InvisibleImage" DROP CONSTRAINT "InvisibleImage_imageId_fkey";
-- DropForeignKey
ALTER TABLE "InvisibleUrl" DROP CONSTRAINT "InvisibleUrl_id_fkey";
-- DropForeignKey
ALTER TABLE "Theme" DROP CONSTRAINT "Theme_userId_fkey";
-- DropForeignKey
ALTER TABLE "Url" DROP CONSTRAINT "Url_userId_fkey";
-- DropTable
DROP TABLE "InvisibleUrl";
-- DropTable
DROP TABLE "Url";
-- AddForeignKey
ALTER TABLE "Theme" ADD CONSTRAINT "Theme_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "Image" ADD CONSTRAINT "Image_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "InvisibleImage" ADD CONSTRAINT "InvisibleImage_imageId_fkey" FOREIGN KEY ("imageId") REFERENCES "Image"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
-- RenameIndex
ALTER INDEX "InvisibleImage.invis_unique" RENAME TO "InvisibleImage_invis_key";
@@ -0,0 +1,34 @@
-- CreateTable
CREATE TABLE "Url" (
"id" TEXT NOT NULL,
"destination" TEXT NOT NULL,
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"views" INTEGER NOT NULL DEFAULT 0,
"userId" INTEGER NOT NULL,
CONSTRAINT "Url_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "InvisibleUrl" (
"id" SERIAL NOT NULL,
"invis" TEXT NOT NULL,
"urlId" TEXT NOT NULL,
CONSTRAINT "InvisibleUrl_pkey" PRIMARY KEY ("id")
);
-- CreateIndex
CREATE UNIQUE INDEX "Url_id_key" ON "Url"("id");
-- CreateIndex
CREATE UNIQUE INDEX "InvisibleUrl_invis_key" ON "InvisibleUrl"("invis");
-- CreateIndex
CREATE UNIQUE INDEX "InvisibleUrl_urlId_unique" ON "InvisibleUrl"("urlId");
-- AddForeignKey
ALTER TABLE "Url" ADD CONSTRAINT "Url_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "InvisibleUrl" ADD CONSTRAINT "InvisibleUrl_urlId_fkey" FOREIGN KEY ("urlId") REFERENCES "Url"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "Url" ADD COLUMN "vanity" TEXT;
@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "User" ADD COLUMN "embedSiteName" TEXT DEFAULT E'{image.file} • {user.name}';
@@ -0,0 +1,11 @@
-- AlterTable
ALTER TABLE "User" ADD COLUMN "ratelimited" BOOLEAN NOT NULL DEFAULT false;
-- RenameIndex
ALTER INDEX "InvisibleImage_imageId_unique" RENAME TO "InvisibleImage_imageId_key";
-- RenameIndex
ALTER INDEX "InvisibleUrl_urlId_unique" RENAME TO "InvisibleUrl_urlId_key";
-- RenameIndex
ALTER INDEX "Theme_userId_unique" RENAME TO "Theme_userId_key";
@@ -0,0 +1,8 @@
-- CreateTable
CREATE TABLE "Stats" (
"id" SERIAL NOT NULL,
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"data" JSONB NOT NULL,
CONSTRAINT "Stats_pkey" PRIMARY KEY ("id")
);
@@ -0,0 +1,5 @@
-- CreateEnum
CREATE TYPE "ImageFormat" AS ENUM ('UUID', 'DATE', 'RANDOM');
-- AlterTable
ALTER TABLE "Image" ADD COLUMN "format" "ImageFormat" NOT NULL DEFAULT E'RANDOM';
@@ -0,0 +1,2 @@
-- AlterEnum
ALTER TYPE "ImageFormat" ADD VALUE 'NAME';
@@ -0,0 +1,12 @@
/*
Warnings:
- You are about to drop the `Theme` table. If the table is not empty, all the data it contains will be lost.
*/
-- DropForeignKey
ALTER TABLE "Theme" DROP CONSTRAINT "Theme_userId_fkey";
-- AlterTable
ALTER TABLE "User" ALTER COLUMN "systemTheme" SET DEFAULT E'system';
-- DropTable
DROP TABLE "Theme";
@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "User" ADD COLUMN "domains" TEXT[];
@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "Image" ADD COLUMN "password" TEXT;
@@ -0,0 +1,9 @@
/*
Warnings:
- You are about to drop the column `ratelimited` on the `User` table. All the data in the column will be lost.
*/
-- AlterTable
ALTER TABLE "User" DROP COLUMN "ratelimited",
ADD COLUMN "ratelimit" TIMESTAMP(3);
@@ -0,0 +1,17 @@
-- CreateTable
CREATE TABLE "Invite" (
"id" SERIAL NOT NULL,
"code" TEXT NOT NULL,
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"expires_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"used" BOOLEAN NOT NULL DEFAULT false,
"createdById" INTEGER NOT NULL,
CONSTRAINT "Invite_pkey" PRIMARY KEY ("id")
);
-- CreateIndex
CREATE UNIQUE INDEX "Invite_code_key" ON "Invite"("code");
-- AddForeignKey
ALTER TABLE "Invite" ADD CONSTRAINT "Invite_createdById_fkey" FOREIGN KEY ("createdById") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
@@ -0,0 +1,3 @@
-- AlterTable
ALTER TABLE "Invite" ALTER COLUMN "expires_at" DROP NOT NULL,
ALTER COLUMN "expires_at" DROP DEFAULT;
@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "Image" ADD COLUMN "expires_at" TIMESTAMP(3);
@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "User" ADD COLUMN "avatar" TEXT;
@@ -0,0 +1,4 @@
-- AlterTable
ALTER TABLE "User" ADD COLUMN "oauth" BOOLEAN NOT NULL DEFAULT false,
ADD COLUMN "oauthProvider" TEXT,
ALTER COLUMN "password" DROP NOT NULL;
@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "User" ADD COLUMN "oauthAccessToken" TEXT;
@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "User" ADD COLUMN "superAdmin" BOOLEAN NOT NULL DEFAULT false;
@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "Image" ADD COLUMN "maxViews" INTEGER;
@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "Url" ADD COLUMN "maxViews" INTEGER;
@@ -0,0 +1,31 @@
/*
Warnings:
- You are about to drop the column `oauth` on the `User` table. All the data in the column will be lost.
- You are about to drop the column `oauthAccessToken` on the `User` table. All the data in the column will be lost.
- You are about to drop the column `oauthProvider` on the `User` table. All the data in the column will be lost.
*/
-- CreateEnum
CREATE TYPE "OauthProviders" AS ENUM ('DISCORD', 'GITHUB');
-- AlterTable
ALTER TABLE "User" DROP COLUMN "oauth",
DROP COLUMN "oauthAccessToken",
DROP COLUMN "oauthProvider";
-- CreateTable
CREATE TABLE "OAuth" (
"id" SERIAL NOT NULL,
"provider" "OauthProviders" NOT NULL,
"userId" INTEGER NOT NULL,
"token" TEXT NOT NULL,
CONSTRAINT "OAuth_pkey" PRIMARY KEY ("id")
);
-- CreateIndex
CREATE UNIQUE INDEX "OAuth_provider_key" ON "OAuth"("provider");
-- AddForeignKey
ALTER TABLE "OAuth" ADD CONSTRAINT "OAuth_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
@@ -0,0 +1,5 @@
-- DropIndex
DROP INDEX "OAuth_provider_key";
-- AlterTable
ALTER TABLE "OAuth" ADD COLUMN "refresh" TEXT;
@@ -0,0 +1,8 @@
-- DropForeignKey
ALTER TABLE "Image" DROP CONSTRAINT "Image_userId_fkey";
-- AlterTable
ALTER TABLE "Image" ALTER COLUMN "userId" DROP NOT NULL;
-- AddForeignKey
ALTER TABLE "Image" ADD CONSTRAINT "Image_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE SET NULL ON UPDATE CASCADE;
@@ -0,0 +1,2 @@
-- AlterEnum
ALTER TYPE "OauthProviders" ADD VALUE 'GOOGLE';
@@ -0,0 +1,8 @@
/*
Warnings:
- Added the required column `username` to the `OAuth` table without a default value. This is not possible if the table is not empty.
*/
-- AlterTable
ALTER TABLE "OAuth" ADD COLUMN "username" TEXT NOT NULL;
@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "User" ADD COLUMN "totpSecret" TEXT;
@@ -0,0 +1,26 @@
-- DropForeignKey
ALTER TABLE "InvisibleImage" DROP CONSTRAINT "InvisibleImage_imageId_fkey";
-- DropForeignKey
ALTER TABLE "InvisibleUrl" DROP CONSTRAINT "InvisibleUrl_urlId_fkey";
-- DropForeignKey
ALTER TABLE "Invite" DROP CONSTRAINT "Invite_createdById_fkey";
-- DropForeignKey
ALTER TABLE "Url" DROP CONSTRAINT "Url_userId_fkey";
-- AlterTable
ALTER TABLE "Url" ALTER COLUMN "userId" DROP NOT NULL;
-- AddForeignKey
ALTER TABLE "InvisibleImage" ADD CONSTRAINT "InvisibleImage_imageId_fkey" FOREIGN KEY ("imageId") REFERENCES "Image"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "Url" ADD CONSTRAINT "Url_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE SET NULL ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "InvisibleUrl" ADD CONSTRAINT "InvisibleUrl_urlId_fkey" FOREIGN KEY ("urlId") REFERENCES "Url"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "Invite" ADD CONSTRAINT "Invite_createdById_fkey" FOREIGN KEY ("createdById") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
@@ -1,370 +0,0 @@
-- CreateEnum
CREATE TYPE "UserFilesQuota" AS ENUM ('BY_BYTES', 'BY_FILES');
-- CreateEnum
CREATE TYPE "Role" AS ENUM ('USER', 'ADMIN', 'SUPERADMIN');
-- CreateEnum
CREATE TYPE "OAuthProviderType" AS ENUM ('DISCORD', 'GOOGLE', 'GITHUB', 'OIDC');
-- CreateEnum
CREATE TYPE "IncompleteFileStatus" AS ENUM ('PENDING', 'PROCESSING', 'COMPLETE', 'FAILED');
-- CreateTable
CREATE TABLE "Zipline" (
"id" TEXT NOT NULL,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,
"firstSetup" BOOLEAN NOT NULL DEFAULT true,
"coreReturnHttpsUrls" BOOLEAN NOT NULL DEFAULT false,
"coreDefaultDomain" TEXT,
"coreTempDirectory" TEXT NOT NULL,
"chunksEnabled" BOOLEAN NOT NULL DEFAULT true,
"chunksMax" INTEGER NOT NULL DEFAULT 99614720,
"chunksSize" INTEGER NOT NULL DEFAULT 26214400,
"tasksDeleteInterval" INTEGER NOT NULL DEFAULT 1800000,
"tasksClearInvitesInterval" INTEGER NOT NULL DEFAULT 1800000,
"tasksMaxViewsInterval" INTEGER NOT NULL DEFAULT 1800000,
"tasksThumbnailsInterval" INTEGER NOT NULL DEFAULT 1800000,
"tasksMetricsInterval" INTEGER NOT NULL DEFAULT 1800000,
"filesRoute" TEXT NOT NULL DEFAULT '/u',
"filesLength" INTEGER NOT NULL DEFAULT 6,
"filesDefaultFormat" TEXT NOT NULL DEFAULT 'random',
"filesDisabledExtensions" TEXT[],
"filesMaxFileSize" INTEGER NOT NULL DEFAULT 104857600,
"filesDefaultExpiration" INTEGER,
"filesAssumeMimetypes" BOOLEAN NOT NULL DEFAULT false,
"filesDefaultDateFormat" TEXT NOT NULL DEFAULT 'YYYY-MM-DD_HH:mm:ss',
"filesRemoveGpsMetadata" BOOLEAN NOT NULL DEFAULT false,
"urlsRoute" TEXT NOT NULL DEFAULT '/go',
"urlsLength" INTEGER NOT NULL DEFAULT 6,
"featuresImageCompression" BOOLEAN NOT NULL DEFAULT true,
"featuresRobotsTxt" BOOLEAN NOT NULL DEFAULT true,
"featuresHealthcheck" BOOLEAN NOT NULL DEFAULT true,
"featuresUserRegistration" BOOLEAN NOT NULL DEFAULT false,
"featuresOauthRegistration" BOOLEAN NOT NULL DEFAULT false,
"featuresDeleteOnMaxViews" BOOLEAN NOT NULL DEFAULT true,
"featuresThumbnailsEnabled" BOOLEAN NOT NULL DEFAULT true,
"featuresThumbnailsNumberThreads" INTEGER NOT NULL DEFAULT 4,
"featuresMetricsEnabled" BOOLEAN NOT NULL DEFAULT true,
"featuresMetricsAdminOnly" BOOLEAN NOT NULL DEFAULT false,
"featuresMetricsShowUserSpecific" BOOLEAN NOT NULL DEFAULT true,
"invitesEnabled" BOOLEAN NOT NULL DEFAULT true,
"invitesLength" INTEGER NOT NULL DEFAULT 6,
"websiteTitle" TEXT NOT NULL DEFAULT 'Zipline',
"websiteTitleLogo" TEXT,
"websiteExternalLinks" JSONB NOT NULL DEFAULT '[{ "name": "GitHub", "url": "https://github.com/diced/zipline"}, { "name": "Documentation", "url": "https://zipline.diced.sh/"}]',
"websiteLoginBackground" TEXT,
"websiteDefaultAvatar" TEXT,
"websiteTos" TEXT,
"websiteThemeDefault" TEXT NOT NULL DEFAULT 'system',
"websiteThemeDark" TEXT NOT NULL DEFAULT 'builtin:dark_gray',
"websiteThemeLight" TEXT NOT NULL DEFAULT 'builtin:light_gray',
"oauthBypassLocalLogin" BOOLEAN NOT NULL DEFAULT false,
"oauthLoginOnly" BOOLEAN NOT NULL DEFAULT false,
"oauthDiscordClientId" TEXT,
"oauthDiscordClientSecret" TEXT,
"oauthDiscordRedirectUri" TEXT,
"oauthGoogleClientId" TEXT,
"oauthGoogleClientSecret" TEXT,
"oauthGoogleRedirectUri" TEXT,
"oauthGithubClientId" TEXT,
"oauthGithubClientSecret" TEXT,
"oauthGithubRedirectUri" TEXT,
"oauthOidcClientId" TEXT,
"oauthOidcClientSecret" TEXT,
"oauthOidcAuthorizeUrl" TEXT,
"oauthOidcTokenUrl" TEXT,
"oauthOidcUserinfoUrl" TEXT,
"oauthOidcRedirectUri" TEXT,
"mfaTotpEnabled" BOOLEAN NOT NULL DEFAULT false,
"mfaTotpIssuer" TEXT NOT NULL DEFAULT 'Zipline',
"mfaPasskeys" BOOLEAN NOT NULL DEFAULT false,
"ratelimitEnabled" BOOLEAN NOT NULL DEFAULT true,
"ratelimitMax" INTEGER NOT NULL DEFAULT 10,
"ratelimitWindow" INTEGER,
"ratelimitAdminBypass" BOOLEAN NOT NULL DEFAULT true,
"ratelimitAllowList" TEXT[],
"httpWebhookOnUpload" TEXT,
"httpWebhookOnShorten" TEXT,
"discordWebhookUrl" TEXT,
"discordUsername" TEXT,
"discordAvatarUrl" TEXT,
"discordOnUploadWebhookUrl" TEXT,
"discordOnUploadUsername" TEXT,
"discordOnUploadAvatarUrl" TEXT,
"discordOnUploadContent" TEXT,
"discordOnUploadEmbed" JSONB,
"discordOnShortenWebhookUrl" TEXT,
"discordOnShortenUsername" TEXT,
"discordOnShortenAvatarUrl" TEXT,
"discordOnShortenContent" TEXT,
"discordOnShortenEmbed" JSONB,
"pwaEnabled" BOOLEAN NOT NULL DEFAULT false,
"pwaTitle" TEXT NOT NULL DEFAULT 'Zipline',
"pwaShortName" TEXT NOT NULL DEFAULT 'Zipline',
"pwaDescription" TEXT NOT NULL DEFAULT 'Zipline',
"pwaThemeColor" TEXT NOT NULL DEFAULT '#000000',
"pwaBackgroundColor" TEXT NOT NULL DEFAULT '#000000',
CONSTRAINT "Zipline_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "User" (
"id" TEXT NOT NULL,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,
"username" TEXT NOT NULL,
"password" TEXT,
"avatar" TEXT,
"token" TEXT NOT NULL,
"role" "Role" NOT NULL DEFAULT 'USER',
"view" JSONB NOT NULL DEFAULT '{}',
"totpSecret" TEXT,
"sessions" TEXT[],
CONSTRAINT "User_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "Export" (
"id" TEXT NOT NULL,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,
"completed" BOOLEAN NOT NULL DEFAULT false,
"path" TEXT NOT NULL,
"files" INTEGER NOT NULL,
"size" TEXT NOT NULL,
"userId" TEXT NOT NULL,
CONSTRAINT "Export_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "UserQuota" (
"id" TEXT NOT NULL,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,
"filesQuota" "UserFilesQuota" NOT NULL,
"maxBytes" TEXT,
"maxFiles" INTEGER,
"maxUrls" INTEGER,
"userId" TEXT,
CONSTRAINT "UserQuota_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "UserPasskey" (
"id" TEXT NOT NULL,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,
"lastUsed" TIMESTAMP(3),
"name" TEXT NOT NULL,
"reg" JSONB NOT NULL,
"userId" TEXT NOT NULL,
CONSTRAINT "UserPasskey_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "OAuthProvider" (
"id" TEXT NOT NULL,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,
"userId" TEXT NOT NULL,
"provider" "OAuthProviderType" NOT NULL,
"username" TEXT NOT NULL,
"accessToken" TEXT NOT NULL,
"refreshToken" TEXT,
"oauthId" TEXT,
CONSTRAINT "OAuthProvider_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "File" (
"id" TEXT NOT NULL,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,
"deletesAt" TIMESTAMP(3),
"name" TEXT NOT NULL,
"originalName" TEXT,
"size" BIGINT NOT NULL,
"type" TEXT NOT NULL,
"views" INTEGER NOT NULL DEFAULT 0,
"maxViews" INTEGER,
"favorite" BOOLEAN NOT NULL DEFAULT false,
"password" TEXT,
"userId" TEXT,
"folderId" TEXT,
CONSTRAINT "File_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "Thumbnail" (
"id" TEXT NOT NULL,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,
"path" TEXT NOT NULL,
"fileId" TEXT NOT NULL,
CONSTRAINT "Thumbnail_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "Folder" (
"id" TEXT NOT NULL,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,
"name" TEXT NOT NULL,
"public" BOOLEAN NOT NULL DEFAULT false,
"userId" TEXT NOT NULL,
CONSTRAINT "Folder_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "IncompleteFile" (
"id" TEXT NOT NULL,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,
"status" "IncompleteFileStatus" NOT NULL,
"chunksTotal" INTEGER NOT NULL,
"chunksComplete" INTEGER NOT NULL,
"metadata" JSONB NOT NULL,
"userId" TEXT NOT NULL,
CONSTRAINT "IncompleteFile_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "Tag" (
"id" TEXT NOT NULL,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,
"name" TEXT NOT NULL,
"color" TEXT NOT NULL,
"userId" TEXT,
CONSTRAINT "Tag_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "Url" (
"id" TEXT NOT NULL,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,
"code" TEXT NOT NULL,
"vanity" TEXT,
"destination" TEXT NOT NULL,
"views" INTEGER NOT NULL DEFAULT 0,
"maxViews" INTEGER,
"password" TEXT,
"userId" TEXT,
CONSTRAINT "Url_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "Metric" (
"id" TEXT NOT NULL,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,
"data" JSONB NOT NULL,
CONSTRAINT "Metric_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "Invite" (
"id" TEXT NOT NULL,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,
"expiresAt" TIMESTAMP(3),
"code" TEXT NOT NULL,
"uses" INTEGER NOT NULL DEFAULT 0,
"maxUses" INTEGER,
"inviterId" TEXT NOT NULL,
CONSTRAINT "Invite_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "_FileToTag" (
"A" TEXT NOT NULL,
"B" TEXT NOT NULL,
CONSTRAINT "_FileToTag_AB_pkey" PRIMARY KEY ("A","B")
);
-- CreateIndex
CREATE UNIQUE INDEX "User_username_key" ON "User"("username");
-- CreateIndex
CREATE UNIQUE INDEX "User_token_key" ON "User"("token");
-- CreateIndex
CREATE UNIQUE INDEX "UserQuota_userId_key" ON "UserQuota"("userId");
-- CreateIndex
CREATE UNIQUE INDEX "OAuthProvider_provider_oauthId_key" ON "OAuthProvider"("provider", "oauthId");
-- CreateIndex
CREATE UNIQUE INDEX "Thumbnail_fileId_key" ON "Thumbnail"("fileId");
-- CreateIndex
CREATE UNIQUE INDEX "Tag_name_key" ON "Tag"("name");
-- CreateIndex
CREATE UNIQUE INDEX "Url_code_vanity_key" ON "Url"("code", "vanity");
-- CreateIndex
CREATE UNIQUE INDEX "Invite_code_key" ON "Invite"("code");
-- CreateIndex
CREATE INDEX "_FileToTag_B_index" ON "_FileToTag"("B");
-- AddForeignKey
ALTER TABLE "Export" ADD CONSTRAINT "Export_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "UserQuota" ADD CONSTRAINT "UserQuota_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "UserPasskey" ADD CONSTRAINT "UserPasskey_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "OAuthProvider" ADD CONSTRAINT "OAuthProvider_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "File" ADD CONSTRAINT "File_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE SET NULL ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "File" ADD CONSTRAINT "File_folderId_fkey" FOREIGN KEY ("folderId") REFERENCES "Folder"("id") ON DELETE SET NULL ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "Thumbnail" ADD CONSTRAINT "Thumbnail_fileId_fkey" FOREIGN KEY ("fileId") REFERENCES "File"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "Folder" ADD CONSTRAINT "Folder_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "IncompleteFile" ADD CONSTRAINT "IncompleteFile_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "Tag" ADD CONSTRAINT "Tag_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE SET NULL ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "Url" ADD CONSTRAINT "Url_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE SET NULL ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "Invite" ADD CONSTRAINT "Invite_inviterId_fkey" FOREIGN KEY ("inviterId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "_FileToTag" ADD CONSTRAINT "_FileToTag_A_fkey" FOREIGN KEY ("A") REFERENCES "File"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "_FileToTag" ADD CONSTRAINT "_FileToTag_B_fkey" FOREIGN KEY ("B") REFERENCES "Tag"("id") ON DELETE CASCADE ON UPDATE CASCADE;
@@ -1,2 +0,0 @@
-- AlterTable
ALTER TABLE "Zipline" ALTER COLUMN "filesDefaultExpiration" SET DATA TYPE TEXT;
@@ -1,17 +0,0 @@
-- AlterTable
ALTER TABLE "Zipline" ALTER COLUMN "chunksMax" SET DEFAULT '95mb',
ALTER COLUMN "chunksMax" SET DATA TYPE TEXT,
ALTER COLUMN "chunksSize" SET DEFAULT '25mb',
ALTER COLUMN "chunksSize" SET DATA TYPE TEXT,
ALTER COLUMN "tasksDeleteInterval" SET DEFAULT '30m',
ALTER COLUMN "tasksDeleteInterval" SET DATA TYPE TEXT,
ALTER COLUMN "tasksClearInvitesInterval" SET DEFAULT '30m',
ALTER COLUMN "tasksClearInvitesInterval" SET DATA TYPE TEXT,
ALTER COLUMN "tasksMaxViewsInterval" SET DEFAULT '30m',
ALTER COLUMN "tasksMaxViewsInterval" SET DATA TYPE TEXT,
ALTER COLUMN "tasksThumbnailsInterval" SET DEFAULT '30m',
ALTER COLUMN "tasksThumbnailsInterval" SET DATA TYPE TEXT,
ALTER COLUMN "tasksMetricsInterval" SET DEFAULT '30m',
ALTER COLUMN "tasksMetricsInterval" SET DATA TYPE TEXT,
ALTER COLUMN "filesMaxFileSize" SET DEFAULT '100mb',
ALTER COLUMN "filesMaxFileSize" SET DATA TYPE TEXT;
@@ -1,2 +0,0 @@
-- AlterTable
ALTER TABLE "Zipline" ADD COLUMN "websiteLoginBackgroundBlur" BOOLEAN NOT NULL DEFAULT true;
@@ -1,2 +0,0 @@
-- AlterTable
ALTER TABLE "Url" ADD COLUMN "enabled" BOOLEAN NOT NULL DEFAULT true;
@@ -1,3 +0,0 @@
-- AlterTable
ALTER TABLE "Zipline" ADD COLUMN "filesRandomWordsNumAdjectives" INTEGER NOT NULL DEFAULT 2,
ADD COLUMN "filesRandomWordsSeparator" TEXT NOT NULL DEFAULT '-';
@@ -1,2 +0,0 @@
-- AlterTable
ALTER TABLE "Folder" ADD COLUMN "allowUploads" BOOLEAN NOT NULL DEFAULT false;
@@ -1,3 +0,0 @@
-- AlterTable
ALTER TABLE "Zipline" ADD COLUMN "featuresVersionAPI" TEXT NOT NULL DEFAULT 'https://zipline-version.diced.sh',
ADD COLUMN "featuresVersionChecking" BOOLEAN NOT NULL DEFAULT true;
@@ -1,2 +0,0 @@
-- AlterTable
ALTER TABLE "Zipline" ADD COLUMN "oauthDiscordWhitelistIds" TEXT[] DEFAULT ARRAY[]::TEXT[];
@@ -1,10 +0,0 @@
/*
Warnings:
- You are about to drop the column `oauthDiscordWhitelistIds` on the `Zipline` table. All the data in the column will be lost.
*/
-- AlterTable
ALTER TABLE "Zipline" DROP COLUMN "oauthDiscordWhitelistIds",
ADD COLUMN "oauthDiscordAllowedIds" TEXT[] DEFAULT ARRAY[]::TEXT[],
ADD COLUMN "oauthDiscordDeniedIds" TEXT[] DEFAULT ARRAY[]::TEXT[];
@@ -1,2 +0,0 @@
-- AlterTable
ALTER TABLE "Zipline" ADD COLUMN "domains" TEXT[] DEFAULT ARRAY[]::TEXT[];
@@ -1,2 +0,0 @@
-- AlterTable
ALTER TABLE "public"."Zipline" ADD COLUMN "filesDefaultCompressionFormat" TEXT DEFAULT 'jpg';
@@ -1,2 +0,0 @@
-- AlterTable
ALTER TABLE "public"."Zipline" ADD COLUMN "featuresThumbnailsFormat" TEXT NOT NULL DEFAULT 'jpg';
@@ -1,2 +0,0 @@
-- AlterTable
ALTER TABLE "public"."Zipline" ADD COLUMN "coreTrustProxy" BOOLEAN NOT NULL DEFAULT false;
@@ -1,2 +0,0 @@
-- AlterTable
ALTER TABLE "public"."Zipline" ADD COLUMN "filesMaxExpiration" TEXT;
@@ -1,11 +0,0 @@
/*
Warnings:
- You are about to drop the column `mfaPasskeys` on the `Zipline` table. All the data in the column will be lost.
*/
-- AlterTable
ALTER TABLE "public"."Zipline" DROP COLUMN "mfaPasskeys",
ADD COLUMN "mfaPasskeysEnabled" BOOLEAN NOT NULL DEFAULT false,
ADD COLUMN "mfaPasskeysOrigin" TEXT,
ADD COLUMN "mfaPasskeysRpID" TEXT;
@@ -1,2 +0,0 @@
-- AlterTable
ALTER TABLE "public"."Zipline" ADD COLUMN "tasksCleanThumbnailsInterval" TEXT NOT NULL DEFAULT '1d';
@@ -1,6 +0,0 @@
-- AlterTable
ALTER TABLE "public"."Folder" ADD COLUMN "parentId" TEXT;
-- AddForeignKey
ALTER TABLE "public"."Folder" ADD CONSTRAINT "Folder_parentId_fkey" FOREIGN KEY ("parentId") REFERENCES "public"."Folder"("id") ON DELETE SET NULL ON UPDATE CASCADE;
@@ -1,23 +0,0 @@
/*
Warnings:
- You are about to drop the column `sessions` on the `User` table. All the data in the column will be lost.
*/
-- AlterTable
ALTER TABLE "public"."User" DROP COLUMN "sessions";
-- CreateTable
CREATE TABLE "public"."UserSession" (
"id" TEXT NOT NULL,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"ua" TEXT NOT NULL,
"client" TEXT NOT NULL,
"device" TEXT NOT NULL,
"userId" TEXT NOT NULL,
CONSTRAINT "UserSession_pkey" PRIMARY KEY ("id")
);
-- AddForeignKey
ALTER TABLE "public"."UserSession" ADD CONSTRAINT "UserSession_userId_fkey" FOREIGN KEY ("userId") REFERENCES "public"."User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
+2 -2
View File
@@ -1,3 +1,3 @@
# Please do not edit this file manually
# It should be added in your version-control system (e.g., Git)
provider = "postgresql"
# It should be added in your version-control system (i.e. Git)
provider = "postgresql"
+85 -377
View File
@@ -1,403 +1,111 @@
generator client {
provider = "prisma-client"
output = "../src/prisma"
moduleFormat = "cjs"
previewFeatures = ["queryCompiler", "driverAdapters"]
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
model Zipline {
id String @id @default(cuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
firstSetup Boolean @default(true)
coreReturnHttpsUrls Boolean @default(false)
coreDefaultDomain String?
coreTempDirectory String // default join(tmpdir(), 'zipline')
coreTrustProxy Boolean @default(false)
chunksEnabled Boolean @default(true)
chunksMax String @default("95mb")
chunksSize String @default("25mb")
tasksDeleteInterval String @default("30m")
tasksClearInvitesInterval String @default("30m")
tasksMaxViewsInterval String @default("30m")
tasksThumbnailsInterval String @default("30m")
tasksMetricsInterval String @default("30m")
tasksCleanThumbnailsInterval String @default("1d")
filesRoute String @default("/u")
filesLength Int @default(6)
filesDefaultFormat String @default("random")
filesDisabledExtensions String[]
filesMaxFileSize String @default("100mb")
filesDefaultExpiration String?
filesMaxExpiration String?
filesAssumeMimetypes Boolean @default(false)
filesDefaultDateFormat String @default("YYYY-MM-DD_HH:mm:ss")
filesRemoveGpsMetadata Boolean @default(false)
filesRandomWordsNumAdjectives Int @default(2)
filesRandomWordsSeparator String @default("-")
filesDefaultCompressionFormat String? @default("jpg")
urlsRoute String @default("/go")
urlsLength Int @default(6)
featuresImageCompression Boolean @default(true)
featuresRobotsTxt Boolean @default(true)
featuresHealthcheck Boolean @default(true)
featuresUserRegistration Boolean @default(false)
featuresOauthRegistration Boolean @default(false)
featuresDeleteOnMaxViews Boolean @default(true)
featuresThumbnailsEnabled Boolean @default(true)
featuresThumbnailsNumberThreads Int @default(4)
featuresThumbnailsFormat String @default("jpg")
featuresMetricsEnabled Boolean @default(true)
featuresMetricsAdminOnly Boolean @default(false)
featuresMetricsShowUserSpecific Boolean @default(true)
featuresVersionChecking Boolean @default(true)
featuresVersionAPI String @default("https://zipline-version.diced.sh")
invitesEnabled Boolean @default(true)
invitesLength Int @default(6)
websiteTitle String @default("Zipline")
websiteTitleLogo String?
websiteExternalLinks Json @default("[{ \"name\": \"GitHub\", \"url\": \"https://github.com/diced/zipline\"}, { \"name\": \"Documentation\", \"url\": \"https://zipline.diced.sh/\"}]")
websiteLoginBackground String?
websiteLoginBackgroundBlur Boolean @default(true)
websiteDefaultAvatar String?
websiteTos String?
websiteThemeDefault String @default("system")
websiteThemeDark String @default("builtin:dark_gray")
websiteThemeLight String @default("builtin:light_gray")
oauthBypassLocalLogin Boolean @default(false)
oauthLoginOnly Boolean @default(false)
oauthDiscordClientId String?
oauthDiscordClientSecret String?
oauthDiscordRedirectUri String?
oauthDiscordAllowedIds String[] @default([])
oauthDiscordDeniedIds String[] @default([])
oauthGoogleClientId String?
oauthGoogleClientSecret String?
oauthGoogleRedirectUri String?
oauthGithubClientId String?
oauthGithubClientSecret String?
oauthGithubRedirectUri String?
oauthOidcClientId String?
oauthOidcClientSecret String?
oauthOidcAuthorizeUrl String?
oauthOidcTokenUrl String?
oauthOidcUserinfoUrl String?
oauthOidcRedirectUri String?
mfaTotpEnabled Boolean @default(false)
mfaTotpIssuer String @default("Zipline")
mfaPasskeysEnabled Boolean @default(false)
mfaPasskeysRpID String?
mfaPasskeysOrigin String?
ratelimitEnabled Boolean @default(true)
ratelimitMax Int @default(10)
ratelimitWindow Int?
ratelimitAdminBypass Boolean @default(true)
ratelimitAllowList String[]
httpWebhookOnUpload String?
httpWebhookOnShorten String?
discordWebhookUrl String?
discordUsername String?
discordAvatarUrl String?
discordOnUploadWebhookUrl String?
discordOnUploadUsername String?
discordOnUploadAvatarUrl String?
discordOnUploadContent String?
discordOnUploadEmbed Json?
discordOnShortenWebhookUrl String?
discordOnShortenUsername String?
discordOnShortenAvatarUrl String?
discordOnShortenContent String?
discordOnShortenEmbed Json?
pwaEnabled Boolean @default(false)
pwaTitle String @default("Zipline")
pwaShortName String @default("Zipline")
pwaDescription String @default("Zipline")
pwaThemeColor String @default("#000000")
pwaBackgroundColor String @default("#000000")
domains String[] @default([])
generator client {
provider = "prisma-client-js"
}
model User {
id String @id @default(cuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
username String @unique
password String?
avatar String?
token String @unique
role Role @default(USER)
view Json @default("{}")
totpSecret String?
passkeys UserPasskey[]
sessions UserSession[]
quota UserQuota?
files File[]
urls Url[]
folders Folder[]
invites Invite[]
tags Tag[]
oauthProviders OAuthProvider[]
IncompleteFile IncompleteFile[]
exports Export[]
id Int @id @default(autoincrement())
username String
password String?
avatar String?
token String
administrator Boolean @default(false)
superAdmin Boolean @default(false)
systemTheme String @default("system")
embedTitle String?
embedColor String @default("#2f3136")
embedSiteName String? @default("{image.file} • {user.name}")
ratelimit DateTime?
totpSecret String?
domains String[]
oauth OAuth[]
images Image[]
urls Url[]
Invite Invite[]
}
model Export {
id String @id @default(cuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
completed Boolean @default(false)
path String
files Int
size String
User User @relation(fields: [userId], references: [id], onDelete: Cascade, onUpdate: Cascade)
userId String
enum ImageFormat {
UUID
DATE
RANDOM
NAME
}
model UserSession {
id String @id
createdAt DateTime @default(now())
ua String
client String
device String
User User @relation(fields: [userId], references: [id], onDelete: Cascade, onUpdate: Cascade)
userId String
model Image {
id Int @id @default(autoincrement())
file String
mimetype String @default("image/png")
created_at DateTime @default(now())
expires_at DateTime?
maxViews Int?
views Int @default(0)
favorite Boolean @default(false)
embed Boolean @default(false)
password String?
invisible InvisibleImage?
format ImageFormat @default(RANDOM)
user User? @relation(fields: [userId], references: [id], onDelete: SetNull)
userId Int?
}
model UserQuota {
id String @id @default(cuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
filesQuota UserFilesQuota
maxBytes String?
maxFiles Int?
maxUrls Int?
User User? @relation(fields: [userId], references: [id], onDelete: Cascade)
userId String? @unique
}
enum UserFilesQuota {
BY_BYTES
BY_FILES
}
model UserPasskey {
id String @id @default(cuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
lastUsed DateTime?
name String
reg Json
User User @relation(fields: [userId], references: [id], onDelete: Cascade, onUpdate: Cascade)
userId String
}
enum Role {
USER
ADMIN
SUPERADMIN
}
model OAuthProvider {
id String @id @default(cuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
userId String
provider OAuthProviderType
username String
accessToken String
refreshToken String?
oauthId String?
user User @relation(fields: [userId], references: [id])
@@unique([provider, oauthId])
}
enum OAuthProviderType {
DISCORD
GOOGLE
GITHUB
OIDC
}
model File {
id String @id @default(cuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
deletesAt DateTime?
name String // name & file saved on datasource
originalName String? // original name of file when uploaded
size BigInt
type String
views Int @default(0)
maxViews Int?
favorite Boolean @default(false)
password String?
tags Tag[]
User User? @relation(fields: [userId], references: [id], onDelete: SetNull, onUpdate: Cascade)
userId String?
Folder Folder? @relation(fields: [folderId], references: [id], onDelete: SetNull, onUpdate: Cascade)
folderId String?
thumbnail Thumbnail?
}
model Thumbnail {
id String @id @default(cuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
path String
file File @relation(fields: [fileId], references: [id], onDelete: Cascade, onUpdate: Cascade)
fileId String
@@unique([fileId])
}
model Folder {
id String @id @default(cuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
name String
public Boolean @default(false)
allowUploads Boolean @default(false)
files File[]
parentId String?
parent Folder? @relation("FolderToFolder", fields: [parentId], references: [id], onDelete: SetNull, onUpdate: Cascade)
children Folder[] @relation("FolderToFolder")
User User @relation(fields: [userId], references: [id], onDelete: Cascade, onUpdate: Cascade)
userId String
}
model IncompleteFile {
id String @id @default(cuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
status IncompleteFileStatus
chunksTotal Int
chunksComplete Int
metadata Json
User User @relation(fields: [userId], references: [id], onDelete: Cascade, onUpdate: Cascade)
userId String
}
enum IncompleteFileStatus {
PENDING
PROCESSING
COMPLETE
FAILED
}
model Tag {
id String @id @default(cuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
name String @unique
color String
files File[]
User User? @relation(fields: [userId], references: [id])
userId String?
model InvisibleImage {
id Int @id @default(autoincrement())
invis String @unique
imageId Int @unique
image Image @relation(fields: [imageId], references: [id], onDelete: Cascade)
}
model Url {
id String @id @default(cuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
code String
vanity String?
id String @id @unique
destination String
views Int @default(0)
vanity String?
created_at DateTime @default(now())
maxViews Int?
password String?
enabled Boolean @default(true)
User User? @relation(fields: [userId], references: [id], onDelete: SetNull, onUpdate: Cascade)
userId String?
@@unique([code, vanity])
views Int @default(0)
invisible InvisibleUrl?
user User? @relation(fields: [userId], references: [id], onDelete: SetNull)
userId Int?
}
model Metric {
id String @id @default(cuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
model InvisibleUrl {
id Int @id @default(autoincrement())
invis String @unique
urlId String @unique
url Url @relation(fields: [urlId], references: [id], onDelete: Cascade)
}
data Json
model Stats {
id Int @id @default(autoincrement())
created_at DateTime @default(now())
data Json
}
model Invite {
id String @id @default(cuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
expiresAt DateTime?
code String @unique
uses Int @default(0)
maxUses Int?
inviter User @relation(fields: [inviterId], references: [id], onDelete: Cascade, onUpdate: Cascade)
inviterId String
id Int @id @default(autoincrement())
code String @unique
created_at DateTime @default(now())
expires_at DateTime?
used Boolean @default(false)
createdBy User @relation(fields: [createdById], references: [id], onDelete: Cascade)
createdById Int
}
model OAuth {
id Int @id @default(autoincrement())
provider OauthProviders
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
userId Int
username String
token String
refresh String?
}
enum OauthProviders {
DISCORD
GITHUB
GOOGLE
}
File diff suppressed because it is too large Load Diff
-1750
View File
File diff suppressed because it is too large Load Diff
Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 582 B

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