diff --git a/contrib/dokku-installer.py b/contrib/dokku-installer.py index 5b321c98d..025e49773 100755 --- a/contrib/dokku-installer.py +++ b/contrib/dokku-installer.py @@ -21,7 +21,13 @@ try: except subprocess.CalledProcessError: pass -key_file = os.getenv('KEY_FILE', '/root/.ssh/authorized_keys') +key_file = os.getenv('KEY_FILE', None) +if os.path.isfile('/home/ec2-user/.ssh/authorized_keys'): + key_file = '/home/ec2-user/.ssh/authorized_keys' +elif os.path.isfile('/home/ubuntu/.ssh/authorized_keys'): + key_file = '/home/ubuntu/.ssh/authorized_keys' +else: + key_file = '/root/.ssh/authorized_keys' admin_keys = [] if os.path.isfile(key_file): @@ -72,6 +78,7 @@ class GetHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): def do_GET(self): content = PAGE.replace('{VERSION}', VERSION) content = content.replace('{HOSTNAME}', hostname) + content = content.replace('{AUTHORIZED_KEYS_LOCATION}', key_file) content = content.replace('{ADMIN_KEYS}', "\n".join(admin_keys)) self.send_response(200) self.end_headers() @@ -212,33 +219,91 @@ PAGE = """ Dokku Setup - - + + + -
-
-

Dokku Setup {VERSION}

-
-

Admin Access

-
- -
-
-

Hostname Configuration

-
- - +
+ +

Dokku Setup {VERSION}

+ -
- + +
+
+

Admin Access

+
+
+ + Public keys allow users to ssh onto the server as the dokku user, as well as remotely execute Dokku commands. They are currently auto-populated from: {AUTHORIZED_KEYS_LOCATION}, and can be changed later via the dokku ssh-keys plugin. +
+
-

Your app URLs will look like:

-
http://hostname:port
-
- - + +
+
+

Hostname Configuration

+
+ + + This will be used as the default host for all applications, and can be changed later via the dokku domains:set-global command. +
+
+ + + When enabled, Nginx will be run on port 80 and proxy requests to apps based on hostname. + When disabled, a specific port will be setup for each application on first deploy, and requests to that port will be proxied to the relevant app. +
+
+
What will app URLs look like?
+
http://hostname:port
+
+
+
+ +
+