info messages and less verbose auth with dev

This commit is contained in:
Umputun
2018-09-11 00:36:46 -05:00
parent ae8071ac00
commit 396b77e4ff
3 changed files with 6 additions and 7 deletions
+4 -3
View File
@@ -33,10 +33,11 @@ ADD LICENSE /go/src/github.com/umputun/remark/
COPY --from=build-frontend /srv/web/public/ web
RUN \
sed -i "s|https://demo.remark42.com|http://127.0.0.1:8080|g" /go/src/github.com/umputun/remark/backend/web/*.js && \
sed -i "/REMOVE-START/,/REMOVE-END/d" ./web/iframe.html && \
export WEB_ROOT=/go/src/github.com/umputun/remark/backend/web && \
sed -i "s|https://demo.remark42.com|http://127.0.0.1:8080|g" ${WEB_ROOT}/*.js && \
sed -i "/REMOVE-START/,/REMOVE-END/d" ${WEB_ROOT}/iframe.html && \
go get -v github.com/rakyll/statik && \
statik --src=/go/src/github.com/umputun/remark/backend/web --dest=/go/src/github.com/umputun/remark/backend/app/rest -p api -f && \
statik --src=${WEB_ROOT} --dest=/go/src/github.com/umputun/remark/backend/app/rest -p api -f && \
ls -la /go/src/github.com/umputun/remark/backend/app/rest/api/statik.go && \
ls -la /go/src/github.com/umputun/remark/backend/web/
+2 -2
View File
@@ -167,7 +167,7 @@ func (s *ServerCommand) newServerApp() (*serverApp, error) {
if !strings.HasPrefix(s.RemarkURL, "http://") && !strings.HasPrefix(s.RemarkURL, "https://") {
return nil, errors.Errorf("invalid remark42 url %s", s.RemarkURL)
}
log.Printf("[DEBUG] remark42 url=%s", s.RemarkURL)
log.Printf("[INFO] root url=%s", s.RemarkURL)
storeEngine, err := s.makeDataStore()
if err != nil {
@@ -314,7 +314,7 @@ func (a *serverApp) activateBackup(ctx context.Context) {
// makeDataStore creates store for all sites
func (s *ServerCommand) makeDataStore() (result engine.Interface, err error) {
log.Printf("[INFO] make data store, type %s", s.Store.Type)
log.Printf("[INFO] make data store, type=%s", s.Store.Type)
switch s.Store.Type {
case "bolt":
-2
View File
@@ -172,10 +172,8 @@ func (a *Authenticator) basicDevUser(r *http.Request) bool {
return false
}
log.Printf("[DEBUG] dev user auth")
s := strings.SplitN(r.Header.Get("Authorization"), " ", 2)
if len(s) != 2 {
log.Printf("[WARN] dev user auth failed, incorrect auth header %s", r.Header.Get("Authorization"))
return false
}