aboutsummaryrefslogtreecommitdiffstats
path: root/src/github.rs
AgeCommit message (Collapse)Author
2022-06-04Update copyright yearTeddy Wing
2022-06-04github::Repo: Change `git_url` to `clone_url`Teddy Wing
I was getting errors mirroring and updating: failed to connect to github.com: Connection timed out; class=Os (2) and remote 'origin' already exists; class=Config (7); code=Exists(-4) It turns out that the `git_url` field, which I had been using previously to mirror and clone repositories, stopped working. My guess is that it's because Reflectub is not authorised to clone GitHub "git://" URLs, so the connection timed out. I'm not sure why this stopped being allowed, though. The URL change seems to have happened around March 2022, or at least between December 2021 and April 2022. The second error was caused by a previously-created repository existing in the filesystem, but not being in the database as it hadn't been correctly mirrored. For now, I've decided not to fix that problem and am only fixing the URL issue. The GitHub API also includes a `clone_url` field, which contains an HTTPS clone URL. Using this URL to mirror fixes the timeout problem.
2021-06-23update_mtime(): Set the mtime to the repo's `pushed_at` timeTeddy Wing
Use `pushed_at` instead of `updated_at`. This mtime is used to sort repositories on CGit's repository index page. Prevent things like GitHub stars from changing the sort order. The sort should instead be influenced by repository changes.
2021-06-12Switch from 'reqwest' to 'ureq'; Remove asyncTeddy Wing
Remove all async from the project by switching from 'reqwest' to 'ureq'. This should make the code simpler, and hopefully enable us to try out multithreading.
2021-06-07Add license (GNU GPLv3+)Teddy Wing
2021-06-06github::Repo: Remove TODOTeddy Wing
Don't see any reason to do this now.
2021-06-06Provide an option to skip repos larger than a given sizeTeddy Wing
Allows a maximum repo size to be given as a command line argument. Repos larger than this will not be mirrored. This gives us a way to save server space by avoiding gigantic repositories.
2021-05-30github::fetch_repos(): Request repos be sorted by updated timeTeddy Wing
2021-05-30github::fetch_repos(): Extract username to function argumentTeddy Wing
2021-05-30github::fetch_repos(): Add documentationTeddy Wing
2021-05-30github::fetch_repos(): Fetch all repos from all pagesTeddy Wing
Also switch from `reqwest::blocking` to async because I was getting this error, probably because I call `fetch_repos()` in the async 'tokio' function `main()`: thread 'main' panicked at 'Cannot drop a runtime in a context where blocking is not allowed. This happens when a runtime is dropped from within an asynchronous context.', $HOME/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.6.1/src/runtime/blocking/shutdown.rs:51:21
2021-05-30main::update(): Update repository description on fetch updateTeddy Wing
If the repository was updated, write the description into the `description` file. Add a `github::Repo.description()` method to get an empty string if the description is `None`. This facilitates writing to the `description` file.
2021-05-30Replace boxed errors with concrete error typesTeddy Wing
2021-05-30database: Add a way to get a single repoTeddy Wing
2021-05-29github::fetch_repos(): Remove `unwrap`sTeddy Wing
2021-05-29Move `Repo` to `github` moduleTeddy Wing
Makes more sense here rather than in its own module since it models GitHub's repository structure.
2021-05-29Split GitHub API request into separate filesTeddy Wing