Skip to content

Commit

Permalink
🚀 v0.5.3
Browse files Browse the repository at this point in the history
v0.5.3
  • Loading branch information
cdosoftei authored Jun 11, 2022
2 parents fac0b6e + f31a8a3 commit 443e618
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 49 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
file: etc/Dockerfile
push: true
tags: rtckit/eqivo:${{ github.ref_name }}-full
- run: curl -OL https://downloads.dockerslim.com/releases/1.37.3/dist_linux.tar.gz
- run: curl -OL https://downloads.dockerslim.com/releases/1.37.6/dist_linux.tar.gz
- run: tar zfvx dist_linux.tar.gz
- run: ./dist_linux/docker-slim build --http-probe-off --continue-after 1 --include-cert-all --include-exe=/usr/local/bin/eqivo --include-exe=/usr/local/bin/php --target rtckit/eqivo:${{ github.ref_name }}-full --tag rtckit/eqivo:${{ github.ref_name }}
- run: docker push rtckit/eqivo:${{ github.ref_name }}
14 changes: 7 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "rtckit/eqivo",
"description": "Telephony API Platform",
"version": "0.5.2",
"version": "0.5.3",
"keywords": [
"telecommunications",
"voip",
Expand Down Expand Up @@ -31,7 +31,7 @@
"ext-libxml": "*",
"ext-pcre": "*",
"ext-simplexml": "*",
"monolog/monolog": "^2.5",
"monolog/monolog": "^3.1",
"nikic/fast-route": "^1.3",
"ramsey/uuid": "^4.3",
"react/event-loop": "^1.3",
Expand All @@ -40,16 +40,16 @@
"rtckit/esl": "^0.8",
"rtckit/react-esl": "^0.8",
"rtckit/sip": "^0.7",
"symfony/yaml": "^6.0",
"wikimedia/ip-set": "^3.0",
"symfony/yaml": "^6.1",
"wikimedia/ip-set": "^3.1",
"wyrihaximus/react-psr-3-stdio": "^3.0"
},
"require-dev": {
"clue/block-react": "^1.5",
"phpstan/phpstan": "^1.6",
"phpstan/phpstan": "^1.7",
"phpunit/phpunit": "^9.5",
"vimeo/psalm": "^4.22",
"zircote/swagger-php": "^4.3"
"vimeo/psalm": "^4.23",
"zircote/swagger-php": "^4.4"
},
"suggest": {
"ext-pcntl": "Enables daemonization support",
Expand Down
2 changes: 1 addition & 1 deletion etc/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM php:8.1.5-cli-bullseye
FROM php:8.1.7-cli-bullseye

RUN docker-php-ext-install pcntl

Expand Down
2 changes: 1 addition & 1 deletion etc/Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM php:8.1.5-cli-bullseye
FROM php:8.1.7-cli-bullseye

RUN docker-php-ext-install pcntl

Expand Down
2 changes: 1 addition & 1 deletion src/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

class App
{
public const VERSION = '0.8.0';
public const VERSION = '0.5.3';

public Config\Set $config;

Expand Down
8 changes: 4 additions & 4 deletions src/Config/CliArguments.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace RTCKit\Eqivo\Config;

use Monolog\Logger;
use Monolog\Level;
use InvalidArgumentException;

class CliArguments implements ResolverInterface
Expand Down Expand Up @@ -206,7 +206,7 @@ function (string $value): bool {
* @psalm-suppress ArgumentTypeCoercion
* @phpstan-ignore-next-line
*/
$config->restServerLogLevel = Logger::toMonologLevel($args['rest-log-level']);
$config->restServerLogLevel = Level::fromName($args['rest-log-level']);
} catch (InvalidArgumentException $e) {
fwrite(STDERR, 'Malformed --rest-log-level argument: ' . $e->getMessage() . PHP_EOL);
}
Expand Down Expand Up @@ -278,7 +278,7 @@ function (string $value): bool {
* @psalm-suppress ArgumentTypeCoercion
* @phpstan-ignore-next-line
*/
$config->outboundServerLogLevel = Logger::toMonologLevel($args['outbound-log-level']);
$config->outboundServerLogLevel = Level::fromName($args['outbound-log-level']);
} catch (InvalidArgumentException $e) {
fwrite(STDERR, 'Malformed --outbound-log-level argument: ' . $e->getMessage() . PHP_EOL);
}
Expand All @@ -291,7 +291,7 @@ function (string $value): bool {
* @psalm-suppress ArgumentTypeCoercion
* @phpstan-ignore-next-line
*/
$config->inboundServerLogLevel = Logger::toMonologLevel($args['inbound-log-level']);
$config->inboundServerLogLevel = Level::fromName($args['inbound-log-level']);
} catch (InvalidArgumentException $e) {
fwrite(STDERR, 'Malformed --inbound-log-level argument: ' . $e->getMessage() . PHP_EOL);
}
Expand Down
32 changes: 19 additions & 13 deletions src/Config/ConfigFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,11 @@

use RTCKit\Eqivo\Exception\EqivoException;

use Monolog\Logger;
use Monolog\Level;
use Symfony\Component\Yaml\Yaml;
use Closure;
use InvalidArgumentException;

/**
* @phpstan-import-type Level from \Monolog\Logger
*/
class ConfigFile implements ResolverInterface
{
public function resolve(Set $config): void
Expand Down Expand Up @@ -198,9 +195,12 @@ public function resolve(Set $config): void

if (isset($input['restServerLogLevel'])) {
try {
/** @var Level */
$restServerLogLevel = $input['restServerLogLevel'];
$config->restServerLogLevel = Logger::toMonologLevel($restServerLogLevel);
/**
* Allow Monolog to deal with the verbosity level matching
* @psalm-suppress ArgumentTypeCoercion
* @phpstan-ignore-next-line
*/
$config->restServerLogLevel = Level::fromName($input['restServerLogLevel']);
} catch (InvalidArgumentException $e) {
fwrite(STDERR, 'Malformed `restServerLogLevel` parameter in configuration file: ' . $e->getMessage() . PHP_EOL);
}
Expand Down Expand Up @@ -274,19 +274,25 @@ public function resolve(Set $config): void

if (isset($input['outboundServerLogLevel'])) {
try {
/** @var Level */
$outboundServerLogLevel = $input['outboundServerLogLevel'];
$config->outboundServerLogLevel = Logger::toMonologLevel($outboundServerLogLevel);
/**
* Allow Monolog to deal with the verbosity level matching
* @psalm-suppress ArgumentTypeCoercion
* @phpstan-ignore-next-line
*/
$config->outboundServerLogLevel = Level::fromName($input['outboundServerLogLevel']);
} catch (InvalidArgumentException $e) {
fwrite(STDERR, 'Malformed `outboundServerLogLevel` parameter in configuration file: ' . $e->getMessage() . PHP_EOL);
}
}

if (isset($input['inboundServerLogLevel'])) {
try {
/** @var Level */
$inboundServerLogLevel = $input['inboundServerLogLevel'];
$config->inboundServerLogLevel = Logger::toMonologLevel($inboundServerLogLevel);
/**
* Allow Monolog to deal with the verbosity level matching
* @psalm-suppress ArgumentTypeCoercion
* @phpstan-ignore-next-line
*/
$config->inboundServerLogLevel = Level::fromName($input['inboundServerLogLevel']);
} catch (InvalidArgumentException $e) {
fwrite(STDERR, 'Malformed `inboundServerLogLevel` parameter in configuration file: ' . $e->getMessage() . PHP_EOL);
}
Expand Down
24 changes: 13 additions & 11 deletions src/Config/LegacyConfigFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,9 @@

namespace RTCKit\Eqivo\Config;

use Monolog\Logger;
use Monolog\Level;
use InvalidArgumentException;

/**
* @phpstan-import-type Level from \Monolog\Logger
*/
class LegacyConfigFile implements ResolverInterface
{
public function resolve(Set $config): void
Expand Down Expand Up @@ -150,9 +147,12 @@ function (string $value): bool {

if (isset($legacy['rest_server']['LOG_LEVEL'])) {
try {
/** @var Level */
$inboundServerLogLevel = $legacy['rest_server']['LOG_LEVEL'];
$config->inboundServerLogLevel = Logger::toMonologLevel($inboundServerLogLevel);
/**
* Allow Monolog to deal with the verbosity level matching
* @psalm-suppress ArgumentTypeCoercion
* @phpstan-ignore-next-line
*/
$config->restServerLogLevel = $config->inboundServerLogLevel = Level::fromName($legacy['rest_server']['LOG_LEVEL']);
} catch (InvalidArgumentException $e) {
fwrite(STDERR, 'Malformed LOG_LEVEL (rest_server) line in legacy configuration file' . PHP_EOL);
fwrite(STDERR, $e->getMessage() . PHP_EOL);
Expand Down Expand Up @@ -196,10 +196,12 @@ function (string $value): bool {

if (isset($legacy['outbound_server']['LOG_LEVEL'])) {
try {

/** @var Level */
$outboundServerLogLevel = $legacy['outbound_server']['LOG_LEVEL'];
$config->outboundServerLogLevel = Logger::toMonologLevel($outboundServerLogLevel);
/**
* Allow Monolog to deal with the verbosity level matching
* @psalm-suppress ArgumentTypeCoercion
* @phpstan-ignore-next-line
*/
$config->outboundServerLogLevel = Level::fromName($legacy['outbound_server']['LOG_LEVEL']);
} catch (InvalidArgumentException $e) {
fwrite(STDERR, 'Malformed LOG_LEVEL (outbound_server) line in legacy configuration file' . PHP_EOL);
fwrite(STDERR, $e->getMessage() . PHP_EOL);
Expand Down
14 changes: 4 additions & 10 deletions src/Config/Set.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@

namespace RTCKit\Eqivo\Config;

use Monolog\Logger;
use Monolog\Level;

/**
* @phpstan-import-type Level from \Monolog\Logger
*/
class Set
{
public const INBOUND_SOCKET_ADDRESS = 'inbound_socket_address';
Expand Down Expand Up @@ -55,8 +52,7 @@ class Set

public int $restServerMaxRequestSize = 16384;

/** @phpstan-var Level */
public int $restServerLogLevel = Logger::DEBUG;
public Level $restServerLogLevel = Level::Debug;

/** @var list<string> Allowed CIDRs */
public array $restAllowedIps = [];
Expand All @@ -76,12 +72,10 @@ class Set

public int $outboundServerAdvertisedPort;

/** @phpstan-var Level */
public int $outboundServerLogLevel = Logger::DEBUG;
public Level $outboundServerLogLevel = Level::Debug;

/* Inbound Server settings */
/** @phpstan-var Level */
public int $inboundServerLogLevel = Logger::DEBUG;
public Level $inboundServerLogLevel = Level::Debug;

public string $callHeartbeatUrl;

Expand Down

0 comments on commit 443e618

Please sign in to comment.