Skip to content

Commit

Permalink
version 1.8.7
Browse files Browse the repository at this point in the history
  • Loading branch information
nokonoko committed Aug 24, 2024
1 parent e878f1b commit aa78551
Show file tree
Hide file tree
Showing 49 changed files with 405 additions and 312 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ docker/uguuForDocker.tar.gz
!/.php-cs-fixer.cache
test.php
.php-cs-fixer.cache
syncToDev.sh
syncToDev.sh
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ all: builddirs npm_dependencies ejs minify copy-img copy-php copy-benchmarks
ejs:
$(foreach i,$(pageList), \
"node_modules/ejs/bin/cli.js" -f $(CURDIR)/$(CONF) $(CURDIR)/src/templates/$(i) -o $(CURDIR)/build/html/unmin/$(noExt).html;)
sed -i '/uguu.min.js/d' $(CURDIR)/build/html/unmin/faq.html
sed -i '/uguu.min.js/d' $(CURDIR)/build/html/unmin/api.html

minify:
"node_modules/@node-minify/cli/dist/cli.mjs" --compressor uglify-es --input $(CURDIR)/src/static/js/uguu.js --output $(CURDIR)/build/js/uguu.min.js
Expand All @@ -41,6 +43,8 @@ installdirs:
mkdir -p $(DESTDIR)/ $(DESTDIR)/img/grills

copy-img:
cp -v $(CURDIR)/src/static/img/*.avif $(CURDIR)/build/img/
cp -v $(CURDIR)/src/static/img/grills/*.avif $(CURDIR)/build/img/grills/
"node_modules/imagemin-cli/cli.js" $(CURDIR)/src/static/img/*.png -o=$(CURDIR)/build/img/
"node_modules/imagemin-cli/cli.js" $(CURDIR)/src/static/img/grills/*.png --plugin=pngquant -o=$(CURDIR)/build/img/grills/

Expand All @@ -67,12 +71,12 @@ install: installdirs
rm -rf $(DESTDIR)/js
rm -rf $(DESTDIR)/php
mv $(DESTDIR)/img $(DESTDIR)/public/
mv $(DESTDIR)/grill.php $(DESTDIR)/public/
mv $(DESTDIR)/upload.php $(DESTDIR)/public/
cd $(DESTDIR)/ && $(CURL) -o composer-setup.php https://raw.githubusercontent.com/composer/getcomposer.org/main/web/installer
cd $(DESTDIR)/ && $(PHP) composer-setup.php --quiet
cd $(DESTDIR)/ && rm composer-setup.php
cd $(DESTDIR)/ && php composer.phar update && php composer.phar install && php composer.phar dump-autoload
bash ./compress.sh "$(DESTDIR)/public/"

dist:
DESTDIR=$(TMPDIR)/uguu-$(PKGVERSION)
Expand Down
50 changes: 13 additions & 37 deletions RELEASE_NOTE.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,20 @@
## Uguu 1.8.6
## Uguu 1.8.7

### Whats new

* Includes INDEX creation in the dbSchemas files, this greatly improves performance when performing filename generation, antidupe, blacklist or rate-limit checks against the database,
especially on big databases. It's recommended you follow the instructions below on how to add INDEX.
* time() is called once in connector to get a timestamp instead of multiple times.
* The function `diverseArray` is now called `transposeArray`, the variables within the function are also renamed to make it easier to understand.
* The function `uploadFile` performs a check if `BENCHMARK_MODE` is set in the configuration, if it is the file will not be uploaded.
* Benchmarking capbility added.
* Docs updated with how to use [Benchmarking](https://github.com/nokonoko/Uguu/wiki/Benchmarking) and also a [Optimization Guide](https://github.com/nokonoko/Uguu/wiki/Optimization).
* Donation icons and copy icon have been replaced by SVG loaded in uguu.css to reduce amount of requests and data transfer needed when loading page.
* Preloading improvements for CSS and JS.
* "grillLoader" has been replaced with loading the grills via JS, which is controlled via the "GRILLS" array in `config.json` upon compilation.
* Upon compilation all assets will be pre-compressed using gzip so Nginx can serve them without having to compress them on runtime.
* Updated Nginx examples: faster TLS handshake, php extension re-write, allowing Nginx to serve pre-compressed assets.
* CSS fixes and improvements, better accessibility on mobile devices.
* The API no longer returns the original filename when uploading, since this can leak sensitive information.
* Assets such as the background image and the grills come pre-compressed in the AVIF format which further reduces load size, if a browser doesnt support AVIF it will fall back to PNG.
* Other minor things.

### Breaking changes

* config.json must include the `"BENCHMARK_MODE"` value, should be set to `false` when not benchmarking, otherwise file(s) will not be uploaded.
* `config.json` needs to be updated.
* Nginx config needs to be updated.

### Add INDEX to an existing Uguu installation

#### SQLite

```
CREATE INDEX files_hash_idx ON files (hash);
CREATE INDEX files_name_idx ON files (filename);
CREATE INDEX ratelimit_iphash_idx ON ratelimit (iphash);
CREATE INDEX blacklist_hash_idx ON blacklist (hash);
```

#### PostgreSQL

```
CREATE INDEX files_hash_idx ON files (hash);
CREATE INDEX files_name_idx ON files (filename);
CREATE INDEX ratelimit_iphash_idx ON ratelimit (iphash);
CREATE INDEX blacklist_hash_idx ON blacklist (hash);
```

#### MySQL

```
CREATE INDEX files_hash_idx ON files (hash);
CREATE INDEX files_name_idx ON files (filename);
CREATE INDEX ratelimit_iphash_idx ON ratelimit (iphash);
CREATE INDEX blacklist_hash_idx ON blacklist (hash);
```
Recommended to do a clean install for this release, you may keep your existing database and all of your config.json settings.
6 changes: 6 additions & 0 deletions compress.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
pathTo="$1"
for file in $(find "$pathTo" -name '*.html' -o -name '*.css' -o -name '*.js')
do
gzip --best -vk "$file"
done
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "uguu",
"version": "1.8.6",
"version": "1.8.7",
"description": "Uguu is a simple lightweight temporary file host with support for drop, paste, click and API uploading.",
"homepage": "https://uguu.se",
"repository": {
Expand Down
59 changes: 0 additions & 59 deletions src/Classes/CuteGrills.php

This file was deleted.

39 changes: 0 additions & 39 deletions src/Classes/GrillLoader.php

This file was deleted.

2 changes: 1 addition & 1 deletion src/Classes/Upload.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ public function uploadFile(): array
}
return [
'hash' => $this->FILE_INFO['XXH'],
'name' => $this->FILE_INFO['NAME'],
//'name' => $this->FILE_INFO['NAME'],
'filename' => $this->FILE_INFO['FILENAME'],
'url' => 'https://' . $this->Connector->CONFIG['FILE_DOMAIN'] . '/' . $this->FILE_INFO['FILENAME'],
'size' => $this->FILE_INFO['SIZE'],
Expand Down
25 changes: 23 additions & 2 deletions src/config.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"dest": "dist",
"pkgVersion": "1.8.6",
"pkgVersion": "1.8.7",
"pages": [
"index.ejs",
"faq.ejs",
"api.ejs"
],
"DEBUG": false,
"BENCHMARK_MODE": true,
"BENCHMARK_MODE": false,
"max_upload_size": 128,
"expireTime": 8,
"expireTimeUnit": "hours",
Expand Down Expand Up @@ -73,5 +73,26 @@
"application/x-executable",
"application/x-mach-binary",
"image/svg+xml"
],
"GRILLS": [
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9",
"10",
"11",
"12",
"13",
"14",
"15",
"16",
"17",
"18",
"19",
"20"
]
}
Loading

0 comments on commit aa78551

Please sign in to comment.