From c20f56333034e39fdcb26d07f0be1397ba7ba424 Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Sun, 13 Jul 2014 16:04:10 -0700 Subject: [PATCH] reverted back to original sqlite database location --- Makefile | 2 + debian/drone/DEBIAN/control | 2 +- debian/drone/etc/init/drone.conf | 4 +- server/main.go | 75 -------------------------------- 4 files changed, 4 insertions(+), 79 deletions(-) diff --git a/Makefile b/Makefile index 580a0a45..4d413a6b 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 a7d76e06..2bafdcb3 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 fda2a586..55962c45 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 a8ff5761..ef1489af 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 -`