The Great Linting Fixes, Drone configuration fix (again) and flatfile changes.

Great linting fixes has been applied, thanks to golangci-lint for
extensive reporting.

Fixed Drone configuration to use array for when-branch statement in
Docker plugin.

Flatfile storage from now will write files with 0600 permission for
greater security.
This commit is contained in:
2021-11-20 22:19:58 +05:00
parent 218e0bf667
commit 2b44a60ee7
14 changed files with 154 additions and 156 deletions

View File

@@ -39,29 +39,29 @@ import (
)
func main() {
c := context.New()
c.Initialize()
appCtx := context.New()
appCtx.Initialize()
c.Logger.Info().Msg("Starting Fast Pastebin...")
appCtx.Logger.Info().Msg("Starting Fast Pastebin...")
// Here goes initial initialization for packages that want CLI flags
// to be added.
// Parse flags.
c.Flagger.Parse()
appCtx.Flagger.Parse()
// Continue loading.
c.LoadConfiguration()
c.InitializePost()
database.New(c)
c.Database.Initialize()
templater.Initialize(c)
appCtx.LoadConfiguration()
appCtx.InitializePost()
database.New(appCtx)
appCtx.Database.Initialize()
templater.Initialize(appCtx)
captcha.New(c)
captcha.New(appCtx)
dbnotavailable.New(c)
indexpage.New(c)
pastes.New(c)
dbnotavailable.New(appCtx)
indexpage.New(appCtx)
pastes.New(appCtx)
// CTRL+C handler.
signalHandler := make(chan os.Signal, 1)
@@ -71,7 +71,7 @@ func main() {
go func() {
<-signalHandler
c.Shutdown()
appCtx.Shutdown()
shutdownDone <- true
}()