James Moger
2012-12-05 6c127c1ce12994ab4a235c53c254cf776e347e69
Improving first-run setup of GCA and Gitblit GO
2 files modified
39 ■■■■ changed files
src/com/gitblit/authority/GitblitAuthority.java 34 ●●●● patch | view | raw | blame | history
src/com/gitblit/wicket/GitBlitWebApp.properties 5 ●●●● patch | view | raw | blame | history
src/com/gitblit/authority/GitblitAuthority.java
@@ -21,6 +21,7 @@
import java.awt.Dimension;
import java.awt.EventQueue;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import java.awt.Insets;
import java.awt.Point;
import java.awt.event.ActionEvent;
@@ -69,6 +70,7 @@
import javax.swing.JTable;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.JToolBar;
import javax.swing.RowFilter;
import javax.swing.SwingConstants;
import javax.swing.UIManager;
@@ -565,15 +567,26 @@
                    }
                };
                JTextField durationTF = new JTextField(4);
                durationTF.setInputVerifier(verifier);
                durationTF.setVerifyInputWhenFocusTarget(true);
                durationTF.setText("" + certificateConfig.duration);
                JPanel durationPanel = Utils.newFieldPanel(Translation.get("gb.duration"), durationTF, Translation.get("gb.duration.days").replace("{0}",  "").trim());
                JTextField siteNameTF = new JTextField(20);
                siteNameTF.setText(gitblitSettings.getString(Keys.web.siteName, "Gitblit"));
                JPanel siteNamePanel = Utils.newFieldPanel(Translation.get("gb.siteName"),
                        siteNameTF, Translation.get("gb.siteNameDescription"));
                JTextField validityTF = new JTextField(4);
                validityTF.setInputVerifier(verifier);
                validityTF.setVerifyInputWhenFocusTarget(true);
                validityTF.setText("" + certificateConfig.duration);
                JPanel validityPanel = Utils.newFieldPanel(Translation.get("gb.validity"),
                        validityTF, Translation.get("gb.duration.days").replace("{0}",  "").trim());
                JPanel p1 = new JPanel(new GridLayout(0, 1, 5, 2));
                p1.add(siteNamePanel);
                p1.add(validityPanel);
                DefaultOidsPanel oids = new DefaultOidsPanel(metadata);
                JPanel panel = new JPanel(new BorderLayout());
                panel.add(durationPanel, BorderLayout.NORTH);
                panel.add(p1, BorderLayout.NORTH);
                panel.add(oids, BorderLayout.CENTER);
                int result = JOptionPane.showConfirmDialog(GitblitAuthority.this, 
@@ -582,9 +595,13 @@
                if (result == JOptionPane.OK_OPTION) {
                    try {
                        oids.update(metadata);
                        certificateConfig.duration = Integer.parseInt(durationTF.getText());
                        certificateConfig.duration = Integer.parseInt(validityTF.getText());
                        certificateConfig.store(config, metadata);
                        config.save();
                        Map<String, String> updates = new HashMap<String, String>();
                        updates.put(Keys.web.siteName, siteNameTF.getText());
                        gitblitSettings.saveSettings(updates);
                    } catch (Exception e1) {
                        Utils.showException(GitblitAuthority.this, e1);
                    }
@@ -728,7 +745,8 @@
            }
        });
        
        JPanel buttonControls = new JPanel(new FlowLayout(FlowLayout.LEFT, Utils.MARGIN, Utils.MARGIN));
        JToolBar buttonControls = new JToolBar(JToolBar.HORIZONTAL);
        buttonControls.setFloatable(false);
        buttonControls.add(certificateDefaultsButton);
        buttonControls.add(newSSLCertificate);
        buttonControls.add(emailBundle);
src/com/gitblit/wicket/GitBlitWebApp.properties
@@ -436,4 +436,7 @@
gb.noMaximum = no maximum
gb.attributes = attributes
gb.serveCertificate = serve https with this certificate
gb.sslCertificateGeneratedRestart = Successfully generated new server SSL certificate for {0}.\nYou must restart Gitblit to use the new certificate.\n\nIf you are launching with the '--alias' parameter you will have to set that to ''--alias {0}''.
gb.sslCertificateGeneratedRestart = Successfully generated new server SSL certificate for {0}.\nYou must restart Gitblit to use the new certificate.\n\nIf you are launching with the '--alias' parameter you will have to set that to ''--alias {0}''.
gb.validity = validity
gb.siteName = site name
gb.siteNameDescription = short, descriptive name of your server