From: Jeff Halter Date: Mon, 26 Jul 2021 23:41:01 +0000 (-0700) Subject: patch: Fix ACLs and brew install issues X-Git-Url: https://git.r.bdr.sh/rbdr/mobius/commitdiff_plain/5454019cb1d74aca96edec31f1951a94ff70f1d1?ds=sidebyside patch: Fix ACLs and brew install issues --- diff --git a/server.go b/server.go index 002eb40..e51f673 100644 --- a/server.go +++ b/server.go @@ -504,13 +504,6 @@ func (s *Server) handleNewConnection(conn net.Conn) error { return fmt.Errorf("incorrect login") } - // Hotline 1.2.3 client does not send fieldVersion - // Nostalgia client sends "" - //if string(*c.Version) == "" { - // *c.UserName = clientLogin.GetField(fieldUserName).Data - // *c.Icon = clientLogin.GetField(fieldUserIconID).Data - //} - // if clientLogin.GetField(fieldUserName).Data != nil { *c.UserName = clientLogin.GetField(fieldUserName).Data } @@ -539,13 +532,6 @@ func (s *Server) handleNewConnection(conn net.Conn) error { // Show agreement to client c.Server.outbox <- *NewTransaction(tranShowAgreement, c.ID, NewField(fieldData, s.Agreement)) - // The Hotline ClientConn v1.2.3 has a different login sequence than 1.9.2 - if string(*c.Version) == "" { - if _, err := c.notifyNewUserHasJoined(); err != nil { - return err - } - } - if _, err := c.notifyNewUserHasJoined(); err != nil { return err } diff --git a/server/mobius/config/Files/hello.txt b/server/mobius/config/Files/hello.txt new file mode 100644 index 0000000..271a837 --- /dev/null +++ b/server/mobius/config/Files/hello.txt @@ -0,0 +1 @@ +I'm a test file \ No newline at end of file diff --git a/server/mobius/config/ThreadedNews.yaml b/server/mobius/config/ThreadedNews.yaml index dc2e8b5..59e0a68 100644 --- a/server/mobius/config/ThreadedNews.yaml +++ b/server/mobius/config/ThreadedNews.yaml @@ -1 +1 @@ -Categories: +Categories: {} diff --git a/transaction_handlers.go b/transaction_handlers.go index 7920eaa..b06297d 100644 --- a/transaction_handlers.go +++ b/transaction_handlers.go @@ -41,6 +41,9 @@ var TransactionHandlers = map[uint16]TransactionType{ tranUserAccess: { Name: "tranUserAccess", }, + tranNotifyDeleteUser: { + Name: "tranNotifyDeleteUser", + }, tranAgreed: { Access: accessAlwaysAllow, Name: "tranAgreed", @@ -117,18 +120,26 @@ var TransactionHandlers = map[uint16]TransactionType{ Handler: HandleGetFileNameList, }, tranGetMsgs: { + Access: accessNewsReadArt, + DenyMsg: "You are not allowed to read news.", Name: "tranGetMsgs", Handler: HandleGetMsgs, }, tranGetNewsArtData: { + Access: accessNewsReadArt, + DenyMsg: "You are not allowed to read news.", Name: "tranGetNewsArtData", Handler: HandleGetNewsArtData, }, tranGetNewsArtNameList: { + Access: accessNewsReadArt, + DenyMsg: "You are not allowed to read news.", Name: "tranGetNewsArtNameList", Handler: HandleGetNewsArtNameList, }, tranGetNewsCatNameList: { + Access: accessNewsReadArt, + DenyMsg: "You are not allowed to read news.", Name: "tranGetNewsCatNameList", Handler: HandleGetNewsCatNameList, }, @@ -150,24 +161,27 @@ var TransactionHandlers = map[uint16]TransactionType{ Handler: HandleInviteNewChat, }, tranInviteToChat: { + Access: accessOpenChat, + DenyMsg: "You are not allowed to request private chat.", Name: "tranInviteToChat", Handler: HandleInviteToChat, }, tranJoinChat: { + Access: accessAlwaysAllow, Name: "tranJoinChat", Handler: HandleJoinChat, }, tranKeepAlive: { + Access: accessAlwaysAllow, Name: "tranKeepAlive", Handler: HandleKeepAlive, }, tranLeaveChat: { + Access: accessAlwaysAllow, Name: "tranJoinChat", Handler: HandleLeaveChat, }, - tranNotifyDeleteUser: { - Name: "tranNotifyDeleteUser", - }, + tranListUsers: { Access: accessOpenUser, DenyMsg: "You are not allowed to view accounts.", @@ -181,14 +195,20 @@ var TransactionHandlers = map[uint16]TransactionType{ Handler: HandleMoveFile, }, tranNewFolder: { + Access: accessCreateFolder, + DenyMsg: "You are not allow to create folders.", Name: "tranNewFolder", Handler: HandleNewFolder, }, tranNewNewsCat: { + Access: accessNewsCreateCat, + DenyMsg: "You are not allowed to create news categories.", Name: "tranNewNewsCat", Handler: HandleNewNewsCat, }, tranNewNewsFldr: { + Access: accessNewsCreateFldr, + DenyMsg: "You are not allowed to create news folders.", Name: "tranNewNewsFldr", Handler: HandleNewNewsFldr, }, @@ -199,6 +219,8 @@ var TransactionHandlers = map[uint16]TransactionType{ Handler: HandleNewUser, }, tranOldPostNews: { + Access: accessNewsPostArt, + DenyMsg: "You are not allowed to post news.", Name: "tranOldPostNews", Handler: HandleTranOldPostNews, }, @@ -209,10 +231,12 @@ var TransactionHandlers = map[uint16]TransactionType{ Handler: HandlePostNewsArt, }, tranRejectChatInvite: { + Access: accessAlwaysAllow, Name: "tranRejectChatInvite", Handler: HandleRejectChatInvite, }, tranSendInstantMsg: { + Access: accessAlwaysAllow, //Access: accessSendPrivMsg, //DenyMsg: "You are not allowed to send private messages", Name: "tranSendInstantMsg", @@ -228,6 +252,7 @@ var TransactionHandlers = map[uint16]TransactionType{ }, }, tranSetChatSubject: { + Access: accessAlwaysAllow, Name: "tranSetChatSubject", Handler: HandleSetChatSubject, }, @@ -237,6 +262,7 @@ var TransactionHandlers = map[uint16]TransactionType{ Handler: HandleSetClientUserInfo, }, tranSetFileInfo: { + Access: accessAlwaysAllow, // granular access is in the handler Name: "tranSetFileInfo", Handler: HandleSetFileInfo, }, @@ -253,6 +279,7 @@ var TransactionHandlers = map[uint16]TransactionType{ Handler: HandleUploadFile, }, tranUploadFldr: { + Access: accessAlwaysAllow, // TODO: what should this be? Name: "tranUploadFldr", Handler: HandleUploadFolder, }, diff --git a/version.go b/version.go index 1025a59..d24a4bc 100644 --- a/version.go +++ b/version.go @@ -1,3 +1,3 @@ package hotline -const VERSION = "0.0.5" +const VERSION = "0.0.6"