Skip to content
This repository has been archived by the owner on May 27, 2024. It is now read-only.

portal-number #205

Open
wants to merge 1 commit into
base: v3
Choose a base branch
from
Open

portal-number #205

wants to merge 1 commit into from

Conversation

samermassoud
Copy link
Contributor

@samermassoud samermassoud commented Aug 9, 2022

this feature is to address following use cases

  1. deploy multiple portals with diferent FQDN and nodes, connected ot he same Db.
  2. orgnizations running multiple VPN services to access air-tight hubs need to consolidate user management and access settings. 2 portals running sperately with default maxActiveApiConfiguration => 3 allows for one user to have 6 connections. by merging 2 portals into 1 DB maxActiveApiConfiguration => 3 become global rather than by portal.
  3. users dont have to authorize clients on every portal as in seperate portals deployment.

the changes in this open the road for moving config to the Db. accoridng to scope (global, portal, profile, node). yet this is not included.
in the setup we tested this, the config.php is split multiple files

<?php

declare(strict_types=1);
$config = [];
$defaultConfig = [];
$profileConfig = [];
$systemConfig = [];

if (file_exists(__DIR__.'/config/default-config.php') ) {
    $defaultConfig = include __DIR__.'/config/default-config.php';
}
if (file_exists(__DIR__.'/config/profile-config.php') ) {
    $profileConfig = include __DIR__.'/config/profile-config.php';
}
if (file_exists(__DIR__.'/config/system-config.php') ) {
    $systemConfig  = include __DIR__.'/config/system-config.php';
} 

$config = array_merge($defaultConfig, $systemConfig , $profileConfig);

return $config;


changes add new parameter to config.php

	'portalNumber' => 0,

the new parameter is used in Storage .

portalNumber is showing in portal in these sections

  1. info view in the portal
  2. user view portal configurations & connection log

features can be planned base don this feature release

  • move global config paramters to Db (language, API, Log)
  • portal connection log and stats, live stats to includes portalNumber and shows global figures not accessed portal only.

@ghost
Copy link

ghost commented Aug 10, 2022

For the database migrations, we embedded the php-sqlite-migrate library. There you can find how to write migrations (for SQLite). The eduVPN / Let's Connect! 3.x code has its own copy inside that also supports other databases, but the documentation is not really up to date, but it is basically the same...

Update: see https://github.com/eduvpn/vpn-server-api/tree/v2/schema for an example where we add a database index in a migration.

@samermassoud
Copy link
Contributor Author

schema was updated (added default 0)
migration file was created

new schema & migration script

portalNumber configured in config class. and passed  to dbconfig class to be used in Storage class
storage was updated to return portal_number in resultset for portal use (and future use as needed)
admin portal was adjusted to show portal number in (info, users)

connections, Stats and log works for current portal only.
need to consider creating new view for global stats
@samermassoud
Copy link
Contributor Author

did you have a chance to run this change?
let me know what can be done, if any?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant