diff --git a/Makefile b/Makefile index 580a0a450..4d413a6b6 100644 --- a/Makefile +++ b/Makefile @@ -45,6 +45,8 @@ lessc: # creates a debian package for drone to install # `sudo dpkg -i drone.deb` deb: + mkdir -p debian/drone/usr/local/bin + mkdir -p debian/drone/var/lib/drone dpkg-deb --build debian/drone deploy: diff --git a/debian/drone/DEBIAN/control b/debian/drone/DEBIAN/control index a7d76e06b..2bafdcb3b 100644 --- a/debian/drone/DEBIAN/control +++ b/debian/drone/DEBIAN/control @@ -1,5 +1,5 @@ Package: drone -Version: 0.1 +Version: 0.3 Section: base Priority: optional Architecture: amd64 diff --git a/debian/drone/etc/init/drone.conf b/debian/drone/etc/init/drone.conf index fda2a5862..55962c454 100644 --- a/debian/drone/etc/init/drone.conf +++ b/debian/drone/etc/init/drone.conf @@ -1,11 +1,9 @@ start on (filesystem and net-device-up) +chdir /var/lib/drone console log script - mkdir -p /root/.drone - cd /root/.drone - DRONED_OPTS="--port=:80" if [ -f /etc/default/$UPSTART_JOB ]; then . /etc/default/$UPSTART_JOB diff --git a/server/main.go b/server/main.go index a8ff57616..ef1489afc 100644 --- a/server/main.go +++ b/server/main.go @@ -3,11 +3,7 @@ package main import ( "database/sql" "flag" - "io/ioutil" "net/http" - "os" - "os/user" - "path/filepath" "runtime" "strings" @@ -154,74 +150,3 @@ func setupQueue() { func setupHandlers() { } - -// initialize the .drone directory and create a skeleton config -// file if one does not already exist. -func init() { - // load the current user - u, err := user.Current() - if err != nil { - panic(err) - } - - // set .drone home dir - home = filepath.Join(u.HomeDir, ".drone") - - // create the .drone home directory - os.MkdirAll(home, 0777) - - // check for the config file - filename := filepath.Join(u.HomeDir, ".drone", "config.toml") - if _, err := os.Stat(filename); err != nil { - // if not exists, create - ioutil.WriteFile(filename, []byte(defaultConfig), 0777) - } -} - -var defaultConfig = ` -# Enables user self-registration. If false, the system administrator -# will need to manually add users to the system. -registration = true - -[smtp] -host = "" -port = "" -from = "" -username = "" -password = "" - -[bitbucket] -url = "https://bitbucket.org" -api = "https://bitbucket.org" -client = "" -secret = "" -enabled = false - -[github] -url = "https://github.com" -api = "https://api.github.com" -client = "" -secret = "" -enabled = false - -[githubenterprise] -url = "" -api = "" -client = "" -secret = "" -enabled = false - -[gitlab] -url = "" -api = "" -client = "" -secret = "" -enabled = false - -[stash] -url = "" -api = "" -client = "" -secret = "" -enabled = false -`