mirror of
https://gitea.phreedom.club/localhost_frssoft/bloat.git
synced 2024-11-05 04:29:21 +02:00
Add install target for make
- Update default config path accordingly - Mention use of config file in README
This commit is contained in:
parent
a981085260
commit
cd9306294d
27
Makefile
27
Makefile
|
@ -1,11 +1,32 @@
|
|||
GO=go
|
||||
BINPATH=/usr/local/bin
|
||||
DATAPATH=/var/bloat
|
||||
ETCPATH=/etc
|
||||
|
||||
all: bloat
|
||||
|
||||
PHONY:
|
||||
|
||||
bloat: main.go PHONY
|
||||
bloat: main.go
|
||||
$(GO) build $(GOFLAGS) -o bloat main.go
|
||||
|
||||
install: bloat
|
||||
cp bloat $(BINPATH)/bloat
|
||||
chmod 0755 $(BINPATH)/bloat
|
||||
mkdir -p $(DATAPATH)/database
|
||||
cp -r templates $(DATAPATH)/
|
||||
cp -r static $(DATAPATH)/
|
||||
sed -e "s%=database%=$(DATAPATH)/database%g" \
|
||||
-e "s%=templates%=$(DATAPATH)/templates%g" \
|
||||
-e "s%=static%=$(DATAPATH)/static%g" \
|
||||
< bloat.conf > $(ETCPATH)/bloat.conf
|
||||
|
||||
uninstall:
|
||||
rm -f $(BINPATH)/bloat
|
||||
rm -fr $(DATAPATH)/templates
|
||||
rm -fr $(DATAPATH)/static
|
||||
rm -f $(ETCPATH)/bloat.conf
|
||||
|
||||
clean:
|
||||
rm -f bloat
|
||||
|
||||
run: bloat
|
||||
./bloat
|
||||
|
|
6
README
6
README
|
@ -18,17 +18,17 @@ External dependencies:
|
|||
|
||||
Building and Installation:
|
||||
|
||||
Make sure you have GO installed. Other dependencies will be downloaded
|
||||
Make sure you have Go installed. Other dependencies will be downloaded
|
||||
automatically.
|
||||
|
||||
Typing make will build the binary
|
||||
$ make
|
||||
|
||||
Edit the provided config file. See the default.conf file for more details.
|
||||
$ ed default.conf
|
||||
$ ed bloat.conf
|
||||
|
||||
Run the binary
|
||||
$ ./bloat
|
||||
$ ./bloat -f bloat.conf
|
||||
|
||||
You can now access the frontend at http://localhost:8080, which is the default
|
||||
listen address. You can also setup a reverse HTTP proxy to serve the frontend over
|
||||
|
|
2
main.go
2
main.go
|
@ -20,7 +20,7 @@ import (
|
|||
)
|
||||
|
||||
var (
|
||||
configFile = "bloat.conf"
|
||||
configFile = "/etc/bloat.conf"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
|
|
@ -6,7 +6,6 @@ import (
|
|||
"io"
|
||||
"mime/multipart"
|
||||
"net/http"
|
||||
"path"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
|
@ -595,7 +594,7 @@ func NewHandler(s Service, staticDir string) http.Handler {
|
|||
r.HandleFunc("/fluoride/retweet/{id}", fRetweet).Methods(http.MethodPost)
|
||||
r.HandleFunc("/fluoride/unretweet/{id}", fUnretweet).Methods(http.MethodPost)
|
||||
r.PathPrefix("/static").Handler(http.StripPrefix("/static",
|
||||
http.FileServer(http.Dir(path.Join(".", staticDir)))))
|
||||
http.FileServer(http.Dir(staticDir))))
|
||||
|
||||
return r
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue