1
0
Fork 0
mirror of https://github.com/Eggbertx/gochan.git synced 2025-08-03 07:36:23 -07:00

fixing merge (push)

This commit is contained in:
Joshua Merrell 2013-06-04 18:04:56 -07:00
parent 2d7bf4a826
commit ebf891e785
4 changed files with 2 additions and 54 deletions

View file

@ -3,11 +3,8 @@
- Set up load balancing - Set up load balancing
- Clean up config file template - Clean up config file template
- Set up HTTPS for management - Set up HTTPS for management
- gzip-encoding for html, css, and javascript
- Set up backend mode, compatibility with nginx and Apache
- Set up templating - Set up templating
- Set up timezone adjusting - Set up timezone adjusting
- Set up new mod menu style, integrated with board pages
- Give administrator server control options (restart/shutdown daemon, etc) - Give administrator server control options (restart/shutdown daemon, etc)
- Set up basic posting/board interaction - Set up basic posting/board interaction
- find out what changes were made in Kusaba 0.9.3 to fix XSS vulnerability - find out what changes were made in Kusaba 0.9.3 to fix XSS vulnerability

View file

@ -7,7 +7,7 @@ import (
) )
var ( var (
version float32 = 0.2 version float32 = 0.3
) )
@ -25,7 +25,6 @@ func main() {
needs_initial_setup = true needs_initial_setup = true
runInitialSetup() runInitialSetup()
} }
fmt.Println("Loading and parsing templates...") fmt.Println("Loading and parsing templates...")
initTemplates() initTemplates()
fmt.Println("Initializing server...") fmt.Println("Initializing server...")

View file

@ -92,11 +92,7 @@ func makeHandler(fn func(http.ResponseWriter, *http.Request)) http.HandlerFunc {
} }
} }
<<<<<<< HEAD
func exitWithErrorPage(w http.ResponseWriter, err string) { func exitWithErrorPage(w http.ResponseWriter, err string) {
=======
func exitWithErrorPage(writer http.ResponseWriter, err string) {
>>>>>>> 0b6e2bc132fad7f323348b27857431ea8674c382
error_page_bytes,_ := ioutil.ReadFile("templates/error.html") error_page_bytes,_ := ioutil.ReadFile("templates/error.html")
error_page := string(error_page_bytes) error_page := string(error_page_bytes)
error_page = strings.Replace(error_page,"{ERRORTEXT}", err,-1) error_page = strings.Replace(error_page,"{ERRORTEXT}", err,-1)
@ -125,4 +121,4 @@ func serverError() {
func serveFile(w http.ResponseWriter, filepath string) { func serveFile(w http.ResponseWriter, filepath string) {
http.ServeFile(w, &request, filepath) http.ServeFile(w, &request, filepath)
access_log.Write("Success: 200 from " + request.RemoteAddr + " @ " + request.RequestURI) access_log.Write("Success: 200 from " + request.RemoteAddr + " @ " + request.RequestURI)
} }

View file

@ -3,16 +3,12 @@ package main
import ( import (
"os" "os"
"fmt" "fmt"
//"database/sql"
//_ "github.com/go-sql-driver/mysql"
"github.com/ziutek/mymysql/mysql" "github.com/ziutek/mymysql/mysql"
_ "github.com/ziutek/mymysql/native" // Native engine _ "github.com/ziutek/mymysql/native" // Native engine
//_ "github.com/ziutek/mymysql/thrsafe" // Thread safe engine //_ "github.com/ziutek/mymysql/thrsafe" // Thread safe engine
) )
var ( var (
//db *sql.DB
db mysql.Conn db mysql.Conn
db_connected = false db_connected = false
) )
@ -34,44 +30,4 @@ func connectToSQLServer(usedb bool) {
} }
} }
db_connected = true db_connected = true
}
func dbTests() {
results,err := db.Start("SELECT * FROM `"+config.DBprefix+"staff")
if err != nil {
fmt.Println(err.Error())
os.Exit(2)
}
/*var entry StaffTable
if err != nil {
error_log.Write(err.Error())
}
for results.Next() {
err = results.Scan(&entry.username,&entry.password_checksum,&entry.rank)
//if err != nil { panic(err) }
}*/
for {
row, err := results.GetRow()
if err != nil {
error_log.Write(err.Error())
}
if row == nil {
// No more rows
break
}
// Print all cols
for _, col := range row {
if col == nil {
fmt.Print("<NULL>")
} else {
os.Stdout.Write(col.([]byte))
}
fmt.Print(" ")
}
fmt.Println()
}
} }