this repo has no description
at main 97 lines 3.0 kB view raw view rendered
1Now to really get your hands dirty. It's time to build your own CAR. 2 3The CAR libraries listed in **Part one** above can help with this, or you can hand-craft every byte if you're that hardcore. 4 5Your CAR just needs to have one very specific record to pass this challenge: 6 7- **Collection:** `codes.advent.challenge.day` 8- **Rkey:** `three` 9 10Inside the record, we'll be looking for: 11 12- `"verificationCode": "{{code}}"` 13 14Any valid `DID` will do for the commit, and the signature won't be verified. 15 16 17<form id="car-upload" method="post" action="/day/3/upload-car" enctype="multipart/form-data"> 18 <div id="drop-zone" style="border-radius: 0.5rem; padding: 1.25rem 1.5rem; text-align: center; cursor: pointer; max-width: 28rem;"> 19 <p id="drop-label" style="display: flex; align-items: center; gap: 0.75rem; margin: 0; color: var(--color-primary)"> 20 Drop your CAR off here <small style="opacity: 0.667">(or click to browse)</small> 21 </p> 22 <div id="drop-file-name" class="hidden" style="font-family: monospace; font-size: 0.875rem;"></div> 23 <input id="car-input" type="file" name="car_file" accept=".car" class="hidden" required /> 24 </div> 25</form> 26 27<script> 28(function() { 29 const form = document.getElementById('car-upload'); 30 const zone = document.getElementById('drop-zone'); 31 const input = document.getElementById('car-input'); 32 const label = document.getElementById('drop-label'); 33 const fileName = document.getElementById('drop-file-name'); 34 35 function trySubmit(file) { 36 if (file.size > 2 * Math.pow(2, 20)) { 37 alert('Are sending a car or a damn truck??? (max 2MB)'); 38 return; 39 } 40 label.classList.add('hidden'); 41 fileName.classList.remove('hidden'); 42 fileName.textContent = 'Uploading ' + file.name + '...'; 43 form.submit(); 44 } 45 46 zone.addEventListener('click', function() { input.click(); }); 47 48 input.addEventListener('change', function() { 49 if (input.files[0]) trySubmit(input.files[0]); 50 }); 51 52 zone.addEventListener('dragover', function(e) { 53 e.preventDefault(); 54 zone.classList.add('dragging'); 55 }); 56 57 zone.addEventListener('dragleave', function() { 58 zone.classList.remove('dragging'); 59 }); 60 61 zone.addEventListener('drop', function(e) { 62 e.preventDefault(); 63 zone.style.borderColor = 'oklch(0.7 0 0)'; 64 var file = e.dataTransfer.files[0]; 65 if (file) { 66 input.files = e.dataTransfer.files; 67 trySubmit(file); 68 } 69 }); 70})(); 71</script> 72<style> 73#drop-zone { 74 border: 1px dashed oklch(0.7 0 0); 75} 76#drop-zone.dragging, 77#drop-zone:hover { 78 background: hsla(0, 0%, 50%, 0.2); 79 border-color: #22c55e; 80} 81#drop-label { 82 opacity: 0.667; 83} 84#drop-zone.dragging #drop-label 85#drop-zone:hover #drop-label { 86 opacity: 1; 87} 88</style> 89 90 91<hr/> 92 93<details> 94 <summary>MAJOR CHEATING hint for part 2</summary> 95 96 So&hellip; we really want you to build your own car. But. Tools like `goat` and `PDSls` do have a "download repo" function, and also a "create record" function, 👀 97</details>