Complete README to add selinux rule about sendmail

Complete README to add tombstone clearning command documentation
Add a few logs when handling accounts as an admin in the web panel and the API
Bump package number
This commit is contained in:
Timothée Jaussoin 2021-09-08 16:23:47 +02:00
parent 63a690d6b2
commit 572254befb
6 changed files with 41 additions and 4 deletions

View file

@ -34,6 +34,7 @@ PRIVACY_POLICY_URL= # A URL pointing to the Privacy Policy
LOG_CHANNEL=stack
# External FlexiSIP database
# Ensure that you have the proper SELinux configuration to allow database connections, see the README
DB_DRIVER=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
@ -42,6 +43,7 @@ DB_USERNAME=flexisip
DB_PASSWORD=flexisip
# Logs
# Ensure that you have the proper SELinux configuration to write in the storage directory, see the README
BROADCAST_DRIVER=log
CACHE_DRIVER=file
QUEUE_CONNECTION=sync
@ -49,6 +51,7 @@ SESSION_DRIVER=cookie
SESSION_LIFETIME=120
# SMTP and emails
# Ensure that you have the proper SELinux configuration to allow emails sending, see the README
MAIL_DRIVER=
MAIL_HOST=
MAIL_PORT=2525

View file

@ -107,8 +107,12 @@ Allow the webserver user to write in the `storage/` directory:
If your database is located on a remote machine, you should also allow your webserver user to connect to remote hosts:
semanage port -a -t http_port_t -p tcp 3306 // Open remote connections on the MySQL port for example
setsebool httpd_can_network_connect 1 // Allow remote network connected
setsebool httpd_can_network_connect_db 1 // Allow remote database connection
setsebool -P httpd_can_network_connect 1 // Allow remote network connected
setsebool -P httpd_can_network_connect_db 1 // Allow remote database connection
If you are planning to send emails using your account manager:
setsebool -P httpd_can_sendmail 1 // Allow email to be sent
## Usage
@ -143,6 +147,14 @@ This request will remove the accounts that were not confirmed after `x days`. In
The base request will not delete the related accounts by default. You need to add `--apply` to remove them.
### Remove deleted accounts tombstones
This request will remove the deleted accounts tombstones created after `x days`.
php artisan accounts:clear-accounts-tombstones {days} {--apply}
The base request will not delete the related tombstones by default. You need to add `--apply` to remove them.
### Set an account admin
This command will set the admin role to any available Flexisip account (the external Flexisip database need to be configured beforehand). You need to use the account DB id as a parameter in this command.

View file

@ -28,7 +28,6 @@ use Illuminate\Validation\Rule;
use Carbon\Carbon;
use App\Account;
use App\AccountTombstone;
use App\Alias;
use App\Rules\WithoutSpaces;
use App\Helpers\Utils;

View file

@ -22,6 +22,7 @@ namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Str;
use Illuminate\Support\Facades\Log;
use Carbon\Carbon;
use App\Account;
@ -75,6 +76,8 @@ class AccountController extends Controller
$this->fillPassword($request, $account);
$this->fillPhone($request, $account);
Log::channel('events')->info('Web Admin: Account created', ['id' => $account->identifier]);
return redirect()->route('admin.account.show', $account->id);
}
@ -95,6 +98,8 @@ class AccountController extends Controller
$this->fillPassword($request, $account);
$this->fillPhone($request, $account);
Log::channel('events')->info('Web Admin: Account updated', ['id' => $account->identifier]);
return redirect()->route('admin.account.show', $id);
}
@ -108,6 +113,8 @@ class AccountController extends Controller
$account->activated = true;
$account->save();
Log::channel('events')->info('Web Admin: Account activated', ['id' => $account->identifier]);
return redirect()->back();
}
@ -116,6 +123,8 @@ class AccountController extends Controller
$account->activated = false;
$account->save();
Log::channel('events')->info('Web Admin: Account deactivated', ['id' => $account->identifier]);
return redirect()->back();
}
@ -124,6 +133,8 @@ class AccountController extends Controller
$account->confirmation_key = Str::random(WebAuthenticateController::$emailCodeSize);
$account->save();
Log::channel('events')->info('Web Admin: Account provisioned', ['id' => $account->identifier]);
return redirect()->back();
}
@ -133,6 +144,8 @@ class AccountController extends Controller
$admin->account_id = $account->id;
$admin->save();
Log::channel('events')->info('Web Admin: Account set as admin', ['id' => $account->identifier]);
return redirect()->back();
}
@ -145,6 +158,8 @@ class AccountController extends Controller
if ($account->admin) $account->admin->delete();
Log::channel('events')->info('Web Admin: Account unset as admin', ['id' => $account->identifier]);
return redirect()->back();
}
@ -162,6 +177,8 @@ class AccountController extends Controller
$request->session()->flash('success', 'Account successfully destroyed');
Log::channel('events')->info('Web Admin: Account deleted', ['id' => $account->identifier]);
return redirect()->route('admin.account.index');
}

View file

@ -57,6 +57,8 @@ class AccountController extends Controller
$tombstone->save();
}
Log::channel('events')->info('API Admin: Account destroyed', ['id' => $account->identifier]);
$account->delete();
}
@ -66,6 +68,8 @@ class AccountController extends Controller
$account->activated = true;
$account->save();
Log::channel('events')->info('API Admin: Account activated', ['id' => $account->identifier]);
return $account;
}
@ -75,6 +79,8 @@ class AccountController extends Controller
$account->activated = false;
$account->save();
Log::channel('events')->info('API Admin: Account deactivated', ['id' => $account->identifier]);
return $account;
}

View file

@ -8,7 +8,7 @@
#%define _datadir %{_datarootdir}
#%define _docdir %{_datadir}/doc
%define build_number 100
%define build_number 101
%define var_dir /var/opt/belledonne-communications
%define opt_dir /opt/belledonne-communications/share/flexisip-account-manager