diff --git a/README.md b/README.md index fd049a848..edd069e42 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,6 @@ Drone documentation is organized into several categories: * [Plugin Guide](http://readme.drone.io/docs/plugin/) * [API Reference](http://readme.drone.io/docs/api/) -### Community +### Community, Help -Contributions, questions, and comments are welcomed and encouraged. Drone developers hang out in the [drone/drone](https://gitter.im/drone/drone) room on [gitter](https://gitter.im/drone/drone). +Contributions, questions, and comments are welcomed and encouraged. Drone developers hang out in the [drone/drone](https://gitter.im/drone/drone) room on gitter. We ask that you please post your questions to [gitter](https://gitter.im/drone/drone) before creating an issue. diff --git a/doc/setup/mysql.md b/doc/setup/mysql.md index 2cd2109a9..380cf76f7 100644 --- a/doc/setup/mysql.md +++ b/doc/setup/mysql.md @@ -5,8 +5,8 @@ Drone comes with support for MySQL as an alternate database engine. To enable Postgres, you should specify the following environment variables: ``` -DATASTORE_DRIVER="mysql" -DATASTORE_CONFIG="root:pa55word@tcp(localhost:3306)/drone" +DATABASE_DRIVER="mysql" +DATABASE_DATASOURCE="root:pa55word@tcp(localhost:3306)/drone" ``` ## MySQL connection diff --git a/doc/setup/postgres.md b/doc/setup/postgres.md index 24af892c9..fb4ddcaf6 100644 --- a/doc/setup/postgres.md +++ b/doc/setup/postgres.md @@ -4,8 +4,8 @@ Drone comes with support for Postgres as an alternate database engine. To enable Postgres, you should specify the following environment variables: ``` -DATASTORE_DRIVER="postgres" -DATASTORE_CONFIG="postgres://root:pa55word@127.0.0.1:5432/postgres" +DATABASE_DRIVER="postgres" +DATABASE_DATASOURCE="postgres://root:pa55word@127.0.0.1:5432/postgres" ``` ## Postgres connection diff --git a/doc/setup/sqlite.md b/doc/setup/sqlite.md index 31fadf637..473541c3f 100644 --- a/doc/setup/sqlite.md +++ b/doc/setup/sqlite.md @@ -3,13 +3,13 @@ Drone uses SQLite as the default database with zero configuration required. In order to customize the SQLite database configuration you should specify the following environment variables: ``` -DATASTORE_DRIVER="sqlite3" -DATASTORE_CONFIG="/var/lib/drone/drone.sqlite" +DATABASE_DRIVER="sqlite3" +DATABASE_DATASOURCE="/var/lib/drone/drone.sqlite" ``` ## Sqlite3 connection -The components of this connection string are: +The components of the datasource connection string are: * `path` local path to sqlite database. The default value is `/var/lib/drone/drone.sqlite`. diff --git a/pkg/types/config.go b/pkg/types/config.go index 6a431b613..7d219e58e 100644 --- a/pkg/types/config.go +++ b/pkg/types/config.go @@ -47,6 +47,7 @@ type Step struct { Entrypoint []string Command []string Volumes []string + Cache []string WorkingDir string `yaml:"working_dir"` NetworkMode string `yaml:"net"` diff --git a/pkg/utils/sshutil/sshutil.go b/pkg/utils/sshutil/sshutil.go index 7def573e2..197265f00 100644 --- a/pkg/utils/sshutil/sshutil.go +++ b/pkg/utils/sshutil/sshutil.go @@ -37,3 +37,16 @@ func MarshalPrivateKey(privkey *rsa.PrivateKey) []byte { privateKeyPEM := pem.EncodeToMemory(&pem.Block{Type: "RSA PRIVATE KEY", Headers: nil, Bytes: privateKeyMarshaled}) return privateKeyPEM } + +// helper function to encrypt a plain-text string using +// an RSA public key. +func Encrypt(pubkey *rsa.PublicKey, msg string) ([]byte, error) { + return rsa.EncryptPKCS1v15(rand.Reader, pubkey, []byte(msg)) +} + +// helper function to encrypt a plain-text string using +// an RSA public key. +func Decrypt(privkey *rsa.PrivateKey, secret string) (string, error) { + msg, err := rsa.DecryptPKCS1v15(rand.Reader, privkey, []byte(secret)) + return string(msg), err +}