Age | Commit message (Collapse) | Author |
|
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, was changed from an "https://" URL to
a "git://" URL. Since Reflectub is not authorised to clone any GitHub
"git://" URLs, the connection timed out.
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 the
HTTPS clone URL. This fixes the timeout problem.
|
|
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.
|
|
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.
|
|
|
|
Don't see any reason to do this now.
|
|
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.
|
|
|
|
|
|
|
|
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
|
|
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.
|
|
|
|
|
|
|
|
Makes more sense here rather than in its own module since it models
GitHub's repository structure.
|
|
|