diff --git a/capsulflask/__init__.py b/capsulflask/__init__.py index 3e1628e..2229fa9 100644 --- a/capsulflask/__init__.py +++ b/capsulflask/__init__.py @@ -58,6 +58,7 @@ app.config.from_mapping( LOG_LEVEL=os.environ.get("LOG_LEVEL", default="INFO"), SPOKE_HOST_ID=os.environ.get("SPOKE_HOST_ID", default="baikal"), SPOKE_HOST_TOKEN=os.environ.get("SPOKE_HOST_TOKEN", default="changeme"), + SSH_USERNAME=os.environ.get("SSH_USERNAME", default="cyberian"), HUB_TOKEN=os.environ.get("HUB_TOKEN", default="changeme"), # https://www.postgresql.org/docs/9.1/libpq-ssl.html#LIBPQ-SSL-SSLMODE-STATEMENTS diff --git a/capsulflask/console.py b/capsulflask/console.py index 3dabb11..83aa9eb 100644 --- a/capsulflask/console.py +++ b/capsulflask/console.py @@ -112,6 +112,8 @@ def detail(id): if vm is None: return abort(404, f"{id} doesn't exist.") + vm['ssh_username'] = current_app.config['SSH_USERNAME'] + if vm['deleted']: return render_template("capsul-detail.html", vm=vm, delete=True, deleted=True) diff --git a/capsulflask/landing.py b/capsulflask/landing.py index 8161352..9514d70 100644 --- a/capsulflask/landing.py +++ b/capsulflask/landing.py @@ -22,7 +22,7 @@ def pricing(): @bp.route("/faq") def faq(): - return render_template("faq.html") + return render_template("faq.html", ssh_username=current_app.config['SSH_USERNAME']) @bp.route("/about-ssh") def about_ssh(): diff --git a/capsulflask/templates/capsul-detail.html b/capsulflask/templates/capsul-detail.html index 6479314..c7d16e1 100644 --- a/capsulflask/templates/capsul-detail.html +++ b/capsulflask/templates/capsul-detail.html @@ -101,7 +101,7 @@
ssh to the ip provided to you using the cyberian user.
-$ ssh cyberian@1.2.3.4+
ssh to the ip provided to you using the "{{ ssh_username }}" user.
+$ ssh {{ ssh_username }}@1.2.3.4
For more information, see Understanding the Secure Shell Protocol (SSH).
The cyberian user has passwordless sudo access by default. This should work:
+The "{{ ssh_username }}" user has passwordless sudo access by default. This should work:
# Linux $ sudo su -