**Note**: This version of Imeji is modified to run on Caddy. For the Apache version, [visit this project instead](https://git.yandols.xyz/YandolsZX/IcarusImeji).
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](https://gitlab.com/meno/dropzone) library and also includes a basic POST uploader for clients incompatible with the aforementioned dropzone.js library.
@ -6,19 +8,75 @@ This repository is used for development and project tracking of the code we use
# Requirements
* A server running [Caddy Webserver](https://caddyserver.com/) v2.
* A server running [Caddy Webserver](https://caddyserver.com/) v2
* The ability to use subdomains
* PHP 7.1 or greater
That's about it.
# Configuration
# 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.
Don't forget to set up `.htaccess` to suit your server environment and also make sure to configure the path to your `.htpasswd` file. Ideally you would want the .htpasswd file itself outside of Imeji's working directory for safety.
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.
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](https://caddyserver.com/docs/caddyfile/directives/basicauth) 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.
You can use our [issue tracker](https://git.yandols.xyz/LocariaTechnologies/IcarusImeji-Caddy/issues) to help report problems or suggest enhancements on the Imeji system. [Pull requests](https://git.yandols.xyz/LocariaTechnologies/IcarusImeji-Caddy/pulls) are also welcome.