Commit Graph

8 Commits

Author SHA1 Message Date
3497cbaa6e Upload example config toml 2025-09-22 20:33:36 -04:00
129d67bc8b Don't use the same API key for other organizations we are pulling from
```EOF
For the organizations list, I am trying use my test instance, but getting the following in the logs;
```
2025-09-23T00:12:38.638052Z  INFO gitea_mirror: Fetching repositories from organization: https://gitea.hak8or.com/mirrors
2025-09-23T00:12:38.638081Z  INFO fetch_org_repos{org_url="https://gitea.hak8or.com/mirrors"}: gitea_mirror: Querying API endpoint: https://gitea.hak8or.com/api/v1/users/mirrors/repos
2025-09-23T00:12:38.653694Z ERROR gitea_mirror: Failed to fetch repos from https://gitea.hak8or.com/mirrors: HTTP status client error (401 Unauthorized) for url (https://gitea.hak8or.com/api/v1/users/mirrors/repos?page=1)
2025-09-23T00:12:38.653713Z  INFO gitea_mirror: Gitea mirror process completed.
```

I don't have a user with that key for the instance. Can you add the ability to provide an api key to each organization entry in the toml config? At the same time, is it possible to get a list of all repos from an organization without needing to use an api key? If so, when no api key is provided, can you use that?
```EOF
2025-09-22 20:29:14 -04:00
f732535db2 Re-create this with the canvas option in Gemini 2.5 Pro web chat
```EOF
Create a very minimal and simple tool written in rust which takes in a list of git URLs, and using the gitea api checks if the remote is already mirrored, and if not, then create a repo migration to gitea. I want to basically create a script which can be used to ensure a list of git repos are mirrord to a gitea server.

 The script should take in some command line arguments for;
  - an option to do a dry run, meaning do the check if the repo has to be mirrord, but do not initiate the actual migration
 - path to a TOML configuration file (also can be supplied via an ENV variable)

 The configuration file would have the following information;
   - an API key to be used when talking to the gitea instance we are migrating to
  - the url of the above gitea instance
  - a list of git URLs including an optional rename of the repo name
  - a list of URLs of another git server (gitea, if the API is the same then github, gitlab, etc) that includes the organization name or username. You would clone all repos under that organization/username. For example "https://github.com/hak8or" would be all repos owned by hak8or.

Example toml file;
```
gitea_url = "https://gitmirror.hak8or.com"

api_key = "api_key_goes_here"

repos = [
	{ url = "https://gitea.hak8or.com/hak8or/gitea_mirror.git" },
	{ rename = "cool_rename", url = "https://gitea.hak8or.com/hak8or/gitea_mirror.git" },
	{ rename = "cool_another_rename", url = "https://gitea.hak8or.com/hak8or/gitea_mirror.git" },
	{ rename = "rusty_rust", url = "https://github.com/rust-lang/rust.git" },
]
```

Ensure the script is as minimal as possible, do not use libraries if you can avoid them (except clap for CLI arguments, tracing for logging, actix for async and web interactions, reqwest for actual queries, and serde_json for json, or whatever else is commonly used in rust). I will be invoking this tool with a systemd timer.
```EOF
2025-09-22 20:28:35 -04:00
121387dbd2 Making mirrors be public by default (the heck Gemini ...)
All checks were successful
Cargo Build & Test / Rust project - latest (1.90) (push) Successful in 4m14s
v0.2
2025-09-21 20:07:53 -04:00
0292577ff8 Remove stupid icons ... (friggen LLMs pulling in web dev habits ...) 2025-09-21 20:07:33 -04:00
9e63a0e3a8 Allow a rename for the repo name when ingesting remote URLs
Some checks failed
Cargo Build & Test / Rust project - latest (1.90) (push) Failing after 13m35s
2025-09-21 19:53:24 -04:00
18801200d4 Use github actions CI to generate release binaries
All checks were successful
Cargo Build & Test / Rust project - latest (1.90) (push) Successful in 1m48s
v0.1
2025-09-19 19:22:34 -04:00
ed63a7496f Add initial. Generated with Claude 4.1 Opus as one-shot
Prompt;
```
Create a very minimal and simple tool written in rust which takes in a list of git URLs, and using the gitea api checks if the remote is mirrored, and if not, then create a repo migration to gitea. I want to basically create a script which can be used to ensure a list of git repos are mirrord to a gitea server.

The script should take in some command line arguments for;
 - an option to do a dry run, meaning do the check if the repo has to be mirrord, but do not initiate the actual migration
- path to a TOML configuration file (also can be supplied via an ENV variable)

The configuration file would have the following information;
 - a list of git URLs
 - an API key to be used with gitea
 - the gitea url

Ensure the script is as minimal as possible, do not use libraries if you can avoid them (except clap for CLI arguments, tracing for logging, actix for async and web interactions, reqwest for actual queries, and serde_json for json, or whatever else is common in rust). I will be invoking this tool with a systemd timer.
```
2025-09-19 19:13:57 -04:00