Skip to content

Commit ab1ee46

Browse files
committed
Rebrand to 'lockbox'
Since it's where you keep your keys ;)
1 parent e8f4dc3 commit ab1ee46

File tree

20 files changed

+50
-42
lines changed

20 files changed

+50
-42
lines changed

.env.schema

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
DATABASE_URL=sqlite:///data/ssh-key-authority-dev.db
1+
DATABASE_URL=sqlite:///data/lockbox-dev.db
22
SESSION_SECRET_KEY=

README.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,31 @@
1-
# ssh-key-authority
1+
# Lockbox
22

3-
A centralised location for your personal SSH keys. Written using [Starlette](https://www.starlette.io/).
4-
5-
Supports:
3+
A place to put your keys. Lockbox is a centralised store for your personal SSH keys. It supports:
64

75
- [GitHub](https://github.com/)
86
- [GitLab](https://gitlab.com/)
97
- [Gogs](https://gogs.io/) and [Gitea](https://gitea.io/)
108
- Any `sshd` with an `AuthorizedKeysCommand` configuration directive
119

10+
Written using [Starlette](https://www.starlette.io/).
11+
12+
## Security
13+
14+
**Beware:** For all the systems you hook it up to, Lockbox is a [single point of failure](https://en.wikipedia.org/wiki/Single_point_of_failure).
15+
That is, if an adversary can gain control of your account on your Lockbox instance,
16+
they can deploy their own key and access any of the linked systems.
17+
18+
Furthermore, the administrator of the Lockbox instance you are using is capable of adding keys under any user,
19+
so make sure you trust the admin. (In the best-case scenario, the admin is you.)
20+
1221
## Usage
1322

1423
```
1524
$ # set up a virtualenv, or don't, your choice. then:
1625
$ pip install -r requirements.txt
1726
$ cp .env.schema .env; $EDITOR .env # Set up the DATABASE_URL value
1827
$ alembic upgrade head # Run migrations to initialise the database
19-
$ ./run_prod.sh ./ssh-key-authority.sock # Starts a gunicorn instance (with a uvicorn worker) listening at unix:./ssh-key-authority.sock
28+
$ ./run_prod.sh ./lockbox.sock # Starts a gunicorn instance (with a uvicorn worker) listening at unix:./lockbox.sock
2029
$ # Use nginx to proxy into the socket
2130
```
2231

contrib/check_keys.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@ if [ $? == 0 ]; then
1010

1111
authorized_keys_file="~$KEYS_USER/.ssh/authorized_keys"
1212
if [ -f "$authorized_keys_file" ]; then
13-
regular_authorized_keys=`sed '/.*###### SSH-KEY-AUTHORITY SECTION ######.*/{s///;q;}' < "$authorized_keys_file"`
13+
regular_authorized_keys=`sed '/.*### LOCKBOX SECTION.*/{s///;q;}' < "$authorized_keys_file"`
1414

15-
(echo $regular_authorized_keys; echo '###### SSH-KEY-AUTHORITY SECTION ######
16-
# PLEASE DO NOT EDIT UNDER THIS SECTION
17-
# IT WILL BE WIPED BY SSH-KEY-AUTHORITY'; echo $fetched_keys) > authorized_keys_file
15+
(echo $regular_authorized_keys; echo '### LOCKBOX SECTION
16+
# Please do not edit under this section, it is
17+
# automatically generated and may be wiped
18+
# at any time.'; echo $fetched_keys) > authorized_keys_file
1819
fi
1920
else
2021
>&2 echo "An error occurred while fetching $KEYS_USER's keys from $KEYS_HOST."

ssh_key_authority/__init__.py renamed to lockbox/__init__.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99

1010
from starlette.staticfiles import StaticFiles
1111

12-
from ssh_key_authority.db import database
13-
from ssh_key_authority.config import SESSION_SECRET_KEY
14-
from ssh_key_authority.auth import SessionAuthBackend
12+
from lockbox.db import database
13+
from lockbox.config import SESSION_SECRET_KEY
14+
from lockbox.auth import SessionAuthBackend
1515

16-
from ssh_key_authority.routes.main_page import main_page_endpoint
17-
from ssh_key_authority.routes.login import login_endpoint, logout_endpoint
18-
from ssh_key_authority.routes.register import register_page_endpoint, register_endpoint
19-
from ssh_key_authority.routes.deploy_key import deploy_key_endpoint
20-
from ssh_key_authority.routes.list_keys import list_keys_endpoint
16+
from lockbox.routes.main_page import main_page_endpoint
17+
from lockbox.routes.login import login_endpoint, logout_endpoint
18+
from lockbox.routes.register import register_page_endpoint, register_endpoint
19+
from lockbox.routes.deploy_key import deploy_key_endpoint
20+
from lockbox.routes.list_keys import list_keys_endpoint
2121

2222
app = Starlette(
2323
routes=[
File renamed without changes.
File renamed without changes.

ssh_key_authority/db.py renamed to lockbox/db.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from ssh_key_authority.config import DATABASE_URL
1+
from lockbox.config import DATABASE_URL
22

33
import databases
44
import sqlalchemy

lockbox/debug.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from lockbox import app
2+
3+
app.debug = True
File renamed without changes.

ssh_key_authority/routes/deploy_key.py renamed to lockbox/routes/deploy_key.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
from starlette.requests import Request
44
from starlette.responses import RedirectResponse
55

6-
from ssh_key_authority.flashes import flash
7-
from ssh_key_authority.db import database, keys, users
6+
from lockbox.flashes import flash
7+
from lockbox.db import database, keys, users
88

99

1010
class InvalidKeyException(Exception):

ssh_key_authority/routes/list_keys.py renamed to lockbox/routes/list_keys.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from starlette.requests import Request
44
from starlette.responses import PlainTextResponse
55

6-
from ssh_key_authority.db import database, keys, users, access_keys
6+
from lockbox.db import database, keys, users, access_keys
77

88

99
def generate_key_info(ssh_keys, include_comments: bool) -> Generator[str, None, None]:

ssh_key_authority/routes/login.py renamed to lockbox/routes/login.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
from starlette.requests import Request
44
from starlette.responses import RedirectResponse
55

6-
from ssh_key_authority.db import database, users
7-
from ssh_key_authority.flashes import flash
6+
from lockbox.db import database, users
7+
from lockbox.flashes import flash
88

99

1010
async def login_valid(username: str, password: str) -> bool:

ssh_key_authority/routes/main_page.py renamed to lockbox/routes/main_page.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from starlette.requests import Request
22

3-
from ssh_key_authority.templating import render_template
4-
from ssh_key_authority.config import REGISTRATION_ENABLED
3+
from lockbox.templating import render_template
4+
from lockbox.config import REGISTRATION_ENABLED
55

66

77
async def main_page_endpoint(request: Request):

ssh_key_authority/routes/register.py renamed to lockbox/routes/register.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
from starlette.requests import Request
44
from starlette.responses import RedirectResponse, PlainTextResponse
55

6-
from ssh_key_authority.templating import render_template
7-
from ssh_key_authority.db import database, users
8-
from ssh_key_authority.config import REGISTRATION_ENABLED
9-
from ssh_key_authority.flashes import flash
6+
from lockbox.templating import render_template
7+
from lockbox.db import database, users
8+
from lockbox.config import REGISTRATION_ENABLED
9+
from lockbox.flashes import flash
1010

1111

1212
async def disabled_registration_endpoint(request: Request):

ssh_key_authority/templating.py renamed to lockbox/templating.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from starlette.requests import Request
22
from starlette.templating import Jinja2Templates
33

4-
from ssh_key_authority.flashes import get_and_clear_flashes
4+
from lockbox.flashes import get_and_clear_flashes
55

66
templates = Jinja2Templates(directory="templates")
77

migrations/env.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010

1111
import sys, os
1212

13-
# Put the working directory in the sys path so that we can import ssh_key_authority
13+
# Put the working directory in the sys path so that we can import the lockbox package
1414
sys.path.insert(0, os.path.abspath("."))
1515

16-
from ssh_key_authority.db import metadata as app_metadata
17-
from ssh_key_authority.config import DATABASE_URL
16+
from lockbox.db import metadata as app_metadata
17+
from lockbox.config import DATABASE_URL
1818

1919
config.set_main_option("sqlalchemy.url", str(DATABASE_URL))
2020
target_metadata = app_metadata

run_dev.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
import uvicorn
44

55
if __name__ == "__main__":
6-
uvicorn.run("ssh_key_authority.debug:app", host="127.0.0.1", port=5000, reload=True)
6+
uvicorn.run("lockbox.debug:app", host="127.0.0.1", port=5000, reload=True)

ssh_key_authority/debug.py

Lines changed: 0 additions & 3 deletions
This file was deleted.

templates/base.html.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
66

77
<link rel="icon" href="data:">
8-
<title>{{ title }}{% if not override_title %} - SSH Key Authority{% endif %}</title>
8+
<title>{{ title }}{% if not override_title %} - Lockbox{% endif %}</title>
99

1010
<link rel="stylesheet" href="/static/global.css">
1111

templates/index.html.j2

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
{% set override_title = true %}
2-
{% set title = "SSH Key Authority" %}
2+
{% set title = "Lockbox" %}
33
{% set description = "A centralised location for your personal SSH keys." %}
4-
54
{% extends "base.html.j2" %}
6-
{% block title %}SSH Key Authority{% endblock %}
75

86
{% block content %}
97
{% if request.user.is_authenticated %}

0 commit comments

Comments
 (0)