Skip to content

Commit

Permalink
1.8.6
Browse files Browse the repository at this point in the history
  • Loading branch information
nokonoko committed Apr 14, 2024
1 parent 9184e8d commit 1f745d3
Show file tree
Hide file tree
Showing 35 changed files with 537 additions and 127 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ build
vendor
package-lock.json
uguu.sq3
.idea
.phpdoc
.vscode
composer.phar
Expand Down
5 changes: 5 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions .idea/Uguu.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions .idea/codeception.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/copyright/Uguu_GPL_3.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions .idea/copyright/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

64 changes: 64 additions & 0 deletions .idea/php.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions .idea/phpspec.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ CONTAINER_NAME = "$(CONTAINER_NAME)"
pageList = $(shell $(CURDIR)/$(NODEJQ) -r ".pages[]" $(CURDIR)/$(CONF))
noExt = $(shell echo $(i) | cut -d '.' -f1)

all: builddirs npm_dependencies ejs minify copy-img copy-php
all: builddirs npm_dependencies ejs minify copy-img copy-php copy-benchmarks

ejs:
$(foreach i,$(pageList), \
Expand All @@ -49,6 +49,11 @@ copy-php:
cp -v $(CURDIR)/src/static/php/*.php $(CURDIR)/build/php/
cp -v $(CURDIR)/src/Classes/*.php $(CURDIR)/build/php/Classes/

copy-benchmarks:
cp -v $(CURDIR)/src/Benchmarks/*.php $(CURDIR)/build/php/Benchmarks/
cp -v $(CURDIR)/src/Benchmarks/file.jpg $(CURDIR)/build/php/Benchmarks/
cp -v $(CURDIR)/src/Benchmarks/runBenchmark.sh $(CURDIR)/build/php/Benchmarks/

install: installdirs
rm -rf $(DESTDIR)/*
cp -rv $(CURDIR)/build/* $(DESTDIR)/
Expand Down Expand Up @@ -111,5 +116,5 @@ remove-container:
docker rm -f uguu

builddirs:
mkdir -p $(CURDIR)/build $(CURDIR)/build/img $(CURDIR)/build/html $(CURDIR)/build/html/min $(CURDIR)/build/html/unmin $(CURDIR)/build/js $(CURDIR)/build/css $(CURDIR)/build/php $(CURDIR)/build/php/Classes $(CURDIR)/build/public
mkdir -p $(CURDIR)/build $(CURDIR)/build/img $(CURDIR)/build/html $(CURDIR)/build/html/min $(CURDIR)/build/html/unmin $(CURDIR)/build/js $(CURDIR)/build/css $(CURDIR)/build/php $(CURDIR)/build/php/Classes $(CURDIR)/build/php/Benchmarks $(CURDIR)/build/php/Benchmarks/tmp $(CURDIR)/build/public

5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,8 @@ Hit me up at [@nekunekus](https://twitter.com/nekunekus) or email me at neku@pom

We'd really like if you can take some time to make sure your coding style is
consistent with the project. Uguu follows [PHP
PSR-2](https://www.php-fig.org/psr/psr-12/) and [Airbnb JavaScript
(ES5)](https://github.com/airbnb/javascript/tree/es5-deprecated/es5) (`airbnb/legacy`)
coding style guides. We use ESLint and PHPCS tools to enforce these standards.
PSR-12](https://www.php-fig.org/psr/psr-12/)
coding style guides. We use PHPCS tools to enforce these standards.

You can also help by sending us feature requests or writing documentation and
tests.
Expand Down
44 changes: 44 additions & 0 deletions RELEASE_NOTE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
## Uguu 1.8.6

### 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).

### 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.

### 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);
```
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.5",
"version": "1.8.6",
"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
46 changes: 46 additions & 0 deletions php_cs.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?php
/*
* Uguu
*
* @copyright Copyright (c) 2022-2024 Go Johansson (nokonoko) <neku@pomf.se>
*
* Note that this was previously distributed under the MIT license 2015-2022.
*
* If you are a company that wants to use Uguu I urge you to contact me to
* solve any potential license issues rather then using pre-2022 code.
*
* A special thanks goes out to the open source community around the world
* for supporting and being the backbone of projects like Uguu.
*
* This project can be found at <https://github.com/nokonoko/Uguu>.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

$finder = (new PhpCsFixer\Finder())
->in(__DIR__)
->exclude([
'dist',
'build',
'node_modules'
])
;

return (new PhpCsFixer\Config())
->setRules([
'@PSR12' => true,
'strict_param' => true,
])
->setFinder($finder)
;
Loading

0 comments on commit 1f745d3

Please sign in to comment.