]> source.dussan.org Git - gitblit.git/commitdiff
Tweak to GCA config, fix send mail prompts, added authority.cmd
authorJames Moger <james.moger@gitblit.com>
Tue, 27 Nov 2012 22:01:59 +0000 (17:01 -0500)
committerJames Moger <james.moger@gitblit.com>
Tue, 27 Nov 2012 22:01:59 +0000 (17:01 -0500)
distrib/authority.cmd [new file with mode: 0644]
distrib/authority.conf
src/com/gitblit/authority/GitblitAuthority.java
src/com/gitblit/authority/NewClientCertificateDialog.java

diff --git a/distrib/authority.cmd b/distrib/authority.cmd
new file mode 100644 (file)
index 0000000..145f524
--- /dev/null
@@ -0,0 +1 @@
+@java -jar authority.jar\r
index 3e62e3c3bb7383a8a709cdfa82e0a1376504cdb4..575e9b1e1b47524d5ac33029a544bfe10aa6e5b5 100644 (file)
@@ -3,4 +3,5 @@
        organizationalUnit = Gitblit
        organization = Gitblit
        locality = Gitblit
-       stateProvince = NY
+       stateProvince = NY\r
+       countryCode = US
index 446c0292fc87069f0c5633b045a6b9cb1a9b68d4..6d219b731fa6610a15547f10679f84d3052341a7 100644 (file)
@@ -129,6 +129,8 @@ public class GitblitAuthority extends JFrame implements X509Log {
 \r
        private JButton certificateDefaultsButton;\r
 \r
+       private JButton newSSLCertificate;\r
+\r
        public static void main(String... args) {\r
                EventQueue.invokeLater(new Runnable() {\r
                        public void run() {\r
@@ -296,13 +298,15 @@ public class GitblitAuthority extends JFrame implements X509Log {
                        if (!caKeystore.exists()) {\r
                                // show certificate defaults dialog \r
                                certificateDefaultsButton.doClick();\r
+                               \r
+                               // create "localhost" ssl certificate\r
+                               prepareX509Infrastructure();\r
                        }\r
                }\r
        }\r
        \r
        private boolean prepareX509Infrastructure() {\r
                if (caKeystorePassword == null) {\r
-                       caKeystorePassword = gitblitSettings.getString(Keys.server.storePassword, null);\r
                        JPasswordField pass = new JPasswordField(10){\r
                                private static final long serialVersionUID = 1L;\r
 \r
@@ -320,7 +324,6 @@ public class GitblitAuthority extends JFrame implements X509Log {
                        if (result == JOptionPane.OK_OPTION) {\r
                                caKeystorePassword = new String(pass.getPassword());\r
                        } else {\r
-                               caKeystorePassword = null;\r
                                return false;\r
                        }\r
                }\r
@@ -594,7 +597,7 @@ public class GitblitAuthority extends JFrame implements X509Log {
                        }\r
                });\r
                \r
-               JButton newSSLCertificate = new JButton(new ImageIcon(getClass().getResource("/rosette_16x16.png")));\r
+               newSSLCertificate = new JButton(new ImageIcon(getClass().getResource("/rosette_16x16.png")));\r
                newSSLCertificate.setFocusable(false);\r
                newSSLCertificate.setToolTipText(Translation.get("gb.newSSLCertificate"));              \r
                newSSLCertificate.addActionListener(new ActionListener() {\r
@@ -672,8 +675,7 @@ public class GitblitAuthority extends JFrame implements X509Log {
                                                        metadata.serverHostname = Constants.NAME;\r
                                                }\r
                                                metadata.userDisplayname = ucm.user.getDisplayName();\r
-                                               sendEmail(ucm.user, metadata, zip);\r
-                                               return true;\r
+                                               return sendEmail(ucm.user, metadata, zip);\r
                                        }\r
 \r
                                        @Override\r
@@ -780,7 +782,7 @@ public class GitblitAuthority extends JFrame implements X509Log {
                }\r
        }\r
        \r
-       private void sendEmail(UserModel user, X509Metadata metadata, File zip) {\r
+       private boolean sendEmail(UserModel user, X509Metadata metadata, File zip) {\r
                // send email\r
                try {\r
                        if (mail.isReady()) {\r
@@ -807,11 +809,13 @@ public class GitblitAuthority extends JFrame implements X509Log {
                                message.setContent(mp);\r
 \r
                                mail.sendNow(message);\r
+                               return true;\r
                        } else {\r
                                JOptionPane.showMessageDialog(GitblitAuthority.this, "Sorry, the mail server settings are not configured properly.\nCan not send email.", Translation.get("gb.error"), JOptionPane.ERROR_MESSAGE);\r
                        }\r
                } catch (Exception e) {\r
                        Utils.showException(GitblitAuthority.this, e);\r
                }\r
+               return false;\r
        }\r
 }\r
index 35fac5ae8053b417554989e507c70223c0f41a9c..3d2143907e55f244d751366f0af10b4081679b9d 100644 (file)
@@ -119,6 +119,7 @@ public class NewClientCertificateDialog extends JDialog {
                message.setLineWrap(true);\r
                message.setWrapStyleWord(true);\r
                message.setEditable(false);\r
+               message.setRows(6);\r
                message.setPreferredSize(new Dimension(300, 100));\r
                \r
                content.add(new JScrollPane(message), BorderLayout.CENTER);\r