From 13d1b2918a179b2b73afbb4c52e1822b7d3c8ec0 Mon Sep 17 00:00:00 2001 From: KatolaZ Date: Mon, 3 Jul 2017 11:46:39 +0100 Subject: Name changed to "binnit" --- binit.cfg | 21 --------------------- binnit.cfg | 21 +++++++++++++++++++++ config.go | 24 ++++++++++++++++++++++++ main.go | 32 ++++++++++++++++++++++++++++---- templ.go | 25 ++++++++++++++++++++++++- 5 files changed, 97 insertions(+), 26 deletions(-) delete mode 100644 binit.cfg create mode 100644 binnit.cfg diff --git a/binit.cfg b/binit.cfg deleted file mode 100644 index 0f66b25..0000000 --- a/binit.cfg +++ /dev/null @@ -1,21 +0,0 @@ -## -## These are comments -## - -## Server name -server_name=localhost:8080 - -## Bind address -bind_addr = 127.0.0.1 - -## Port number -bind_port=8080 - -## Directory where all pastes are kept -paste_dir=./pastes - -## Directory where HTML files and templates are kept -templ_dir=./html - -## max size of a paste, in bytes (cannot exceed 65535) -max_size=16384 diff --git a/binnit.cfg b/binnit.cfg new file mode 100644 index 0000000..0f66b25 --- /dev/null +++ b/binnit.cfg @@ -0,0 +1,21 @@ +## +## These are comments +## + +## Server name +server_name=localhost:8080 + +## Bind address +bind_addr = 127.0.0.1 + +## Port number +bind_port=8080 + +## Directory where all pastes are kept +paste_dir=./pastes + +## Directory where HTML files and templates are kept +templ_dir=./html + +## max size of a paste, in bytes (cannot exceed 65535) +max_size=16384 diff --git a/config.go b/config.go index ad5b4cb..7313356 100644 --- a/config.go +++ b/config.go @@ -1,3 +1,27 @@ +/* + * This program is free software: you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * . + * + * (c) Vincenzo "KatolaZ" Nicosia 2017 -- + * + * + * This file is part of "binnit", a minimal no-fuss pastebin-like + * server written in golang + * + */ + + package main diff --git a/main.go b/main.go index 6c3c151..f241701 100644 --- a/main.go +++ b/main.go @@ -1,3 +1,27 @@ +/* + * This program is free software: you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * . + * + * (c) Vincenzo "KatolaZ" Nicosia 2017 -- + * + * + * This file is part of "binnit", a minimal no-fuss pastebin-like + * server written in golang + * + */ + + package main import ( @@ -19,7 +43,7 @@ var p_conf = Config{ bind_port: "8000", paste_dir: "./pastes", templ_dir: "./tmpl", - log_fname: "./binit.log", + log_fname: "./binnit.log", max_size: 4096, } @@ -144,7 +168,7 @@ func main() { - parse_config("binit.cfg", &p_conf) + parse_config("binnit.cfg", &p_conf) f, err := os.OpenFile(p_conf.log_fname, os.O_APPEND | os.O_CREATE | os.O_RDWR, 0600) @@ -156,10 +180,10 @@ func main() { log.SetOutput(io.Writer(f)) - log.SetPrefix("[binit]: ") + log.SetPrefix("[binnit]: ") log.SetFlags(log.Ldate | log.Ltime | log.Lmicroseconds) - log.Println("Binit version 0.1 -- Starting ") + log.Println("Binnit version 0.1 -- Starting ") log.Printf(" + Serving pastes on: %s\n", p_conf.server_name) log.Printf(" + listening on: %s:%s\n", p_conf.bind_addr, p_conf.bind_port ) log.Printf(" + paste_dir: %s\n", p_conf.paste_dir) diff --git a/templ.go b/templ.go index 72656bd..2e018da 100644 --- a/templ.go +++ b/templ.go @@ -1,6 +1,29 @@ +/* + * This program is free software: you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + * . + * + * (c) Vincenzo "KatolaZ" Nicosia 2017 -- + * + * + * This file is part of "binnit", a minimal no-fuss pastebin-like + * server written in golang + * + */ + /* * -* Templating support for binit +* minimal Templating support for binit * */ -- cgit v1.2.3