Skip to content

ehsannarmani/gradle-mirror-cloudflare-worker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gradle Mirror By Cloudflare Workers

This mirror developed to download gradle dependencies without network interference and sanctions

Usage:

Simply add the mirror url as a maven repository in the settings.gradle file and re-sync project:

pluginManagement {
    repositories {
        maven("https://en-mirror.ir")
    }
}
dependencyResolutionManagement {
    ...
    repositories {
        maven("https://en-mirror.ir")
    }
}

Note

Clone of mirror is launched at en-mirror.ir and ready to use. this mirror contains google,central and jitpack mavens.

Repository Filtering

By default, all repositories are mirrored. To mirror only a specific repository, include its key in the mirror URL, like this:

maven("https://en-mirror.ir/jitpack")

Worker Setup:

  • CLI Setup:
    • Ensure you have Node.js installed on your system, then install the Wrangler CLI:
      • npm install -g wrangler
    • Login to your cloudflare account using: wrangler login
    • Deploy the worker using: wrangler deploy
  • Bash Setup:
    • Ensure you have Node.js installed on your system
    • Execute the bash script:
    • bash <(curl -fsSL https://raw.githubusercontent.com/ehsannarmani/gradle-mirror-cloudflare-worker/master/setup.sh)
    • Note: if you are in Windows os, you can execute the bash script like this:
    • bash -c "bash <(curl -fsSL https://raw.githubusercontent.com/ehsannarmani/gradle-mirror-cloudflare-worker/master/setup.sh)"

Now, your worker is ready to use and the mirror url is your worker url in this pattern: https://[worker-name].[cloudflare-username].workers.dev/

Custom Domain:

  • Set up your domain in Cloudflare, configure the DNS servers on the domain, and wait until the domain becomes active
  • After your domain becomes active, click on websites tab and select your domain
  • Click on DNS tab and add new CNAME record, set content to your worker domain: [worker-name].[cloudflare-username].workers.dev
  • Keep proxied checked
  • Click on Worker Routes tab and add route
  • If you want to mirror your root domain, enter the route like this: your-domain.com/*
  • Select the created worker and click on save.

Now your custom domain should be connected to worker, and you can use your own mirror!


Note

You can set up mirror without using cloudflare with PHP Back-End, see.

About

A mirror that has been developed to download gradle dependencies without network interference and sanctions

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published