Giter Site home page Giter Site logo

gitbucket-announce-plugin's Introduction

gitbucket-announce-plugin

This plugin enhances GitBucket by providing an announce mechanism.

Features

Global Announce

This feature allows to notify GitBucket users. It is available to admin users via the System Administration menu of GitBucket.

The global announce sends an email to all active users. For that, notifications and thus SMTP settings of the global GitBucket configuration have to be correctly filled in the System Administration\System Settings\Notification email section.

It is then possible, for example, to notify every user that an upgrade of the system is planned the next Monday at midday.

Compatibility

Plugin version GitBucket version
1.14.x 4.35.x
1.13.x 4.33.x
1.12.x 4.32.x
1.11.x 4.26.x
1.10.x 4.21.x -> 4.25.x
1.9.x 4.19.x, 4.20.x
1.8.x 4.17.x, 4.18.x
1.7.x 4.16.x
1.6.x 4.10.x
1.5.x 4.3.x
1.4.x 4.0.0 -> 4.2.x
1.3.x 3.11.x, 3.12.x
1.2.x 3.11.x
1.1.x 3.7.x -> 3.10.x
1.0.x 3.6.x

Usage

  • Open a shell window at the root of the project, hit sbt assembly
  • if you update gitbucket-announce-plugin, remove any existing previous copy of gitbucket-announce-plugin from GITBUCKET_HOME/plugins
  • Copy target/scala-2.12/gitbucket-announce-plugin-assembly-X.X.X.jar into GITBUCKET_HOME/plugins
  • Restart GitBucket

Release Notes

1.14.0

1.13.0

1.12.0

1.11.0

1.10.0

  • update to gitbucket 4.22.0

1.9.0

1.8.0

1.7.1

  • fix database support problem when gitbucket works with other than H2

1.7.0

  • update to gitbucket 4.16

1.6.0

1.5.0

  • issue-12 adapt to new gitbucket version handling

1.4.0

  • issue-11 enhance plugin compatibility, runs with gitbucket 4.0.0

1.3

  • issue-10 allow sending to partial list of receivers, correct exception handling on email failure

1.2

  • issue-9 make the plugin compatible with gitbucket 3.11

1.1

  • issue-5 use new SystemSettings.useSMTP property introduced in gitbucket 3.7
  • pullrequest-7 adapt markdown parser

1.0

  • introduce gitbucket-announce-plugin
  • global announce by email in System Administration menu
  • depends on gitbucket/gitbucket#861

gitbucket-announce-plugin's People

Contributors

aadrian avatar hikaruworld avatar kasancode avatar mcfoggy avatar onukura avatar pinghe avatar takezoe avatar ymorika avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gitbucket-announce-plugin's Issues

Support GitBucket 4.35.0

GitBucket v4.35.0 and latest version of this plugin v1.13.0 causes following error because of binary incompatibility.

12:57:22.045 [qtp42768293-229] ERROR f.b.g.a.c.AnnounceController - Catch unhandled error in request: Request(GET //localhost:8080/admin/announce)@7e5e76f1
java.lang.NoSuchMethodError: gitbucket.core.html.main$.apply(Ljava/lang/String;Lscala/Option;Lplay/twirl/api/Html;Lgitbucket/core/controller/Context;)Lplay/twirl/api/Html;
        at fr.brouillard.gitbucket.announce.html.announce$.apply(announce.template.scala:25)
        at fr.brouillard.gitbucket.announce.controller.AnnounceControllerBase.$anonfun$$init$$2(AnnounceController.scala:33)
        at gitbucket.core.util.AdminAuthenticator.authenticate(Authenticator.scala:77)
        at gitbucket.core.util.AdminAuthenticator.adminOnly(Authenticator.scala:72)
        at gitbucket.core.util.AdminAuthenticator.adminOnly$(Authenticator.scala:72)
        at fr.brouillard.gitbucket.announce.controller.AnnounceController.adminOnly(AnnounceController.scala:16)
        at fr.brouillard.gitbucket.announce.controller.AnnounceControllerBase.$anonfun$$init$$1(AnnounceController.scala:33)
        at org.scalatra.ScalatraBase.liftAction(ScalatraBase.scala:282)
        at org.scalatra.ScalatraBase.$anonfun$invoke$1(ScalatraBase.scala:276)
        at org.scalatra.ApiFormats.withRouteMultiParams(ApiFormats.scala:180)
        at org.scalatra.ApiFormats.withRouteMultiParams$(ApiFormats.scala:171)
        at gitbucket.core.controller.ControllerBase.withRouteMultiParams(ControllerBase.scala:35)
        at org.scalatra.ScalatraBase.invoke(ScalatraBase.scala:275)
        at org.scalatra.ScalatraBase.invoke$(ScalatraBase.scala:274)
        at gitbucket.core.controller.ControllerBase.invoke(ControllerBase.scala:35)
        at org.scalatra.ScalatraBase.$anonfun$runRoutes$3(ScalatraBase.scala:250)
        at scala.Option.flatMap(Option.scala:283)
        at org.scalatra.ScalatraBase.$anonfun$runRoutes$1(ScalatraBase.scala:248)
        at scala.collection.immutable.Stream.flatMap(Stream.scala:202)
        at org.scalatra.ScalatraBase.runRoutes(ScalatraBase.scala:247)
        at org.scalatra.ScalatraBase.runRoutes$(ScalatraBase.scala:245)
        at gitbucket.core.controller.ControllerBase.runRoutes(ControllerBase.scala:35)
        at org.scalatra.ScalatraBase.runActions$1(ScalatraBase.scala:169)
        at org.scalatra.ScalatraBase.$anonfun$executeRoutes$6(ScalatraBase.scala:181)
        at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
        at org.scalatra.ScalatraBase.cradleHalt(ScalatraBase.scala:201)
        at org.scalatra.ScalatraBase.executeRoutes(ScalatraBase.scala:181)
        at org.scalatra.ScalatraBase.executeRoutes$(ScalatraBase.scala:150)
        at gitbucket.core.controller.ControllerBase.executeRoutes(ControllerBase.scala:35)
        at org.scalatra.ScalatraBase.$anonfun$handle$1(ScalatraBase.scala:123)
        at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
        at scala.util.DynamicVariable.withValue(DynamicVariable.scala:59)
        at org.scalatra.DynamicScope.withResponse(DynamicScope.scala:75)
        at org.scalatra.DynamicScope.withResponse$(DynamicScope.scala:73)
        at gitbucket.core.controller.ControllerBase.withResponse(ControllerBase.scala:35)
        at org.scalatra.DynamicScope.$anonfun$withRequestResponse$1(DynamicScope.scala:55)
        at scala.util.DynamicVariable.withValue(DynamicVariable.scala:59)
        at org.scalatra.DynamicScope.withRequest(DynamicScope.scala:66)
        at org.scalatra.DynamicScope.withRequest$(DynamicScope.scala:64)
        at gitbucket.core.controller.ControllerBase.withRequest(ControllerBase.scala:35)
        at org.scalatra.DynamicScope.withRequestResponse(DynamicScope.scala:54)
        at org.scalatra.DynamicScope.withRequestResponse$(DynamicScope.scala:52)
        at gitbucket.core.controller.ControllerBase.withRequestResponse(ControllerBase.scala:35)
        at org.scalatra.ScalatraBase.handle(ScalatraBase.scala:123)
        at org.scalatra.ScalatraBase.handle$(ScalatraBase.scala:119)
        at gitbucket.core.controller.ControllerBase.org$scalatra$servlet$ServletBase$$super$handle(ControllerBase.scala:35)
        at org.scalatra.servlet.ServletBase.handle(ServletBase.scala:42)
        at org.scalatra.servlet.ServletBase.handle$(ServletBase.scala:35)
        at gitbucket.core.controller.ControllerBase.org$scalatra$FlashMapSupport$$super$handle(ControllerBase.scala:35)
        at org.scalatra.FlashMapSupport.$anonfun$handle$1(FlashMap.scala:197)
        at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
        at scala.util.DynamicVariable.withValue(DynamicVariable.scala:59)
        at org.scalatra.DynamicScope.withRequest(DynamicScope.scala:66)
        at org.scalatra.DynamicScope.withRequest$(DynamicScope.scala:64)
        at gitbucket.core.controller.ControllerBase.withRequest(ControllerBase.scala:35)
        at org.scalatra.FlashMapSupport.handle(FlashMap.scala:172)
        at org.scalatra.FlashMapSupport.handle$(FlashMap.scala:171)
        at gitbucket.core.controller.ControllerBase.handle(ControllerBase.scala:35)
        at org.scalatra.ScalatraFilter.$anonfun$doFilter$1(ScalatraFilter.scala:41)
        at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
        at scala.util.DynamicVariable.withValue(DynamicVariable.scala:59)
        at org.scalatra.ScalatraFilter.doFilter(ScalatraFilter.scala:41)
        at org.scalatra.ScalatraFilter.doFilter$(ScalatraFilter.scala:36)
        at gitbucket.core.controller.ControllerBase.doFilter(ControllerBase.scala:73)
        at gitbucket.core.servlet.PluginControllerFilter.$anonfun$process$2(PluginControllerFilter.scala:39)
        at gitbucket.core.servlet.PluginControllerFilter.$anonfun$process$2$adapted(PluginControllerFilter.scala:32)
        at scala.collection.immutable.List.foreach(List.scala:305)
        at gitbucket.core.servlet.PluginControllerFilter.process(PluginControllerFilter.scala:32)
        at gitbucket.core.servlet.ControllerFilter.doFilter(CompositeScalatraFilter.scala:25)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1591)
        at org.scalatra.ScalatraFilter.$anonfun$doNotFound$1(ScalatraFilter.scala:80)
        at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
        at org.scalatra.ScalatraBase.$anonfun$executeRoutes$5(ScalatraBase.scala:172)
        at scala.Option.getOrElse(Option.scala:201)
        at org.scalatra.ScalatraBase.$anonfun$executeRoutes$3(ScalatraBase.scala:172)
        at scala.Option.getOrElse(Option.scala:201)
        at org.scalatra.ScalatraBase.runActions$1(ScalatraBase.scala:172)
        at org.scalatra.ScalatraBase.$anonfun$executeRoutes$6(ScalatraBase.scala:181)
        at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
        at org.scalatra.ScalatraBase.cradleHalt(ScalatraBase.scala:201)
        at org.scalatra.ScalatraBase.executeRoutes(ScalatraBase.scala:181)
        at org.scalatra.ScalatraBase.executeRoutes$(ScalatraBase.scala:150)
        at gitbucket.core.controller.ControllerBase.executeRoutes(ControllerBase.scala:35)
        at org.scalatra.ScalatraBase.$anonfun$handle$1(ScalatraBase.scala:123)
        at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
        at scala.util.DynamicVariable.withValue(DynamicVariable.scala:59)
        at org.scalatra.DynamicScope.withResponse(DynamicScope.scala:75)
        at org.scalatra.DynamicScope.withResponse$(DynamicScope.scala:73)
        at gitbucket.core.controller.ControllerBase.withResponse(ControllerBase.scala:35)
        at org.scalatra.DynamicScope.$anonfun$withRequestResponse$1(DynamicScope.scala:55)
        at scala.util.DynamicVariable.withValue(DynamicVariable.scala:59)
        at org.scalatra.DynamicScope.withRequest(DynamicScope.scala:66)
        at org.scalatra.DynamicScope.withRequest$(DynamicScope.scala:64)
        at gitbucket.core.controller.ControllerBase.withRequest(ControllerBase.scala:35)
        at org.scalatra.DynamicScope.withRequestResponse(DynamicScope.scala:54)
        at org.scalatra.DynamicScope.withRequestResponse$(DynamicScope.scala:52)
        at gitbucket.core.controller.ControllerBase.withRequestResponse(ControllerBase.scala:35)
        at org.scalatra.ScalatraBase.handle(ScalatraBase.scala:123)
        at org.scalatra.ScalatraBase.handle$(ScalatraBase.scala:119)
        at gitbucket.core.controller.ControllerBase.org$scalatra$servlet$ServletBase$$super$handle(ControllerBase.scala:35)
        at org.scalatra.servlet.ServletBase.handle(ServletBase.scala:42)
        at org.scalatra.servlet.ServletBase.handle$(ServletBase.scala:35)
        at gitbucket.core.controller.ControllerBase.org$scalatra$FlashMapSupport$$super$handle(ControllerBase.scala:35)
        at org.scalatra.FlashMapSupport.$anonfun$handle$1(FlashMap.scala:197)
        at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
        at scala.util.DynamicVariable.withValue(DynamicVariable.scala:59)
        at org.scalatra.DynamicScope.withRequest(DynamicScope.scala:66)
        at org.scalatra.DynamicScope.withRequest$(DynamicScope.scala:64)
        at gitbucket.core.controller.ControllerBase.withRequest(ControllerBase.scala:35)
        at org.scalatra.FlashMapSupport.handle(FlashMap.scala:172)
        at org.scalatra.FlashMapSupport.handle$(FlashMap.scala:171)
        at gitbucket.core.controller.ControllerBase.handle(ControllerBase.scala:35)
        at org.scalatra.ScalatraFilter.$anonfun$doFilter$1(ScalatraFilter.scala:41)
        at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
        at scala.util.DynamicVariable.withValue(DynamicVariable.scala:59)
        at org.scalatra.ScalatraFilter.doFilter(ScalatraFilter.scala:41)
        at org.scalatra.ScalatraFilter.doFilter$(ScalatraFilter.scala:36)
        at gitbucket.core.controller.ControllerBase.doFilter(ControllerBase.scala:73)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1591)
        at gitbucket.core.servlet.TransactionFilter.$anonfun$doFilter$1(TransactionFilter.scala:39)
        at gitbucket.core.servlet.TransactionFilter.$anonfun$doFilter$1$adapted(TransactionFilter.scala:30)
        at com.github.takezoe.slick.blocking.BlockingJdbcProfile$BlockingAPI$BlockingDatabase.$anonfun$withTransaction$2(BlockingProfile.scala:207)
        at slick.JdbcProfileBlockingSession$BlockingSession.withTransaction(TransactionalJdbcBackend.scala:26)
        at com.github.takezoe.slick.blocking.BlockingJdbcProfile$BlockingAPI$BlockingDatabase.$anonfun$withTransaction$1(BlockingProfile.scala:207)
        at com.github.takezoe.slick.blocking.BlockingJdbcProfile$BlockingAPI$BlockingDatabase.withSession(BlockingProfile.scala:200)
        at com.github.takezoe.slick.blocking.BlockingJdbcProfile$BlockingAPI$BlockingDatabase.withTransaction(BlockingProfile.scala:207)
        at gitbucket.core.servlet.TransactionFilter.doFilter(TransactionFilter.scala:30)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1583)
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:542)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
        at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:536)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
        at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1581)
        at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1307)
        at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:482)
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1549)
        at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1204)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
        at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:221)
        at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:146)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
        at org.eclipse.jetty.server.Server.handle(Server.java:494)
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:374)
        at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:268)
        at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
        at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129)
        at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:367)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:782)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:918)
        at java.lang.Thread.run(Thread.java:748)

allow to choose target audience of email announce

When writing an email announce in System Administration panel, offer the possibility to send the announce:

  • globally, actual behavior (all active users)
  • to a defined audience: users and/or groups like in image below

image

Error:Plugin version is 1.6.0, but database version is 1.1

Hello, I use gitbucket in version 4.13 and the plugins "gitbucket-announce-plugin.jar" in version 1.6.
I have this error message: "Plugin version is 1.6.0, but database version is 1.1".
For information gitbucket version 4.2.1 and gitbucket-announce-plugin.jar version v1.4 works.
Do you have any solutions?
Thank you in advance

move send button outside of the box container

the "send notification" button should be put outside of the box container so that it does not make visible a grey panel at the bottom of the page.

image

It should look like the System Settings page of gitbucket.

image

Separate SMTP settings from the GitBucket "base" settings for the plugin

SMTP settings for the announce should be splitted up:

  • SMTP settings (announce plugin)
  • SMTP notification settings ("base" GitBucket)

Doing so, we could separate the GIT notifications and it's underlying SMTP usage from any other feature that would require to send email.

We needed to remove the "base" SMTP settings and "send notifications" from the bare GitBucket configuration since it became too verbose with no ability to modity to whom and when the emails are sent out. This, naturally disables the possibility to use announce plugin.

Update to gitbucket 4.17

  • Use new Mailer API which is introduced in GitBucket 4.17.0
  • Separate database access as a service

Add exception handling

There is no specific exception handling for sending e-mail. This cause a lot of undesirable behavior:

  1. No log record are created
  2. No e-mail is sended, even if only one rcpt is invalid
  3. Server returns HTTP STATUS 500 with the stackstrace string as body, making the browser to show the body as text

You could use setSendPartial to prevent behavior number 2, but it still will needed to handle exception.

It also will be nice to log which e-mails were invalid with SendFailedException.getInvalidAddresses.

Sorry not to provide a PR, but I don't work with Scala.

update to gitbucket 4.10

update plugin to be compatible with gitbucket 4.10:

  • scala 2.12
  • blocking-slick 0.0.7 & slick 3.2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.