mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	Organization level webhooks
This commit is contained in:
		@@ -24,16 +24,18 @@ var CmdDump = cli.Command{
 | 
			
		||||
	Description: `Dump compresses all related files and database into zip file.
 | 
			
		||||
It can be used for backup and capture Gogs server image to send to maintainer`,
 | 
			
		||||
	Action: runDump,
 | 
			
		||||
	Flags:  []cli.Flag{},
 | 
			
		||||
	Flags: []cli.Flag{
 | 
			
		||||
		cli.BoolFlag{"verbose, v", "show process details", ""},
 | 
			
		||||
	},
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func runDump(*cli.Context) {
 | 
			
		||||
func runDump(ctx *cli.Context) {
 | 
			
		||||
	setting.NewConfigContext()
 | 
			
		||||
	models.LoadModelsConfig()
 | 
			
		||||
	models.SetEngine()
 | 
			
		||||
 | 
			
		||||
	log.Printf("Dumping local repositories...%s", setting.RepoRootPath)
 | 
			
		||||
	zip.Verbose = false
 | 
			
		||||
	zip.Verbose = ctx.Bool("verbose")
 | 
			
		||||
	defer os.Remove("gogs-repo.zip")
 | 
			
		||||
	if err := zip.PackTo(setting.RepoRootPath, "gogs-repo.zip", true); err != nil {
 | 
			
		||||
		log.Fatalf("Fail to dump local repositories: %v", err)
 | 
			
		||||
 
 | 
			
		||||
@@ -69,9 +69,9 @@ func newMacaron() *macaron.Macaron {
 | 
			
		||||
			SkipLogging: !setting.DisableRouterLog,
 | 
			
		||||
		},
 | 
			
		||||
	))
 | 
			
		||||
	if setting.EnableGzip {
 | 
			
		||||
		m.Use(macaron.Gzip())
 | 
			
		||||
	}
 | 
			
		||||
	// if setting.EnableGzip {
 | 
			
		||||
	// 	m.Use(macaron.Gzip())
 | 
			
		||||
	// }
 | 
			
		||||
	m.Use(macaron.Renderer(macaron.RenderOptions{
 | 
			
		||||
		Directory:  path.Join(setting.StaticRootPath, "templates"),
 | 
			
		||||
		Funcs:      []template.FuncMap{base.TemplateFuncs},
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user