# Copyright (C) 2026 Nicola Taibi
# This file is part of SpaceGL.
#
# SpaceGL is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <https://www.gnu.org/licenses/>.

# 1. Generate a random 128-bit master key ONCE (do NOT share this value
#    with anyone, and do not reuse example keys from documentation).
export SPACEGL_KEY="$(openssl rand -hex 32)"

# 2. Start the server (terminal 1).
./spacegl-server

# 3. Start the client (terminal 2) using THE SAME key value.
#
# With GLFW 3d:
export SPACEGL_KEY="<paste the same value generated above>"
./spacegl-client gl

# With Vulkan 3d:
export SPACEGL_KEY="<paste the same value generated above>"
./spacegl-client vk

# NOTE: server and clients MUST run with the identical SPACEGL_KEY,
# otherwise the secure handshake will be rejected.
