gitea/cmd
Kemal Zebari 0606284fcf
Add --skip-db option to dump command (#30613)
Attempts to resolve #28720.

---

Note that I am not a Gitea administrator so I don't normally use the
gitea CLI. Just saw this issue and wanted an opportunity to understand
how this subcommand works and see if I can add this feature :^)

I tested both with `--skip-db` and without and it appears to not add any
database-specific files to the generated archive i.e. I don't see a
`gitea-db.sql` or `gitea.db` file:
```console
$ TAGS="bindata sqlite sqlite_unlock_notify" make backend
Running go generate...
bindata for migration already up-to-date
bindata for options already up-to-date
bindata for public already up-to-date
bindata for templates already up-to-date
$ ./gitea dump --skip-db
2024/04/20 01:16:11 ...s/setting/session.go:77:loadSessionFrom() [I] Session Service Enabled
2024/04/20 01:16:11 ...s/storage/storage.go:176:initAttachments() [I] Initialising Attachment storage with type: local
2024/04/20 01:16:11 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /workspaces/gitea/data/attachments
2024/04/20 01:16:11 ...s/storage/storage.go:166:initAvatars() [I] Initialising Avatar storage with type: local
2024/04/20 01:16:11 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /workspaces/gitea/data/avatars
2024/04/20 01:16:11 ...s/storage/storage.go:192:initRepoAvatars() [I] Initialising Repository Avatar storage with type: local
2024/04/20 01:16:11 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /workspaces/gitea/data/repo-avatars
2024/04/20 01:16:11 ...s/storage/storage.go:186:initLFS() [I] Initialising LFS storage with type: local
2024/04/20 01:16:11 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /workspaces/gitea/data/lfs
2024/04/20 01:16:11 ...s/storage/storage.go:198:initRepoArchives() [I] Initialising Repository Archive storage with type: local
2024/04/20 01:16:11 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /workspaces/gitea/data/repo-archive
2024/04/20 01:16:11 ...s/storage/storage.go:208:initPackages() [I] Initialising Packages storage with type: local
2024/04/20 01:16:11 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /workspaces/gitea/data/packages
2024/04/20 01:16:11 ...s/storage/storage.go:219:initActions() [I] Initialising Actions storage with type: local
2024/04/20 01:16:11 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /workspaces/gitea/data/actions_log
2024/04/20 01:16:11 ...s/storage/storage.go:223:initActions() [I] Initialising ActionsArtifacts storage with type: local
2024/04/20 01:16:11 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /workspaces/gitea/data/actions_artifacts
2024/04/20 01:16:11 cmd/dump.go:172:runDump() [I] Dumping local repositories... /workspaces/gitea/data/gitea-repositories
2024/04/20 01:16:11 cmd/dump.go:195:runDump() [I] Skipping database
2024/04/20 01:16:11 cmd/dump.go:229:runDump() [I] Adding custom configuration file from /workspaces/gitea/custom/conf/app.ini
2024/04/20 01:16:11 cmd/dump.go:256:runDump() [I] Packing data directory.../workspaces/gitea/data
2024/04/20 01:16:11 cmd/dump.go:335:runDump() [I] Finish dumping in file /workspaces/gitea/gitea-dump-1713575771.zip
$ unzip /workspaces/gitea/gitea-dump-1713575771.zip -d example
Archive:  /workspaces/gitea/gitea-dump-1713575771.zip
. . .
$ ls example/
app.ini  custom  data  repos
$ ls example/data/
actions_artifacts  actions_log  avatars  home  indexers  jwt  queues  repo-archive  repo-avatars  tmp
```

Co-authored-by: Giteabot <teabot@gitea.io>
2024-04-21 23:32:12 +02:00
..
actions.go Return responseText instead of string in some functions (#28836) 2024-01-19 10:45:23 +08:00
admin_auth_ldap_test.go Penultimate round of db.DefaultContext refactor (#27414) 2023-10-11 04:24:07 +00:00
admin_auth_ldap.go Penultimate round of db.DefaultContext refactor (#27414) 2023-10-11 04:24:07 +00:00
admin_auth_oauth.go chore: use errors.New to replace fmt.Errorf with no parameters will much better (#30621) 2024-04-21 19:44:03 +00:00
admin_auth_stmp.go chore: use errors.New to replace fmt.Errorf with no parameters will much better (#30621) 2024-04-21 19:44:03 +00:00
admin_auth.go chore: use errors.New to replace fmt.Errorf with no parameters will much better (#30621) 2024-04-21 19:44:03 +00:00
admin_regenerate.go Move some asymkey functions to service layer (#28894) 2024-03-04 08:57:39 +00:00
admin_user_change_password.go Improve "must-change-password" logic and document (#30472) 2024-04-14 17:22:14 +00:00
admin_user_create.go Improve "must-change-password" logic and document (#30472) 2024-04-14 17:22:14 +00:00
admin_user_delete.go chore: use errors.New to replace fmt.Errorf with no parameters will much better (#30621) 2024-04-21 19:44:03 +00:00
admin_user_generate_access_token.go chore: use errors.New to replace fmt.Errorf with no parameters will much better (#30621) 2024-04-21 19:44:03 +00:00
admin_user_list.go Reduce usage of db.DefaultContext (#27073) 2023-09-14 17:09:32 +00:00
admin_user_must_change_password.go Refactor to use urfave/cli/v2 (#25959) 2023-07-21 17:28:19 +08:00
admin_user.go Refactor to use urfave/cli/v2 (#25959) 2023-07-21 17:28:19 +08:00
admin.go Simplify how git repositories are opened (#28937) 2024-01-27 21:09:51 +01:00
cert.go Expanded minimum RSA Keylength to 3072 (#26604) 2023-08-28 00:53:16 +00:00
cmd.go Refactor to use urfave/cli/v2 (#25959) 2023-07-21 17:28:19 +08:00
docs.go Refactor to use urfave/cli/v2 (#25959) 2023-07-21 17:28:19 +08:00
doctor_convert.go Recommend/convert to use case-sensitive collation for MySQL/MSSQL (#28662) 2024-01-10 11:03:23 +00:00
doctor_test.go Move doctor package from modules to services (#28856) 2024-01-20 10:07:31 +08:00
doctor.go Move doctor package from modules to services (#28856) 2024-01-20 10:07:31 +08:00
dump_repo.go Refactor to use urfave/cli/v2 (#25959) 2023-07-21 17:28:19 +08:00
dump.go Add --skip-db option to dump command (#30613) 2024-04-21 23:32:12 +02:00
embedded.go chore: use errors.New to replace fmt.Errorf with no parameters will much better (#30621) 2024-04-21 19:44:03 +00:00
generate.go Refactor JWT secret generating & decoding code (#29172) 2024-02-16 15:18:30 +00:00
hook_test.go Refactor internal API for git commands, use meaningful messages instead of "Internal Server Error" (#23687) 2023-03-29 14:32:26 +08:00
hook.go Performance optimization for git push (#30104) 2024-04-09 03:43:17 +00:00
keys.go Refactor cmd setup and remove deadcode (#29313) 2024-02-22 07:04:30 +00:00
mailer.go Return responseText instead of string in some functions (#28836) 2024-01-19 10:45:23 +08:00
main_test.go make writing main test easier (#27270) 2023-09-28 01:38:53 +00:00
main.go Improve CLI code and descriptions (#28482) 2023-12-15 15:49:01 +00:00
manager_logging.go chore: use errors.New to replace fmt.Errorf with no parameters will much better (#30621) 2024-04-21 19:44:03 +00:00
manager.go Refactor to use urfave/cli/v2 (#25959) 2023-07-21 17:28:19 +08:00
migrate_storage_test.go Another round of db.DefaultContext refactor (#27103) 2023-09-25 13:17:37 +00:00
migrate_storage.go Fix migrate storage bug (#28830) 2024-01-20 23:27:31 +08:00
migrate.go Refactor to use urfave/cli/v2 (#25959) 2023-07-21 17:28:19 +08:00
restore_repo.go Refactor to use urfave/cli/v2 (#25959) 2023-07-21 17:28:19 +08:00
serv.go Refactor cmd setup and remove deadcode (#29313) 2024-02-22 07:04:30 +00:00
web_acme.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
web_graceful.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
web_https.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
web.go Clean up log messages (#30313) 2024-04-07 19:17:06 +08:00