Skip to content

Commit

Permalink
Use keyType during key generation to create correct key type
Browse files Browse the repository at this point in the history
Change-Type: patch
Connects-To: #27
Signed-off-by: Andreas Fitzek <[email protected]>
  • Loading branch information
afitzek committed Nov 29, 2017
1 parent eac7c03 commit 6946659
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
5 changes: 1 addition & 4 deletions resin/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,7 @@ func init() {
if err := viper.BindEnv("allow-env", "SSHPROXY_ALLOW_ENV"); err != nil {
return err
}
if err := viper.BindEnv("sentry-dsn", "SSHPROXY_SENTRY_DSN"); err != nil {
return err
}
return nil
return viper.BindEnv("sentry-dsn", "SSHPROXY_SENTRY_DSN")
}()
if err != nil {
log.Fatal("Initialisation failed", err)
Expand Down
2 changes: 1 addition & 1 deletion sshproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func (s *Server) addHostKey(keyType string) error {
}
// generate ssh server keys
log.Printf("Generating private key... (%s)", keyType)
err := exec.Command("ssh-keygen", "-f", keyPath, "-t", "rsa", "-N", "").Run()
err := exec.Command("ssh-keygen", "-f", keyPath, "-t", keyType, "-N", "").Run()
if err != nil {
return err
}
Expand Down
24 changes: 16 additions & 8 deletions versionist.conf.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
var execSync = require('child_process').execSync;
'use strict';

var getAuthor = (commitHash) => {
return execSync(`git show --quiet --format="%an" ${commitHash}`, { encoding: 'utf8' }).replace('\n', '');
}
const execSync = require('child_process').execSync;

const getAuthor = (commitHash) => {
return execSync(`git show --quiet --format="%an" ${commitHash}`, {
encoding: 'utf8'
}).replace('\n', '');
};

const isIncrementalCommit = (changeType) => {
return Boolean(changeType) && changeType.trim().toLowerCase() !== 'none';
};

module.exports = {
// This setup allows the editing and parsing of footer tags to get version and type information,
Expand All @@ -12,7 +20,7 @@ module.exports = {
parseFooterTags: true,
getGitReferenceFromVersion: 'v-prefix',
incrementVersion: 'semver',
updateVersion: (cwd, version, cb) => { cb(); },
editVersion: false,

// Always add the entry to the top of the Changelog, below the header.
addEntryToChangelog: {
Expand All @@ -23,14 +31,14 @@ module.exports = {
// Only include a commit when there is a footer tag of 'change-type'.
// Ensures commits which do not up versions are not included.
includeCommitWhen: (commit) => {
return !!commit.footer['change-type'];
return isIncrementalCommit(commit.footer['change-type']);
},

// Determine the type from 'change-type:' tag.
// Should no explicit change type be made, then no changes are assumed.
getIncrementLevelFromCommit: (commit) => {
if (commit.footer['change-type']) {
return commit.footer['change-type'].trim();
if (isIncrementalCommit(commit.footer['change-type'])) {
return commit.footer['change-type'].trim().toLowerCase();
}
},

Expand Down

0 comments on commit 6946659

Please sign in to comment.