Add config option to change the server name. Ref #2149

pull/2160/head
grossmj 1 year ago
parent 91b50eb5f2
commit 3e29ae4276

@ -15,6 +15,9 @@ default_admin_password = admin
[Server]
; Server name, default is what is returned by socket.gethostname()
name = GNS3_Server
; What protocol the server uses (http or https)
protocol = http

@ -65,6 +65,7 @@ class Controller:
self._load_base_files()
server_config = Config.instance().settings.Server
Config.instance().listen_for_config_changes(self._update_config)
name = server_config.name
host = server_config.host
port = server_config.port
@ -86,7 +87,7 @@ class Controller:
try:
self._local_server = await self.add_compute(
compute_id="local",
name=f"{socket.gethostname()} (controller)",
name=name,
protocol=protocol,
host=host,
console_host=console_host,

@ -14,6 +14,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import socket
from enum import Enum
from pydantic import BaseModel, Field, SecretStr, FilePath, DirectoryPath, validator
from typing import List
@ -123,6 +125,7 @@ class BuiltinSymbolTheme(str, Enum):
class ServerSettings(BaseModel):
local: bool = False
name: str = f"{socket.gethostname()} (controller)"
protocol: ServerProtocol = ServerProtocol.http
host: str = "0.0.0.0"
port: int = Field(3080, gt=0, le=65535)

Loading…
Cancel
Save