Merge branch 'tycrek:master' into master

pull/135/head
NotAShelf 9 months ago committed by GitHub
commit afc943c2bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,2 +1 @@
patreon: tycrek
custom: ['https://jmoore.dev/donate']
ko_fi: tycrek

@ -18,5 +18,5 @@
[Contributing Guidelines]: https://github.com/tycrek/ass/blob/master/CONTRIBUTING.md
[Contributing Guidelines]: https://github.com/tycrek/ass/blob/master/.github/CONTRIBUTING.md
[ISC License]: https://github.com/tycrek/ass/blob/master/LICENSE

21
.github/README.md vendored

@ -1,28 +1,33 @@
<div align="center">
<h1><a href="https://github.com/tycrek/ass" target="_blank"><img height="180" alt="ass" src="https://imagedelivery.net/cNsTmYlz178gQNL42swQfw/44357fc5-8afd-4a17-76b9-556660b5fc00/public"></a></h1>
</div>
<h1><a href="https://github.com/tycrek/ass" target="_blank"><img height="180" alt="ass" src="https://i.tycrek.dev/ass-round-square-logo-white-with-text"></a></h1>
![GitHub package.json version]
![GitHub license]
![GitHub last commit]
![Lines of code]
![GitHub Repo stars]
[![Discord badge]][Discord invite]
</div>
**ass** is a self-hosted ShareX upload server written in Node.js. I initially started this project purely out of spite. ass aims to be as **unopinionated** as possible, giving users & hosts alike the ability to modify nearly everything.
By default, ass comes with a resource viewing page, which includes metadata about the resource as well as a download button & inline viewers for images, videos, & audio. It does **not** have a user dashboard or registration system: **this is intentional!** Developers are free to [create their own frontends] using the languages & tools they are most comfortable with. Writing & using these frontends is fully documented below, in the wiki, & in the source code.
#### Developers ❤
### Notice (Sep 2023)
The current release version 0.14.x is now in **maintenence mode**. What this means is I'll only be providing updates to catastrophic issues.
However! I'm currently working on [a new version](https://github.com/tycrek/ass/pull/220), 0.15.0, which is a lot more stable and organized. I have no ETA but please know that I'm continuing to work on it when I can. Version 0.14.x is still functional, just a bit rough around the edges.
#### Developers 🧡
ass was designed with developers in mind. If you are a developer & want something changed to better suit you, let me know & we'll see what we can do!
[GitHub package.json version]: https://img.shields.io/github/package-json/v/tycrek/ass?color=fd842d&style=for-the-badge
[GitHub license]: https://img.shields.io/github/license/tycrek/ass?color=FD7C21&style=for-the-badge
[GitHub last commit]: https://img.shields.io/github/last-commit/tycrek/ass?color=FD710D&style=for-the-badge
[Lines of code]: https://img.shields.io/tokei/lines/github/tycrek/ass?color=F26602&label=LINES&style=for-the-badge
[GitHub Repo stars]: https://img.shields.io/github/stars/tycrek/ass?color=DE5E02&style=for-the-badge
[Discord badge]: https://img.shields.io/discord/848274994375294986?label=Support%20server&logo=Discord&logoColor=FFF&style=for-the-badge
[GitHub Repo stars]: https://img.shields.io/github/stars/tycrek/ass?color=F26602&style=for-the-badge
[Discord badge]: https://img.shields.io/discord/848274994375294986?label=Discord&logo=Discord&logoColor=FFF&style=for-the-badge
[Discord invite]: https://discord.gg/wGZYt5fasY
[create their own frontends]: #custom-frontends
@ -124,7 +129,7 @@ ass supports two installation methods: Docker (recommended) & local (manual).
1. Clone the ass repo using `git clone https://github.com/tycrek/ass.git && cd ass/`
2. Run the command that corresponds to your OS:
- **Linux**: `./install/docker-linux.sh` (uses `#!/bin/bash`)
- **Windows**: `install/docker-windows.bat` (from Command Prompt)
- **Windows**: `install\docker-windows.bat` (from Command Prompt)
- These scripts are identical using the equivalent commands in each OS.
3. Work through the setup process when prompted.

@ -0,0 +1,20 @@
name: Merge Conflict Labeler
on:
push:
pull_request_target:
types: [ synchronize ]
jobs:
label:
name: 'Merge conflict labeling'
runs-on: ubuntu-latest
if: ${{ github.repository == 'tycrek/ass' }}
steps:
- uses: eps1lon/actions-label-merge-conflict@releases/2.x
if: ${{ github.event_name == 'push' || github.event_name == 'pull_request_target'}}
with:
dirtyLabel: 'merge conflict'
commentOnDirty: 'This pull request has merge conflicts. Please resolve the conflicts so the PR can be successfully reviewed and merged.'
commentOnClean: "Conflicts have been resolved. A maintainer will review the pull request shortly."
repoToken: "${{ secrets.GH_TOKEN }}"

@ -39,11 +39,11 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
@ -54,7 +54,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
uses: github/codeql-action/autobuild@v2
# Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
@ -68,4 +68,4 @@ jobs:
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v2

@ -3,6 +3,7 @@ on:
push:
pull_request:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
@ -10,11 +11,11 @@ jobs:
ARCHIVE_NAME: ass-build-${{ github.run_id }}-${{ github.run_number }}
steps:
# Checkout repo
- uses: actions/checkout@v2
- uses: actions/checkout@v4
# Set up Node 16
- name: Setup Node.js environment
uses: actions/setup-node@v2.4.1
uses: actions/setup-node@v3
with:
node-version: 16.14.0
@ -38,7 +39,7 @@ jobs:
# Upload archive as an artifact
- name: Upload archive
uses: actions/upload-artifact@v2.2.4
uses: actions/upload-artifact@v3
with:
name: ${{ env.ARCHIVE_NAME }}
path: ${{ env.ARCHIVE_NAME }}.zip

3
.gitmodules vendored

@ -1,3 +0,0 @@
[submodule "ass-x"]
path = ass-x
url = git@github.com:tycrek/ass-x.git

@ -4,7 +4,7 @@
# - Zusier <zusier@pm.me> (https://github.com/Zusier)
# Node 16 image
FROM node:16.19.1
FROM node:16.20.2
# Set working directory
WORKDIR /opt/ass/

@ -1 +0,0 @@
Subproject commit 2b143138ef2cb7790117709882e429f5e7680d75

6397
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -1,6 +1,6 @@
{
"name": "ass",
"version": "0.14.4",
"version": "0.14.6",
"description": "The simple self-hosted ShareX server",
"main": "ass.js",
"engines": {
@ -49,34 +49,33 @@
"@tycrek/joint": "^1.0.0-1",
"@tycrek/log": "^0.7.1",
"@tycrek/papito": "^0.3.4",
"@xoi/gps-metadata-remover": "^1.1.1",
"@xoi/gps-metadata-remover": "^1.1.2",
"any-shell-escape": "^0.1.1",
"autoprefixer": "^10.4.13",
"aws-sdk": "^2.1318.0",
"axios": "^1.3.3",
"bcrypt": "^5.1.0",
"autoprefixer": "^10.4.16",
"aws-sdk": "^2.1467.0",
"axios": "^1.5.1",
"bcrypt": "^5.1.1",
"chalk": "^4.1.2",
"check-node-version": "^4.2.1",
"crypto-random-string": "3.3.1",
"cssnano": "^5.1.15",
"cssnano": "^6.0.1",
"escape-html": "^1.0.3",
"express": "^4.18.2",
"express-brute": "^1.0.1",
"express-busboy": "^9.0.0",
"ffmpeg-static": "^5.1.0",
"fs-extra": "^11.1.0",
"helmet": "^6.0.1",
"luxon": "^3.3.0",
"express-busboy": "^10.1.0",
"ffmpeg-static": "^5.2.0",
"fs-extra": "^11.1.1",
"helmet": "^7.0.0",
"luxon": "^3.4.3",
"nanoid": "^3.3.4",
"node-fetch": "^2.6.7",
"node-vibrant": "^3.1.6",
"node-vibrant": "^3.2.1-alpha.1",
"prompt": "^1.3.0",
"pug": "^3.0.2",
"sanitize-filename": "^1.6.3",
"sharp": "^0.31.3",
"sharp": "^0.32.6",
"stream-to-array": "^2.3.0",
"submodule": "^1.2.1",
"tailwindcss": "^3.2.7",
"tailwindcss": "^3.3.3",
"typescript": "^4.9.5",
"uuid": "^8.3.2"
},
@ -84,7 +83,6 @@
"@types/bcrypt": "^5.0.0",
"@types/escape-html": "^1.0.1",
"@types/express": "^4.17.13",
"@types/express-brute": "^1.0.1",
"@types/express-busboy": "^8.0.0",
"@types/ffmpeg-static": "^3.0.0",
"@types/fs-extra": "^9.0.12",

@ -59,24 +59,6 @@ app.disable('x-powered-by');
app.set('trust proxy', isProxied);
app.set('view engine', 'pug');
// Rate limiting using express-brute
// ! Notice !
// The rate limiting used here is very trivial and should be used with caution.
// I plan to improve this in the future somehow (possibly with redis, who knows).
// - tycrek, 2022-08-18
// todo: fix this eventually
import ExpressBrute from 'express-brute';
const bruteforce = new ExpressBrute(new ExpressBrute.MemoryStore(), {
freeRetries: 50,
minWait: 50, // 50ms
maxWait: 500, // 500ms
lifetime: 5, // 5 seconds
failCallback: (_req, res, _next, _nextValidRequestDate) => res.sendStatus(429),
});
// Routes to protect
app.get(['/'], bruteforce.prevent, (_req, _res, next) => next());
// Express logger middleware
// app.use(log.middleware());

@ -104,7 +104,13 @@ const migrate = (authFileName = 'auth.json'): Promise<Users> => new Promise(asyn
// We did it hoofuckingray
.then(() => log.success('Migrated all auth & file data to new auth system'))
.then(() => resolve(newUsers))
.catch(reject);
.catch((err) => (
log.blank().blank().blank()
.info('READ THIS', 'If you see this after installation, please run ass once again before asking for help. This error will automatically fix itself.')
.blank()
.info('Hey you', 'Read that message ^^')
.blank().blank().blank(),
reject(err)));
});
/**

@ -26,8 +26,8 @@ function getCommand(src: String, dest: String) {
'-v', (isProd ? 'error' : 'debug'), // Log level
'-i', src, // Input file
'-ss', '00:00:01.000', // Timestamp of frame to grab
'-vf', `scale=${THUMBNAIL.WIDTH}:${THUMBNAIL.HEIGHT}:force_original_aspect_ratio=increase,crop=${THUMBNAIL.WIDTH}:${THUMBNAIL.HEIGHT}`, // Dimensions of output file
'-frames:v', '1', // Number of frames to grab
'-s', `${THUMBNAIL.WIDTH}x${THUMBNAIL.HEIGHT}`, // Dimensions of output file
dest // Output file
]);
}

@ -51,7 +51,7 @@ export function randomHexColour() { // From: https://www.geeksforgeeks.org/javas
}
export function getResourceColor(colorValue: string, vibrantValue: string) {
return colorValue === '&random' ? randomHexColour() : colorValue === '&vibrant' ? vibrantValue : colorValue;
return (!colorValue || colorValue === '&vibrant') ? vibrantValue : colorValue === '&random' ? randomHexColour() : colorValue;
}
export function formatTimestamp(timestamp: number, timeoffset: string) {

Loading…
Cancel
Save