Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Add bucket storage support #9567
This is a follow up PR for #7795, cherry-pick those commits and add:
will migrate from local to cloud storage, and:
will migrate back from cloud to local.
techknowlogick left a comment
Thank you for this PR
I've gone through and noticed a few items with import structures, and noted a few of them (there are others that I haven't noted, but should still also be resolved)
- Use the right public-host for fake-gcs-server - Running TestGit in separated command to prevent using all available ports of the container.
ContentStore.Verify always return non-nil error, which seems to be wrong behavior. In case error occured, we should return instead of masking it like current behavior.
GCS client calls are asynchronous, with large upload files, it causes the CI container run out of resources quickly.
We should not exit gitea if we can not create local file, just return the error to the caller instead.
This PR adds subcommand "storage-migrate" command to allow migration from local to cloud storage and vice versa. To migrate from local to cloud: gitea storage-migrate --bucket='s3://gitea?endpoint=localhost:9000&disableSSL=true&s3ForcePathStyle=true®ion=us-east-1' To migrate from cloud to local: gitea storage-migrate --local --bucket='s3://gitea?endpoint=localhost:9000&disableSSL=true&s3ForcePathStyle=true®ion=us-east-1' Absolute paths are not supported, since when storage.OpenBucket always assumes local path if the path is absolute.