diff --git a/.gitignore b/.gitignore index 68fad2d9..454fb7f4 100644 --- a/.gitignore +++ b/.gitignore @@ -194,5 +194,8 @@ typings/ # ublock + chromium /uBOLite.chromium.mv3 /chromium-profile -# direnv /.direnv + +# KJ +deploy.sh +gunicorn.sh diff --git a/Makefile b/Makefile index adefa0f1..a91fdb6b 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: serve +.PHONY: serve install serve: python manage.py runserver @@ -12,5 +12,8 @@ test: format: black bookmarks black siteroot - npx prettier bookmarks/frontend --write + npx prettier bookmarks/frontend --write npx prettier bookmarks/styles --write + +install: + .venv/bin/pip install -r requirements.txt --upgrade diff --git a/bookmarks/frontend/components/SearchAutoComplete.svelte b/bookmarks/frontend/components/SearchAutoComplete.svelte index 64d84181..c5ca8689 100644 --- a/bookmarks/frontend/components/SearchAutoComplete.svelte +++ b/bookmarks/frontend/components/SearchAutoComplete.svelte @@ -210,7 +210,7 @@ {/if} {#each suggestions.tags as suggestion} @@ -221,7 +221,7 @@ {/if} {#each suggestions.recentSearches as suggestion} @@ -232,7 +232,7 @@ {/if} {#each suggestions.bookmarks as suggestion} diff --git a/bookmarks/frontend/components/TagAutocomplete.svelte b/bookmarks/frontend/components/TagAutocomplete.svelte index 09553b48..66eb41ec 100644 --- a/bookmarks/frontend/components/TagAutocomplete.svelte +++ b/bookmarks/frontend/components/TagAutocomplete.svelte @@ -119,7 +119,7 @@ {#each suggestions as tag,i} diff --git a/bookmarks/templates/bookmarks/bookmark_list.html b/bookmarks/templates/bookmarks/bookmark_list.html index e1159758..3d3deaa9 100644 --- a/bookmarks/templates/bookmarks/bookmark_list.html +++ b/bookmarks/templates/bookmarks/bookmark_list.html @@ -158,4 +158,4 @@
{% pagination bookmark_list.bookmarks_page %}
-{% endif %} +{% endif %} \ No newline at end of file diff --git a/bookmarks/templates/bookmarks/layout.html b/bookmarks/templates/bookmarks/layout.html index 678da394..b69d20c0 100644 --- a/bookmarks/templates/bookmarks/layout.html +++ b/bookmarks/templates/bookmarks/layout.html @@ -98,4 +98,4 @@

LINKDING

{% endblock %} - + \ No newline at end of file diff --git a/bookmarks/templates/bookmarks/nav_menu.html b/bookmarks/templates/bookmarks/nav_menu.html index e8173612..1e935777 100644 --- a/bookmarks/templates/bookmarks/nav_menu.html +++ b/bookmarks/templates/bookmarks/nav_menu.html @@ -80,4 +80,4 @@ -{% endhtmlmin %} +{% endhtmlmin %} \ No newline at end of file diff --git a/bookmarks/templates/bookmarks/tag_cloud.html b/bookmarks/templates/bookmarks/tag_cloud.html index 52a8ad23..01c5c459 100644 --- a/bookmarks/templates/bookmarks/tag_cloud.html +++ b/bookmarks/templates/bookmarks/tag_cloud.html @@ -20,7 +20,7 @@ {{ tag.name|first_char }}{{ tag.name|remaining_chars:1 }} + class="highlight-char">{{ tag.name|first_char }}{{ tag.name|remaining_chars:1 }} {% else %} {# Render remaining tags normally #} diff --git a/bookmarks/templates/settings/general.html b/bookmarks/templates/settings/general.html index dc6f0702..1d55b950 100644 --- a/bookmarks/templates/settings/general.html +++ b/bookmarks/templates/settings/general.html @@ -194,7 +194,7 @@

Profile

Enabling this feature will automatically create snapshots of bookmarked websites on the Internet Archive Wayback - Machine. + Machine. This allows to preserve, and later access the website as it was at the point in time it was bookmarked, in case it goes offline or its content is modified. Please consider donating to the - {% endif %} + {% endif %}
diff --git a/deploy_excludes b/deploy_excludes new file mode 100644 index 00000000..f6b3b3fd --- /dev/null +++ b/deploy_excludes @@ -0,0 +1,47 @@ +__pycache__ +_sources +._* +.DS_Store +.editorconfig +.env +.env.* +.git +.gitignore +.github +.svn +.venv +*._* +*.kdev4 +*.lock +*.log +*.log.* +*.pid +*.pyc +*.pyo +*.scss +*.sqlite3 +*.swp +*.vim +*.vscode +*~ +/bookmarks/static/favicon.png +data +db.sqlite3 +deploy_excludes +deploy_includes +deploy.sh +develserver.sh +docs +docker +Gruntfile.js +gulpfile.js +media +node_modules +rollup.config.mjs +sass +scss +/siteroot/settings/dev.py +/static +tmp +vim +vim/*.sh diff --git a/deploy_includes b/deploy_includes new file mode 100644 index 00000000..090b58a5 --- /dev/null +++ b/deploy_includes @@ -0,0 +1,2 @@ +bookmarks/styles/* +migrations/__init__.py diff --git a/package-lock.json b/package-lock.json index 72a0524a..49976af9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,14 +12,15 @@ "@hotwired/turbo": "^8.0.6", "@rollup/plugin-node-resolve": "^15.2.3", "@rollup/plugin-terser": "^0.4.4", - "@rollup/wasm-node": "^4.13.0", + "@rollup/wasm-node": "^4.21.3", "cssnano": "^7.0.6", - "postcss": "^8.4.45", + "postcss": "^8.4.47", "postcss-cli": "^11.0.0", "postcss-import": "^16.1.0", "postcss-nesting": "^13.0.0", - "rollup-plugin-svelte": "^7.2.0", - "svelte": "^4.0.0" + "rollup-plugin-svelte": "^7.2.2", + "spectre.css": "^0.5.9", + "svelte": "^4.2.19" }, "devDependencies": { "prettier": "^3.3.3" @@ -27,8 +28,7 @@ }, "node_modules/@ampproject/remapping": { "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", - "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", + "license": "Apache-2.0", "dependencies": { "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.24" @@ -89,8 +89,7 @@ }, "node_modules/@jridgewell/gen-mapping": { "version": "0.3.5", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", - "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", + "license": "MIT", "dependencies": { "@jridgewell/set-array": "^1.2.1", "@jridgewell/sourcemap-codec": "^1.4.10", @@ -102,24 +101,21 @@ }, "node_modules/@jridgewell/resolve-uri": { "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", - "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "license": "MIT", "engines": { "node": ">=6.0.0" } }, "node_modules/@jridgewell/set-array": { "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", - "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", + "license": "MIT", "engines": { "node": ">=6.0.0" } }, "node_modules/@jridgewell/source-map": { "version": "0.3.6", - "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.6.tgz", - "integrity": "sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ==", + "license": "MIT", "dependencies": { "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.25" @@ -127,13 +123,11 @@ }, "node_modules/@jridgewell/sourcemap-codec": { "version": "1.4.15", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", - "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==" + "license": "MIT" }, "node_modules/@jridgewell/trace-mapping": { "version": "0.3.25", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", - "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", + "license": "MIT", "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" @@ -173,8 +167,7 @@ }, "node_modules/@rollup/plugin-node-resolve": { "version": "15.2.3", - "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-15.2.3.tgz", - "integrity": "sha512-j/lym8nf5E21LwBT4Df1VD6hRO2L2iwUeUmP7litikRsVp1H6NWx20NEp0Y7su+7XGc476GnXXc4kFeZNGmaSQ==", + "license": "MIT", "dependencies": { "@rollup/pluginutils": "^5.0.1", "@types/resolve": "1.20.2", @@ -195,20 +188,19 @@ } } }, - "node_modules/@rollup/plugin-terser": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/@rollup/plugin-terser/-/plugin-terser-0.4.4.tgz", - "integrity": "sha512-XHeJC5Bgvs8LfukDwWZp7yeqin6ns8RTl2B9avbejt6tZqsqvVoWI7ZTQrcNsfKEDWBTnTxM8nMDkO2IFFbd0A==", + "node_modules/@rollup/plugin-node-resolve/node_modules/@rollup/pluginutils": { + "version": "5.1.0", + "license": "MIT", "dependencies": { - "serialize-javascript": "^6.0.1", - "smob": "^1.0.0", - "terser": "^5.17.4" + "@types/estree": "^1.0.0", + "estree-walker": "^2.0.2", + "picomatch": "^2.3.1" }, "engines": { "node": ">=14.0.0" }, "peerDependencies": { - "rollup": "^2.0.0||^3.0.0||^4.0.0" + "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" }, "peerDependenciesMeta": { "rollup": { @@ -216,20 +208,23 @@ } } }, - "node_modules/@rollup/pluginutils": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.1.0.tgz", - "integrity": "sha512-XTIWOPPcpvyKI6L1NHo0lFlCyznUEyPmPY1mc3KpPVDYulHSTvyeLNVW00QTLIAFNhR3kYnJTQHeGqU4M3n09g==", + "node_modules/@rollup/plugin-node-resolve/node_modules/estree-walker": { + "version": "2.0.2", + "license": "MIT" + }, + "node_modules/@rollup/plugin-terser": { + "version": "0.4.4", + "license": "MIT", "dependencies": { - "@types/estree": "^1.0.0", - "estree-walker": "^2.0.2", - "picomatch": "^2.3.1" + "serialize-javascript": "^6.0.1", + "smob": "^1.0.0", + "terser": "^5.17.4" }, "engines": { "node": ">=14.0.0" }, "peerDependencies": { - "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" + "rollup": "^2.0.0||^3.0.0||^4.0.0" }, "peerDependenciesMeta": { "rollup": { @@ -446,9 +441,10 @@ "peer": true }, "node_modules/@rollup/wasm-node": { - "version": "4.13.0", - "resolved": "https://registry.npmjs.org/@rollup/wasm-node/-/wasm-node-4.13.0.tgz", - "integrity": "sha512-oFX11wzU7RTaiW06WBtRpzIVN/oaG0I3XkevNO0brBklYnY9zpLhTfksN4b+TdBt6CfXV/KdVhdWLbb0fQIR7A==", + "version": "4.21.3", + "resolved": "https://registry.npmjs.org/@rollup/wasm-node/-/wasm-node-4.21.3.tgz", + "integrity": "sha512-uZFl4GXMgyllfuKjY/zlXxTxDs+G/LB7snVENskpJt7IIXw6cD1yqi3eBeGM8NxE9kuxrNB0Qr1QLNtDYTlqeQ==", + "license": "MIT", "dependencies": { "@types/estree": "1.0.5" }, @@ -484,18 +480,15 @@ }, "node_modules/@types/estree": { "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", - "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==" + "license": "MIT" }, "node_modules/@types/resolve": { "version": "1.20.2", - "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.20.2.tgz", - "integrity": "sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==" + "license": "MIT" }, "node_modules/acorn": { "version": "8.11.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", - "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", + "license": "MIT", "bin": { "acorn": "bin/acorn" }, @@ -539,16 +532,14 @@ }, "node_modules/aria-query": { "version": "5.3.0", - "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.0.tgz", - "integrity": "sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==", + "license": "Apache-2.0", "dependencies": { "dequal": "^2.0.3" } }, "node_modules/axobject-query": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-4.0.0.tgz", - "integrity": "sha512-+60uv1hiVFhHZeO+Lz0RYzsVHy5Wr1ayX0mwda9KPDVLNJgZ1T9Ny7VmFbLDzxsH0D87I86vgj3gFrjTJUYznw==", + "license": "Apache-2.0", "dependencies": { "dequal": "^2.0.3" } @@ -613,13 +604,11 @@ }, "node_modules/buffer-from": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==" + "license": "MIT" }, "node_modules/builtin-modules": { "version": "3.3.0", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.3.0.tgz", - "integrity": "sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==", + "license": "MIT", "engines": { "node": ">=6" }, @@ -695,8 +684,7 @@ }, "node_modules/code-red": { "version": "1.0.4", - "resolved": "https://registry.npmjs.org/code-red/-/code-red-1.0.4.tgz", - "integrity": "sha512-7qJWqItLA8/VPVlKJlFXU+NBlo/qyfs39aJcuMT/2ere32ZqvF5OSxgdM5xOfJJ7O429gg2HM47y8v9P+9wrNw==", + "license": "MIT", "dependencies": { "@jridgewell/sourcemap-codec": "^1.4.15", "@types/estree": "^1.0.1", @@ -736,8 +724,7 @@ }, "node_modules/commander": { "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" + "license": "MIT" }, "node_modules/css-declaration-sorter": { "version": "7.2.0", @@ -767,8 +754,7 @@ }, "node_modules/css-tree": { "version": "2.3.1", - "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.3.1.tgz", - "integrity": "sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==", + "license": "MIT", "dependencies": { "mdn-data": "2.0.30", "source-map-js": "^1.0.1" @@ -904,8 +890,7 @@ }, "node_modules/deepmerge": { "version": "4.3.1", - "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", - "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -920,8 +905,7 @@ }, "node_modules/dequal": { "version": "2.0.3", - "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", - "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", + "license": "MIT", "engines": { "node": ">=6" } @@ -1006,11 +990,6 @@ "node": ">=6" } }, - "node_modules/estree-walker": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", - "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==" - }, "node_modules/fast-glob": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", @@ -1060,9 +1039,7 @@ }, "node_modules/fsevents": { "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "hasInstallScript": true, + "license": "MIT", "optional": true, "os": [ "darwin" @@ -1073,8 +1050,7 @@ }, "node_modules/function-bind": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", - "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -1165,8 +1141,7 @@ }, "node_modules/is-builtin-module": { "version": "3.2.1", - "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-3.2.1.tgz", - "integrity": "sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==", + "license": "MIT", "dependencies": { "builtin-modules": "^3.3.0" }, @@ -1409,9 +1384,9 @@ } }, "node_modules/postcss": { - "version": "8.4.45", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.45.tgz", - "integrity": "sha512-7KTLTdzdZZYscUc65XmjFiB73vBhBfbPztCYdUNvlaso9PrzjzcmjqBPR0lNGkcVlcO4BjiO5rK/qNz+XAen1Q==", + "version": "8.4.47", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.47.tgz", + "integrity": "sha512-56rxCq7G/XfB4EkXq9Egn5GCqugWvDFjafDOThIdMBsI15iqPqR5r15TfSr1YPYeEI19YeaXMCbY6u88Y76GLQ==", "funding": [ { "type": "opencollective", @@ -1426,10 +1401,11 @@ "url": "https://github.com/sponsors/ai" } ], + "license": "MIT", "dependencies": { "nanoid": "^3.3.7", - "picocolors": "^1.0.1", - "source-map-js": "^1.2.0" + "picocolors": "^1.1.0", + "source-map-js": "^1.2.1" }, "engines": { "node": "^10 || ^12 || >=14" @@ -1974,6 +1950,7 @@ "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz", "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==", "dev": true, + "license": "MIT", "bin": { "prettier": "bin/prettier.cjs" }, @@ -2013,8 +1990,7 @@ }, "node_modules/randombytes": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", - "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "license": "MIT", "dependencies": { "safe-buffer": "^5.1.0" } @@ -2048,8 +2024,7 @@ }, "node_modules/resolve": { "version": "1.22.8", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", - "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", + "license": "MIT", "dependencies": { "is-core-module": "^2.13.0", "path-parse": "^1.0.7", @@ -2064,8 +2039,7 @@ }, "node_modules/resolve.exports": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", - "integrity": "sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==", + "license": "MIT", "engines": { "node": ">=10" } @@ -2115,9 +2089,10 @@ } }, "node_modules/rollup-plugin-svelte": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/rollup-plugin-svelte/-/rollup-plugin-svelte-7.2.0.tgz", - "integrity": "sha512-Qvo5VNFQZtaI+sHSjcCIFDP+olfKVyslAoJIkL3DxuhUpNY5Ys0+hhxUY3kuEKt9BXFgkFJiiic/XRb07zdSbg==", + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/rollup-plugin-svelte/-/rollup-plugin-svelte-7.2.2.tgz", + "integrity": "sha512-hgnIblTRewaBEVQD6N0Q43o+y6q1TmDRhBjaEzQCi50bs8TXqjc+d1zFZyE8tsfgcfNHZQzclh4RxlFUB85H8Q==", + "license": "MIT", "dependencies": { "@rollup/pluginutils": "^4.1.0", "resolve.exports": "^2.0.0" @@ -2142,6 +2117,12 @@ "node": ">= 8.0.0" } }, + "node_modules/rollup-plugin-svelte/node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "license": "MIT" + }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -2166,8 +2147,6 @@ }, "node_modules/safe-buffer": { "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", "funding": [ { "type": "github", @@ -2181,12 +2160,12 @@ "type": "consulting", "url": "https://feross.org/support" } - ] + ], + "license": "MIT" }, "node_modules/serialize-javascript": { "version": "6.0.2", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", - "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", + "license": "BSD-3-Clause", "dependencies": { "randombytes": "^2.1.0" } @@ -2203,14 +2182,12 @@ } }, "node_modules/smob": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/smob/-/smob-1.4.1.tgz", - "integrity": "sha512-9LK+E7Hv5R9u4g4C3p+jjLstaLe11MDsL21UpYaCNmapvMkYhqCV4A/f/3gyH8QjMyh6l68q9xC85vihY9ahMQ==" + "version": "1.5.0", + "license": "MIT" }, "node_modules/source-map": { "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" } @@ -2225,13 +2202,18 @@ }, "node_modules/source-map-support": { "version": "0.5.21", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", - "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "license": "MIT", "dependencies": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" } }, + "node_modules/spectre.css": { + "version": "0.5.9", + "resolved": "https://registry.npmjs.org/spectre.css/-/spectre.css-0.5.9.tgz", + "integrity": "sha512-9jUqwZmCnvflrxFGcK+ize43TvjwDjqMwZPVubEtSIHzvinH0TBUESm1LcOJx3Ur7bdPaeOHQIjOqBl1Y5kLFw==", + "license": "MIT" + }, "node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", @@ -2273,8 +2255,7 @@ }, "node_modules/supports-preserve-symlinks-flag": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", - "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -2347,9 +2328,8 @@ } }, "node_modules/terser": { - "version": "5.29.2", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.29.2.tgz", - "integrity": "sha512-ZiGkhUBIM+7LwkNjXYJq8svgkd+QK3UUr0wJqY4MieaezBSAIPgbSPZyIx0idM6XWK5CMzSWa8MJIzmRcB8Caw==", + "version": "5.30.4", + "license": "BSD-2-Clause", "dependencies": { "@jridgewell/source-map": "^0.3.3", "acorn": "^8.8.2", diff --git a/package.json b/package.json index cf8975e1..7e9cb445 100644 --- a/package.json +++ b/package.json @@ -25,14 +25,15 @@ "@hotwired/turbo": "^8.0.6", "@rollup/plugin-node-resolve": "^15.2.3", "@rollup/plugin-terser": "^0.4.4", - "@rollup/wasm-node": "^4.13.0", + "@rollup/wasm-node": "^4.21.3", "cssnano": "^7.0.6", - "postcss": "^8.4.45", + "postcss": "^8.4.47", "postcss-cli": "^11.0.0", "postcss-import": "^16.1.0", "postcss-nesting": "^13.0.0", - "rollup-plugin-svelte": "^7.2.0", - "svelte": "^4.0.0" + "rollup-plugin-svelte": "^7.2.2", + "spectre.css": "^0.5.9", + "svelte": "^4.2.19" }, "devDependencies": { "prettier": "^3.3.3" diff --git a/poetry.toml b/poetry.toml new file mode 100644 index 00000000..384db5fd --- /dev/null +++ b/poetry.toml @@ -0,0 +1,3 @@ +[virtualenvs] +create = true +in-project = true \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..2cf582be --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,14 @@ +[tool.poetry] +name = "linkding" +version = "1.30.0" +description = "linkding is a bookmark manager that you can host yourself." +authors = ["Sascha Ißbrücker https://github.com/sissbruecker"] +license = "MIT" +readme = "README.md" + +[tool.poetry.dependencies] +python = ">=3.11,<3.13" + +[build-system] +requires = ["poetry-core"] +build-backend = "poetry.core.masonry.api" diff --git a/requirements.in b/requirements.in index 99c8fdf3..de4069fd 100644 --- a/requirements.in +++ b/requirements.in @@ -2,6 +2,7 @@ beautifulsoup4 bleach bleach-allowlist Django +django-environ django-registration django-widget-tweaks djangorestframework diff --git a/requirements.txt b/requirements.txt index 5bd253df..3d7a5754 100644 --- a/requirements.txt +++ b/requirements.txt @@ -33,6 +33,8 @@ django==5.1.1 # django-registration # djangorestframework # mozilla-django-oidc +django-environ==0.11.2 + # via -r requirements.in django-registration==3.4 # via -r requirements.in django-widget-tweaks==1.5.0 diff --git a/siteroot/settings/base.py b/siteroot/settings/base.py index f8220751..be9860b3 100644 --- a/siteroot/settings/base.py +++ b/siteroot/settings/base.py @@ -13,21 +13,29 @@ import json import os import shlex +from email.utils import getaddresses +from pathlib import Path +import environ -# Build paths inside the project like this: os.path.join(BASE_DIR, ...) -BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) -# BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) +# Set the project base directory +BASE_DIR = Path(__file__).resolve().parent.parent.parent -# Quick-start development settings - unsuitable for production -# See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/ - -# SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = "kgq$h3@!!vbb6*nzfz(dbze=*)zsroqa8gvc0#1gx$3cd8z99^" +# Take environment variables from .env file +env = environ.Env() +env.read_env(str(BASE_DIR / ".env")) # SECURITY WARNING: don't run with debug turned on in production! -DEBUG = False +DEBUG = env.bool("DEBUG") + +# Quick-start development settings - unsuitable for production +# See https://docs.djangoproject.com/en/4.2/howto/deployment/checklist/ -ALLOWED_HOSTS = ["*"] +SECRET_KEY = env("DJANGO_SECRET_KEY") +ADMINS = getaddresses([env("DJANGO_ADMINS")]) +EMAIL_SUBJECT_PREFIX = env("DJANGO_EMAIL_SUBJECT_PREFIX") +SERVER_EMAIL = env("DJANGO_SERVER_EMAIL") +DEFAULT_FROM_EMAIL = env("DJANGO_SERVER_EMAIL") +ALLOWED_HOSTS = env.list("DJANGO_ALLOWED_HOSTS") # Application definition @@ -60,11 +68,17 @@ ROOT_URLCONF = "siteroot.urls" +default_loaders = [ + "django.template.loaders.filesystem.Loader", + "django.template.loaders.app_directories.Loader", +] +cached_loaders = [("django.template.loaders.cached.Loader", default_loaders)] + TEMPLATES = [ { "BACKEND": "django.template.backends.django.DjangoTemplates", "DIRS": [], - "APP_DIRS": True, + "APP_DIRS": False, "OPTIONS": { "context_processors": [ "django.template.context_processors.debug", @@ -74,6 +88,7 @@ "bookmarks.context_processors.toasts", "bookmarks.context_processors.app_version", ], + "loaders": default_loaders if DEBUG else cached_loaders, }, }, ] @@ -112,7 +127,7 @@ LANGUAGE_CODE = "en-us" -TIME_ZONE = os.getenv("TZ", "UTC") +TIME_ZONE = "Europe/Vienna" USE_I18N = True @@ -230,32 +245,13 @@ LD_DB_PORT = os.getenv("LD_DB_PORT", None) LD_DB_OPTIONS = json.loads(os.getenv("LD_DB_OPTIONS") or "{}") -if LD_DB_ENGINE == "postgres": - default_database = { - "ENGINE": "django.db.backends.postgresql_psycopg2", - "NAME": LD_DB_DATABASE, - "USER": LD_DB_USER, - "PASSWORD": LD_DB_PASSWORD, - "HOST": LD_DB_HOST, - "PORT": LD_DB_PORT, - "OPTIONS": LD_DB_OPTIONS, - } -else: - default_database = { - "ENGINE": "django.db.backends.sqlite3", - "NAME": os.path.join(BASE_DIR, "data", "db.sqlite3"), - "OPTIONS": LD_DB_OPTIONS, - # Creating a connection loads the ICU extension into the SQLite - # connection, and also loads an ICU collation. The latter causes a - # memory leak, so try to counter that by making connections indefinitely - # persistent. - "CONN_MAX_AGE": None, - } - -DATABASES = {"default": default_database} +# Database +# https://docs.djangoproject.com/en/4.2/ref/settings/#databases +DATABASES = {"default": env.db("DJANGO_DATABASE_URL")} +USE_SQLITE_ICU_EXTENSION = False SQLITE_ICU_EXTENSION_PATH = "./libicu.so" -USE_SQLITE = default_database["ENGINE"] == "django.db.backends.sqlite3" +USE_SQLITE = "django.db.backends.sqlite3" USE_SQLITE_ICU_EXTENSION = USE_SQLITE and os.path.exists(SQLITE_ICU_EXTENSION_PATH) # Favicons