diff --git a/CONTRIBUTING.md b/.github/CONTRIBUTING.md similarity index 100% rename from CONTRIBUTING.md rename to .github/CONTRIBUTING.md diff --git a/README.md b/.github/README.md old mode 100755 new mode 100644 similarity index 99% rename from README.md rename to .github/README.md index e56a613..4b6399c --- a/README.md +++ b/.github/README.md @@ -167,7 +167,7 @@ Easy! Just pull the changes & run this one-liner: git pull # Rebuild the container with the new changes (uncomment the 2nd part if the update requires refreshing the config) -docker-compose up --force-recreate --build -d && docker image prune -f # docker-compose exec ass npm run setup && docker-compose restart +docker-compose up --force-recreate --build -d && docker image prune -f # && docker-compose exec ass npm run setup && docker-compose restart ``` - `--force-recreate` will force the container to rebuild diff --git a/.github/SUPPORT.md b/.github/SUPPORT.md new file mode 100644 index 0000000..2ce3050 --- /dev/null +++ b/.github/SUPPORT.md @@ -0,0 +1,3 @@ +# Need extra support? + +Join the **[Official Support Discord](https://discord.gg/wGZYt5fasY)!** diff --git a/.github/autoapproval.yml b/.github/autoapproval.yml new file mode 100644 index 0000000..250e344 --- /dev/null +++ b/.github/autoapproval.yml @@ -0,0 +1,5 @@ +from_owner: + - tycrek +required_labels: + - tycrek +apply_labels: [] \ No newline at end of file diff --git a/_.npmrc b/_.npmrc deleted file mode 100644 index 91bb892..0000000 --- a/_.npmrc +++ /dev/null @@ -1 +0,0 @@ -@tycrek:registry=https://npm.pkg.github.com \ No newline at end of file diff --git a/flameshot_example.sh b/flameshot_example.sh index 9f0b280..d87e3a0 100644 --- a/flameshot_example.sh +++ b/flameshot_example.sh @@ -2,7 +2,7 @@ IMAGEPATH="$HOME/Pictures/" # Where to store screenshots before they're deleted IMAGENAME="ass" # Not really important, tells Flameshot what file to send and delete KEY="" # Your ass upload token -DOMAIN="" # Your upload domain +DOMAIN="" # Your upload domain (without http:// or https://) flameshot config -f "$IMAGENAME" # Make sure that Flameshot names the file correctly flameshot gui -r -p "$IMAGEPATH" # Prompt the screenshot GUI @@ -14,6 +14,7 @@ URL=$(curl -X POST \ -H "User-Agent: ShareX/13.4.0" \ -H "Authorization: $KEY" \ -F "file=@$IMAGEPATH$IMAGENAME.png" "https://$DOMAIN/" | grep -Po '(?<="resource":")[^"]+') -echo "$URL" | xclip -sel clip +# printf instead of echo as echo appends a newline +printf "%s" "$URL" | xclip -sel clip rm "$IMAGEPATH$IMAGENAME.png" # Delete the image locally diff --git a/package-lock.json b/package-lock.json index 9ab19fa..c10839c 100755 --- a/package-lock.json +++ b/package-lock.json @@ -10,9 +10,9 @@ "license": "ISC", "dependencies": { "@tsconfig/node14": "^1.0.1", - "@tycrek/express-nofavicon": "^1.0.2", + "@tycrek/express-nofavicon": "^1.0.3", "@tycrek/isprod": "^2.0.2", - "@tycrek/log": ">=0.5.x", + "@tycrek/log": "^0.5.9", "@tycrek/papito": "^0.3.4", "any-shell-escape": "^0.1.1", "aws-sdk": "^2.930.0", @@ -669,9 +669,9 @@ } }, "node_modules/@tycrek/log": { - "version": "0.5.6", - "resolved": "https://registry.npmjs.org/@tycrek/log/-/log-0.5.6.tgz", - "integrity": "sha512-DQTIHK+mUYnE+xXc4LKpbncUFGvcRQSeTdSPI5tOA8ewltM1JH75KK/PYX3ciA8neVIUle/1+pGTCyvZ+O0QQA==", + "version": "0.5.9", + "resolved": "https://registry.npmjs.org/@tycrek/log/-/log-0.5.9.tgz", + "integrity": "sha512-D4UFyt03JJH/ECnaVc8e3aP70gGSE6rw/p8FZAH8J/rRml6ZHtRnlXbPCCAJK5n80KwGHD7UKqH9lQBcoEknvw==", "dependencies": { "chalk": "^4.1.1", "deepmerge": "^4.2.2", @@ -1145,9 +1145,9 @@ } }, "node_modules/aws-sdk": { - "version": "2.998.0", - "resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.998.0.tgz", - "integrity": "sha512-jenbMcGxOg9AeH6p1m0vbsJYNaeJXBnOM58GXsaKecPgRnCm/IykTPlB6aQKfNDk0WQnw5BHDcy7iQPnEjEkUQ==", + "version": "2.999.0", + "resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.999.0.tgz", + "integrity": "sha512-OcnD7m+HCZv2qDzmS7TgABGf26mVPfIyah0Dgz7hHAxBtx78qFWi/s9U6BDxVBKWLg7OKWVHf0opiMG4ujteqg==", "hasInstallScript": true, "dependencies": { "buffer": "4.9.2", @@ -1995,9 +1995,9 @@ } }, "node_modules/express-rate-limit": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/express-rate-limit/-/express-rate-limit-5.3.0.tgz", - "integrity": "sha512-qJhfEgCnmteSeZAeuOKQ2WEIFTX5ajrzE0xS6gCOBCoRQcU+xEzQmgYQQTpzCcqUAAzTEtu4YEih4pnLfvNtew==" + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/express-rate-limit/-/express-rate-limit-5.4.0.tgz", + "integrity": "sha512-sT+rk1wvj06+0MpEiij7y3kGdB4hoMyQ+a5zcESUpDMLhbLXoYIQI6JfsvLBz1wOhmfF//ALG/Q59FKMI0x2Eg==" }, "node_modules/eyes": { "version": "0.1.8", @@ -5080,9 +5080,9 @@ "integrity": "sha512-JKTrwCgdmnUhBOl8OLYAK+B79ZOPJGpQ2yEdsbcGup+TrCjA5vO1bEcpAjlNgHrgYlUwkw0lMxY6SCuPlwZXLw==" }, "@tycrek/log": { - "version": "0.5.6", - "resolved": "https://registry.npmjs.org/@tycrek/log/-/log-0.5.6.tgz", - "integrity": "sha512-DQTIHK+mUYnE+xXc4LKpbncUFGvcRQSeTdSPI5tOA8ewltM1JH75KK/PYX3ciA8neVIUle/1+pGTCyvZ+O0QQA==", + "version": "0.5.9", + "resolved": "https://registry.npmjs.org/@tycrek/log/-/log-0.5.9.tgz", + "integrity": "sha512-D4UFyt03JJH/ECnaVc8e3aP70gGSE6rw/p8FZAH8J/rRml6ZHtRnlXbPCCAJK5n80KwGHD7UKqH9lQBcoEknvw==", "requires": { "chalk": "^4.1.1", "deepmerge": "^4.2.2", @@ -5493,9 +5493,9 @@ "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==" }, "aws-sdk": { - "version": "2.998.0", - "resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.998.0.tgz", - "integrity": "sha512-jenbMcGxOg9AeH6p1m0vbsJYNaeJXBnOM58GXsaKecPgRnCm/IykTPlB6aQKfNDk0WQnw5BHDcy7iQPnEjEkUQ==", + "version": "2.999.0", + "resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.999.0.tgz", + "integrity": "sha512-OcnD7m+HCZv2qDzmS7TgABGf26mVPfIyah0Dgz7hHAxBtx78qFWi/s9U6BDxVBKWLg7OKWVHf0opiMG4ujteqg==", "requires": { "buffer": "4.9.2", "events": "1.1.1", @@ -6159,9 +6159,9 @@ } }, "express-rate-limit": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/express-rate-limit/-/express-rate-limit-5.3.0.tgz", - "integrity": "sha512-qJhfEgCnmteSeZAeuOKQ2WEIFTX5ajrzE0xS6gCOBCoRQcU+xEzQmgYQQTpzCcqUAAzTEtu4YEih4pnLfvNtew==" + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/express-rate-limit/-/express-rate-limit-5.4.0.tgz", + "integrity": "sha512-sT+rk1wvj06+0MpEiij7y3kGdB4hoMyQ+a5zcESUpDMLhbLXoYIQI6JfsvLBz1wOhmfF//ALG/Q59FKMI0x2Eg==" }, "eyes": { "version": "0.1.8", diff --git a/package.json b/package.json index 948619c..da3f42e 100755 --- a/package.json +++ b/package.json @@ -37,9 +37,9 @@ }, "dependencies": { "@tsconfig/node14": "^1.0.1", - "@tycrek/express-nofavicon": "^1.0.2", + "@tycrek/express-nofavicon": "^1.0.3", "@tycrek/isprod": "^2.0.2", - "@tycrek/log": ">=0.5.x", + "@tycrek/log": "^0.5.9", "@tycrek/papito": "^0.3.4", "any-shell-escape": "^0.1.1", "aws-sdk": "^2.930.0", diff --git a/sample_config.sxcu b/sample_config.sxcu index 93052f1..6b52cff 100755 --- a/sample_config.sxcu +++ b/sample_config.sxcu @@ -10,5 +10,7 @@ "Body": "MultipartFormData", "FileFormName": "file", "URL": "$json:.resource$", - "DeletionURL": "$json:.delete$" + "ThumbnailURL": "$json:.thumbnail$", + "DeletionURL": "$json:.delete$", + "ErrorMessage": "$response$" } \ No newline at end of file diff --git a/src/ass.ts b/src/ass.ts index bd91059..e7c901b 100644 --- a/src/ass.ts +++ b/src/ass.ts @@ -69,7 +69,7 @@ useSsl && app.use(helmet.hsts({ preload: true })); // skipcq: JS-0093 app.use(nofavicon); // Use custom index, otherwise render README.md -const ASS_INDEX = indexFile !== '' && fs.existsSync(`../${indexFile}`) && require(`../${indexFile}`); +const ASS_INDEX = indexFile !== '' && fs.existsSync(`../${indexFile}`) && (typeof require(`../${indexFile}`) === typeof Function); app.get('/', (req, res, next) => ASS_INDEX // skipcq: JS-0229 ? ASS_INDEX(req, res, next) : fs.readFile(path('README.md'))