|
|
@ -14,7 +14,6 @@ import ( |
|
|
|
"github.com/gorilla/mux" |
|
|
|
"github.com/gorilla/mux" |
|
|
|
"github.com/writeas/go-webfinger" |
|
|
|
"github.com/writeas/go-webfinger" |
|
|
|
"github.com/writeas/web-core/log" |
|
|
|
"github.com/writeas/web-core/log" |
|
|
|
"github.com/writeas/writefreely/config" |
|
|
|
|
|
|
|
"github.com/writefreely/go-nodeinfo" |
|
|
|
"github.com/writefreely/go-nodeinfo" |
|
|
|
"net/http" |
|
|
|
"net/http" |
|
|
|
"path/filepath" |
|
|
|
"path/filepath" |
|
|
@ -153,16 +152,8 @@ func InitRoutes(apper Apper, r *mux.Router) *mux.Router { |
|
|
|
write.HandleFunc("/login", handler.Web(viewLogin, UserLevelNoneRequired)) |
|
|
|
write.HandleFunc("/login", handler.Web(viewLogin, UserLevelNoneRequired)) |
|
|
|
write.HandleFunc("/invite/{code}", handler.Web(handleViewInvite, UserLevelNoneRequired)).Methods("GET") |
|
|
|
write.HandleFunc("/invite/{code}", handler.Web(handleViewInvite, UserLevelNoneRequired)).Methods("GET") |
|
|
|
// TODO: show a reader-specific 404 page if the function is disabled
|
|
|
|
// TODO: show a reader-specific 404 page if the function is disabled
|
|
|
|
readPerm := func(cfg *config.Config) UserLevel { |
|
|
|
write.HandleFunc("/read", handler.Web(viewLocalTimeline, UserLevelReader)) |
|
|
|
if cfg.App.Private { |
|
|
|
RouteRead(handler, UserLevelReader, write.PathPrefix("/read").Subrouter()) |
|
|
|
// Private instance, so only allow users to access Reader routes
|
|
|
|
|
|
|
|
return UserLevelUserType |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return UserLevelOptionalType |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
write.HandleFunc("/read", handler.Web(viewLocalTimeline, readPerm)) |
|
|
|
|
|
|
|
RouteRead(handler, readPerm, write.PathPrefix("/read").Subrouter()) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
draftEditPrefix := "" |
|
|
|
draftEditPrefix := "" |
|
|
|
if apper.App().cfg.App.SingleUser { |
|
|
|
if apper.App().cfg.App.SingleUser { |
|
|
|