Add transport encryption and configuration updates

This commit is contained in:
netkas 2025-01-15 14:22:46 -05:00
parent 4a143a8a97
commit a2bbb6e57b
4 changed files with 28 additions and 3 deletions

20
.idea/dataSources.xml generated
View file

@ -8,5 +8,25 @@
<jdbc-url>jdbc:mariadb://127.0.0.1:3306/socialbox</jdbc-url>
<working-dir>$ProjectFileDir$</working-dir>
</data-source>
<data-source source="LOCAL" name="Coffee Database" uuid="d114bae4-44f5-49c3-849a-149881b09342">
<driver-ref>mariadb</driver-ref>
<synchronize>true</synchronize>
<jdbc-driver>org.mariadb.jdbc.Driver</jdbc-driver>
<jdbc-url>jdbc:mariadb://127.0.0.1:3308/socialbox</jdbc-url>
<jdbc-additional-properties>
<property name="database.introspection.mysql.dbe5060" value="true" />
</jdbc-additional-properties>
<working-dir>$ProjectFileDir$</working-dir>
</data-source>
<data-source source="LOCAL" name="Teapot Database" uuid="64dd3c41-0f4f-4f65-b186-d42813467391">
<driver-ref>mariadb</driver-ref>
<synchronize>true</synchronize>
<jdbc-driver>org.mariadb.jdbc.Driver</jdbc-driver>
<jdbc-url>jdbc:mariadb://127.0.0.1:3307/socialbox</jdbc-url>
<jdbc-additional-properties>
<property name="database.introspection.mysql.dbe5060" value="true" />
</jdbc-additional-properties>
<working-dir>$ProjectFileDir$</working-dir>
</data-source>
</component>
</project>

View file

@ -23,7 +23,6 @@ services:
restart: unless-stopped
volumes:
- ./coffee_socialbox/config:/etc/config
- ./coffee_socialbox/logs:/var/log
- ./coffee_socialbox/data:/etc/socialbox
environment:
# No need to change these values
@ -81,6 +80,8 @@ services:
- coffee_mariadb_data:/var/lib/mysql
networks:
- coffee_network
ports:
- "3308:3306"
expose:
- "3306"
healthcheck:
@ -127,7 +128,6 @@ services:
restart: unless-stopped
volumes:
- ./teapot_socialbox/config:/etc/config
- ./teapot_socialbox/logs:/var/log
- ./teapot_socialbox/data:/etc/socialbox
environment:
# No need to change these values
@ -185,6 +185,8 @@ services:
- teapot_mariadb_data:/var/lib/mysql
networks:
- teapot_network
ports:
- "3307:3306" # Unique port for Teapot instance
expose:
- "3306"
healthcheck:

View file

@ -46,13 +46,15 @@
{
try
{
$stmt = Database::getConnection()->prepare("INSERT INTO external_sessions (domain, rpc_endpoint, session_uuid, server_keypair_expires, server_public_signing_key, server_public_encryption_key, host_public_encryption_key, host_private_encryption_key, private_shared_secret, host_transport_encryption_key, server_transport_encryption_key) VALUES (:domain, :rpc_endpoint, :session_uuid, :server_keypair_expires, :server_public_signing_key, :server_public_encryption_key, :host_public_encryption_key, :host_private_encryption_key, :private_shared_secret, :host_transport_encryption_key, :server_transport_encryption_key)");
$stmt = Database::getConnection()->prepare("INSERT INTO external_sessions (domain, rpc_endpoint, session_uuid, transport_encryption_algorithm, server_keypair_expires, server_public_signing_key, server_public_encryption_key, host_public_encryption_key, host_private_encryption_key, private_shared_secret, host_transport_encryption_key, server_transport_encryption_key) VALUES (:domain, :rpc_endpoint, :session_uuid, :transport_encryption_algorithm, :server_keypair_expires, :server_public_signing_key, :server_public_encryption_key, :host_public_encryption_key, :host_private_encryption_key, :private_shared_secret, :host_transport_encryption_key, :server_transport_encryption_key)");
$domain = $exportedSession->getRemoteServer();
$stmt->bindParam(':domain', $domain);
$rpcEndpoint = $exportedSession->getRpcEndpoint();
$stmt->bindParam(':rpc_endpoint', $rpcEndpoint);
$sessionUuid = $exportedSession->getSessionUuid();
$stmt->bindParam(':session_uuid', $sessionUuid);
$transportEncryptionAlgorithm = $exportedSession->getTransportEncryptionAlgorithm();
$stmt->bindParam(':transport_encryption_algorithm', $transportEncryptionAlgorithm);
$serverKeypairExpires = $exportedSession->getServerKeypairExpires();
$stmt->bindParam(':server_keypair_expires', $serverKeypairExpires);
$serverPublicSigningKey = $exportedSession->getServerPublicSigningKey();

View file

@ -27,6 +27,7 @@
*/
public function __construct(array $data)
{
// TODO: Bug: PHP message: PHP Warning: Undefined array key "address" in /var/ncc/packages/net.nosial.socialbox=1.0.0/bin/src/Socialbox/Objects/Standard/Peer.php on line 28
if(is_string($data['address']))
{
$this->address = PeerAddress::fromAddress($data['address']);