From 4b9434ce0a20a321c28d47cdab7b3adf3500ce1b Mon Sep 17 00:00:00 2001 From: Wim Brand Date: Wed, 30 Sep 2026 19:11:13 +0200 Subject: [PATCH] Remove unused IP ban system --- res/static/style/layout.css | 3 +- svelte/src/admin_panel/FileInfo.svelte | 3 - svelte/src/admin_panel/IPBans.svelte | 222 ------------------ svelte/src/admin_panel/Router.svelte | 6 - svelte/src/home_page/AddressReputation.svelte | 179 -------------- svelte/src/home_page/HomePage.svelte | 20 +- .../user_home/dashboard/AccountBans.svelte | 89 +++++++ .../src/user_home/dashboard/Dashboard.svelte | 6 +- svelte/tsconfig.json | 4 +- 9 files changed, 97 insertions(+), 435 deletions(-) delete mode 100644 svelte/src/admin_panel/IPBans.svelte delete mode 100644 svelte/src/home_page/AddressReputation.svelte create mode 100644 svelte/src/user_home/dashboard/AccountBans.svelte diff --git a/res/static/style/layout.css b/res/static/style/layout.css index 4065f1d..c7ddd05 100644 --- a/res/static/style/layout.css +++ b/res/static/style/layout.css @@ -381,7 +381,8 @@ table:not(.form) { min-width: 100%; } -tr>td { +tr>td, +tr>th { padding: 0.2em 0.5em; } diff --git a/svelte/src/admin_panel/FileInfo.svelte b/svelte/src/admin_panel/FileInfo.svelte index 1457f3c..d39c488 100644 --- a/svelte/src/admin_panel/FileInfo.svelte +++ b/svelte/src/admin_panel/FileInfo.svelte @@ -70,7 +70,6 @@ const date = (d: string) => (!d || d.startsWith("0001-")) ? "never" : formatDate MD5{file.hash_md5} Size{formatDataVolume(file.size, 4)} ({file.size} B) Created{date(file.created)} - Thumbnail{file.thumbnail_status || "none"} Abuse @@ -151,7 +150,6 @@ const date = (d: string) => (!d || d.startsWith("0001-")) ? "never" : formatDate User Size Type - Views Created Modified Deleted @@ -166,7 +164,6 @@ const date = (d: string) => (!d || d.startsWith("0001-")) ? "never" : formatDate {ref.user_id} {formatDataVolume(ref.size, 3)} {ref.type} - {ref.views} {date(ref.created)} {date(ref.modified)} {ref.deleted ? formatDate(ref.deleted) : ""} diff --git a/svelte/src/admin_panel/IPBans.svelte b/svelte/src/admin_panel/IPBans.svelte deleted file mode 100644 index 49fbb64..0000000 --- a/svelte/src/admin_panel/IPBans.svelte +++ /dev/null @@ -1,222 +0,0 @@ - - -
-
-
- Bans {rows.length} -
-
- Offences {total_offences} -
-
- - -
- {#if creating} -
-
-
- - - -
- {#each abuse_types as t (t)} - - -
- {/each} -
- -
-
-
- {/if} - - {#each rows as row (row.address)} - - {#snippet header()} -
-
{row.address}
-
- Offences
- {row.offences.length} -
-
- Date
- {formatDate(row.offences[0].ban_time, false, false, false)} -
- -
- {/snippet} -
- - - - - - - - - - - - {#each row.offences as offence (offence.ban_time)} - - - - - - - - {/each} - -
ReasonReporterBan timeExpire timeFile
{offence.reason}{offence.reporter}{formatDate(offence.ban_time, true, true, false)}{formatDate(offence.expire_time, true, true, false)} - {#if offence.file_link} - - {offence.file_name} - - {/if} -
-
-
- {/each} -
- - diff --git a/svelte/src/admin_panel/Router.svelte b/svelte/src/admin_panel/Router.svelte index d91351c..4c71058 100644 --- a/svelte/src/admin_panel/Router.svelte +++ b/svelte/src/admin_panel/Router.svelte @@ -1,6 +1,5 @@ - -{#if result !== null && result.user_banned} -
- - {#snippet header()} -
- Your account has been banned, click for details -
- {/snippet} -

- Your user account has been banned from uploading to - Nova due to violation of the - content policy. Below is a list of - files originating from your account which have been blocked: -

- -
- - - - - - - - - - - {#each result.user_offences as offence (offence.ban_time)} - - - - - - - {/each} - -
FileReasonBan dateExpiry date
- {#if offence.file_link} - - {offence.file_name} - - {/if} - {offence.reason}{formatDate(offence.ban_time, false, false, false)}{formatDate(offence.expire_time, false, false, false)}
-
-

- If you would like to dispute your account ban you can mail me at - support@nova.storage. Please do not mail unless you have a - good reason. If you do not provide a valid reason why the ban - should be reversed your e-mail will be ignored. And do not - forget to put your username ({$user === null ? "" : $user.username}) in the - e-mail. -

-
-
-{:else if result !== null && result.ip_offences.length > 0} -
- - {#snippet header()} -
- {#if result.ip_banned} - Your IP address has been banned, click for details - {:else} - Your IP address has received a copyright strike, click for details - {/if} -
- {/snippet} - - {#if result.ip_banned} -

- Your IP address ({result.address}) has been banned from - uploading to Nova due to violation of the - content policy. Below is a list of - files originating from your IP address which have been - blocked: -

- {:else} -

- Your IP address ({result.address}) has received copyright - strikes. At 10 copyright strikes your IP address will be banned - and you will be unable to upload files to Nova. Below is a - list of files originating from your IP address which have been - blocked: -

- {/if} - -
- - - - - - - - - - - {#each result.ip_offences as offence (offence.ban_time)} - - - - - - - {/each} - -
FileReasonBan dateExpiry date
- {#if offence.file_link} - - {offence.file_name} - - {/if} - {offence.reason}{formatDate(offence.ban_time, false, false, false)}{formatDate(offence.expire_time, false, false, false)}
-
- -

- That these files originated from your IP address does not - necessarily mean that they were uploaded by you. It's possible - that people on your home/business network are sharing the same - IP address. If you're using a VPN then there are often many - people using the same IP address. And some ISPs deploy CGNAT, in - which case there could be hundreds of people sharing the same IP - address. In all of these cases IPv6 is the solution, but most - ISPs are decades behind on implementing internet standards. They - just don't care. -

-

- Now you may be asking: If IP banning is so unreliable, why are - you still using it? Well, I need to protect my service from - abuse somehow. The alternative is authenticating every user. - This adds another barrier to entry and generally complicates - things. -

-

- If you would like to dispute your IP ban you can mail me at - support@nova.storage. Please do not mail unless you have a good - reason. If you do not provide a valid reason why the IP ban should - be reversed your e-mail will be ignored. And do not forget to put - your IP address ({result.address}) in the e-mail. -

-
-
-{/if} - - diff --git a/svelte/src/home_page/HomePage.svelte b/svelte/src/home_page/HomePage.svelte index 230c916..c1be590 100644 --- a/svelte/src/home_page/HomePage.svelte +++ b/svelte/src/home_page/HomePage.svelte @@ -2,10 +2,9 @@ import Menu from "filesystem/Menu.svelte"; import Footer from "layout/Footer.svelte"; import { drop_target } from "lib/DropTarget"; -import AddressReputation from "./AddressReputation.svelte"; import GetStarted from "./GetStarted.svelte"; import Pricing from "./Pricing.svelte"; -import SubscriptionPlans from "./SubscriptionPlans.svelte"; +import SubscriptionPlans from "layout/checkout/SubscriptionPlans.svelte"; let upload_widget @@ -14,8 +13,6 @@ let upload_widget
- -
This is a development server. All files and accounts may be lost when @@ -63,17 +60,6 @@ let upload_widget -
-

Get started

-
- - -
-
-
-
-
- diff --git a/svelte/src/user_home/dashboard/AccountBans.svelte b/svelte/src/user_home/dashboard/AccountBans.svelte new file mode 100644 index 0000000..f4dba9b --- /dev/null +++ b/svelte/src/user_home/dashboard/AccountBans.svelte @@ -0,0 +1,89 @@ + + +{#if offences.length > 0} +
+ + {#snippet header()} +
+ Your account has been banned, click for details +
+ {/snippet} +

+ Your user account has been banned from uploading to + Nova due to violation of the + content policy. Below is a list of + files originating from your account which have been blocked: +

+ +
+ + + + + + + + + + + {#each offences as offence (offence.ban_time)} + + + + + + + {/each} + +
FileReasonBan dateExpiry date
+ {#if offence.file_link} + + {offence.file_name} + + {/if} + {offence.reason}{formatDate(offence.ban_time, false, false, false)}{formatDate(offence.expire_time, false, false, false)}
+
+

+ If you would like to dispute your account ban you can mail me at + support@nova.storage. Please do not mail unless you have a + good reason. If you do not provide a valid reason why the ban + should be reversed your e-mail will be ignored. And do not + forget to put your username ({$user === null ? "" : $user.username}) in the + e-mail. +

+
+
+{/if} + + diff --git a/svelte/src/user_home/dashboard/Dashboard.svelte b/svelte/src/user_home/dashboard/Dashboard.svelte index 1f34069..79924e2 100644 --- a/svelte/src/user_home/dashboard/Dashboard.svelte +++ b/svelte/src/user_home/dashboard/Dashboard.svelte @@ -7,7 +7,7 @@ import CardSubscription from "./CardSubscription.svelte"; import CardUsage from "./CardUsage.svelte"; import CardActivity from "./CardActivity.svelte"; import CardPrepaidTransactions from "./CardPrepaidTransactions.svelte"; -import AddressReputation from "home_page/AddressReputation.svelte"; +import AccountBans from "./AccountBans.svelte"; import { flip } from "svelte/animate"; let cards = $state([]) @@ -74,7 +74,7 @@ onMount(() => { id: "prepaid_transactions", elem: CardPrepaidTransactions, title: "Prepaid transactions", - link: "/user/prepaid/transactions", + link: "/user/subscription/transactions", }, { id: "usage", elem: CardUsage, @@ -121,7 +121,7 @@ onMount(() => {
- +
{#each cards as card, i (card.id)} diff --git a/svelte/tsconfig.json b/svelte/tsconfig.json index 85bba05..8fdd39b 100644 --- a/svelte/tsconfig.json +++ b/svelte/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { "lib": [ - "es2019", + "es2021", "dom" ], "paths": { @@ -10,7 +10,7 @@ ] }, "verbatimModuleSyntax": true, - "target": "ES2019", + "target": "ES2021", "noUnusedLocals": true, "module": "preserve", "moduleResolution": "bundler",