Compare commits
5 Commits
1.2.1
...
3ed5acf75e
Author | SHA1 | Date | |
---|---|---|---|
3ed5acf75e | |||
5202698d06 | |||
e3719fb7b9 | |||
1f8d4f0bce | |||
025697d37c |
@ -5,7 +5,7 @@ UI_PATH=./ui
|
||||
COMPOSE_PROJECT_NAME=emails
|
||||
COMPOSE_PATH_SEPARATOR=:
|
||||
COMPOSE_FILE=./docker-compose.yml:${CLI_PATH}/docker-compose.yml:${API_PATH}/docker-compose.yml:${UI_PATH}/docker-compose.yml
|
||||
COMPOSE_PROFILES=api,ui
|
||||
COMPOSE_PROFILES=api,ui,cli
|
||||
|
||||
ATT_PATH=./attachments
|
||||
LOGS_PATH=./logs
|
||||
|
49
README.md
49
README.md
@ -6,3 +6,52 @@ Grab attachments from emails by inbox.
|
||||
* Choose what mailboxes to watch.
|
||||
* Select messages that you want to grab attachments from.
|
||||
* Download (or view in browser) (decrypted) attachments from messages.
|
||||
|
||||
## Requirements
|
||||
|
||||
* Docker with Docker Compose [https://www.docker.com/](https://www.docker.com/)
|
||||
|
||||
## Installation
|
||||
|
||||
1. Pull from repository
|
||||
```
|
||||
git pull git@git.provm.cl:Incoviba/emails.git
|
||||
```
|
||||
Change to latest release
|
||||
```
|
||||
git checkout release
|
||||
```
|
||||
2. Check the docker-compose.yml files
|
||||
1. docker-compose.yml - central proxy container
|
||||
2. api/docker-compose.yml - API container and database
|
||||
3. cli/docker-compose.yml - CLI container that runs cron jobs
|
||||
4. ui/docker-compose.yml - UI container
|
||||
3. Generate the API Key
|
||||
If you have openssl (comes with most linux distros) you can run this in terminal
|
||||
```
|
||||
echo API_KEY=`(openssl rand -hex 128)` >> .key.env
|
||||
```
|
||||
4. Check Environment files
|
||||
1. .env - Docker Compose and Environment settings. Check volumes and ports.
|
||||
2. .key.env - API_KEY, generated before.
|
||||
3. .mail.env - Email Identification.
|
||||
4. api/.env - Encrypted PDF files passwords.
|
||||
5. api/.db.env - Database configuration.
|
||||
6. cli/.env - API_URI, for connecting to the api container from the cli container. Change it if the api is someplace else.
|
||||
7. ui/.env - API_URI, same as from the cli.
|
||||
5. Check if every configuration is correct before starting the application
|
||||
```
|
||||
docker compose config
|
||||
```
|
||||
If everything is fine
|
||||
```
|
||||
docker compose up -d
|
||||
```
|
||||
6. Connect to the UI
|
||||
Default [http://localhost:8000](http://localhost:8000)
|
||||
|
||||
## Development
|
||||
When development there is a container for adminer, to use it you can add it into `COMPOSE_PROFILES` or run
|
||||
```
|
||||
docker compose up -d adminer
|
||||
```
|
||||
|
2
api/.adminer.env.sample
Normal file
2
api/.adminer.env.sample
Normal file
@ -0,0 +1,2 @@
|
||||
ADMINER_DESIGN=dracula
|
||||
ADMINER_PLUGINS="tables-filter table-indexes-structure table-structure struct-comments json-column edit-calendar edit-textarea dump-bz2 dump-date dump-json dump-php enum-option"
|
4
api/.db.env.sample
Normal file
4
api/.db.env.sample
Normal file
@ -0,0 +1,4 @@
|
||||
MYSQL_ROOT_PASSWORD=
|
||||
MYSQL_DATABASE=
|
||||
MYSQL_USER=
|
||||
MYSQL_PASSWORD=
|
2
api/.env.sample
Normal file
2
api/.env.sample
Normal file
@ -0,0 +1,2 @@
|
||||
PASSWORDS_SEPARATOR=,
|
||||
PASSWORDS=
|
@ -2,5 +2,4 @@ EMAIL_HOST=imap.gmail.com
|
||||
EMAIL_PORT=993
|
||||
EMAIL_USERNAME=@gmail.com
|
||||
EMAIL_PASSWORD=
|
||||
EMAIL_FOLDER=
|
||||
ATTACHMENTS_FOLDER=/attachments
|
||||
ATTACHMENTS_FOLDER=/attachments
|
@ -18,7 +18,7 @@ services:
|
||||
env_file:
|
||||
- ${API_PATH:-.}/.env
|
||||
- ${API_PATH:-.}/.db.env
|
||||
- .mail.env
|
||||
- ${API_PATH:-.}/.mail.env
|
||||
- .key.env
|
||||
volumes:
|
||||
- ${API_PATH:-.}/:/app/api
|
||||
|
@ -8,6 +8,11 @@ Monolog\ErrorHandler::register($app->getContainer()->get(Psr\Log\LoggerInterface
|
||||
try {
|
||||
$app->run();
|
||||
} catch (Error | Exception $e) {
|
||||
$app->getContainer()->get(Psr\Log\LoggerInterface::class)->error($e);
|
||||
$logger = $app->getContainer()->get(Psr\Log\LoggerInterface::class);
|
||||
if (isset($_REQUEST)) {
|
||||
$logger->debug(Safe\json_encode(compact('_REQUEST')));
|
||||
}
|
||||
$logger->debug(Safe\json_encode(compact('_SERVER')));
|
||||
$logger->error($e);
|
||||
throw $e;
|
||||
}
|
||||
|
1
cli/.env.sample
Normal file
1
cli/.env.sample
Normal file
@ -0,0 +1 @@
|
||||
API_URI=http://proxy:8080
|
@ -8,6 +8,8 @@ Monolog\ErrorHandler::register($app->getContainer()->get(Psr\Log\LoggerInterface
|
||||
try {
|
||||
$app->run();
|
||||
} catch (Error | Exception $e) {
|
||||
$app->getContainer()->get(\Psr\Log\LoggerInterface::class)->error($e);
|
||||
$logger = $app->getContainer()->get(Psr\Log\LoggerInterface::class);
|
||||
$logger->debug(Safe\json_encode(compact('_SERVER')));
|
||||
$logger->error($e);
|
||||
throw $e;
|
||||
}
|
||||
|
1
ui/.env.sample
Normal file
1
ui/.env.sample
Normal file
@ -0,0 +1 @@
|
||||
API_URI=http://proxy:8080
|
@ -8,7 +8,11 @@ Monolog\ErrorHandler::register($app->getContainer()->get(Psr\Log\LoggerInterface
|
||||
try {
|
||||
$app->run();
|
||||
} catch (Error | Exception $e) {
|
||||
$app->getContainer()->get(Psr\Log\LoggerInterface::class)->debug(json_encode(compact('_REQUEST')));
|
||||
$app->getContainer()->get(Psr\Log\LoggerInterface::class)->error($e);
|
||||
$logger = $app->getContainer()->get(Psr\Log\LoggerInterface::class);
|
||||
if (isset($_REQUEST)) {
|
||||
$logger->debug(Safe\json_encode(compact('_REQUEST')));
|
||||
}
|
||||
$logger->debug(Safe\json_encode(compact('_SERVER')));
|
||||
$logger->error($e);
|
||||
throw $e;
|
||||
}
|
||||
|
Reference in New Issue
Block a user