├── .dockerignore ├── .env.example ├── .gitattributes ├── .github └── workflows │ └── docker-publish.yml ├── .gitignore ├── Dockerfile ├── LICENSE ├── README.md ├── docker-compose.yml ├── package-lock.json ├── package.json ├── public ├── app.js ├── assets │ ├── favicon.svg │ └── styles.css ├── index.html ├── login.html ├── login.js ├── managers │ └── toast.js └── service-worker.js ├── scripts ├── convert-logo.js ├── cors.js └── pwa-manifest-generator.js ├── server.js └── todos.json /.dockerignore: -------------------------------------------------------------------------------- 1 | # Node 2 | node_modules 3 | npm-debug.log 4 | yarn-debug.log 5 | yarn-error.log 6 | 7 | # Git 8 | .git 9 | .gitignore 10 | 11 | # Docker 12 | .dockerignore 13 | Dockerfile 14 | 15 | # IDE 16 | .vscode 17 | .idea 18 | *.swp 19 | *.swo 20 | 21 | # OS 22 | .DS_Store 23 | Thumbs.db 24 | 25 | # Application specific 26 | data/ 27 | *.log 28 | .env 29 | 30 | # Scripts and generated assets 31 | # scripts/ # Keep scripts so that we can generate manifest for PWA 32 | assets/ 33 | *.png 34 | !src/assets/*.png # Keep source PNGs if any 35 | Boilerplate.md -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | # DumbDo Configuration 2 | 3 | # PIN Protection (4 digits) 4 | # Leave empty to disable PIN protection 5 | DUMBDO_PIN=1234 6 | 7 | # Server Port (default: 3000) 8 | PORT=3000 9 | 10 | DUMBDO_SITE_TITLE=DumbDo 11 | 12 | # (Optional) Restrict origins - ex: https://subdomain.domain.tld,https://auth.proxy.tld,http://internalip:port' (default is '*') 13 | # - ALLOWED_ORIGINS=http://localhost:3000 14 | # NODE_ENV=development # default production (development allows all origins) -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.github/workflows/docker-publish.yml: -------------------------------------------------------------------------------- 1 | name: Build and Push Docker Image 2 | 3 | on: 4 | push: 5 | branches: 6 | - main # Trigger the workflow on pushes to the main branch 7 | 8 | env: 9 | DOCKER_IMAGE: dumbwareio/dumbdo 10 | PLATFORMS: linux/amd64,linux/arm64 11 | 12 | jobs: 13 | build-and-push: 14 | runs-on: ubuntu-latest 15 | steps: 16 | - name: Checkout code 17 | uses: actions/checkout@v3 18 | 19 | - name: Set up Docker Buildx 20 | uses: docker/setup-buildx-action@v2 21 | 22 | - name: Log in to Docker Hub 23 | uses: docker/login-action@v3 24 | with: 25 | username: ${{ secrets.DOCKER_USERNAME }} 26 | password: ${{ secrets.DOCKER_PASSWORD }} 27 | 28 | - name: Set Docker tags 29 | id: docker_meta 30 | run: | 31 | TAGS="${{ env.DOCKER_IMAGE }}:${{ github.sha }}" 32 | if [ "${{ github.ref }}" = "refs/heads/main" ]; then 33 | TAGS+=" ${{ env.DOCKER_IMAGE }}:latest" 34 | elif [ "${{ github.ref }}" = "refs/heads/testing" ]; then 35 | TAGS+=" ${{ env.DOCKER_IMAGE }}:testing" 36 | fi 37 | echo "DOCKER_TAGS=$TAGS" >> $GITHUB_ENV 38 | 39 | - name: Build and Push Multi-Platform Image 40 | run: | 41 | docker buildx create --use 42 | docker buildx build --platform ${{ env.PLATFORMS }} \ 43 | --tag ${{ env.DOCKER_IMAGE }}:${{ github.sha }} \ 44 | --tag ${{ env.DOCKER_IMAGE }}:latest \ 45 | --push . -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | .pnpm-debug.log* 9 | 10 | # Diagnostic reports (https://nodejs.org/api/report.html) 11 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 12 | 13 | # Runtime data 14 | pids 15 | *.pid 16 | *.seed 17 | *.pid.lock 18 | 19 | # Directory for instrumented libs generated by jscoverage/JSCover 20 | lib-cov 21 | 22 | # Coverage directory used by tools like istanbul 23 | coverage 24 | *.lcov 25 | 26 | # nyc test coverage 27 | .nyc_output 28 | 29 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 30 | .grunt 31 | 32 | # Bower dependency directory (https://bower.io/) 33 | bower_components 34 | 35 | # node-waf configuration 36 | .lock-wscript 37 | 38 | # Compiled binary addons (https://nodejs.org/api/addons.html) 39 | build/Release 40 | 41 | # Dependency directories 42 | node_modules/ 43 | jspm_packages/ 44 | 45 | # Snowpack dependency directory (https://snowpack.dev/) 46 | web_modules/ 47 | 48 | # TypeScript cache 49 | *.tsbuildinfo 50 | 51 | # Optional npm cache directory 52 | .npm 53 | 54 | # Optional eslint cache 55 | .eslintcache 56 | 57 | # Optional stylelint cache 58 | .stylelintcache 59 | 60 | # Microbundle cache 61 | .rpt2_cache/ 62 | .rts2_cache_cjs/ 63 | .rts2_cache_es/ 64 | .rts2_cache_umd/ 65 | 66 | # Optional REPL history 67 | .node_repl_history 68 | 69 | # Output of 'npm pack' 70 | *.tgz 71 | 72 | # Yarn Integrity file 73 | .yarn-integrity 74 | 75 | # dotenv environment variable files 76 | .env 77 | .env.development.local 78 | .env.test.local 79 | .env.production.local 80 | .env.local 81 | 82 | # parcel-bundler cache (https://parceljs.org/) 83 | .cache 84 | .parcel-cache 85 | 86 | # Next.js build output 87 | .next 88 | out 89 | 90 | # Nuxt.js build / generate output 91 | .nuxt 92 | dist 93 | 94 | # Gatsby files 95 | .cache/ 96 | # Comment in the public line in if your project uses Gatsby and not Next.js 97 | # https://nextjs.org/blog/next-9-1#public-directory-support 98 | # public 99 | 100 | # vuepress build output 101 | .vuepress/dist 102 | 103 | # vuepress v2.x temp and cache directory 104 | .temp 105 | .cache 106 | 107 | # Docusaurus cache and generated files 108 | .docusaurus 109 | 110 | # Serverless directories 111 | .serverless/ 112 | 113 | # FuseBox cache 114 | .fusebox/ 115 | 116 | # DynamoDB Local files 117 | .dynamodb/ 118 | 119 | # TernJS port file 120 | .tern-port 121 | 122 | # Stores VSCode versions used for testing VSCode extensions 123 | .vscode-test 124 | 125 | # yarn v2 126 | .yarn/cache 127 | .yarn/unplugged 128 | .yarn/build-state.yml 129 | .yarn/install-state.gz 130 | .pnp.* 131 | 132 | # Dependencies 133 | node_modules/ 134 | npm-debug.log 135 | yarn-debug.log 136 | yarn-error.log 137 | 138 | # Environment 139 | .env 140 | .env.local 141 | .env.*.local 142 | 143 | # Data 144 | data/ 145 | *.log 146 | 147 | # Generated assets 148 | /assets/*.png 149 | *.png 150 | !src/assets/*.png # Keep source PNGs if any 151 | 152 | # IDE 153 | .vscode/ 154 | .idea/ 155 | *.swp 156 | *.swo 157 | 158 | # OS 159 | .DS_Store 160 | Thumbs.db 161 | 162 | Boilerplate.md 163 | 164 | # Generated PWA Files 165 | /public/assets/*manifest.json -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | # Stage 1: Build the application 2 | FROM node:20-alpine AS builder 3 | 4 | WORKDIR /app 5 | 6 | # Copy package files 7 | COPY package*.json ./ 8 | 9 | # Install dependencies 10 | RUN npm install && \ 11 | npm cache clean --force 12 | 13 | # Copy application files 14 | COPY . . 15 | 16 | # Stage 2: Create the runtime image 17 | FROM node:20-alpine 18 | 19 | WORKDIR /app 20 | 21 | # Copy only the necessary files from the builder stage 22 | COPY --from=builder /app/package*.json ./ 23 | COPY --from=builder /app/node_modules ./node_modules 24 | COPY --from=builder /app/server.js ./ 25 | COPY --from=builder /app/public ./public 26 | COPY --from=builder /app/scripts ./scripts 27 | 28 | # Create data directory (if it doesn't exist) 29 | RUN mkdir -p data 30 | 31 | # Expose port (internal port) 32 | EXPOSE 3000 33 | 34 | # Start the application 35 | CMD ["npm", "start"] -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DumbDo 2 | 3 | A stupidly simple todo list application that just works. No complex database, no unnecessary features - just todos. 4 | 5 | ![image](https://github.com/user-attachments/assets/a7857b13-db10-430f-af20-aedbf0d26023) 6 | 7 | 8 | ## Features 9 | 10 | - ✨ Clean, minimal interface 11 | - 🌓 Dark/Light mode with system preference detection 12 | - 💾 File-based storage - todos persist between sessions 13 | - 📱 Fully responsive design 14 | - 🚀 Fast and lightweight 15 | - 🔒 PIN protection (4-10 digits if enabled) 16 | - 🌐 PWA Support 17 | 18 | ## Environment Variables 19 | 20 | | Variable | Description | Default | Required | 21 | |----------|-------------|---------|----------| 22 | | PORT | The port number the server will listen on | 3000 | No | 23 | | DUMBDO_PIN | PIN protection for accessing todos (4-10 digits) | - | No | 24 | 25 | ## Quick Start 26 | 27 | ### Running Locally 28 | 29 | 1. Clone the repository 30 | ```bash 31 | git clone https://github.com/dumbwareio/dumbdo.git 32 | cd dumbdo 33 | ``` 34 | 35 | 2. Install dependencies 36 | ```bash 37 | npm install 38 | ``` 39 | 40 | 3. Start the server 41 | ```bash 42 | npm start 43 | ``` 44 | 45 | 4. Open http://localhost:3000 in your browser 46 | 47 | ### Using Docker 48 | 49 | 1. Pull from Docker Hub (recommended) 50 | ```bash 51 | docker pull dumbwareio/dumbdo:latest 52 | docker run -p 3000:3000 -v $(pwd)/data:/app/data dumbwareio/dumbdo:latest 53 | ``` 54 | 55 | 2. Or build locally 56 | ```bash 57 | docker build -t dumbwareio/dumbdo . 58 | docker run -p 3000:3000 -v $(pwd)/data:/app/data dumbwareio/dumbdo 59 | ``` 60 | 61 | 3. Docker Compose 62 | ```yaml 63 | services: 64 | dumbdo: 65 | image: dumbwareio/dumbdo:latest 66 | container_name: dumbdo 67 | restart: unless-stopped 68 | ports: 69 | - ${DUMBDO_PORT:-3000}:3000 70 | volumes: 71 | - ${DUMBDO_DATA_PATH:-./data}:/app/data 72 | environment: 73 | - DUMBDO_PIN=${DUMBDO_PIN-} 74 | - DUMBDO_SITE_TITLE=DumbDo 75 | # (Optional) Restrict origins - ex: https://subdomain.domain.tld,https://auth.proxy.tld,http://internalip:port' (default is '*') 76 | # - ALLOWED_ORIGINS=http://localhost:3000 77 | # - NODE_ENV=development # default production (development allows all origins) 78 | #healthcheck: 79 | # test: wget --spider -q http://127.0.0.1:3000 80 | # start_period: 20s 81 | # interval: 20s 82 | # timeout: 5s 83 | # retries: 3 84 | ``` 85 | ## Storage 86 | 87 | Todos are stored in a JSON file at `app/data/todos.json`. The file is automatically created when you first run the application. 88 | 89 | To backup your todos, simply copy the `data` directory. To restore, place your backup `todos.json` in the `data` directory. 90 | 91 | ## Development 92 | 93 | The application follows the "Dumb" design system principles: 94 | 95 | - No complex storage 96 | - Single purpose, done well 97 | - "It just works" 98 | 99 | ### Project Structure 100 | 101 | ``` 102 | dumbdo/ 103 | ├── app.js # Frontend JavaScript 104 | ├── index.html # Main HTML file 105 | ├── server.js # Node.js server 106 | ├── styles.css # CSS styles 107 | ├── data/ # Todo storage directory 108 | │ └── todos.json 109 | ├── Dockerfile # Docker configuration 110 | └── package.json # Dependencies and scripts 111 | ``` 112 | 113 | ## Contributing 114 | 115 | This is meant to be a simple application. If you're writing complex code to solve a simple problem, you're probably doing it wrong. Keep it dumb, keep it simple. 116 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | services: 2 | dumbdo: 3 | image: dumbwareio/dumbdo:latest 4 | container_name: dumbdo 5 | restart: unless-stopped 6 | ports: 7 | - ${DUMBDO_PORT:-3000}:3000 8 | volumes: 9 | - ${DUMBDO_DATA_PATH:-./data}:/app/data 10 | environment: 11 | - DUMBDO_PIN=${DUMBDO_PIN-} 12 | - DUMBDO_SITE_TITLE=DumbDo 13 | # (Optional) Restrict origins - ex: https://subdomain.domain.tld,https://auth.proxy.tld,http://internalip:port' (default is '*') 14 | # - ALLOWED_ORIGINS=http://localhost:3000 15 | # - NODE_ENV=development # default production (development allows all origins) 16 | #healthcheck: 17 | # test: wget --spider -q http://127.0.0.1:3000 18 | # start_period: 20s 19 | # interval: 20s 20 | # timeout: 5s 21 | # retries: 3 -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "dumbdo", 3 | "version": "1.0.0", 4 | "lockfileVersion": 3, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "name": "dumbdo", 9 | "version": "1.0.0", 10 | "license": "ISC", 11 | "dependencies": { 12 | "cookie-parser": "^1.4.7", 13 | "cors": "^2.8.5", 14 | "dotenv": "^16.4.7", 15 | "express": "^4.18.2" 16 | }, 17 | "devDependencies": { 18 | "http-server": "^14.1.1", 19 | "sharp": "^0.33.5" 20 | } 21 | }, 22 | "node_modules/@emnapi/runtime": { 23 | "version": "1.3.1", 24 | "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.3.1.tgz", 25 | "integrity": "sha512-kEBmG8KyqtxJZv+ygbEim+KCGtIq1fC22Ms3S4ziXmYKm8uyoLX0MHONVKwp+9opg390VaKRNt4a7A9NwmpNhw==", 26 | "dev": true, 27 | "license": "MIT", 28 | "optional": true, 29 | "dependencies": { 30 | "tslib": "^2.4.0" 31 | } 32 | }, 33 | "node_modules/@img/sharp-darwin-arm64": { 34 | "version": "0.33.5", 35 | "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.33.5.tgz", 36 | "integrity": "sha512-UT4p+iz/2H4twwAoLCqfA9UH5pI6DggwKEGuaPy7nCVQ8ZsiY5PIcrRvD1DzuY3qYL07NtIQcWnBSY/heikIFQ==", 37 | "cpu": [ 38 | "arm64" 39 | ], 40 | "dev": true, 41 | "license": "Apache-2.0", 42 | "optional": true, 43 | "os": [ 44 | "darwin" 45 | ], 46 | "engines": { 47 | "node": "^18.17.0 || ^20.3.0 || >=21.0.0" 48 | }, 49 | "funding": { 50 | "url": "https://opencollective.com/libvips" 51 | }, 52 | "optionalDependencies": { 53 | "@img/sharp-libvips-darwin-arm64": "1.0.4" 54 | } 55 | }, 56 | "node_modules/@img/sharp-darwin-x64": { 57 | "version": "0.33.5", 58 | "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.33.5.tgz", 59 | "integrity": "sha512-fyHac4jIc1ANYGRDxtiqelIbdWkIuQaI84Mv45KvGRRxSAa7o7d1ZKAOBaYbnepLC1WqxfpimdeWfvqqSGwR2Q==", 60 | "cpu": [ 61 | "x64" 62 | ], 63 | "dev": true, 64 | "license": "Apache-2.0", 65 | "optional": true, 66 | "os": [ 67 | "darwin" 68 | ], 69 | "engines": { 70 | "node": "^18.17.0 || ^20.3.0 || >=21.0.0" 71 | }, 72 | "funding": { 73 | "url": "https://opencollective.com/libvips" 74 | }, 75 | "optionalDependencies": { 76 | "@img/sharp-libvips-darwin-x64": "1.0.4" 77 | } 78 | }, 79 | "node_modules/@img/sharp-libvips-darwin-arm64": { 80 | "version": "1.0.4", 81 | "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.0.4.tgz", 82 | "integrity": "sha512-XblONe153h0O2zuFfTAbQYAX2JhYmDHeWikp1LM9Hul9gVPjFY427k6dFEcOL72O01QxQsWi761svJ/ev9xEDg==", 83 | "cpu": [ 84 | "arm64" 85 | ], 86 | "dev": true, 87 | "license": "LGPL-3.0-or-later", 88 | "optional": true, 89 | "os": [ 90 | "darwin" 91 | ], 92 | "funding": { 93 | "url": "https://opencollective.com/libvips" 94 | } 95 | }, 96 | "node_modules/@img/sharp-libvips-darwin-x64": { 97 | "version": "1.0.4", 98 | "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.0.4.tgz", 99 | "integrity": "sha512-xnGR8YuZYfJGmWPvmlunFaWJsb9T/AO2ykoP3Fz/0X5XV2aoYBPkX6xqCQvUTKKiLddarLaxpzNe+b1hjeWHAQ==", 100 | "cpu": [ 101 | "x64" 102 | ], 103 | "dev": true, 104 | "license": "LGPL-3.0-or-later", 105 | "optional": true, 106 | "os": [ 107 | "darwin" 108 | ], 109 | "funding": { 110 | "url": "https://opencollective.com/libvips" 111 | } 112 | }, 113 | "node_modules/@img/sharp-libvips-linux-arm": { 114 | "version": "1.0.5", 115 | "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.0.5.tgz", 116 | "integrity": "sha512-gvcC4ACAOPRNATg/ov8/MnbxFDJqf/pDePbBnuBDcjsI8PssmjoKMAz4LtLaVi+OnSb5FK/yIOamqDwGmXW32g==", 117 | "cpu": [ 118 | "arm" 119 | ], 120 | "dev": true, 121 | "license": "LGPL-3.0-or-later", 122 | "optional": true, 123 | "os": [ 124 | "linux" 125 | ], 126 | "funding": { 127 | "url": "https://opencollective.com/libvips" 128 | } 129 | }, 130 | "node_modules/@img/sharp-libvips-linux-arm64": { 131 | "version": "1.0.4", 132 | "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.0.4.tgz", 133 | "integrity": "sha512-9B+taZ8DlyyqzZQnoeIvDVR/2F4EbMepXMc/NdVbkzsJbzkUjhXv/70GQJ7tdLA4YJgNP25zukcxpX2/SueNrA==", 134 | "cpu": [ 135 | "arm64" 136 | ], 137 | "dev": true, 138 | "license": "LGPL-3.0-or-later", 139 | "optional": true, 140 | "os": [ 141 | "linux" 142 | ], 143 | "funding": { 144 | "url": "https://opencollective.com/libvips" 145 | } 146 | }, 147 | "node_modules/@img/sharp-libvips-linux-s390x": { 148 | "version": "1.0.4", 149 | "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.0.4.tgz", 150 | "integrity": "sha512-u7Wz6ntiSSgGSGcjZ55im6uvTrOxSIS8/dgoVMoiGE9I6JAfU50yH5BoDlYA1tcuGS7g/QNtetJnxA6QEsCVTA==", 151 | "cpu": [ 152 | "s390x" 153 | ], 154 | "dev": true, 155 | "license": "LGPL-3.0-or-later", 156 | "optional": true, 157 | "os": [ 158 | "linux" 159 | ], 160 | "funding": { 161 | "url": "https://opencollective.com/libvips" 162 | } 163 | }, 164 | "node_modules/@img/sharp-libvips-linux-x64": { 165 | "version": "1.0.4", 166 | "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.0.4.tgz", 167 | "integrity": "sha512-MmWmQ3iPFZr0Iev+BAgVMb3ZyC4KeFc3jFxnNbEPas60e1cIfevbtuyf9nDGIzOaW9PdnDciJm+wFFaTlj5xYw==", 168 | "cpu": [ 169 | "x64" 170 | ], 171 | "dev": true, 172 | "license": "LGPL-3.0-or-later", 173 | "optional": true, 174 | "os": [ 175 | "linux" 176 | ], 177 | "funding": { 178 | "url": "https://opencollective.com/libvips" 179 | } 180 | }, 181 | "node_modules/@img/sharp-libvips-linuxmusl-arm64": { 182 | "version": "1.0.4", 183 | "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.0.4.tgz", 184 | "integrity": "sha512-9Ti+BbTYDcsbp4wfYib8Ctm1ilkugkA/uscUn6UXK1ldpC1JjiXbLfFZtRlBhjPZ5o1NCLiDbg8fhUPKStHoTA==", 185 | "cpu": [ 186 | "arm64" 187 | ], 188 | "dev": true, 189 | "license": "LGPL-3.0-or-later", 190 | "optional": true, 191 | "os": [ 192 | "linux" 193 | ], 194 | "funding": { 195 | "url": "https://opencollective.com/libvips" 196 | } 197 | }, 198 | "node_modules/@img/sharp-libvips-linuxmusl-x64": { 199 | "version": "1.0.4", 200 | "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.0.4.tgz", 201 | "integrity": "sha512-viYN1KX9m+/hGkJtvYYp+CCLgnJXwiQB39damAO7WMdKWlIhmYTfHjwSbQeUK/20vY154mwezd9HflVFM1wVSw==", 202 | "cpu": [ 203 | "x64" 204 | ], 205 | "dev": true, 206 | "license": "LGPL-3.0-or-later", 207 | "optional": true, 208 | "os": [ 209 | "linux" 210 | ], 211 | "funding": { 212 | "url": "https://opencollective.com/libvips" 213 | } 214 | }, 215 | "node_modules/@img/sharp-linux-arm": { 216 | "version": "0.33.5", 217 | "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.33.5.tgz", 218 | "integrity": "sha512-JTS1eldqZbJxjvKaAkxhZmBqPRGmxgu+qFKSInv8moZ2AmT5Yib3EQ1c6gp493HvrvV8QgdOXdyaIBrhvFhBMQ==", 219 | "cpu": [ 220 | "arm" 221 | ], 222 | "dev": true, 223 | "license": "Apache-2.0", 224 | "optional": true, 225 | "os": [ 226 | "linux" 227 | ], 228 | "engines": { 229 | "node": "^18.17.0 || ^20.3.0 || >=21.0.0" 230 | }, 231 | "funding": { 232 | "url": "https://opencollective.com/libvips" 233 | }, 234 | "optionalDependencies": { 235 | "@img/sharp-libvips-linux-arm": "1.0.5" 236 | } 237 | }, 238 | "node_modules/@img/sharp-linux-arm64": { 239 | "version": "0.33.5", 240 | "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.33.5.tgz", 241 | "integrity": "sha512-JMVv+AMRyGOHtO1RFBiJy/MBsgz0x4AWrT6QoEVVTyh1E39TrCUpTRI7mx9VksGX4awWASxqCYLCV4wBZHAYxA==", 242 | "cpu": [ 243 | "arm64" 244 | ], 245 | "dev": true, 246 | "license": "Apache-2.0", 247 | "optional": true, 248 | "os": [ 249 | "linux" 250 | ], 251 | "engines": { 252 | "node": "^18.17.0 || ^20.3.0 || >=21.0.0" 253 | }, 254 | "funding": { 255 | "url": "https://opencollective.com/libvips" 256 | }, 257 | "optionalDependencies": { 258 | "@img/sharp-libvips-linux-arm64": "1.0.4" 259 | } 260 | }, 261 | "node_modules/@img/sharp-linux-s390x": { 262 | "version": "0.33.5", 263 | "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.33.5.tgz", 264 | "integrity": "sha512-y/5PCd+mP4CA/sPDKl2961b+C9d+vPAveS33s6Z3zfASk2j5upL6fXVPZi7ztePZ5CuH+1kW8JtvxgbuXHRa4Q==", 265 | "cpu": [ 266 | "s390x" 267 | ], 268 | "dev": true, 269 | "license": "Apache-2.0", 270 | "optional": true, 271 | "os": [ 272 | "linux" 273 | ], 274 | "engines": { 275 | "node": "^18.17.0 || ^20.3.0 || >=21.0.0" 276 | }, 277 | "funding": { 278 | "url": "https://opencollective.com/libvips" 279 | }, 280 | "optionalDependencies": { 281 | "@img/sharp-libvips-linux-s390x": "1.0.4" 282 | } 283 | }, 284 | "node_modules/@img/sharp-linux-x64": { 285 | "version": "0.33.5", 286 | "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.33.5.tgz", 287 | "integrity": "sha512-opC+Ok5pRNAzuvq1AG0ar+1owsu842/Ab+4qvU879ippJBHvyY5n2mxF1izXqkPYlGuP/M556uh53jRLJmzTWA==", 288 | "cpu": [ 289 | "x64" 290 | ], 291 | "dev": true, 292 | "license": "Apache-2.0", 293 | "optional": true, 294 | "os": [ 295 | "linux" 296 | ], 297 | "engines": { 298 | "node": "^18.17.0 || ^20.3.0 || >=21.0.0" 299 | }, 300 | "funding": { 301 | "url": "https://opencollective.com/libvips" 302 | }, 303 | "optionalDependencies": { 304 | "@img/sharp-libvips-linux-x64": "1.0.4" 305 | } 306 | }, 307 | "node_modules/@img/sharp-linuxmusl-arm64": { 308 | "version": "0.33.5", 309 | "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.33.5.tgz", 310 | "integrity": "sha512-XrHMZwGQGvJg2V/oRSUfSAfjfPxO+4DkiRh6p2AFjLQztWUuY/o8Mq0eMQVIY7HJ1CDQUJlxGGZRw1a5bqmd1g==", 311 | "cpu": [ 312 | "arm64" 313 | ], 314 | "dev": true, 315 | "license": "Apache-2.0", 316 | "optional": true, 317 | "os": [ 318 | "linux" 319 | ], 320 | "engines": { 321 | "node": "^18.17.0 || ^20.3.0 || >=21.0.0" 322 | }, 323 | "funding": { 324 | "url": "https://opencollective.com/libvips" 325 | }, 326 | "optionalDependencies": { 327 | "@img/sharp-libvips-linuxmusl-arm64": "1.0.4" 328 | } 329 | }, 330 | "node_modules/@img/sharp-linuxmusl-x64": { 331 | "version": "0.33.5", 332 | "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.33.5.tgz", 333 | "integrity": "sha512-WT+d/cgqKkkKySYmqoZ8y3pxx7lx9vVejxW/W4DOFMYVSkErR+w7mf2u8m/y4+xHe7yY9DAXQMWQhpnMuFfScw==", 334 | "cpu": [ 335 | "x64" 336 | ], 337 | "dev": true, 338 | "license": "Apache-2.0", 339 | "optional": true, 340 | "os": [ 341 | "linux" 342 | ], 343 | "engines": { 344 | "node": "^18.17.0 || ^20.3.0 || >=21.0.0" 345 | }, 346 | "funding": { 347 | "url": "https://opencollective.com/libvips" 348 | }, 349 | "optionalDependencies": { 350 | "@img/sharp-libvips-linuxmusl-x64": "1.0.4" 351 | } 352 | }, 353 | "node_modules/@img/sharp-wasm32": { 354 | "version": "0.33.5", 355 | "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.33.5.tgz", 356 | "integrity": "sha512-ykUW4LVGaMcU9lu9thv85CbRMAwfeadCJHRsg2GmeRa/cJxsVY9Rbd57JcMxBkKHag5U/x7TSBpScF4U8ElVzg==", 357 | "cpu": [ 358 | "wasm32" 359 | ], 360 | "dev": true, 361 | "license": "Apache-2.0 AND LGPL-3.0-or-later AND MIT", 362 | "optional": true, 363 | "dependencies": { 364 | "@emnapi/runtime": "^1.2.0" 365 | }, 366 | "engines": { 367 | "node": "^18.17.0 || ^20.3.0 || >=21.0.0" 368 | }, 369 | "funding": { 370 | "url": "https://opencollective.com/libvips" 371 | } 372 | }, 373 | "node_modules/@img/sharp-win32-ia32": { 374 | "version": "0.33.5", 375 | "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.33.5.tgz", 376 | "integrity": "sha512-T36PblLaTwuVJ/zw/LaH0PdZkRz5rd3SmMHX8GSmR7vtNSP5Z6bQkExdSK7xGWyxLw4sUknBuugTelgw2faBbQ==", 377 | "cpu": [ 378 | "ia32" 379 | ], 380 | "dev": true, 381 | "license": "Apache-2.0 AND LGPL-3.0-or-later", 382 | "optional": true, 383 | "os": [ 384 | "win32" 385 | ], 386 | "engines": { 387 | "node": "^18.17.0 || ^20.3.0 || >=21.0.0" 388 | }, 389 | "funding": { 390 | "url": "https://opencollective.com/libvips" 391 | } 392 | }, 393 | "node_modules/@img/sharp-win32-x64": { 394 | "version": "0.33.5", 395 | "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.33.5.tgz", 396 | "integrity": "sha512-MpY/o8/8kj+EcnxwvrP4aTJSWw/aZ7JIGR4aBeZkZw5B7/Jn+tY9/VNwtcoGmdT7GfggGIU4kygOMSbYnOrAbg==", 397 | "cpu": [ 398 | "x64" 399 | ], 400 | "dev": true, 401 | "license": "Apache-2.0 AND LGPL-3.0-or-later", 402 | "optional": true, 403 | "os": [ 404 | "win32" 405 | ], 406 | "engines": { 407 | "node": "^18.17.0 || ^20.3.0 || >=21.0.0" 408 | }, 409 | "funding": { 410 | "url": "https://opencollective.com/libvips" 411 | } 412 | }, 413 | "node_modules/accepts": { 414 | "version": "1.3.8", 415 | "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", 416 | "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", 417 | "license": "MIT", 418 | "dependencies": { 419 | "mime-types": "~2.1.34", 420 | "negotiator": "0.6.3" 421 | }, 422 | "engines": { 423 | "node": ">= 0.6" 424 | } 425 | }, 426 | "node_modules/ansi-styles": { 427 | "version": "4.3.0", 428 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", 429 | "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", 430 | "dev": true, 431 | "license": "MIT", 432 | "dependencies": { 433 | "color-convert": "^2.0.1" 434 | }, 435 | "engines": { 436 | "node": ">=8" 437 | }, 438 | "funding": { 439 | "url": "https://github.com/chalk/ansi-styles?sponsor=1" 440 | } 441 | }, 442 | "node_modules/array-flatten": { 443 | "version": "1.1.1", 444 | "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", 445 | "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==", 446 | "license": "MIT" 447 | }, 448 | "node_modules/async": { 449 | "version": "3.2.6", 450 | "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", 451 | "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==", 452 | "dev": true, 453 | "license": "MIT" 454 | }, 455 | "node_modules/basic-auth": { 456 | "version": "2.0.1", 457 | "resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-2.0.1.tgz", 458 | "integrity": "sha512-NF+epuEdnUYVlGuhaxbbq+dvJttwLnGY+YixlXlME5KpQ5W3CnXA5cVTneY3SPbPDRkcjMbifrwmFYcClgOZeg==", 459 | "dev": true, 460 | "license": "MIT", 461 | "dependencies": { 462 | "safe-buffer": "5.1.2" 463 | }, 464 | "engines": { 465 | "node": ">= 0.8" 466 | } 467 | }, 468 | "node_modules/basic-auth/node_modules/safe-buffer": { 469 | "version": "5.1.2", 470 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", 471 | "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", 472 | "dev": true, 473 | "license": "MIT" 474 | }, 475 | "node_modules/body-parser": { 476 | "version": "1.20.3", 477 | "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", 478 | "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", 479 | "license": "MIT", 480 | "dependencies": { 481 | "bytes": "3.1.2", 482 | "content-type": "~1.0.5", 483 | "debug": "2.6.9", 484 | "depd": "2.0.0", 485 | "destroy": "1.2.0", 486 | "http-errors": "2.0.0", 487 | "iconv-lite": "0.4.24", 488 | "on-finished": "2.4.1", 489 | "qs": "6.13.0", 490 | "raw-body": "2.5.2", 491 | "type-is": "~1.6.18", 492 | "unpipe": "1.0.0" 493 | }, 494 | "engines": { 495 | "node": ">= 0.8", 496 | "npm": "1.2.8000 || >= 1.4.16" 497 | } 498 | }, 499 | "node_modules/bytes": { 500 | "version": "3.1.2", 501 | "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", 502 | "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", 503 | "license": "MIT", 504 | "engines": { 505 | "node": ">= 0.8" 506 | } 507 | }, 508 | "node_modules/call-bind-apply-helpers": { 509 | "version": "1.0.2", 510 | "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", 511 | "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", 512 | "license": "MIT", 513 | "dependencies": { 514 | "es-errors": "^1.3.0", 515 | "function-bind": "^1.1.2" 516 | }, 517 | "engines": { 518 | "node": ">= 0.4" 519 | } 520 | }, 521 | "node_modules/call-bound": { 522 | "version": "1.0.4", 523 | "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", 524 | "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", 525 | "license": "MIT", 526 | "dependencies": { 527 | "call-bind-apply-helpers": "^1.0.2", 528 | "get-intrinsic": "^1.3.0" 529 | }, 530 | "engines": { 531 | "node": ">= 0.4" 532 | }, 533 | "funding": { 534 | "url": "https://github.com/sponsors/ljharb" 535 | } 536 | }, 537 | "node_modules/chalk": { 538 | "version": "4.1.2", 539 | "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", 540 | "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", 541 | "dev": true, 542 | "license": "MIT", 543 | "dependencies": { 544 | "ansi-styles": "^4.1.0", 545 | "supports-color": "^7.1.0" 546 | }, 547 | "engines": { 548 | "node": ">=10" 549 | }, 550 | "funding": { 551 | "url": "https://github.com/chalk/chalk?sponsor=1" 552 | } 553 | }, 554 | "node_modules/color": { 555 | "version": "4.2.3", 556 | "resolved": "https://registry.npmjs.org/color/-/color-4.2.3.tgz", 557 | "integrity": "sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==", 558 | "dev": true, 559 | "license": "MIT", 560 | "dependencies": { 561 | "color-convert": "^2.0.1", 562 | "color-string": "^1.9.0" 563 | }, 564 | "engines": { 565 | "node": ">=12.5.0" 566 | } 567 | }, 568 | "node_modules/color-convert": { 569 | "version": "2.0.1", 570 | "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", 571 | "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", 572 | "dev": true, 573 | "license": "MIT", 574 | "dependencies": { 575 | "color-name": "~1.1.4" 576 | }, 577 | "engines": { 578 | "node": ">=7.0.0" 579 | } 580 | }, 581 | "node_modules/color-name": { 582 | "version": "1.1.4", 583 | "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", 584 | "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", 585 | "dev": true, 586 | "license": "MIT" 587 | }, 588 | "node_modules/color-string": { 589 | "version": "1.9.1", 590 | "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz", 591 | "integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==", 592 | "dev": true, 593 | "license": "MIT", 594 | "dependencies": { 595 | "color-name": "^1.0.0", 596 | "simple-swizzle": "^0.2.2" 597 | } 598 | }, 599 | "node_modules/content-disposition": { 600 | "version": "0.5.4", 601 | "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", 602 | "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", 603 | "license": "MIT", 604 | "dependencies": { 605 | "safe-buffer": "5.2.1" 606 | }, 607 | "engines": { 608 | "node": ">= 0.6" 609 | } 610 | }, 611 | "node_modules/content-type": { 612 | "version": "1.0.5", 613 | "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", 614 | "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", 615 | "license": "MIT", 616 | "engines": { 617 | "node": ">= 0.6" 618 | } 619 | }, 620 | "node_modules/cookie": { 621 | "version": "0.7.2", 622 | "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", 623 | "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", 624 | "license": "MIT", 625 | "engines": { 626 | "node": ">= 0.6" 627 | } 628 | }, 629 | "node_modules/cookie-parser": { 630 | "version": "1.4.7", 631 | "resolved": "https://registry.npmjs.org/cookie-parser/-/cookie-parser-1.4.7.tgz", 632 | "integrity": "sha512-nGUvgXnotP3BsjiLX2ypbQnWoGUPIIfHQNZkkC668ntrzGWEZVW70HDEB1qnNGMicPje6EttlIgzo51YSwNQGw==", 633 | "license": "MIT", 634 | "dependencies": { 635 | "cookie": "0.7.2", 636 | "cookie-signature": "1.0.6" 637 | }, 638 | "engines": { 639 | "node": ">= 0.8.0" 640 | } 641 | }, 642 | "node_modules/cookie-signature": { 643 | "version": "1.0.6", 644 | "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", 645 | "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==", 646 | "license": "MIT" 647 | }, 648 | "node_modules/cors": { 649 | "version": "2.8.5", 650 | "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", 651 | "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", 652 | "license": "MIT", 653 | "dependencies": { 654 | "object-assign": "^4", 655 | "vary": "^1" 656 | }, 657 | "engines": { 658 | "node": ">= 0.10" 659 | } 660 | }, 661 | "node_modules/corser": { 662 | "version": "2.0.1", 663 | "resolved": "https://registry.npmjs.org/corser/-/corser-2.0.1.tgz", 664 | "integrity": "sha512-utCYNzRSQIZNPIcGZdQc92UVJYAhtGAteCFg0yRaFm8f0P+CPtyGyHXJcGXnffjCybUCEx3FQ2G7U3/o9eIkVQ==", 665 | "dev": true, 666 | "license": "MIT", 667 | "engines": { 668 | "node": ">= 0.4.0" 669 | } 670 | }, 671 | "node_modules/debug": { 672 | "version": "2.6.9", 673 | "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", 674 | "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", 675 | "license": "MIT", 676 | "dependencies": { 677 | "ms": "2.0.0" 678 | } 679 | }, 680 | "node_modules/depd": { 681 | "version": "2.0.0", 682 | "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", 683 | "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", 684 | "license": "MIT", 685 | "engines": { 686 | "node": ">= 0.8" 687 | } 688 | }, 689 | "node_modules/destroy": { 690 | "version": "1.2.0", 691 | "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", 692 | "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", 693 | "license": "MIT", 694 | "engines": { 695 | "node": ">= 0.8", 696 | "npm": "1.2.8000 || >= 1.4.16" 697 | } 698 | }, 699 | "node_modules/detect-libc": { 700 | "version": "2.0.3", 701 | "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.3.tgz", 702 | "integrity": "sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==", 703 | "dev": true, 704 | "license": "Apache-2.0", 705 | "engines": { 706 | "node": ">=8" 707 | } 708 | }, 709 | "node_modules/dotenv": { 710 | "version": "16.4.7", 711 | "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.7.tgz", 712 | "integrity": "sha512-47qPchRCykZC03FhkYAhrvwU4xDBFIj1QPqaarj6mdM/hgUzfPHcpkHJOn3mJAufFeeAxAzeGsr5X0M4k6fLZQ==", 713 | "license": "BSD-2-Clause", 714 | "engines": { 715 | "node": ">=12" 716 | }, 717 | "funding": { 718 | "url": "https://dotenvx.com" 719 | } 720 | }, 721 | "node_modules/dunder-proto": { 722 | "version": "1.0.1", 723 | "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", 724 | "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", 725 | "license": "MIT", 726 | "dependencies": { 727 | "call-bind-apply-helpers": "^1.0.1", 728 | "es-errors": "^1.3.0", 729 | "gopd": "^1.2.0" 730 | }, 731 | "engines": { 732 | "node": ">= 0.4" 733 | } 734 | }, 735 | "node_modules/ee-first": { 736 | "version": "1.1.1", 737 | "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", 738 | "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", 739 | "license": "MIT" 740 | }, 741 | "node_modules/encodeurl": { 742 | "version": "2.0.0", 743 | "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", 744 | "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", 745 | "license": "MIT", 746 | "engines": { 747 | "node": ">= 0.8" 748 | } 749 | }, 750 | "node_modules/es-define-property": { 751 | "version": "1.0.1", 752 | "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", 753 | "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", 754 | "license": "MIT", 755 | "engines": { 756 | "node": ">= 0.4" 757 | } 758 | }, 759 | "node_modules/es-errors": { 760 | "version": "1.3.0", 761 | "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", 762 | "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", 763 | "license": "MIT", 764 | "engines": { 765 | "node": ">= 0.4" 766 | } 767 | }, 768 | "node_modules/es-object-atoms": { 769 | "version": "1.1.1", 770 | "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", 771 | "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", 772 | "license": "MIT", 773 | "dependencies": { 774 | "es-errors": "^1.3.0" 775 | }, 776 | "engines": { 777 | "node": ">= 0.4" 778 | } 779 | }, 780 | "node_modules/escape-html": { 781 | "version": "1.0.3", 782 | "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", 783 | "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", 784 | "license": "MIT" 785 | }, 786 | "node_modules/etag": { 787 | "version": "1.8.1", 788 | "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", 789 | "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", 790 | "license": "MIT", 791 | "engines": { 792 | "node": ">= 0.6" 793 | } 794 | }, 795 | "node_modules/eventemitter3": { 796 | "version": "4.0.7", 797 | "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", 798 | "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==", 799 | "dev": true, 800 | "license": "MIT" 801 | }, 802 | "node_modules/express": { 803 | "version": "4.21.2", 804 | "resolved": "https://registry.npmjs.org/express/-/express-4.21.2.tgz", 805 | "integrity": "sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==", 806 | "license": "MIT", 807 | "dependencies": { 808 | "accepts": "~1.3.8", 809 | "array-flatten": "1.1.1", 810 | "body-parser": "1.20.3", 811 | "content-disposition": "0.5.4", 812 | "content-type": "~1.0.4", 813 | "cookie": "0.7.1", 814 | "cookie-signature": "1.0.6", 815 | "debug": "2.6.9", 816 | "depd": "2.0.0", 817 | "encodeurl": "~2.0.0", 818 | "escape-html": "~1.0.3", 819 | "etag": "~1.8.1", 820 | "finalhandler": "1.3.1", 821 | "fresh": "0.5.2", 822 | "http-errors": "2.0.0", 823 | "merge-descriptors": "1.0.3", 824 | "methods": "~1.1.2", 825 | "on-finished": "2.4.1", 826 | "parseurl": "~1.3.3", 827 | "path-to-regexp": "0.1.12", 828 | "proxy-addr": "~2.0.7", 829 | "qs": "6.13.0", 830 | "range-parser": "~1.2.1", 831 | "safe-buffer": "5.2.1", 832 | "send": "0.19.0", 833 | "serve-static": "1.16.2", 834 | "setprototypeof": "1.2.0", 835 | "statuses": "2.0.1", 836 | "type-is": "~1.6.18", 837 | "utils-merge": "1.0.1", 838 | "vary": "~1.1.2" 839 | }, 840 | "engines": { 841 | "node": ">= 0.10.0" 842 | }, 843 | "funding": { 844 | "type": "opencollective", 845 | "url": "https://opencollective.com/express" 846 | } 847 | }, 848 | "node_modules/express/node_modules/cookie": { 849 | "version": "0.7.1", 850 | "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz", 851 | "integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==", 852 | "license": "MIT", 853 | "engines": { 854 | "node": ">= 0.6" 855 | } 856 | }, 857 | "node_modules/finalhandler": { 858 | "version": "1.3.1", 859 | "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz", 860 | "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==", 861 | "license": "MIT", 862 | "dependencies": { 863 | "debug": "2.6.9", 864 | "encodeurl": "~2.0.0", 865 | "escape-html": "~1.0.3", 866 | "on-finished": "2.4.1", 867 | "parseurl": "~1.3.3", 868 | "statuses": "2.0.1", 869 | "unpipe": "~1.0.0" 870 | }, 871 | "engines": { 872 | "node": ">= 0.8" 873 | } 874 | }, 875 | "node_modules/follow-redirects": { 876 | "version": "1.15.9", 877 | "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz", 878 | "integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==", 879 | "dev": true, 880 | "funding": [ 881 | { 882 | "type": "individual", 883 | "url": "https://github.com/sponsors/RubenVerborgh" 884 | } 885 | ], 886 | "license": "MIT", 887 | "engines": { 888 | "node": ">=4.0" 889 | }, 890 | "peerDependenciesMeta": { 891 | "debug": { 892 | "optional": true 893 | } 894 | } 895 | }, 896 | "node_modules/forwarded": { 897 | "version": "0.2.0", 898 | "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", 899 | "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", 900 | "license": "MIT", 901 | "engines": { 902 | "node": ">= 0.6" 903 | } 904 | }, 905 | "node_modules/fresh": { 906 | "version": "0.5.2", 907 | "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", 908 | "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", 909 | "license": "MIT", 910 | "engines": { 911 | "node": ">= 0.6" 912 | } 913 | }, 914 | "node_modules/function-bind": { 915 | "version": "1.1.2", 916 | "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", 917 | "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", 918 | "license": "MIT", 919 | "funding": { 920 | "url": "https://github.com/sponsors/ljharb" 921 | } 922 | }, 923 | "node_modules/get-intrinsic": { 924 | "version": "1.3.0", 925 | "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", 926 | "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", 927 | "license": "MIT", 928 | "dependencies": { 929 | "call-bind-apply-helpers": "^1.0.2", 930 | "es-define-property": "^1.0.1", 931 | "es-errors": "^1.3.0", 932 | "es-object-atoms": "^1.1.1", 933 | "function-bind": "^1.1.2", 934 | "get-proto": "^1.0.1", 935 | "gopd": "^1.2.0", 936 | "has-symbols": "^1.1.0", 937 | "hasown": "^2.0.2", 938 | "math-intrinsics": "^1.1.0" 939 | }, 940 | "engines": { 941 | "node": ">= 0.4" 942 | }, 943 | "funding": { 944 | "url": "https://github.com/sponsors/ljharb" 945 | } 946 | }, 947 | "node_modules/get-proto": { 948 | "version": "1.0.1", 949 | "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", 950 | "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", 951 | "license": "MIT", 952 | "dependencies": { 953 | "dunder-proto": "^1.0.1", 954 | "es-object-atoms": "^1.0.0" 955 | }, 956 | "engines": { 957 | "node": ">= 0.4" 958 | } 959 | }, 960 | "node_modules/gopd": { 961 | "version": "1.2.0", 962 | "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", 963 | "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", 964 | "license": "MIT", 965 | "engines": { 966 | "node": ">= 0.4" 967 | }, 968 | "funding": { 969 | "url": "https://github.com/sponsors/ljharb" 970 | } 971 | }, 972 | "node_modules/has-flag": { 973 | "version": "4.0.0", 974 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", 975 | "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", 976 | "dev": true, 977 | "license": "MIT", 978 | "engines": { 979 | "node": ">=8" 980 | } 981 | }, 982 | "node_modules/has-symbols": { 983 | "version": "1.1.0", 984 | "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", 985 | "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", 986 | "license": "MIT", 987 | "engines": { 988 | "node": ">= 0.4" 989 | }, 990 | "funding": { 991 | "url": "https://github.com/sponsors/ljharb" 992 | } 993 | }, 994 | "node_modules/hasown": { 995 | "version": "2.0.2", 996 | "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", 997 | "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", 998 | "license": "MIT", 999 | "dependencies": { 1000 | "function-bind": "^1.1.2" 1001 | }, 1002 | "engines": { 1003 | "node": ">= 0.4" 1004 | } 1005 | }, 1006 | "node_modules/he": { 1007 | "version": "1.2.0", 1008 | "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", 1009 | "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", 1010 | "dev": true, 1011 | "license": "MIT", 1012 | "bin": { 1013 | "he": "bin/he" 1014 | } 1015 | }, 1016 | "node_modules/html-encoding-sniffer": { 1017 | "version": "3.0.0", 1018 | "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz", 1019 | "integrity": "sha512-oWv4T4yJ52iKrufjnyZPkrN0CH3QnrUqdB6In1g5Fe1mia8GmF36gnfNySxoZtxD5+NmYw1EElVXiBk93UeskA==", 1020 | "dev": true, 1021 | "license": "MIT", 1022 | "dependencies": { 1023 | "whatwg-encoding": "^2.0.0" 1024 | }, 1025 | "engines": { 1026 | "node": ">=12" 1027 | } 1028 | }, 1029 | "node_modules/http-errors": { 1030 | "version": "2.0.0", 1031 | "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", 1032 | "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", 1033 | "license": "MIT", 1034 | "dependencies": { 1035 | "depd": "2.0.0", 1036 | "inherits": "2.0.4", 1037 | "setprototypeof": "1.2.0", 1038 | "statuses": "2.0.1", 1039 | "toidentifier": "1.0.1" 1040 | }, 1041 | "engines": { 1042 | "node": ">= 0.8" 1043 | } 1044 | }, 1045 | "node_modules/http-proxy": { 1046 | "version": "1.18.1", 1047 | "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz", 1048 | "integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==", 1049 | "dev": true, 1050 | "license": "MIT", 1051 | "dependencies": { 1052 | "eventemitter3": "^4.0.0", 1053 | "follow-redirects": "^1.0.0", 1054 | "requires-port": "^1.0.0" 1055 | }, 1056 | "engines": { 1057 | "node": ">=8.0.0" 1058 | } 1059 | }, 1060 | "node_modules/http-server": { 1061 | "version": "14.1.1", 1062 | "resolved": "https://registry.npmjs.org/http-server/-/http-server-14.1.1.tgz", 1063 | "integrity": "sha512-+cbxadF40UXd9T01zUHgA+rlo2Bg1Srer4+B4NwIHdaGxAGGv59nYRnGGDJ9LBk7alpS0US+J+bLLdQOOkJq4A==", 1064 | "dev": true, 1065 | "license": "MIT", 1066 | "dependencies": { 1067 | "basic-auth": "^2.0.1", 1068 | "chalk": "^4.1.2", 1069 | "corser": "^2.0.1", 1070 | "he": "^1.2.0", 1071 | "html-encoding-sniffer": "^3.0.0", 1072 | "http-proxy": "^1.18.1", 1073 | "mime": "^1.6.0", 1074 | "minimist": "^1.2.6", 1075 | "opener": "^1.5.1", 1076 | "portfinder": "^1.0.28", 1077 | "secure-compare": "3.0.1", 1078 | "union": "~0.5.0", 1079 | "url-join": "^4.0.1" 1080 | }, 1081 | "bin": { 1082 | "http-server": "bin/http-server" 1083 | }, 1084 | "engines": { 1085 | "node": ">=12" 1086 | } 1087 | }, 1088 | "node_modules/iconv-lite": { 1089 | "version": "0.4.24", 1090 | "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", 1091 | "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", 1092 | "license": "MIT", 1093 | "dependencies": { 1094 | "safer-buffer": ">= 2.1.2 < 3" 1095 | }, 1096 | "engines": { 1097 | "node": ">=0.10.0" 1098 | } 1099 | }, 1100 | "node_modules/inherits": { 1101 | "version": "2.0.4", 1102 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", 1103 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", 1104 | "license": "ISC" 1105 | }, 1106 | "node_modules/ipaddr.js": { 1107 | "version": "1.9.1", 1108 | "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", 1109 | "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", 1110 | "license": "MIT", 1111 | "engines": { 1112 | "node": ">= 0.10" 1113 | } 1114 | }, 1115 | "node_modules/is-arrayish": { 1116 | "version": "0.3.2", 1117 | "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", 1118 | "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==", 1119 | "dev": true, 1120 | "license": "MIT" 1121 | }, 1122 | "node_modules/math-intrinsics": { 1123 | "version": "1.1.0", 1124 | "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", 1125 | "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", 1126 | "license": "MIT", 1127 | "engines": { 1128 | "node": ">= 0.4" 1129 | } 1130 | }, 1131 | "node_modules/media-typer": { 1132 | "version": "0.3.0", 1133 | "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", 1134 | "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", 1135 | "license": "MIT", 1136 | "engines": { 1137 | "node": ">= 0.6" 1138 | } 1139 | }, 1140 | "node_modules/merge-descriptors": { 1141 | "version": "1.0.3", 1142 | "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", 1143 | "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", 1144 | "license": "MIT", 1145 | "funding": { 1146 | "url": "https://github.com/sponsors/sindresorhus" 1147 | } 1148 | }, 1149 | "node_modules/methods": { 1150 | "version": "1.1.2", 1151 | "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", 1152 | "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", 1153 | "license": "MIT", 1154 | "engines": { 1155 | "node": ">= 0.6" 1156 | } 1157 | }, 1158 | "node_modules/mime": { 1159 | "version": "1.6.0", 1160 | "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", 1161 | "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", 1162 | "license": "MIT", 1163 | "bin": { 1164 | "mime": "cli.js" 1165 | }, 1166 | "engines": { 1167 | "node": ">=4" 1168 | } 1169 | }, 1170 | "node_modules/mime-db": { 1171 | "version": "1.52.0", 1172 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", 1173 | "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", 1174 | "license": "MIT", 1175 | "engines": { 1176 | "node": ">= 0.6" 1177 | } 1178 | }, 1179 | "node_modules/mime-types": { 1180 | "version": "2.1.35", 1181 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", 1182 | "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", 1183 | "license": "MIT", 1184 | "dependencies": { 1185 | "mime-db": "1.52.0" 1186 | }, 1187 | "engines": { 1188 | "node": ">= 0.6" 1189 | } 1190 | }, 1191 | "node_modules/minimist": { 1192 | "version": "1.2.8", 1193 | "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", 1194 | "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", 1195 | "dev": true, 1196 | "license": "MIT", 1197 | "funding": { 1198 | "url": "https://github.com/sponsors/ljharb" 1199 | } 1200 | }, 1201 | "node_modules/ms": { 1202 | "version": "2.0.0", 1203 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", 1204 | "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", 1205 | "license": "MIT" 1206 | }, 1207 | "node_modules/negotiator": { 1208 | "version": "0.6.3", 1209 | "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", 1210 | "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", 1211 | "license": "MIT", 1212 | "engines": { 1213 | "node": ">= 0.6" 1214 | } 1215 | }, 1216 | "node_modules/object-assign": { 1217 | "version": "4.1.1", 1218 | "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", 1219 | "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", 1220 | "license": "MIT", 1221 | "engines": { 1222 | "node": ">=0.10.0" 1223 | } 1224 | }, 1225 | "node_modules/object-inspect": { 1226 | "version": "1.13.4", 1227 | "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", 1228 | "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", 1229 | "license": "MIT", 1230 | "engines": { 1231 | "node": ">= 0.4" 1232 | }, 1233 | "funding": { 1234 | "url": "https://github.com/sponsors/ljharb" 1235 | } 1236 | }, 1237 | "node_modules/on-finished": { 1238 | "version": "2.4.1", 1239 | "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", 1240 | "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", 1241 | "license": "MIT", 1242 | "dependencies": { 1243 | "ee-first": "1.1.1" 1244 | }, 1245 | "engines": { 1246 | "node": ">= 0.8" 1247 | } 1248 | }, 1249 | "node_modules/opener": { 1250 | "version": "1.5.2", 1251 | "resolved": "https://registry.npmjs.org/opener/-/opener-1.5.2.tgz", 1252 | "integrity": "sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A==", 1253 | "dev": true, 1254 | "license": "(WTFPL OR MIT)", 1255 | "bin": { 1256 | "opener": "bin/opener-bin.js" 1257 | } 1258 | }, 1259 | "node_modules/parseurl": { 1260 | "version": "1.3.3", 1261 | "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", 1262 | "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", 1263 | "license": "MIT", 1264 | "engines": { 1265 | "node": ">= 0.8" 1266 | } 1267 | }, 1268 | "node_modules/path-to-regexp": { 1269 | "version": "0.1.12", 1270 | "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz", 1271 | "integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==", 1272 | "license": "MIT" 1273 | }, 1274 | "node_modules/portfinder": { 1275 | "version": "1.0.35", 1276 | "resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.35.tgz", 1277 | "integrity": "sha512-73JaFg4NwYNAufDtS5FsFu/PdM49ahJrO1i44aCRsDWju1z5wuGDaqyFUQWR6aJoK2JPDWlaYYAGFNIGTSUHSw==", 1278 | "dev": true, 1279 | "license": "MIT", 1280 | "dependencies": { 1281 | "async": "^3.2.6", 1282 | "debug": "^4.3.6" 1283 | }, 1284 | "engines": { 1285 | "node": ">= 10.12" 1286 | } 1287 | }, 1288 | "node_modules/portfinder/node_modules/debug": { 1289 | "version": "4.4.0", 1290 | "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", 1291 | "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", 1292 | "dev": true, 1293 | "license": "MIT", 1294 | "dependencies": { 1295 | "ms": "^2.1.3" 1296 | }, 1297 | "engines": { 1298 | "node": ">=6.0" 1299 | }, 1300 | "peerDependenciesMeta": { 1301 | "supports-color": { 1302 | "optional": true 1303 | } 1304 | } 1305 | }, 1306 | "node_modules/portfinder/node_modules/ms": { 1307 | "version": "2.1.3", 1308 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", 1309 | "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", 1310 | "dev": true, 1311 | "license": "MIT" 1312 | }, 1313 | "node_modules/proxy-addr": { 1314 | "version": "2.0.7", 1315 | "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", 1316 | "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", 1317 | "license": "MIT", 1318 | "dependencies": { 1319 | "forwarded": "0.2.0", 1320 | "ipaddr.js": "1.9.1" 1321 | }, 1322 | "engines": { 1323 | "node": ">= 0.10" 1324 | } 1325 | }, 1326 | "node_modules/qs": { 1327 | "version": "6.13.0", 1328 | "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", 1329 | "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", 1330 | "license": "BSD-3-Clause", 1331 | "dependencies": { 1332 | "side-channel": "^1.0.6" 1333 | }, 1334 | "engines": { 1335 | "node": ">=0.6" 1336 | }, 1337 | "funding": { 1338 | "url": "https://github.com/sponsors/ljharb" 1339 | } 1340 | }, 1341 | "node_modules/range-parser": { 1342 | "version": "1.2.1", 1343 | "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", 1344 | "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", 1345 | "license": "MIT", 1346 | "engines": { 1347 | "node": ">= 0.6" 1348 | } 1349 | }, 1350 | "node_modules/raw-body": { 1351 | "version": "2.5.2", 1352 | "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", 1353 | "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", 1354 | "license": "MIT", 1355 | "dependencies": { 1356 | "bytes": "3.1.2", 1357 | "http-errors": "2.0.0", 1358 | "iconv-lite": "0.4.24", 1359 | "unpipe": "1.0.0" 1360 | }, 1361 | "engines": { 1362 | "node": ">= 0.8" 1363 | } 1364 | }, 1365 | "node_modules/requires-port": { 1366 | "version": "1.0.0", 1367 | "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", 1368 | "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", 1369 | "dev": true, 1370 | "license": "MIT" 1371 | }, 1372 | "node_modules/safe-buffer": { 1373 | "version": "5.2.1", 1374 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", 1375 | "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", 1376 | "funding": [ 1377 | { 1378 | "type": "github", 1379 | "url": "https://github.com/sponsors/feross" 1380 | }, 1381 | { 1382 | "type": "patreon", 1383 | "url": "https://www.patreon.com/feross" 1384 | }, 1385 | { 1386 | "type": "consulting", 1387 | "url": "https://feross.org/support" 1388 | } 1389 | ], 1390 | "license": "MIT" 1391 | }, 1392 | "node_modules/safer-buffer": { 1393 | "version": "2.1.2", 1394 | "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", 1395 | "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", 1396 | "license": "MIT" 1397 | }, 1398 | "node_modules/secure-compare": { 1399 | "version": "3.0.1", 1400 | "resolved": "https://registry.npmjs.org/secure-compare/-/secure-compare-3.0.1.tgz", 1401 | "integrity": "sha512-AckIIV90rPDcBcglUwXPF3kg0P0qmPsPXAj6BBEENQE1p5yA1xfmDJzfi1Tappj37Pv2mVbKpL3Z1T+Nn7k1Qw==", 1402 | "dev": true, 1403 | "license": "MIT" 1404 | }, 1405 | "node_modules/semver": { 1406 | "version": "7.7.1", 1407 | "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", 1408 | "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", 1409 | "dev": true, 1410 | "license": "ISC", 1411 | "bin": { 1412 | "semver": "bin/semver.js" 1413 | }, 1414 | "engines": { 1415 | "node": ">=10" 1416 | } 1417 | }, 1418 | "node_modules/send": { 1419 | "version": "0.19.0", 1420 | "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", 1421 | "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", 1422 | "license": "MIT", 1423 | "dependencies": { 1424 | "debug": "2.6.9", 1425 | "depd": "2.0.0", 1426 | "destroy": "1.2.0", 1427 | "encodeurl": "~1.0.2", 1428 | "escape-html": "~1.0.3", 1429 | "etag": "~1.8.1", 1430 | "fresh": "0.5.2", 1431 | "http-errors": "2.0.0", 1432 | "mime": "1.6.0", 1433 | "ms": "2.1.3", 1434 | "on-finished": "2.4.1", 1435 | "range-parser": "~1.2.1", 1436 | "statuses": "2.0.1" 1437 | }, 1438 | "engines": { 1439 | "node": ">= 0.8.0" 1440 | } 1441 | }, 1442 | "node_modules/send/node_modules/encodeurl": { 1443 | "version": "1.0.2", 1444 | "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", 1445 | "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", 1446 | "license": "MIT", 1447 | "engines": { 1448 | "node": ">= 0.8" 1449 | } 1450 | }, 1451 | "node_modules/send/node_modules/ms": { 1452 | "version": "2.1.3", 1453 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", 1454 | "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", 1455 | "license": "MIT" 1456 | }, 1457 | "node_modules/serve-static": { 1458 | "version": "1.16.2", 1459 | "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", 1460 | "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==", 1461 | "license": "MIT", 1462 | "dependencies": { 1463 | "encodeurl": "~2.0.0", 1464 | "escape-html": "~1.0.3", 1465 | "parseurl": "~1.3.3", 1466 | "send": "0.19.0" 1467 | }, 1468 | "engines": { 1469 | "node": ">= 0.8.0" 1470 | } 1471 | }, 1472 | "node_modules/setprototypeof": { 1473 | "version": "1.2.0", 1474 | "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", 1475 | "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", 1476 | "license": "ISC" 1477 | }, 1478 | "node_modules/sharp": { 1479 | "version": "0.33.5", 1480 | "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.33.5.tgz", 1481 | "integrity": "sha512-haPVm1EkS9pgvHrQ/F3Xy+hgcuMV0Wm9vfIBSiwZ05k+xgb0PkBQpGsAA/oWdDobNaZTH5ppvHtzCFbnSEwHVw==", 1482 | "dev": true, 1483 | "hasInstallScript": true, 1484 | "license": "Apache-2.0", 1485 | "dependencies": { 1486 | "color": "^4.2.3", 1487 | "detect-libc": "^2.0.3", 1488 | "semver": "^7.6.3" 1489 | }, 1490 | "engines": { 1491 | "node": "^18.17.0 || ^20.3.0 || >=21.0.0" 1492 | }, 1493 | "funding": { 1494 | "url": "https://opencollective.com/libvips" 1495 | }, 1496 | "optionalDependencies": { 1497 | "@img/sharp-darwin-arm64": "0.33.5", 1498 | "@img/sharp-darwin-x64": "0.33.5", 1499 | "@img/sharp-libvips-darwin-arm64": "1.0.4", 1500 | "@img/sharp-libvips-darwin-x64": "1.0.4", 1501 | "@img/sharp-libvips-linux-arm": "1.0.5", 1502 | "@img/sharp-libvips-linux-arm64": "1.0.4", 1503 | "@img/sharp-libvips-linux-s390x": "1.0.4", 1504 | "@img/sharp-libvips-linux-x64": "1.0.4", 1505 | "@img/sharp-libvips-linuxmusl-arm64": "1.0.4", 1506 | "@img/sharp-libvips-linuxmusl-x64": "1.0.4", 1507 | "@img/sharp-linux-arm": "0.33.5", 1508 | "@img/sharp-linux-arm64": "0.33.5", 1509 | "@img/sharp-linux-s390x": "0.33.5", 1510 | "@img/sharp-linux-x64": "0.33.5", 1511 | "@img/sharp-linuxmusl-arm64": "0.33.5", 1512 | "@img/sharp-linuxmusl-x64": "0.33.5", 1513 | "@img/sharp-wasm32": "0.33.5", 1514 | "@img/sharp-win32-ia32": "0.33.5", 1515 | "@img/sharp-win32-x64": "0.33.5" 1516 | } 1517 | }, 1518 | "node_modules/side-channel": { 1519 | "version": "1.1.0", 1520 | "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", 1521 | "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", 1522 | "license": "MIT", 1523 | "dependencies": { 1524 | "es-errors": "^1.3.0", 1525 | "object-inspect": "^1.13.3", 1526 | "side-channel-list": "^1.0.0", 1527 | "side-channel-map": "^1.0.1", 1528 | "side-channel-weakmap": "^1.0.2" 1529 | }, 1530 | "engines": { 1531 | "node": ">= 0.4" 1532 | }, 1533 | "funding": { 1534 | "url": "https://github.com/sponsors/ljharb" 1535 | } 1536 | }, 1537 | "node_modules/side-channel-list": { 1538 | "version": "1.0.0", 1539 | "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", 1540 | "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", 1541 | "license": "MIT", 1542 | "dependencies": { 1543 | "es-errors": "^1.3.0", 1544 | "object-inspect": "^1.13.3" 1545 | }, 1546 | "engines": { 1547 | "node": ">= 0.4" 1548 | }, 1549 | "funding": { 1550 | "url": "https://github.com/sponsors/ljharb" 1551 | } 1552 | }, 1553 | "node_modules/side-channel-map": { 1554 | "version": "1.0.1", 1555 | "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", 1556 | "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", 1557 | "license": "MIT", 1558 | "dependencies": { 1559 | "call-bound": "^1.0.2", 1560 | "es-errors": "^1.3.0", 1561 | "get-intrinsic": "^1.2.5", 1562 | "object-inspect": "^1.13.3" 1563 | }, 1564 | "engines": { 1565 | "node": ">= 0.4" 1566 | }, 1567 | "funding": { 1568 | "url": "https://github.com/sponsors/ljharb" 1569 | } 1570 | }, 1571 | "node_modules/side-channel-weakmap": { 1572 | "version": "1.0.2", 1573 | "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", 1574 | "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", 1575 | "license": "MIT", 1576 | "dependencies": { 1577 | "call-bound": "^1.0.2", 1578 | "es-errors": "^1.3.0", 1579 | "get-intrinsic": "^1.2.5", 1580 | "object-inspect": "^1.13.3", 1581 | "side-channel-map": "^1.0.1" 1582 | }, 1583 | "engines": { 1584 | "node": ">= 0.4" 1585 | }, 1586 | "funding": { 1587 | "url": "https://github.com/sponsors/ljharb" 1588 | } 1589 | }, 1590 | "node_modules/simple-swizzle": { 1591 | "version": "0.2.2", 1592 | "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", 1593 | "integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==", 1594 | "dev": true, 1595 | "license": "MIT", 1596 | "dependencies": { 1597 | "is-arrayish": "^0.3.1" 1598 | } 1599 | }, 1600 | "node_modules/statuses": { 1601 | "version": "2.0.1", 1602 | "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", 1603 | "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", 1604 | "license": "MIT", 1605 | "engines": { 1606 | "node": ">= 0.8" 1607 | } 1608 | }, 1609 | "node_modules/supports-color": { 1610 | "version": "7.2.0", 1611 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", 1612 | "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", 1613 | "dev": true, 1614 | "license": "MIT", 1615 | "dependencies": { 1616 | "has-flag": "^4.0.0" 1617 | }, 1618 | "engines": { 1619 | "node": ">=8" 1620 | } 1621 | }, 1622 | "node_modules/toidentifier": { 1623 | "version": "1.0.1", 1624 | "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", 1625 | "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", 1626 | "license": "MIT", 1627 | "engines": { 1628 | "node": ">=0.6" 1629 | } 1630 | }, 1631 | "node_modules/tslib": { 1632 | "version": "2.8.1", 1633 | "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", 1634 | "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", 1635 | "dev": true, 1636 | "license": "0BSD", 1637 | "optional": true 1638 | }, 1639 | "node_modules/type-is": { 1640 | "version": "1.6.18", 1641 | "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", 1642 | "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", 1643 | "license": "MIT", 1644 | "dependencies": { 1645 | "media-typer": "0.3.0", 1646 | "mime-types": "~2.1.24" 1647 | }, 1648 | "engines": { 1649 | "node": ">= 0.6" 1650 | } 1651 | }, 1652 | "node_modules/union": { 1653 | "version": "0.5.0", 1654 | "resolved": "https://registry.npmjs.org/union/-/union-0.5.0.tgz", 1655 | "integrity": "sha512-N6uOhuW6zO95P3Mel2I2zMsbsanvvtgn6jVqJv4vbVcz/JN0OkL9suomjQGmWtxJQXOCqUJvquc1sMeNz/IwlA==", 1656 | "dev": true, 1657 | "dependencies": { 1658 | "qs": "^6.4.0" 1659 | }, 1660 | "engines": { 1661 | "node": ">= 0.8.0" 1662 | } 1663 | }, 1664 | "node_modules/unpipe": { 1665 | "version": "1.0.0", 1666 | "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", 1667 | "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", 1668 | "license": "MIT", 1669 | "engines": { 1670 | "node": ">= 0.8" 1671 | } 1672 | }, 1673 | "node_modules/url-join": { 1674 | "version": "4.0.1", 1675 | "resolved": "https://registry.npmjs.org/url-join/-/url-join-4.0.1.tgz", 1676 | "integrity": "sha512-jk1+QP6ZJqyOiuEI9AEWQfju/nB2Pw466kbA0LEZljHwKeMgd9WrAEgEGxjPDD2+TNbbb37rTyhEfrCXfuKXnA==", 1677 | "dev": true, 1678 | "license": "MIT" 1679 | }, 1680 | "node_modules/utils-merge": { 1681 | "version": "1.0.1", 1682 | "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", 1683 | "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", 1684 | "license": "MIT", 1685 | "engines": { 1686 | "node": ">= 0.4.0" 1687 | } 1688 | }, 1689 | "node_modules/vary": { 1690 | "version": "1.1.2", 1691 | "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", 1692 | "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", 1693 | "license": "MIT", 1694 | "engines": { 1695 | "node": ">= 0.8" 1696 | } 1697 | }, 1698 | "node_modules/whatwg-encoding": { 1699 | "version": "2.0.0", 1700 | "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-2.0.0.tgz", 1701 | "integrity": "sha512-p41ogyeMUrw3jWclHWTQg1k05DSVXPLcVxRTYsXUk+ZooOCZLcoYgPZ/HL/D/N+uQPOtcp1me1WhBEaX02mhWg==", 1702 | "dev": true, 1703 | "license": "MIT", 1704 | "dependencies": { 1705 | "iconv-lite": "0.6.3" 1706 | }, 1707 | "engines": { 1708 | "node": ">=12" 1709 | } 1710 | }, 1711 | "node_modules/whatwg-encoding/node_modules/iconv-lite": { 1712 | "version": "0.6.3", 1713 | "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", 1714 | "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", 1715 | "dev": true, 1716 | "license": "MIT", 1717 | "dependencies": { 1718 | "safer-buffer": ">= 2.1.2 < 3.0.0" 1719 | }, 1720 | "engines": { 1721 | "node": ">=0.10.0" 1722 | } 1723 | } 1724 | } 1725 | } 1726 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "dumbdo", 3 | "version": "1.0.0", 4 | "description": "A stupidly simple todo list", 5 | "main": "server.js", 6 | "scripts": { 7 | "start": "node server.js", 8 | "dev": "node server.js", 9 | "test": "echo \"Error: no test specified\" && exit 1", 10 | "convert-logo": "node scripts/convert-logo.js" 11 | }, 12 | "keywords": [], 13 | "author": "", 14 | "license": "ISC", 15 | "dependencies": { 16 | "cookie-parser": "^1.4.7", 17 | "cors": "^2.8.5", 18 | "dotenv": "^16.4.7", 19 | "express": "^4.18.2" 20 | }, 21 | "devDependencies": { 22 | "http-server": "^14.1.1", 23 | "sharp": "^0.33.5" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /public/app.js: -------------------------------------------------------------------------------- 1 | import { ToastManager } from './managers/toast.js' 2 | 3 | 4 | document.addEventListener('DOMContentLoaded', () => { 5 | // DOM Elements 6 | const todoForm = document.getElementById('todoForm'); 7 | const todoInput = document.getElementById('todoInput'); 8 | const todoList = document.getElementById('todoList'); 9 | const themeToggle = document.getElementById('themeToggle'); 10 | const moonIcon = themeToggle.querySelector('.moon'); 11 | const sunIcon = themeToggle.querySelector('.sun'); 12 | const toastContainer = document.getElementById('toast-container'); 13 | const toastManager = new ToastManager(toastContainer); 14 | const pinModal = document.getElementById('pinModal'); 15 | const pinInputs = [...document.querySelectorAll('.pin-input')]; 16 | const pinError = document.getElementById('pinError'); 17 | const clearCompletedBtn = document.getElementById('clearCompleted'); 18 | const listSelector = document.getElementById('listSelector'); 19 | const renameListBtn = document.getElementById('renameList'); 20 | const deleteListBtn = document.getElementById('deleteList'); 21 | const addListBtn = document.getElementById('addList'); 22 | 23 | 24 | // Set up list selector event handlers once 25 | const selectorContainer = listSelector.parentElement; 26 | 27 | // Show/hide custom select on click 28 | function handleSelectorClick(e) { 29 | e.preventDefault(); 30 | e.stopPropagation(); 31 | const customSelect = selectorContainer.querySelector('.custom-select'); 32 | if (customSelect) { 33 | const isHidden = customSelect.style.display === 'none' || !customSelect.style.display; 34 | customSelect.style.display = isHidden ? 'block' : 'none'; 35 | } 36 | } 37 | 38 | // Hide custom select when clicking outside 39 | function handleOutsideClick(e) { 40 | const customSelect = selectorContainer.querySelector('.custom-select'); 41 | if (customSelect && !selectorContainer.contains(e.target)) { 42 | customSelect.style.display = 'none'; 43 | } 44 | } 45 | 46 | // Handle keyboard navigation 47 | function handleKeyboard(e) { 48 | const customSelect = selectorContainer.querySelector('.custom-select'); 49 | if (customSelect) { 50 | if (e.key === 'Enter' || e.key === ' ') { 51 | e.preventDefault(); 52 | customSelect.style.display = customSelect.style.display === 'none' ? 'block' : 'none'; 53 | } else if (e.key === 'Escape') { 54 | customSelect.style.display = 'none'; 55 | } 56 | } 57 | } 58 | 59 | // Initialize dropdown event listeners after data is loaded 60 | function initializeDropdown() { 61 | listSelector.addEventListener('mousedown', handleSelectorClick); 62 | document.addEventListener('click', handleOutsideClick); 63 | listSelector.addEventListener('keydown', handleKeyboard); 64 | } 65 | 66 | // State 67 | let todos = {}; 68 | let currentList = 'List 1'; 69 | 70 | // List Management 71 | function initializeLists(data) { 72 | if (!data || Object.keys(data).length === 0) { 73 | // Only create List 1 when there are no lists at all 74 | todos = { 'List 1': [] }; 75 | currentList = 'List 1'; 76 | } else { 77 | // Convert only numeric keys, preserve custom names 78 | const convertedData = {}; 79 | Object.entries(data).forEach(([key, value]) => { 80 | // Only convert numeric keys 81 | if (/^\d+$/.test(key)) { 82 | const newKey = `List ${Object.keys(convertedData).length + 1}`; 83 | convertedData[newKey] = value; 84 | } else { 85 | convertedData[key] = value; 86 | } 87 | }); 88 | 89 | todos = convertedData; 90 | currentList = Object.keys(convertedData)[0]; 91 | } 92 | 93 | updateListSelector(); 94 | renderTodos(); 95 | } 96 | 97 | function updateListSelector() { 98 | // Sort the list keys to ensure List 1 comes first 99 | const sortedKeys = Object.keys(todos).sort((a, b) => { 100 | if (a === 'List 1') return -1; 101 | if (b === 'List 1') return 1; 102 | return a.localeCompare(b); 103 | }); 104 | 105 | // Update the native select 106 | listSelector.innerHTML = sortedKeys.map(listId => 107 | `` 108 | ).join(''); 109 | 110 | // Create a custom select 111 | const customSelect = document.createElement('div'); 112 | customSelect.className = 'custom-select'; 113 | customSelect.style.display = 'none'; // Explicitly set initial state 114 | 115 | sortedKeys.forEach(listId => { 116 | const item = document.createElement('div'); 117 | item.className = `list-item ${listId === 'List 1' ? 'list-1' : ''}`; 118 | item.dataset.value = listId; 119 | 120 | const nameSpan = document.createElement('span'); 121 | nameSpan.textContent = listId; 122 | item.appendChild(nameSpan); 123 | 124 | if (listId !== 'List 1') { 125 | const deleteBtn = document.createElement('button'); 126 | deleteBtn.type = 'button'; 127 | deleteBtn.className = 'delete-btn'; 128 | deleteBtn.setAttribute('aria-label', `Delete ${listId}`); 129 | deleteBtn.innerHTML = ` 130 | 131 | 132 | 133 | `; 134 | deleteBtn.addEventListener('click', (e) => { 135 | e.stopPropagation(); 136 | deleteList(listId); 137 | }); 138 | item.appendChild(deleteBtn); 139 | } 140 | 141 | item.addEventListener('click', () => { 142 | if (listId !== currentList) { 143 | switchList(listId); 144 | customSelect.style.display = 'none'; 145 | } 146 | }); 147 | 148 | customSelect.appendChild(item); 149 | }); 150 | 151 | // Replace the existing custom select if any 152 | const existingCustomSelect = selectorContainer.querySelector('.custom-select'); 153 | if (existingCustomSelect) { 154 | const wasVisible = existingCustomSelect.style.display === 'block'; 155 | selectorContainer.removeChild(existingCustomSelect); 156 | if (wasVisible) { 157 | customSelect.style.display = 'block'; 158 | } 159 | } 160 | selectorContainer.appendChild(customSelect); 161 | } 162 | 163 | function switchList(listId) { 164 | currentList = listId; 165 | listSelector.value = listId; // Update the native select value 166 | renderTodos(); 167 | } 168 | 169 | function addNewList() { 170 | const listCount = Object.keys(todos).length + 1; 171 | const newListId = `List ${listCount}`; 172 | todos[newListId] = []; 173 | currentList = newListId; 174 | updateListSelector(); 175 | renderTodos(); 176 | saveTodos(); 177 | toastManager.show('New list added'); 178 | } 179 | 180 | async function renameCurrentList() { 181 | const newName = prompt('Enter new list name:', currentList); 182 | if (newName && newName.trim() && newName !== currentList && !todos[newName]) { 183 | const oldName = currentList; 184 | const oldTodos = { ...todos }; // Keep a full backup 185 | 186 | try { 187 | // Update the data structure 188 | todos[newName] = todos[currentList]; 189 | delete todos[currentList]; 190 | currentList = newName; 191 | 192 | // Update UI 193 | updateListSelector(); 194 | 195 | // Save changes 196 | await saveTodos(); 197 | toastManager.show('List renamed'); 198 | } catch (error) { 199 | // Revert all changes on failure 200 | todos = oldTodos; 201 | currentList = oldName; 202 | updateListSelector(); 203 | toastManager.show('Failed to save list name change', 'error', false, 5000); 204 | } 205 | } 206 | } 207 | 208 | async function deleteList(listId) { 209 | // Don't allow deleting the last list or List 1 210 | if (Object.keys(todos).length <= 1 || listId === 'List 1') { 211 | toastManager.show('Cannot delete this list', 'error'); 212 | return; 213 | } 214 | 215 | if (confirm(`Are you sure you want to delete "${listId}" and all its tasks?`)) { 216 | const oldTodos = { ...todos }; 217 | try { 218 | // Remove the list 219 | delete todos[listId]; 220 | 221 | // If we're deleting the current list, switch to another one 222 | if (listId === currentList) { 223 | currentList = Object.keys(todos)[0]; 224 | } 225 | 226 | // Update UI 227 | updateListSelector(); 228 | renderTodos(); 229 | 230 | // Save changes 231 | await saveTodos(); 232 | toastManager.show('List deleted'); 233 | } catch (error) { 234 | // Revert changes on failure 235 | todos = oldTodos; 236 | updateListSelector(); 237 | renderTodos(); 238 | toastManager.show('Failed to delete list', 'error', false, 5000); 239 | } 240 | } 241 | } 242 | 243 | // Event Listeners for List Management 244 | listSelector.addEventListener('change', (e) => { 245 | switchList(e.target.value); 246 | }); 247 | 248 | renameListBtn.addEventListener('click', renameCurrentList); 249 | addListBtn.addEventListener('click', addNewList); 250 | 251 | // Enhanced fetch with auth headers 252 | async function fetchWithAuth(url, options = {}) { 253 | return fetch(url, options); 254 | } 255 | 256 | // Theme Management 257 | function updateThemeIcons() { 258 | const isDark = document.documentElement.getAttribute('data-theme') === 'dark'; 259 | moonIcon.style.display = isDark ? 'none' : 'block'; 260 | sunIcon.style.display = isDark ? 'block' : 'none'; 261 | } 262 | 263 | // Initialize theme icons 264 | updateThemeIcons(); 265 | 266 | themeToggle.addEventListener('click', () => { 267 | const isDark = document.documentElement.getAttribute('data-theme') === 'dark'; 268 | const newTheme = isDark ? 'light' : 'dark'; 269 | document.documentElement.setAttribute('data-theme', newTheme); 270 | localStorage.setItem('theme', newTheme); 271 | updateThemeIcons(); 272 | }); 273 | 274 | // Todo Management 275 | async function loadTodos() { 276 | try { 277 | const response = await fetchWithAuth('/api/todos'); 278 | if (!response.ok) throw new Error('Failed to load todos'); 279 | const data = await response.json(); 280 | initializeLists(data); 281 | initializeDropdown(); // Initialize dropdown after data is loaded 282 | } catch (error) { 283 | toastManager.show('Failed to load todos', 'error', true); 284 | console.error(error); 285 | } 286 | } 287 | 288 | async function saveTodos() { 289 | try { 290 | const response = await fetchWithAuth('/api/todos', { 291 | method: 'POST', 292 | headers: { 293 | 'Content-Type': 'application/json', 294 | }, 295 | body: JSON.stringify(todos) 296 | }); 297 | if (!response.ok) throw new Error('Failed to save todos'); 298 | return true; 299 | } catch (error) { 300 | toastManager.show('Failed to save todos', 'error'); 301 | console.error(error); 302 | throw error; // Re-throw to handle in calling function 303 | } 304 | } 305 | 306 | function createTodoElement(todo) { 307 | const li = document.createElement('li'); 308 | li.className = `todo-item ${todo.completed ? 'completed' : ''}`; 309 | 310 | // Add drag attributes only for non-completed items 311 | if (!todo.completed) { 312 | li.draggable = true; 313 | li.setAttribute('data-todo-id', todo.text); // Using text as a simple identifier 314 | } 315 | 316 | li.innerHTML = ` 317 |
318 | 319 |
320 | ${linkifyText(todo.text)} 321 | 322 | `; 323 | 324 | const checkbox = li.querySelector('input'); 325 | const checkboxWrapper = li.querySelector('.checkbox-wrapper'); 326 | const todoText = li.querySelector('.todo-text'); 327 | 328 | // Add click handler to the wrapper 329 | checkboxWrapper.addEventListener('click', (e) => { 330 | // Only trigger if clicking the wrapper (not the checkbox directly) 331 | if (e.target === checkboxWrapper) { 332 | checkbox.checked = !checkbox.checked; 333 | todo.completed = checkbox.checked; 334 | renderTodos(); 335 | saveTodos(); 336 | toastManager.show(todo.completed ? 'Task completed! 🎉' : 'Task uncompleted'); 337 | } 338 | }); 339 | 340 | checkbox.addEventListener('change', () => { 341 | todo.completed = checkbox.checked; 342 | renderTodos(); 343 | saveTodos(); 344 | toastManager.show(todo.completed ? 'Task completed! 🎉' : 'Task uncompleted'); 345 | }); 346 | 347 | // Make text editable on click 348 | todoText.addEventListener('click', (e) => { 349 | // Don't trigger edit if clicking a link 350 | if (e.target.tagName === 'A') return; 351 | 352 | const input = document.createElement('input'); 353 | input.type = 'text'; 354 | input.value = todo.text; 355 | input.className = 'edit-input'; 356 | 357 | const originalText = todoText.innerHTML; 358 | todoText.replaceWith(input); 359 | input.focus(); 360 | 361 | function saveEdit() { 362 | const newText = input.value.trim(); 363 | if (newText && newText !== todo.text) { 364 | todo.text = newText; 365 | renderTodos(); 366 | saveTodos(); 367 | toastManager.show('Task updated'); 368 | } else { 369 | input.replaceWith(todoText); 370 | todoText.innerHTML = originalText; 371 | } 372 | } 373 | 374 | input.addEventListener('blur', saveEdit); 375 | input.addEventListener('keydown', (e) => { 376 | if (e.key === 'Enter') { 377 | e.preventDefault(); 378 | saveEdit(); 379 | } else if (e.key === 'Escape') { 380 | input.replaceWith(todoText); 381 | todoText.innerHTML = originalText; 382 | } 383 | }); 384 | }); 385 | 386 | const deleteBtn = li.querySelector('.delete-btn'); 387 | deleteBtn.addEventListener('click', () => { 388 | li.remove(); 389 | todos[currentList] = todos[currentList].filter(t => t !== todo); 390 | saveTodos(); 391 | toastManager.show('Task deleted', 'error'); 392 | }); 393 | 394 | // Add drag and drop event listeners for non-completed items 395 | if (!todo.completed) { 396 | li.addEventListener('dragstart', (e) => { 397 | e.dataTransfer.setData('text/plain', todo.text); 398 | li.classList.add('dragging'); 399 | // Set a custom drag image (optional) 400 | const dragImage = li.cloneNode(true); 401 | dragImage.style.position = 'absolute'; 402 | dragImage.style.top = '-1000px'; 403 | document.body.appendChild(dragImage); 404 | e.dataTransfer.setDragImage(dragImage, 0, 0); 405 | setTimeout(() => document.body.removeChild(dragImage), 0); 406 | }); 407 | 408 | li.addEventListener('dragend', () => { 409 | li.classList.remove('dragging'); 410 | }); 411 | 412 | li.addEventListener('dragover', (e) => { 413 | e.preventDefault(); 414 | const draggingItem = document.querySelector('.dragging'); 415 | if (draggingItem && !li.classList.contains('dragging') && !todo.completed) { 416 | const items = [...todoList.querySelectorAll('.todo-item:not(.completed)')]; 417 | const currentPos = items.indexOf(draggingItem); 418 | const newPos = items.indexOf(li); 419 | 420 | if (currentPos !== newPos) { 421 | const rect = li.getBoundingClientRect(); 422 | const midY = rect.top + rect.height / 2; 423 | const mouseY = e.clientY; 424 | 425 | if (mouseY < midY) { 426 | li.parentNode.insertBefore(draggingItem, li); 427 | } else { 428 | li.parentNode.insertBefore(draggingItem, li.nextSibling); 429 | } 430 | 431 | // Update the todos array to match the new order 432 | const activeTodos = todos[currentList].filter(t => !t.completed); 433 | const completedTodos = todos[currentList].filter(t => t.completed); 434 | const newOrder = [...document.querySelectorAll('.todo-item:not(.completed)')].map(item => { 435 | return activeTodos.find(t => t.text === item.getAttribute('data-todo-id')); 436 | }); 437 | todos[currentList] = [...newOrder, ...completedTodos]; 438 | saveTodos(); 439 | } 440 | } 441 | }); 442 | } 443 | 444 | return li; 445 | } 446 | 447 | // Helper function to convert URLs in text to clickable links 448 | function linkifyText(text) { 449 | // Updated regex that doesn't include trailing punctuation in the URL 450 | const urlRegex = /(https?:\/\/[^\s)]+)([)\s]|$)/g; 451 | return text.replace(urlRegex, (match, url, endChar) => { 452 | // Return the URL as a link plus any trailing character 453 | return `${url}${endChar}`; 454 | }); 455 | } 456 | 457 | function renderTodos() { 458 | todoList.innerHTML = ''; 459 | const currentTodos = todos[currentList] || []; 460 | 461 | // Separate todos into active and completed 462 | const activeTodos = currentTodos.filter(todo => !todo.completed); 463 | const completedTodos = currentTodos.filter(todo => todo.completed); 464 | 465 | // Create a container for active todos 466 | const activeTodosContainer = document.createElement('div'); 467 | activeTodosContainer.className = 'active-todos'; 468 | activeTodosContainer.addEventListener('dragover', (e) => { 469 | e.preventDefault(); 470 | const draggingItem = document.querySelector('.dragging'); 471 | if (draggingItem) { 472 | const items = [...activeTodosContainer.querySelectorAll('.todo-item')]; 473 | if (items.length === 0) { 474 | activeTodosContainer.appendChild(draggingItem); 475 | } 476 | } 477 | }); 478 | todoList.appendChild(activeTodosContainer); 479 | 480 | // Render active todos 481 | activeTodos.forEach(todo => { 482 | activeTodosContainer.appendChild(createTodoElement(todo)); 483 | }); 484 | 485 | // Add divider if there are both active and completed todos 486 | if (activeTodos.length > 0 && completedTodos.length > 0) { 487 | const divider = document.createElement('li'); 488 | divider.className = 'todo-divider'; 489 | divider.textContent = 'Completed'; 490 | todoList.appendChild(divider); 491 | } 492 | 493 | // Render completed todos 494 | completedTodos.forEach(todo => { 495 | todoList.appendChild(createTodoElement(todo)); 496 | }); 497 | } 498 | 499 | // Event Listeners 500 | todoForm.addEventListener('submit', (e) => { 501 | e.preventDefault(); 502 | const text = todoInput.value.trim(); 503 | 504 | if (text) { 505 | const todo = { text, completed: false }; 506 | todos[currentList].push(todo); 507 | renderTodos(); 508 | saveTodos(); 509 | todoInput.value = ''; 510 | toastManager.show('Task added'); 511 | } 512 | }); 513 | 514 | // Clear completed tasks 515 | clearCompletedBtn.addEventListener('click', () => { 516 | const currentTodos = todos[currentList]; 517 | const completedCount = currentTodos.filter(todo => todo.completed).length; 518 | 519 | if (completedCount === 0) { 520 | toastManager.show('No completed tasks to clear'); 521 | return; 522 | } 523 | 524 | if (confirm(`Are you sure you want to delete ${completedCount} completed task${completedCount === 1 ? '' : 's'}?`)) { 525 | todos[currentList] = currentTodos.filter(todo => !todo.completed); 526 | renderTodos(); 527 | saveTodos(); 528 | toastManager.show(`Cleared ${completedCount} completed task${completedCount === 1 ? '' : 's'}`); 529 | } 530 | }); 531 | 532 | const initialize = async () => { 533 | // Initialize 534 | fetch(`api/config`) 535 | .then(resp => resp.json()) 536 | .then(config => { 537 | if (config.error) { 538 | throw new Error(config.error); 539 | } 540 | 541 | document.getElementById('page-title').textContent = `${config.siteTitle} - Stupidly Simple Todo List`; 542 | document.getElementById('header-title').textContent = config.siteTitle; 543 | 544 | loadTodos(); 545 | }) 546 | .catch(err => { 547 | console.error('Error loading site config:', err); 548 | toastManager.show(err, 'error', true); 549 | }) 550 | 551 | // Register PWA Service Worker 552 | if ("serviceWorker" in navigator) { 553 | navigator.serviceWorker.register("/service-worker.js") 554 | .then((reg) => console.log("Service Worker registered:", reg.scope)) 555 | .catch((err) => console.log("Service Worker registration failed:", err)); 556 | } 557 | } 558 | 559 | initialize(); 560 | }) -------------------------------------------------------------------------------- /public/assets/favicon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /public/assets/styles.css: -------------------------------------------------------------------------------- 1 | :root { 2 | /* Light theme variables */ 3 | --primary: #2196F3; 4 | --primary-hover: #1976D2; 5 | --background: #f5f5f5; 6 | --container: white; 7 | --text: #333; 8 | --border: #ccc; 9 | --shadow: 0 2px 4px rgba(0,0,0,0.1); 10 | --transition: 0.2s ease; 11 | --success-status-bg: rgba(37, 99, 235, 0.6); 12 | --danger-status-bg:rgba(220, 38, 38, 0.6); 13 | } 14 | 15 | [data-theme="dark"] { 16 | --background: #1a1a1a; 17 | --container: #2d2d2d; 18 | --text: white; 19 | --border: #404040; 20 | --shadow: 0 2px 4px rgba(0,0,0,0.2); 21 | --success-status-bg: rgba(96, 165, 250, 0.5); 22 | --danger-status-bg:rgba(220, 38, 38, 0.5); 23 | } 24 | 25 | * { 26 | margin: 0; 27 | padding: 0; 28 | box-sizing: border-box; 29 | } 30 | 31 | body { 32 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; 33 | background-color: var(--background); 34 | color: var(--text); 35 | line-height: 1.6; 36 | transition: background-color var(--transition), color var(--transition); 37 | } 38 | 39 | .app { 40 | max-width: 600px; 41 | margin: 0 auto; 42 | padding: 2rem 1rem; 43 | text-align: center; 44 | } 45 | 46 | header { 47 | position: relative; 48 | text-align: center; 49 | margin-bottom: 2rem; 50 | display: flex; 51 | flex-direction: column; 52 | gap: 1rem; 53 | } 54 | 55 | h1 { 56 | margin: 0; 57 | font-size: 2rem; 58 | color: var(--text); 59 | } 60 | 61 | button { 62 | background: var(--primary); 63 | color: white; 64 | border: none; 65 | padding: 0.5rem 1rem; 66 | border-radius: 8px; 67 | cursor: pointer; 68 | transition: background-color var(--transition); 69 | } 70 | 71 | button:hover { 72 | background: var(--primary-hover); 73 | } 74 | 75 | #themeToggle { 76 | position: absolute; 77 | top: 0; 78 | right: 0; 79 | background: transparent; 80 | font-size: 1.5rem; 81 | padding: 0.5rem; 82 | width: 40px; 83 | height: 40px; 84 | display: flex; 85 | align-items: center; 86 | justify-content: center; 87 | border: 2px solid var(--text); 88 | border-radius: 50%; 89 | } 90 | 91 | #themeToggle:hover { 92 | background: rgba(255,255,255,0.1); 93 | } 94 | 95 | #themeToggle svg { 96 | width: 20px; 97 | height: 20px; 98 | stroke: var(--text); 99 | fill: none; 100 | stroke-width: 2; 101 | } 102 | 103 | .button-group { 104 | display: flex; 105 | gap: 0.5rem; 106 | align-items: center; 107 | } 108 | 109 | .clear-btn { 110 | background: transparent; 111 | padding: 0.5rem; 112 | width: 36px; 113 | height: 36px; 114 | display: flex; 115 | align-items: center; 116 | justify-content: center; 117 | border: 1px solid #ff4444; 118 | } 119 | 120 | .clear-btn svg { 121 | stroke: #ff4444; 122 | stroke-width: 2; 123 | fill: none; 124 | } 125 | 126 | .clear-btn:hover { 127 | background: rgba(255,68,68,0.1); 128 | } 129 | 130 | .todo-form { 131 | display: flex; 132 | gap: 0.5rem; 133 | margin-bottom: 2rem; 134 | justify-content: center; 135 | } 136 | 137 | input { 138 | flex: 1; 139 | max-width: 400px; 140 | padding: 0.75rem; 141 | border: 1px solid var(--border); 142 | border-radius: 8px; 143 | background: var(--container); 144 | color: var(--text); 145 | transition: border-color var(--transition); 146 | } 147 | 148 | input:focus { 149 | outline: none; 150 | border-color: var(--primary); 151 | } 152 | 153 | .todo-list { 154 | list-style: none; 155 | display: flex; 156 | flex-direction: column; 157 | gap: 0.5rem; 158 | align-items: center; 159 | width: 100%; 160 | } 161 | 162 | .todo-item { 163 | display: grid; 164 | grid-template-columns: 30px 1fr auto; 165 | align-items: center; 166 | gap: 0.75rem; 167 | padding: 1rem; 168 | background: var(--container); 169 | border-radius: 8px; 170 | box-shadow: var(--shadow); 171 | transition: transform var(--transition), box-shadow var(--transition); 172 | width: 100%; 173 | max-width: 500px; 174 | cursor: default; 175 | position: relative; 176 | } 177 | 178 | .todo-item:not(.completed) { 179 | cursor: grab; 180 | } 181 | 182 | .todo-item.dragging { 183 | cursor: grabbing; 184 | opacity: 0.9; 185 | box-shadow: var(--shadow), 0 8px 16px rgba(0,0,0,0.1); 186 | transform: scale(1.02) translateY(-2px); 187 | } 188 | 189 | .todo-item:not(.completed):hover { 190 | transform: translateY(-2px); 191 | } 192 | 193 | .todo-item.completed span { 194 | text-decoration: line-through; 195 | opacity: 0.7; 196 | } 197 | 198 | .checkbox-wrapper { 199 | position: relative; 200 | width: 100%; 201 | height: 100%; 202 | display: flex; 203 | align-items: center; 204 | justify-content: center; 205 | cursor: pointer; 206 | padding: 0.5rem; 207 | margin: -0.5rem; 208 | } 209 | 210 | .todo-item input[type="checkbox"] { 211 | width: 18px; 212 | height: 18px; 213 | margin: 0; 214 | justify-self: start; 215 | cursor: pointer; 216 | position: relative; 217 | z-index: 1; 218 | } 219 | 220 | .todo-item span { 221 | overflow-wrap: break-word; 222 | word-break: break-word; 223 | min-width: 0; 224 | text-align: left; 225 | justify-self: start; 226 | cursor: pointer; 227 | padding: 0.25rem; 228 | border-radius: 4px; 229 | transition: background-color var(--transition); 230 | } 231 | 232 | .todo-item span:hover { 233 | background-color: rgba(0, 0, 0, 0.05); 234 | } 235 | 236 | [data-theme="dark"] .todo-item span:hover { 237 | background-color: rgba(255, 255, 255, 0.05); 238 | } 239 | 240 | .todo-item .edit-input { 241 | width: 100%; 242 | padding: 0.25rem; 243 | margin: 0; 244 | border: 1px solid var(--primary); 245 | border-radius: 4px; 246 | background: var(--container); 247 | color: var(--text); 248 | font-size: inherit; 249 | font-family: inherit; 250 | } 251 | 252 | .todo-item a { 253 | color: var(--primary); 254 | text-decoration: none; 255 | transition: opacity var(--transition); 256 | } 257 | 258 | .todo-item a:hover { 259 | opacity: 0.8; 260 | text-decoration: underline; 261 | } 262 | 263 | .todo-item.completed a { 264 | opacity: 0.7; 265 | text-decoration: line-through; 266 | } 267 | 268 | .delete-btn { 269 | margin-left: auto; 270 | background: transparent; 271 | color: #ff4444; 272 | padding: 0.25rem 0.5rem; 273 | border: 1px solid #ff4444; 274 | justify-self: end; 275 | } 276 | 277 | .delete-btn:hover { 278 | background: rgba(255,68,68,0.1); 279 | } 280 | 281 | /* .toast-container { 282 | position: fixed; 283 | bottom: 2rem; 284 | left: 50%; 285 | transform: translateX(-50%); 286 | padding: 0.75rem 1.5rem; 287 | background: var(--container); 288 | border-radius: 8px; 289 | box-shadow: var(--shadow); 290 | opacity: 0; 291 | transition: opacity var(--transition); 292 | z-index: 2000; 293 | } */ 294 | 295 | .toast-container { 296 | position: fixed; 297 | bottom: 1rem; 298 | left: 50%; 299 | transform: translateX(-50%); 300 | padding: 0.5rem 1rem; 301 | display: flex; 302 | flex-direction: column; 303 | gap: 10px; 304 | z-index: 2000; 305 | } 306 | 307 | .toast { 308 | color: #ffffff; 309 | padding: 0.5rem 1rem; 310 | border-radius: 20px; 311 | opacity: 0; 312 | transition: opacity 0.3s ease-in-out; 313 | max-width: 300px; 314 | box-sizing: border-box; 315 | word-wrap: break-word; 316 | font-size: 0.875rem; 317 | cursor: pointer; 318 | } 319 | 320 | .toast.show { 321 | opacity: 1; 322 | } 323 | 324 | .toast.success { 325 | background-color: var(--success-status-bg); 326 | } 327 | 328 | .toast.error { 329 | background-color: var(--danger-status-bg); 330 | } 331 | 332 | 333 | .todo-divider { 334 | width: 100%; 335 | max-width: 500px; 336 | text-align: left; 337 | padding: 1rem 0; 338 | margin: 1rem 0; 339 | color: var(--text); 340 | opacity: 0.7; 341 | font-size: 0.9rem; 342 | border-bottom: 1px solid var(--border); 343 | } 344 | 345 | @media (max-width: 480px) { 346 | .app { 347 | padding: 1rem; 348 | } 349 | 350 | h1 { 351 | font-size: 1.5rem; 352 | } 353 | 354 | .todo-form { 355 | flex-direction: column; 356 | align-items: center; 357 | } 358 | 359 | .button-group { 360 | width: 100%; 361 | max-width: 400px; 362 | } 363 | 364 | .button-group button[type="submit"] { 365 | flex: 1; 366 | } 367 | } 368 | 369 | /* PIN Modal Styles */ 370 | .modal { 371 | position: fixed; 372 | top: 0; 373 | left: 0; 374 | width: 100%; 375 | height: 100%; 376 | background: rgba(0, 0, 0, 0.5); 377 | display: none; 378 | justify-content: center; 379 | align-items: center; 380 | z-index: 1000; 381 | } 382 | 383 | .modal[aria-hidden="false"] { 384 | display: flex; 385 | } 386 | 387 | .modal-content { 388 | background: var(--container); 389 | padding: 2rem; 390 | border-radius: 16px; 391 | box-shadow: var(--shadow); 392 | max-width: 90%; 393 | width: 400px; 394 | text-align: center; 395 | } 396 | 397 | .modal h2 { 398 | margin-bottom: 0.5rem; 399 | color: var(--text); 400 | } 401 | 402 | .pin-description { 403 | color: var(--text); 404 | opacity: 0.8; 405 | margin-bottom: 1.5rem; 406 | font-size: 0.9rem; 407 | } 408 | 409 | .pin-input-container { 410 | display: flex; 411 | gap: 0.5rem; 412 | justify-content: center; 413 | margin-bottom: 1rem; 414 | } 415 | 416 | .pin-input-container input.pin-input { 417 | width: 35px; 418 | height: 45px; 419 | text-align: center; 420 | font-size: 1.25rem; 421 | border: 2px solid var(--border); 422 | border-radius: 8px; 423 | background: var(--container); 424 | color: var(--text); 425 | transition: all var(--transition); 426 | flex: none; 427 | max-width: 30px; 428 | padding: 0; 429 | } 430 | 431 | .pin-input-container input.pin-input:focus { 432 | outline: none; 433 | border-color: var(--primary); 434 | } 435 | 436 | .pin-input-container input.pin-input.has-value { 437 | border-color: var(--primary); 438 | background-color: var(--primary); 439 | color: white; 440 | } 441 | 442 | [data-theme="dark"] .pin-input-container input.pin-input.has-value { 443 | color: white; 444 | } 445 | 446 | [data-theme="light"] .pin-input-container input.pin-input.has-value { 447 | color: white; 448 | } 449 | 450 | .pin-error { 451 | color: #ff4444; 452 | font-size: 0.9rem; 453 | margin-top: 1rem; 454 | display: none; 455 | } 456 | 457 | .pin-error[aria-hidden="false"] { 458 | display: block; 459 | } 460 | 461 | /* Remove logo styles as they're no longer needed */ 462 | 463 | .list-controls { 464 | display: flex; 465 | gap: 0.5rem; 466 | align-items: center; 467 | justify-content: flex-start; 468 | width: 100%; 469 | padding: 0 1rem; 470 | } 471 | 472 | .list-buttons { 473 | display: flex; 474 | gap: 0.25rem; 475 | } 476 | 477 | .icon-btn { 478 | background: transparent; 479 | padding: 0.5rem; 480 | width: 32px; 481 | height: 32px; 482 | display: flex; 483 | align-items: center; 484 | justify-content: center; 485 | border: 1px solid var(--border); 486 | } 487 | 488 | .icon-btn svg { 489 | stroke: var(--text); 490 | stroke-width: 2; 491 | fill: none; 492 | } 493 | 494 | .icon-btn:hover { 495 | background: rgba(33, 150, 243, 0.1); 496 | border-color: var(--primary); 497 | } 498 | 499 | .icon-btn:hover svg { 500 | stroke: var(--primary); 501 | } 502 | 503 | .list-selector-container { 504 | position: relative; 505 | min-width: 150px; 506 | } 507 | 508 | .list-selector-container::after { 509 | content: ''; 510 | position: absolute; 511 | right: 10px; 512 | top: 50%; 513 | transform: translateY(-50%); 514 | width: 0; 515 | height: 0; 516 | border-left: 5px solid transparent; 517 | border-right: 5px solid transparent; 518 | border-top: 5px solid var(--text); 519 | pointer-events: none; 520 | z-index: 2; 521 | } 522 | 523 | #listSelector { 524 | appearance: none; 525 | -webkit-appearance: none; 526 | -moz-appearance: none; 527 | background: var(--container); 528 | color: var(--text); 529 | border: 1px solid var(--border); 530 | border-radius: 8px; 531 | padding: 0.5rem; 532 | padding-right: 24px; 533 | font-size: 0.9rem; 534 | cursor: pointer; 535 | transition: all var(--transition); 536 | width: 100%; 537 | position: relative; 538 | z-index: 1; 539 | text-align: left; 540 | } 541 | 542 | #listSelector:focus { 543 | outline: none; 544 | border-color: var(--primary); 545 | } 546 | 547 | /* Hide native select dropdown in Firefox */ 548 | #listSelector:-moz-focusring { 549 | color: transparent; 550 | text-shadow: 0 0 0 var(--text); 551 | } 552 | 553 | /* Hide native select dropdown in IE/Edge */ 554 | #listSelector::-ms-expand { 555 | display: none; 556 | } 557 | 558 | #listSelector option { 559 | position: absolute; 560 | opacity: 0; 561 | pointer-events: none; 562 | } 563 | 564 | .custom-select { 565 | position: absolute; 566 | top: calc(100% + 4px); 567 | left: 0; 568 | right: 0; 569 | background: var(--container); 570 | border: 1px solid var(--border); 571 | border-radius: 8px; 572 | box-shadow: var(--shadow); 573 | display: none; 574 | z-index: 100; 575 | max-height: 200px; 576 | overflow-y: auto; 577 | } 578 | 579 | .list-item { 580 | display: flex; 581 | align-items: center; 582 | justify-content: space-between; 583 | padding: 0.5rem 0.75rem; 584 | cursor: pointer; 585 | color: var(--text); 586 | transition: background-color var(--transition); 587 | text-align: left; 588 | } 589 | 590 | .list-item:hover { 591 | background: rgba(33, 150, 243, 0.1); 592 | } 593 | 594 | .list-item .delete-btn { 595 | opacity: 0; 596 | transition: opacity var(--transition); 597 | color: #ff4444; 598 | background: none; 599 | border: none; 600 | padding: 0.25rem; 601 | margin-left: 0.5rem; 602 | cursor: pointer; 603 | display: inline-flex; 604 | align-items: center; 605 | } 606 | 607 | .list-item:hover .delete-btn { 608 | opacity: 1; 609 | } 610 | 611 | .list-item .delete-btn:hover { 612 | color: #ff6666; 613 | } 614 | 615 | .list-item .delete-btn svg { 616 | width: 14px; 617 | height: 14px; 618 | stroke: currentColor; 619 | stroke-width: 2; 620 | fill: none; 621 | } 622 | 623 | .list-item.list-1 .delete-btn { 624 | display: none; 625 | } 626 | 627 | @media (max-width: 600px) { 628 | .list-controls { 629 | position: static; 630 | margin-bottom: 1rem; 631 | justify-content: center; 632 | } 633 | 634 | header { 635 | flex-direction: column; 636 | gap: 1rem; 637 | } 638 | 639 | #themeToggle { 640 | position: static; 641 | margin-left: auto; 642 | } 643 | } 644 | 645 | /* Login Page Styles */ 646 | .login-page { 647 | min-height: 100vh; 648 | display: flex; 649 | align-items: center; 650 | justify-content: center; 651 | } 652 | 653 | .login-container { 654 | position: relative; 655 | width: 100%; 656 | max-width: 400px; 657 | text-align: center; 658 | } 659 | 660 | .login-box { 661 | background: var(--container); 662 | padding: 2rem; 663 | border-radius: 16px; 664 | box-shadow: var(--shadow); 665 | margin: 2rem 0; 666 | } 667 | 668 | .login-page #themeToggle { 669 | position: absolute; 670 | top: 0; 671 | right: 0; 672 | } 673 | 674 | .login-page h1 { 675 | font-size: 2.5rem; 676 | margin-bottom: 1rem; 677 | } 678 | 679 | .login-page h2 { 680 | color: var(--text); 681 | margin-bottom: 0.5rem; 682 | } 683 | 684 | @media (max-width: 480px) { 685 | .login-container { 686 | padding: 1rem; 687 | } 688 | 689 | .login-box { 690 | padding: 1.5rem; 691 | } 692 | 693 | .login-page h1 { 694 | font-size: 2rem; 695 | } 696 | } 697 | 698 | /* PIN Status Styles */ 699 | .pin-status { 700 | margin-top: 1rem; 701 | display: flex; 702 | flex-direction: column; 703 | gap: 0.5rem; 704 | text-align: center; 705 | } 706 | 707 | .attempts-remaining { 708 | color: #ff4444; 709 | font-size: 0.9rem; 710 | font-weight: 500; 711 | display: none; 712 | } 713 | 714 | .attempts-remaining[aria-hidden="false"] { 715 | display: block; 716 | } 717 | 718 | .lockout-notice { 719 | color: #ff4444; 720 | font-size: 0.9rem; 721 | font-weight: 500; 722 | background: rgba(255, 68, 68, 0.1); 723 | padding: 0.75rem; 724 | border-radius: 8px; 725 | border: 1px solid #ff4444; 726 | display: none; 727 | } 728 | 729 | .lockout-notice[aria-hidden="false"] { 730 | display: block; 731 | } 732 | 733 | .pin-error { 734 | color: #ff4444; 735 | font-size: 0.9rem; 736 | display: none; 737 | } 738 | 739 | .pin-error[aria-hidden="false"] { 740 | display: block; 741 | } 742 | 743 | .active-todos { 744 | display: flex; 745 | flex-direction: column; 746 | gap: 0.5rem; 747 | width: 100%; 748 | align-items: center; 749 | } 750 | 751 | /* Add a visual indicator for drop target */ 752 | .todo-item:not(.completed):not(.dragging)::after { 753 | content: ''; 754 | position: absolute; 755 | left: 0; 756 | right: 0; 757 | height: 2px; 758 | background: var(--primary); 759 | opacity: 0; 760 | transition: opacity var(--transition); 761 | } 762 | 763 | .todo-item:not(.completed):not(.dragging).drop-above::after { 764 | top: -1px; 765 | opacity: 1; 766 | } 767 | 768 | .todo-item:not(.completed):not(.dragging).drop-below::after { 769 | bottom: -1px; 770 | opacity: 1; 771 | } 772 | 773 | /* Add touch-friendly tap target on mobile */ 774 | @media (max-width: 768px) { 775 | .checkbox-wrapper { 776 | padding: 0.75rem; 777 | margin: -0.75rem; 778 | } 779 | } -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | DumbDo - Stupidly Simple Todo List 7 | 8 | 9 | 16 | 17 | 18 | 19 |
20 |
21 |

DumbDo

22 |
23 |
24 | 27 |
28 |
29 | 35 | 41 |
42 |
43 | 59 |
60 | 61 |
62 |
63 | 69 |
70 | 71 | 76 |
77 |
78 | 79 |
    80 | 81 |
82 |
83 | 84 |
85 |
86 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /public/login.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | DumbDo - Login 7 | 8 | 15 | 16 | 17 | 18 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /public/login.js: -------------------------------------------------------------------------------- 1 | // DOM Elements 2 | const loginForm = document.getElementById('loginForm'); 3 | const pinError = document.getElementById('pinError'); 4 | const attemptsRemaining = document.getElementById('attemptsRemaining'); 5 | const lockoutNotice = document.getElementById('lockoutNotice'); 6 | const themeToggle = document.getElementById('themeToggle'); 7 | const moonIcon = themeToggle.querySelector('.moon'); 8 | const sunIcon = themeToggle.querySelector('.sun'); 9 | let pinInputs = []; 10 | 11 | // Theme Management 12 | function updateThemeIcons() { 13 | const isDark = document.documentElement.getAttribute('data-theme') === 'dark'; 14 | moonIcon.style.display = isDark ? 'none' : 'block'; 15 | sunIcon.style.display = isDark ? 'block' : 'none'; 16 | } 17 | 18 | // Initialize theme icons 19 | updateThemeIcons(); 20 | 21 | themeToggle.addEventListener('click', () => { 22 | const isDark = document.documentElement.getAttribute('data-theme') === 'dark'; 23 | const newTheme = isDark ? 'light' : 'dark'; 24 | document.documentElement.setAttribute('data-theme', newTheme); 25 | localStorage.setItem('theme', newTheme); 26 | updateThemeIcons(); 27 | }); 28 | 29 | // Check PIN status periodically 30 | async function checkPinStatus() { 31 | try { 32 | const response = await fetch('/api/pin-required'); 33 | const { locked, lockoutMinutes, attemptsLeft } = await response.json(); 34 | 35 | if (locked) { 36 | showLockout(lockoutMinutes); 37 | pinInputs.forEach(input => input.disabled = true); 38 | } else { 39 | pinInputs.forEach(input => input.disabled = false); 40 | if (attemptsLeft < 5) { 41 | showError('', attemptsLeft); 42 | } 43 | } 44 | } catch (error) { 45 | console.error('Failed to check PIN status:', error); 46 | } 47 | } 48 | 49 | // PIN Management 50 | async function setupPinInputs(data) { 51 | try { 52 | const container = document.querySelector('.pin-input-container'); 53 | container.innerHTML = ''; 54 | 55 | // Create PIN inputs 56 | for (let i = 0; i < data.length; i++) { 57 | const input = document.createElement('input'); 58 | input.type = 'password'; 59 | input.maxLength = 1; 60 | input.pattern = '[0-9]'; 61 | input.inputMode = 'numeric'; 62 | input.className = 'pin-input'; 63 | input.setAttribute('aria-label', `PIN digit ${i + 1}`); 64 | container.appendChild(input); 65 | 66 | if (data.locked) { 67 | input.disabled = true; 68 | } 69 | } 70 | 71 | // Update pinInputs array 72 | pinInputs = [...document.querySelectorAll('.pin-input')]; 73 | setupPinInputListeners(); 74 | 75 | if (data.locked) { 76 | showLockout(data.lockoutMinutes); 77 | } else { 78 | if (data.attemptsLeft < 5) { 79 | showError('', data.attemptsLeft); 80 | } 81 | pinInputs[0].focus(); 82 | } 83 | 84 | // Start periodic status check 85 | setInterval(checkPinStatus, 10000); // Check every 10 seconds 86 | } catch (error) { 87 | showError('Failed to initialize PIN inputs'); 88 | } 89 | } 90 | 91 | function setupPinInputListeners() { 92 | pinInputs.forEach((input, index) => { 93 | input.addEventListener('input', (e) => { 94 | const value = e.target.value; 95 | 96 | // Add/remove the has-value class 97 | input.classList.toggle('has-value', value !== ''); 98 | 99 | if (value && index < pinInputs.length - 1) { 100 | pinInputs[index + 1].focus(); 101 | } 102 | 103 | // Check if all inputs are filled 104 | const pin = pinInputs.map(input => input.value).join(''); 105 | if (pin.length === pinInputs.length) { 106 | verifyPin(pin); 107 | } 108 | }); 109 | 110 | input.addEventListener('keydown', (e) => { 111 | if (e.key === 'Backspace' && !e.target.value && index > 0) { 112 | pinInputs[index - 1].focus(); 113 | pinInputs[index - 1].classList.remove('has-value'); 114 | } 115 | }); 116 | 117 | input.addEventListener('keypress', (e) => { 118 | if (!/[0-9]/.test(e.key)) { 119 | e.preventDefault(); 120 | } 121 | }); 122 | 123 | input.addEventListener('paste', (e) => { 124 | e.preventDefault(); 125 | const text = e.clipboardData.getData('text/plain'); 126 | if (text != null && text.length > 0 && /^\d+$/.test(text)) { 127 | for (let i = index; i < Math.min(index + text.length, pinInputs.length); i++) { 128 | pinInputs[i].value = text[i - index]; 129 | pinInputs[i].focus(); 130 | } 131 | const pin = pinInputs.map(input => input.value).join(''); 132 | if (pin.length === pinInputs.length) { 133 | verifyPin(pin); 134 | } 135 | } 136 | }) 137 | }); 138 | } 139 | 140 | function showError(message, attemptsLeft = null) { 141 | if (message) { 142 | pinError.textContent = message; 143 | pinError.setAttribute('aria-hidden', 'false'); 144 | } else { 145 | pinError.setAttribute('aria-hidden', 'true'); 146 | } 147 | 148 | // Handle attempts remaining 149 | if (attemptsLeft !== null) { 150 | attemptsRemaining.textContent = `${attemptsLeft} attempt${attemptsLeft === 1 ? '' : 's'} remaining`; 151 | attemptsRemaining.setAttribute('aria-hidden', 'false'); 152 | } else { 153 | attemptsRemaining.setAttribute('aria-hidden', 'true'); 154 | } 155 | } 156 | 157 | function showLockout(minutes) { 158 | lockoutNotice.textContent = `Too many attempts. Please try again in ${minutes} minute${minutes === 1 ? '' : 's'}.`; 159 | lockoutNotice.setAttribute('aria-hidden', 'false'); 160 | pinError.setAttribute('aria-hidden', 'true'); 161 | attemptsRemaining.setAttribute('aria-hidden', 'true'); 162 | } 163 | 164 | function clearErrors() { 165 | pinError.setAttribute('aria-hidden', 'true'); 166 | attemptsRemaining.setAttribute('aria-hidden', 'true'); 167 | lockoutNotice.setAttribute('aria-hidden', 'true'); 168 | } 169 | 170 | function clearInputs() { 171 | pinInputs.forEach(input => { 172 | input.value = ''; 173 | input.classList.remove('has-value'); 174 | }); 175 | clearErrors(); 176 | pinInputs[0].focus(); 177 | } 178 | 179 | async function verifyPin(pin) { 180 | try { 181 | const response = await fetch('/api/verify-pin', { 182 | method: 'POST', 183 | headers: { 184 | 'Content-Type': 'application/json', 185 | }, 186 | body: JSON.stringify({ pin }) 187 | }); 188 | 189 | const data = await response.json(); 190 | 191 | if (data.valid) { 192 | // Use replace to prevent back button from returning to login 193 | window.location.replace('/'); 194 | return; 195 | } 196 | 197 | if (data.locked) { 198 | showLockout(data.lockoutMinutes); 199 | pinInputs.forEach(input => input.disabled = true); 200 | } else { 201 | showError(data.error, data.attemptsLeft); 202 | } 203 | clearInputs(); 204 | 205 | // Check status immediately after a failed attempt 206 | await checkPinStatus(); 207 | } catch (error) { 208 | showError('Failed to verify PIN'); 209 | clearInputs(); 210 | } 211 | } 212 | 213 | // Initialize only if we need to be on this page 214 | async function init() { 215 | try { 216 | await fetch('/api/pin-required') 217 | .then(resp => { 218 | if (resp.status === 403) throw new Error(`Forbbiden: ${resp.status}`); 219 | else if (resp.status >= 400) throw new Error(resp.status); 220 | 221 | return resp.json(); 222 | }) 223 | .then(data => { 224 | if (!data.required) { 225 | window.location.replace('/'); 226 | return; 227 | } 228 | 229 | // Only set up PIN inputs if we actually need them 230 | setupPinInputs(data); 231 | }) 232 | .catch(err => { 233 | console.error(err); 234 | const pinContainer = document.getElementById('loginForm'); 235 | if (pinContainer) { 236 | pinContainer.style.opacity = '0.5'; 237 | pinContainer.style.pointerEvents = 'none'; 238 | const pinDescription = document.getElementById('pin-description'); 239 | pinDescription.textContent = ''; 240 | } 241 | showError(err); 242 | }); 243 | 244 | } catch (error) { 245 | showError(`Failed to initialize login`); 246 | console.error(error); 247 | } 248 | } 249 | 250 | // Start initialization 251 | init(); -------------------------------------------------------------------------------- /public/managers/toast.js: -------------------------------------------------------------------------------- 1 | export class ToastManager { 2 | constructor(containerElement) { 3 | this.container = containerElement; 4 | this.isError = 'error'; 5 | this.isSuccess = 'success'; 6 | } 7 | 8 | show(message, type = 'success', isStatic = false, timeoutMs = 2000) { 9 | const toast = document.createElement('div'); 10 | toast.classList.add('toast'); 11 | toast.textContent = message; 12 | 13 | if (type === this.isSuccess) toast.classList.add('success'); 14 | else toast.classList.add('error'); 15 | 16 | this.container.appendChild(toast); 17 | 18 | setTimeout(() => { 19 | toast.addEventListener('click', () => this.hide(toast)); 20 | toast.classList.add('show'); 21 | }, 10); 22 | 23 | if (!isStatic) { 24 | setTimeout(() => { 25 | toast.classList.remove('show'); 26 | setTimeout(() => { 27 | this.hide(toast); 28 | }, 300); // Match transition duration 29 | }, timeoutMs); 30 | } 31 | } 32 | 33 | hide(toast) { 34 | toast.classList.remove('show'); 35 | setTimeout(() => { 36 | this.container.removeChild(toast); 37 | }, 300); 38 | } 39 | 40 | clear() { 41 | // use to clear static toast messages 42 | while (this.container.firstChild) { 43 | this.container.removeChild(this.container.firstChild); 44 | } 45 | } 46 | } -------------------------------------------------------------------------------- /public/service-worker.js: -------------------------------------------------------------------------------- 1 | const CACHE_NAME = "DUMBDO_PWA_CACHE_V1"; 2 | const ASSETS_TO_CACHE = []; 3 | 4 | const preload = async () => { 5 | console.log("Installing web app"); 6 | return await caches.open(CACHE_NAME) 7 | .then(async (cache) => { 8 | console.log("caching index and important routes"); 9 | const response = await fetch("/asset-manifest.json"); 10 | const assets = await response.json(); 11 | ASSETS_TO_CACHE.push(...assets); 12 | console.log("Assets Cached:", ASSETS_TO_CACHE); 13 | return cache.addAll(ASSETS_TO_CACHE); 14 | }); 15 | } 16 | 17 | // Fetch asset manifest dynamically 18 | globalThis.addEventListener("install", (event) => { 19 | event.waitUntil(preload()); 20 | }); 21 | 22 | globalThis.addEventListener("activate", (event) => { 23 | event.waitUntil(clients.claim()); 24 | }); 25 | 26 | globalThis.addEventListener("fetch", (event) => { 27 | event.respondWith( 28 | caches.match(event.request).then((cachedResponse) => { 29 | return cachedResponse || fetch(event.request); 30 | }) 31 | ); 32 | }); -------------------------------------------------------------------------------- /scripts/convert-logo.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const sharp = require('sharp'); 3 | const path = require('path'); 4 | const ASSETS_DIR = path.join(__dirname, "..", "public", "assets"); 5 | 6 | // Sizes for different use cases 7 | const sizes = [16, 32, 48, 64, 128, 192, 256, 512]; 8 | 9 | async function convertLogoToPng() { 10 | console.log("Generating logo files..."); 11 | // Create assets directory if it doesn't exist 12 | if (!fs.existsSync(ASSETS_DIR)) { 13 | fs.mkdirSync(ASSETS_DIR); 14 | } 15 | 16 | const inputFile = path.join(ASSETS_DIR, 'favicon.svg'); 17 | 18 | for (const size of sizes) { 19 | await sharp(inputFile) 20 | .resize(size, size) 21 | .png() 22 | .toFile(path.join(ASSETS_DIR, `logo-${size}.png`)); 23 | 24 | console.log(`Created ${size}x${size} PNG`); 25 | } 26 | 27 | // Create favicon.ico size 28 | await sharp(inputFile) 29 | .resize(32, 32) 30 | .png() 31 | .toFile(path.join(ASSETS_DIR, 'favicon.png')); 32 | 33 | console.log('Conversion complete!'); 34 | } 35 | 36 | module.exports = { convertLogoToPng }; -------------------------------------------------------------------------------- /scripts/cors.js: -------------------------------------------------------------------------------- 1 | const ALLOWED_ORIGINS = process.env.ALLOWED_ORIGINS || '*'; 2 | const NODE_ENV = process.env.NODE_ENV || 'production'; 3 | let allowedOrigins = []; 4 | 5 | function setupOrigins() { 6 | if (NODE_ENV === 'development' || ALLOWED_ORIGINS === '*') allowedOrigins = '*'; 7 | else if (ALLOWED_ORIGINS && typeof ALLOWED_ORIGINS === 'string') { 8 | try { 9 | console.log('ALLOWED ORIGINS TEST:', ALLOWED_ORIGINS); 10 | const allowed = ALLOWED_ORIGINS.split(',').map(origin => origin.trim()); 11 | allowed.forEach(origin => { 12 | const normalizedOrigin = normalizeOrigin(origin); 13 | allowedOrigins.push(normalizedOrigin); 14 | }); 15 | } 16 | catch (error) { 17 | console.error(`Error setting up ALLOWED_ORIGINS: ${ALLOWED_ORIGINS}:`, error); 18 | } 19 | } 20 | console.log("ALLOWED ORIGINS:", allowedOrigins); 21 | return allowedOrigins; 22 | } 23 | 24 | function normalizeOrigin(origin) { 25 | if (origin) { 26 | try { 27 | console.log("Validating Origin:", origin); 28 | const normalizedOrigin = new URL(origin).origin; 29 | console.log("Normalized Url:", normalizedOrigin); 30 | return normalizedOrigin; 31 | } catch (error) { 32 | console.error("Error parsing referer URL:", error); 33 | throw new Error("Error parsing referer URL:", error); 34 | } 35 | } 36 | } 37 | 38 | function validateOrigin(origin) { 39 | if (NODE_ENV === 'development' || allowedOrigins === '*') return true; 40 | 41 | try { 42 | if (origin) origin = normalizeOrigin(origin); 43 | else { 44 | console.warn("No origin to validate."); 45 | return false; 46 | } 47 | 48 | if (allowedOrigins.includes(origin)) return true; 49 | else { 50 | console.warn("Blocked request from origin:", { origin }); 51 | return false; 52 | } 53 | } 54 | catch (error) { 55 | console.error(error); 56 | } 57 | } 58 | 59 | function originValidationMiddleware(req, res, next) { 60 | let origin = req.headers.referer; 61 | const isOriginValid = validateOrigin(origin); 62 | 63 | if (isOriginValid) { 64 | next(); 65 | } else { 66 | console.warn("Blocked request from origin:", { origin }); 67 | res.status(403).json({ error: 'Forbidden' }); 68 | } 69 | } 70 | 71 | 72 | function getCorsOptions() { 73 | const allowedOrigins = setupOrigins(); 74 | const corsOptions = { 75 | origin: allowedOrigins, 76 | credentials: true, 77 | methods: ['GET', 'POST', 'PUT', 'DELETE', 'OPTIONS'], 78 | allowedHeaders: ['Content-Type', 'Authorization'], 79 | }; 80 | 81 | return corsOptions; 82 | } 83 | 84 | module.exports = { getCorsOptions, originValidationMiddleware }; -------------------------------------------------------------------------------- /scripts/pwa-manifest-generator.js: -------------------------------------------------------------------------------- 1 | const fs = require("fs"); 2 | const path = require("path"); 3 | const PUBLIC_DIR = path.join(__dirname, "..", "public"); 4 | const ASSETS_DIR = path.join(PUBLIC_DIR, "assets"); 5 | 6 | function getFiles(dir, basePath = "/") { 7 | let fileList = []; 8 | const files = fs.readdirSync(dir); 9 | 10 | files.forEach((file) => { 11 | const filePath = path.join(dir, file); 12 | const fileUrl = path.join(basePath, file).replace(/\\/g, "/"); 13 | 14 | if (fs.statSync(filePath).isDirectory()) { 15 | fileList = fileList.concat(getFiles(filePath, fileUrl)); 16 | } else { 17 | fileList.push(fileUrl); 18 | } 19 | }); 20 | 21 | return fileList; 22 | } 23 | 24 | function generateAssetManifest() { 25 | const assets = getFiles(PUBLIC_DIR); 26 | fs.writeFileSync(path.join(ASSETS_DIR, "asset-manifest.json"), JSON.stringify(assets, null, 2)); 27 | console.log("Asset manifest generated!", assets); 28 | } 29 | 30 | function generatePWAManifest(siteTitle) { 31 | generateAssetManifest(); // fetched later in service-worker 32 | 33 | const pwaManifest = { 34 | name: siteTitle, 35 | short_name: siteTitle, 36 | description: "A stupidly simple todo list", 37 | start_url: "/", 38 | display: "standalone", 39 | background_color: "#ffffff", 40 | theme_color: "#000000", 41 | icons: [ 42 | { 43 | src: "assets/logo-192.png", 44 | type: "image/png", 45 | sizes: "192x192" 46 | }, 47 | { 48 | src: "assets/logo-512.png", 49 | type: "image/png", 50 | sizes: "512x512" 51 | } 52 | ], 53 | orientation: "any" 54 | }; 55 | 56 | fs.writeFileSync(path.join(ASSETS_DIR, "manifest.json"), JSON.stringify(pwaManifest, null, 2)); 57 | console.log("PWA manifest generated!", pwaManifest); 58 | } 59 | 60 | module.exports = { generatePWAManifest }; -------------------------------------------------------------------------------- /server.js: -------------------------------------------------------------------------------- 1 | require('dotenv').config(); 2 | const express = require('express'); 3 | const cors = require('cors'); 4 | const fs = require('fs').promises; 5 | const path = require('path'); 6 | const crypto = require('crypto'); 7 | const cookieParser = require('cookie-parser'); 8 | const app = express(); 9 | const { getCorsOptions, originValidationMiddleware } = require('./scripts/cors'); 10 | const { convertLogoToPng } = require('./scripts/convert-logo'); 11 | const { generatePWAManifest } = require('./scripts/pwa-manifest-generator'); 12 | 13 | // Environment variables 14 | const PORT = process.env.PORT || 3000; 15 | const PIN = process.env.DUMBDO_PIN; 16 | const SITE_TITLE = process.env.DUMBDO_SITE_TITLE || 'DumbDo'; 17 | const MIN_PIN_LENGTH = 4; 18 | const MAX_PIN_LENGTH = 10; 19 | const PUBLIC_DIR = path.join(__dirname, 'public'); 20 | const ASSETS_DIR = path.join(PUBLIC_DIR, 'assets'); 21 | 22 | // Generate PWA assets 23 | convertLogoToPng(); 24 | generatePWAManifest(SITE_TITLE); 25 | 26 | // Trust proxy - required for secure cookies behind a reverse proxy 27 | app.set('trust proxy', 1); 28 | 29 | // Cors Setup 30 | const corsOptions = getCorsOptions(); 31 | 32 | // Middleware 33 | app.use(cors(corsOptions)); 34 | app.use(express.json()); 35 | app.use(cookieParser()); 36 | 37 | // Apply origin validation to all /api routes 38 | app.use('/api', originValidationMiddleware); 39 | 40 | // Brute force protection 41 | const loginAttempts = new Map(); // Stores IP addresses and their attempt counts 42 | const MAX_ATTEMPTS = 5; // Maximum allowed attempts 43 | const LOCKOUT_TIME = 15 * 60 * 1000; // 15 minutes in milliseconds 44 | 45 | // Reset attempts for an IP 46 | function resetAttempts(ip) { 47 | loginAttempts.delete(ip); 48 | } 49 | 50 | // Check if an IP is locked out 51 | function isLockedOut(ip) { 52 | const attempts = loginAttempts.get(ip); 53 | if (!attempts) return false; 54 | 55 | if (attempts.count >= MAX_ATTEMPTS) { 56 | const timeElapsed = Date.now() - attempts.lastAttempt; 57 | if (timeElapsed < LOCKOUT_TIME) { 58 | return true; 59 | } 60 | resetAttempts(ip); 61 | } 62 | return false; 63 | } 64 | 65 | // Record an attempt for an IP 66 | function recordAttempt(ip) { 67 | const attempts = loginAttempts.get(ip) || { count: 0, lastAttempt: 0 }; 68 | attempts.count += 1; 69 | attempts.lastAttempt = Date.now(); 70 | loginAttempts.set(ip, attempts); 71 | } 72 | 73 | // Cleanup old lockouts periodically 74 | setInterval(() => { 75 | const now = Date.now(); 76 | for (const [ip, attempts] of loginAttempts.entries()) { 77 | if (now - attempts.lastAttempt >= LOCKOUT_TIME) { 78 | loginAttempts.delete(ip); 79 | } 80 | } 81 | }, 60000); // Clean up every minute 82 | 83 | // Constant-time string comparison 84 | function secureCompare(a, b) { 85 | if (typeof a !== 'string' || typeof b !== 'string') { 86 | return false; 87 | } 88 | 89 | return crypto.timingSafeEqual( 90 | Buffer.from(a.padEnd(MAX_PIN_LENGTH, '0')), 91 | Buffer.from(b.padEnd(MAX_PIN_LENGTH, '0')) 92 | ); 93 | } 94 | 95 | // Public PIN Routes - these don't require authentication 96 | app.get('/api/pin-required', (req, res) => { 97 | const lockoutTime = isLockedOut(req.ip); 98 | const attempts = loginAttempts.get(req.ip); 99 | const attemptsLeft = attempts ? MAX_ATTEMPTS - attempts.count : MAX_ATTEMPTS; 100 | 101 | res.json({ 102 | required: !!PIN, 103 | length: PIN ? PIN.length : MIN_PIN_LENGTH, 104 | locked: isLockedOut(req.ip), 105 | attemptsLeft: Math.max(0, attemptsLeft), 106 | lockoutMinutes: lockoutTime ? Math.ceil((LOCKOUT_TIME - (Date.now() - attempts.lastAttempt)) / 1000 / 60) : 0 107 | }); 108 | }); 109 | 110 | app.post('/api/verify-pin', (req, res) => { 111 | const { pin } = req.body; 112 | const ip = req.ip; 113 | 114 | // Check if IP is locked out 115 | if (isLockedOut(ip)) { 116 | const attempts = loginAttempts.get(ip); 117 | const timeLeft = Math.ceil((LOCKOUT_TIME - (Date.now() - attempts.lastAttempt)) / 1000 / 60); 118 | return res.status(429).json({ 119 | error: `Too many attempts. Please try again in ${timeLeft} minutes.`, 120 | locked: true, 121 | lockoutMinutes: timeLeft 122 | }); 123 | } 124 | 125 | // Validate PIN length 126 | if (PIN && (pin.length < MIN_PIN_LENGTH || pin.length > MAX_PIN_LENGTH)) { 127 | recordAttempt(ip); 128 | const attempts = loginAttempts.get(ip); 129 | return res.status(401).json({ 130 | valid: false, 131 | error: `PIN must be between ${MIN_PIN_LENGTH} and ${MAX_PIN_LENGTH} digits`, 132 | attemptsLeft: MAX_ATTEMPTS - attempts.count 133 | }); 134 | } 135 | 136 | // Add artificial delay to further prevent timing attacks 137 | const delay = crypto.randomInt(50, 150); 138 | setTimeout(() => { 139 | if (!PIN || secureCompare(pin, PIN)) { 140 | // Reset attempts on successful login 141 | resetAttempts(ip); 142 | 143 | // Set secure cookie 144 | res.cookie('DUMBDO_PIN', pin, { 145 | httpOnly: true, 146 | secure: process.env.NODE_ENV === 'production', 147 | sameSite: 'strict' 148 | }); 149 | 150 | res.json({ valid: true }); 151 | } else { 152 | // Record failed attempt 153 | recordAttempt(ip); 154 | 155 | const attempts = loginAttempts.get(ip); 156 | const attemptsLeft = MAX_ATTEMPTS - attempts.count; 157 | 158 | res.status(401).json({ 159 | valid: false, 160 | error: `Invalid PIN. ${attemptsLeft} attempts remaining before lockout.`, 161 | attemptsLeft 162 | }); 163 | } 164 | }, delay); 165 | }); 166 | 167 | // Get site configuration 168 | app.get('/api/config', (req, res) => { 169 | res.json({ 170 | siteTitle: SITE_TITLE 171 | }); 172 | }); 173 | 174 | // Serve static files that don't need PIN protection 175 | app.get('/login.js', (req, res) => { 176 | res.sendFile(path.join(PUBLIC_DIR, 'login.js')); 177 | }); 178 | 179 | app.get('/styles.css', (req, res) => { 180 | res.sendFile(path.join(ASSETS_DIR, 'styles.css')); 181 | }); 182 | 183 | app.get('/favicon.svg', (req, res) => { 184 | res.sendFile(path.join(ASSETS_DIR, 'favicon.svg')); 185 | }); 186 | 187 | // Serve the pwa/asset manifest 188 | app.get('/asset-manifest.json', (req, res) => { 189 | // generated in pwa-manifest-generator and fetched from service-worker.js 190 | res.sendFile(path.join(ASSETS_DIR, 'asset-manifest.json')); 191 | }); 192 | app.get('/manifest.json', (req, res) => { 193 | res.sendFile(path.join(ASSETS_DIR, 'manifest.json')); 194 | }); 195 | 196 | // PIN validation helper 197 | function isValidPin(providedPin) { 198 | return !PIN || (providedPin && secureCompare(providedPin, PIN)); 199 | } 200 | 201 | // PIN validation middleware - everything after this requires PIN 202 | app.use((req, res, next) => { 203 | const providedPin = req.cookies.DUMBDO_PIN || req.headers['x-pin']; 204 | 205 | if (isValidPin(providedPin)) { 206 | return next(); 207 | } 208 | 209 | if (req.xhr || req.path.startsWith('/api/')) { 210 | return res.status(401).json({ error: 'Invalid PIN' }); 211 | } 212 | 213 | if (req.path !== '/login') { 214 | return res.redirect('/login'); 215 | } 216 | 217 | next(); 218 | }); 219 | 220 | // Protected routes below 221 | 222 | app.get('/', (req, res) => { 223 | res.sendFile(path.join(PUBLIC_DIR, 'index.html')); 224 | }); 225 | 226 | app.get('/login', (req, res) => { 227 | const providedPin = req.cookies.DUMBDO_PIN || req.headers['x-pin']; 228 | 229 | if (isValidPin(providedPin)) { 230 | res.redirect('/'); 231 | } else { 232 | res.sendFile(path.join(PUBLIC_DIR, 'login.html')); 233 | } 234 | }); 235 | 236 | // Protect all other static files 237 | app.use(express.static(PUBLIC_DIR)); 238 | app.use(express.static('.')); 239 | 240 | // Data directory and file path 241 | const DATA_DIR = path.join(__dirname, 'data'); 242 | const DATA_FILE = path.join(DATA_DIR, 'todos.json'); 243 | 244 | // Ensure the data directory and file exist 245 | async function initDataFile() { 246 | try { 247 | await fs.access(DATA_DIR); 248 | } catch { 249 | await fs.mkdir(DATA_DIR); 250 | } 251 | 252 | try { 253 | await fs.access(DATA_FILE); 254 | } catch { 255 | await fs.writeFile(DATA_FILE, JSON.stringify({})); 256 | } 257 | 258 | console.log('Todo list stored at:', DATA_FILE); 259 | } 260 | 261 | // Protected API routes 262 | app.get('/api/todos', async (req, res) => { 263 | try { 264 | const data = await fs.readFile(DATA_FILE, 'utf8'); 265 | res.json(JSON.parse(data)); 266 | } catch (error) { 267 | res.status(500).json({ error: 'Failed to read todos' }); 268 | } 269 | }); 270 | 271 | app.post('/api/todos', async (req, res) => { 272 | try { 273 | await fs.writeFile(DATA_FILE, JSON.stringify(req.body, null, 2)); 274 | res.json({ success: true }); 275 | } catch (error) { 276 | res.status(500).json({ error: 'Failed to save todos' }); 277 | } 278 | }); 279 | 280 | // Initialize and start server 281 | initDataFile().then(() => { 282 | app.listen(PORT, () => { 283 | console.log(`DumbDo server running at http://localhost:${PORT}`); 284 | console.log('PIN protection:', PIN ? 'enabled' : 'disabled'); 285 | }); 286 | }); -------------------------------------------------------------------------------- /todos.json: -------------------------------------------------------------------------------- 1 | [{"text":"test","completed":false},{"text":"me","completed":false},{"text":"lol","completed":false}] --------------------------------------------------------------------------------