-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.example.php
More file actions
79 lines (72 loc) · 2.88 KB
/
Copy pathconfig.example.php
File metadata and controls
79 lines (72 loc) · 2.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<?php
/**
* Copyright (C) 2026 Jammmmm
*
* This file is part of Procco.
*
* 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, version 3.
*
* See the LICENSE file for details.
*/
declare(strict_types=1);
/**
* Agent configuration.
*/
return [
// Fully-qualified input handler class to use for inputs
'input_handler' => \Procco\Service\InputHandler\ImapEmailCommandHandler::class,
// E-mail notifications
'mailer_dsn' => 'smtp://user:pass@smtp.example.com:587',
'from_email' => 'you@example.com',
'notification_email' => 'them@example.com',
// Logs base directory. Subdirectories are created in the format YYYY-MM.
'log_directory' => __DIR__ . '/logs',
// Only commands in this list will be executed, and the token received must match the defined token for each command.
// NOTE: When dealing with paths, use the full absolute path. For example, instead of ~/somefile.txt, use /home/user/somefile.txt
'commands' => [
'start_agent' => [
'system' => ['sudo', 'systemctl', 'start', 'agent'],
'token' => 'token_for_start_agent',
'timeout' => 30,
],
'stop_agent' => [
'system' => ['sudo', 'systemctl', 'stop', 'agent'],
'token' => 'token_for_stop_agent',
'timeout' => 30,
],
'status_agent' => [
'system' => ['sudo', 'systemctl', 'status', 'agent'],
'token' => 'token_for_status_agent',
'timeout' => 30,
'allow_arguments' => true, // Optional: allow ARGUMENTS from input to be appended to the system command
'send_output' => true, // Optional: send the output from the command execution in the notification e-mail
],
],
// Handler-specific configuration
'input_handlers' => [
// ImapEmailCommandHandler settings
\Procco\Service\InputHandler\ImapEmailCommandHandler::class => [
// IMAP settings
'imap' => [
'default' => 'default',
'accounts' => [
'default' => [
'host' => 'imap.example.com',
'port' => 993,
'encryption' => 'ssl',
'validate_cert' => true,
'username' => 'your@email.com',
'password' => 'yourpassword',
'protocol' => 'imap',
],
],
],
// Allowed senders. If left empty, all senders are trusted.
'allowed_senders' => ['you@example.com', 'trusted@domain.com'],
// Action to take on a processed e-mail: 'read' (mark as read) or 'delete'. Defaults to 'read'.
'email_processed_action' => 'read',
],
],
];