From d34cd6e5e9f82a86878ba85b9aa8255dafb64188 Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Tue, 11 Aug 2015 23:57:12 -0700 Subject: [PATCH] ability to package 0.4 (.deb only at the moment) --- cmd/drone-server/drone.go | 3 ++- dist/drone/DEBIAN/conffiles | 2 +- dist/drone/etc/drone/drone.toml | 36 --------------------------------- dist/drone/etc/init/drone.conf | 8 ++++++-- pkg/server/session/session.go | 5 ++--- 5 files changed, 11 insertions(+), 43 deletions(-) delete mode 100644 dist/drone/etc/drone/drone.toml diff --git a/cmd/drone-server/drone.go b/cmd/drone-server/drone.go index b12fe7c0..aecd8f41 100644 --- a/cmd/drone-server/drone.go +++ b/cmd/drone-server/drone.go @@ -95,6 +95,7 @@ func main() { if err != nil { panic(err) } + settings.Plugins = []string{conf.plugin.filter} // todo hack store, err := store.New(conf.database.driver, conf.database.config) if err != nil { @@ -106,7 +107,7 @@ func main() { panic(err) } - session := session.New(settings) + session := session.New(conf.remote.config) eventbus_ := eventbus.New() queue_ := queue.New() updater := runner.NewUpdater(eventbus_, store, remote) diff --git a/dist/drone/DEBIAN/conffiles b/dist/drone/DEBIAN/conffiles index 980d34ea..91e7ed3c 100644 --- a/dist/drone/DEBIAN/conffiles +++ b/dist/drone/DEBIAN/conffiles @@ -1,2 +1,2 @@ /etc/init/drone.conf -/etc/drone/drone.toml +/etc/drone/dronerc diff --git a/dist/drone/etc/drone/drone.toml b/dist/drone/etc/drone/drone.toml deleted file mode 100644 index 195c8cf6..00000000 --- a/dist/drone/etc/drone/drone.toml +++ /dev/null @@ -1,36 +0,0 @@ -[server] -addr = ":80" -cert = "" -key = "" - -# [session] -# secret = "" -# expires = "" - -[database] -driver="sqlite3" -datasource="/var/lib/drone/drone.sqlite" - -[docker] -cert = "" -key = "" -addr = "unix:///var/run/docker.sock" -swarm = "" - -# [remote] -# kind = "github" -# base = "https://github.com" -# orgs = [] -# open = false -# private = false -# skip_verify = true - -# [auth] -# client = "" -# secret = "" -# authorize = "https://github.com/login/oauth/authorize" -# access_token = "https://github.com/login/oauth/access_token" -# request_token = "" - -# [agents] -# secret = "" diff --git a/dist/drone/etc/init/drone.conf b/dist/drone/etc/init/drone.conf index e855388b..7ca81679 100644 --- a/dist/drone/etc/init/drone.conf +++ b/dist/drone/etc/init/drone.conf @@ -4,5 +4,9 @@ chdir /var/lib/drone console log script - drone --config /etc/drone/drone.toml -end script \ No newline at end of file + set -a + if [ -f /etc/drone/dronerc ]; then + . /etc/drone/dronerc + fi + /usr/local/bin/drone +end script diff --git a/pkg/server/session/session.go b/pkg/server/session/session.go index 686c9fbf..b85616cf 100644 --- a/pkg/server/session/session.go +++ b/pkg/server/session/session.go @@ -6,7 +6,6 @@ import ( "time" "github.com/drone/drone/Godeps/_workspace/src/github.com/dgrijalva/jwt-go" - "github.com/drone/drone/pkg/config" common "github.com/drone/drone/pkg/types" ) @@ -20,8 +19,8 @@ type session struct { expire time.Duration } -func New(s *config.Config) Session { - secret := []byte(s.Session.Secret) +func New(rand string) Session { + secret := []byte(rand) expire := time.Hour * 72 return &session{ secret: secret,