A fork of the Icarus Imeji Uploader Service tweaked for better compatibility on Caddy webserver.
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 
YandolsZX 0ad29df912
Fixed a wrong error code in upload.php, also wrong version in dropload.php comments.
il y a 3 ans
assets Move droploader files from addonstyle into assets folder. il y a 5 ans
legacy Added legacy uploader redirector. il y a 5 ans
public Made public/index.php the 404 page because of how Caddy works. il y a 4 ans
.gitignore Added .gitignore file. il y a 5 ans
LICENSE.md Removed apache .htaccess files. il y a 4 ans
README.md Updated README.md with Caddy Server instructions. il y a 4 ans
dropload.php Fixed a wrong error code in upload.php, also wrong version in dropload.php comments. il y a 3 ans
failed.php Also apply assets path change to the upload failed page. il y a 5 ans
favicon.ico Import current version to date onto the dev server repository. il y a 6 ans
index.php More cleanup + changes to the legacy front-end. il y a 5 ans
legacy.php Fixed a domain change missed by the migrationdev branch. il y a 5 ans
logs.php Changed more filepaths and URLs that I forgot to change. il y a 5 ans
removal.php Changed more filepaths and URLs that I forgot to change. il y a 5 ans
robots.txt Updated robots.txt file. il y a 5 ans
tos.php Changed more filepaths and URLs that I forgot to change. il y a 5 ans
upload.php Fixed a wrong error code in upload.php, also wrong version in dropload.php comments. il y a 3 ans

README.md

Icarus Imeji Uploader Service (Caddy Version)

Note: This version of Imeji is modified to run on Caddy. For the Apache version, visit this project instead.

Imeji (for short) is a form of PHP image uploader system that you can use to host a simple image uploader service on your server. It utilizes the dropzone.js library and also includes a basic POST uploader for clients incompatible with the aforementioned dropzone.js library.

This repository is used for development and project tracking of the code we use on our live image uploader. However, you a free to download a copy of it for yourself and alter it to use within the limits of our license.

Requirements

  • A server running Caddy Webserver v2
  • The ability to use subdomains
  • PHP 7.1 or greater

That's about it.

Application Configuration

You can configure parameters within dropload.php and upload.php to your liking, making them both have the same changes or have them function with different parameters respectively.

Anything else such as the front-end design of pages is completely up to you to change. Be sure to change the paths of elements and assets in the index.php file and other related files too.

Caddyfile Configuration

Unlike the Apache version of Imeji, the Caddy version has to be configured differently and is all done from within your Caddyfile instead of a file in the root directory of the application.

Entry file for Imeji Frontend (Users upload images here)

The following is an example Caddyfile entry you can use for the Frontend side of your own Imeji instance, configure it to your specifications.

# Imeji Frontend (User Uploader)
imeji.yandols.xyz {
   root * /path/to/your/imeji
   file_server
   php_fastcgi unix//run/php-fpm/www.sock
   log {
      output file /path/to/your/logs/directory/imeji_frontend.log
      format logfmt
   }

}

Entry file for Imeji Backend (Users are served images here)

The following is an example Caddyfile entry you can use for the Backend side of your own Imeji instance, configure it to your own specifications.

# Imeji Backend (Image File Serving)
i.yandols.xyz {
   root * /path/to/your/imeji/public
   file_server
   php_fastcgi unix//run/php-fpm/www.sock
   header +Access-Control-Allow-Origin "*"
   log {
      output file /path/to/your/logs/directory/imeji_backend.log
      format logfmt
   }
}

Adding a login requirement to access log files

By default, Imeji logs uploads to the uploads.log file, which can be viewed as a sorted table by accessing imeji.yourdomain.com/logs.php in your browser. The log contains sensitive information such as the IP Address and User Agent of the users who upload images to your Imeji instance, so it would be ideal to protect these files behind a login prompt so only authorized users can access them.

Caddy supports the basicauth directive which is one of the ways you can use to protect your logs from unauthorized access.

The following contains an example of the basicauth directive you can add to your Caddyfile entry for the Imeji Frontend. Follow the official Caddy instructions on how to get your password in a hashed form like in the example below. Do NOT use a plaintext password as it will not be accepted by Caddy.

   basicauth /*.log {
      Yourusernamehere JDJhJDEwJEVCNmdaNEg2Ti5iejRMYkF3MFZhZ3VtV3E1SzBWZEZ5Q3VWc0tzOEJwZE9TaFlZdEVkZDhX
   }
   basicauth /logs.php {
      Yourusernamehere JDJhJDEwJEVCNmdaNEg2Ti5iejRMYkF3MFZhZ3VtV3E1SzBWZEZ5Q3VWc0tzOEJwZE9TaFlZdEVkZDhX
   }

Contributing

You can use our issue tracker to help report problems or suggest enhancements on the Imeji system. Pull requests are also welcome.

License

See the LICENSE.md file.

Third Party Code Attribution

  • The Icarus Imeji Uploader Service uses the dropzone.js library by Matias Meno. (MIT License)
  • The front-end template uses the Identity template by ajlkn. (CCA 3.0 License)