Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
adangel committed Jun 6, 2020
0 parents commit bd75e15
Show file tree
Hide file tree
Showing 12 changed files with 2,432 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
vendor/
data/*
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
language: php
install: composer install
script: vendor/bin/phpunit tests
cache:
directories:
- vendor
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 Andreas Dangel

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
57 changes: 57 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# chunk-php

Simple hosting of temporary files. The idea is basically [chunk.io](https://chunk.io/) but implemented
in php so that can run on any website hoster.

## Features

* Simple upload via browser
* Upload via command line
* Supports ZIP and TAR archives
* Basic user control
* Limit file size
* Delete old files after a configurable period
* Example:
* Upload interface: <https://chunk.adangel.org>
* Single image file: <https://chunk.adangel.org/adangel/8ec0f806-0317-4cdb-8925-eae3538b0b04>
* A zip archive containing a website: <https://chunk.adangel.org/adangel/06190ed0-dd89-4dc8-946a-7324b062afe9/index.html>

## Development

```
composer install
vendor/bin/phpunit tests
```

### Run for development

php -S localhost:8000 index.php

and then go to <http://localhost:8000>

## Deploy into production

Depending on whether the script should be available at the root
or as a subfolder, you need to use `.htaccess` and configure
rewrite rules.

```
# Make sure, the directory has "AllowOverride FileInfo".
RewriteEngine on
# if installed in subfolder "/chunk-php/"
RewriteRule ^$ /chunk-php/index.php [END]
RewriteRule ^(.*)$ /chunk-php/index.php/$1 [END]
# if installed in root directory
RewriteRule ^$ /index.php [END]
RewriteRule ^(.*)$ /index.php/$1 [END]
```

And adjust the users/credentials in `src/Config.php`.

## Changelog

### 1.0.0 (2020-06-06)
* Initial version
21 changes: 21 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "adangel/chunkphp",
"require": {
"php": ">=7.0",
"ext-zip": "*",
"ext-phar": "*"
},
"require-dev": {
"phpunit/phpunit": "^9.2"
},
"autoload": {
"psr-4": {
"com\\github\\adangel\\chunkphp\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"com\\github\\adangel\\chunkphp\\": "tests/"
}
}
}
Loading

0 comments on commit bd75e15

Please sign in to comment.