upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/docs/reference
diff options
context:
space:
mode:
Diffstat (limited to 'docs/reference')
-rw-r--r--docs/reference/configuration.md89
1 files changed, 89 insertions, 0 deletions
diff --git a/docs/reference/configuration.md b/docs/reference/configuration.md
index 1c62911..b90686e 100644
--- a/docs/reference/configuration.md
+++ b/docs/reference/configuration.md
@@ -744,6 +744,95 @@ NGIT_REPOSITORY_WHITELIST=bitcoin-core,npub1alice...
744 744
745--- 745---
746 746
747### Repository Blacklist
748
749#### `NGIT_REPOSITORY_BLACKLIST`
750
751**Description:** Blacklist specific repositories/pubkeys/identifiers to reject
752**Type:** Comma-separated list
753**Default:** Empty (no repositories are blacklisted)
754**Required:** No
755
756**Format:** Same as whitelist formats:
757- `npub1...` - Block all repos from this pubkey
758- `npub1.../identifier` - Block specific repo
759- `identifier` - Block repos with this identifier (any pubkey)
760
761**Precedence:** Blacklist takes precedence over **ALL** whitelists:
762- Blacklisted repos are rejected even if they match archive or repository whitelists
763- Blacklisted repos are rejected even if they list our service
764- Blacklist is checked **first** before any other validation
765
766**Examples:**
767
768```bash
769# Block all repos from specific pubkey
770NGIT_REPOSITORY_BLACKLIST=npub1spam...
771
772# Block specific repo
773NGIT_REPOSITORY_BLACKLIST=npub1alice.../malware-repo
774
775# Block repos with specific identifiers
776NGIT_REPOSITORY_BLACKLIST=malware,spam,phishing
777
778# Combined blacklist
779NGIT_REPOSITORY_BLACKLIST=npub1spam...,npub1alice.../bad-repo,malware
780```
781
782**Rejection Reasons:**
783
784The blacklist provides specific rejection reasons based on the match type:
785
786- **Npub format:** `"Repository owner <npub> is blacklisted"`
787- **Npub/identifier format:** `"Repository <npub>/<identifier> is blacklisted"`
788- **Identifier format:** `"Repository identifier <identifier> is blacklisted"`
789
790These reasons help operators understand why a repository was rejected without needing to flag it in curation metadata.
791
792**Behavior:**
793
794Blacklist is checked **before** all other validation:
7951. Check blacklist → Reject if matched
7962. Check if lists service → Accept if matches repository whitelist (if enabled)
7973. Check archive config → Accept if matches archive whitelist (if enabled)
7984. Reject otherwise
799
800**Use Cases:**
801
802```bash
803# Block spam/malware repos
804NGIT_REPOSITORY_BLACKLIST=malware,spam,phishing
805
806# Block abusive users
807NGIT_REPOSITORY_BLACKLIST=npub1spammer...,npub1abuser...
808
809# Block specific problematic repos
810NGIT_REPOSITORY_BLACKLIST=npub1alice.../copyright-violation,npub1bob.../illegal-content
811
812# Temporary block for investigation
813NGIT_REPOSITORY_BLACKLIST=npub1suspicious.../repo-under-review
814```
815
816**Comparison with Whitelists:**
817
818| Configuration | Blacklisted? | Matches Whitelist? | Lists Service? | Result |
819|---------------|--------------|-------------------|----------------|---------|
820| Blacklist only | Yes | N/A | N/A | ❌ Reject (blacklisted) |
821| Blacklist only | No | N/A | Yes | ✅ Accept (GRASP-01) |
822| Blacklist + Repository whitelist | Yes | Yes | Yes | ❌ Reject (blacklist wins) |
823| Blacklist + Archive whitelist | Yes | Yes | No | ❌ Reject (blacklist wins) |
824| Blacklist + Both whitelists | Yes | Yes | Yes | ❌ Reject (blacklist wins) |
825| Blacklist only | No | N/A | No | ❌ Reject (no whitelist match) |
826
827**NIP-11 Impact:**
828
829Blacklist does **not** affect NIP-11 metadata:
830- No `curation` field changes (blacklist is operational, not curation policy)
831- Blacklist is transparent to clients (rejected with specific reason)
832- Operators can use blacklist without advertising curation
833
834---
835
747### Logging Configuration 836### Logging Configuration
748 837
749#### `RUST_LOG` 838#### `RUST_LOG`