Skip to content

d12frosted/mirror-elpa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sponsor

mirror-elpa

(To) Mirror Emacs Lisp package archives. Used to create and maintain mirrors under Git repository.

Available mirrors:

Note that currently only GitLab and GitHub are supported out of box as a remote for the mirror. Though you can use mirror-elpa to maintain local mirror or mirror on any other Git hosting. See Usage section for more information.

Prerequisites

The following software must be installed on your system:

  • Git
  • Emacs
  • rsync

Usage

In order to use mirror-elpa script, you need to prepare configuration file. You can do it manually or use configure script provided by this repository. Example of configuration file:

mirror_path="$XDG_CACHE_HOME/elpa-mirror"
mirror_host="github.com"
mirror_owner="d12frosted"
mirror_repo="elpa-mirror"
access_login="$ACCESS_LOGIN"
access_token="$ACCESS_TOKEN"
commit_name="Golem"
commit_email="golem@d12frosted.io"
elpa_clone_path="$XDG_CACHE_HOME/elpa-clone"

function git_config_hook {
  git config commit.gpgsign false
}

Some explanations:

  1. mirror_path is location of mirror repository on your disk.
  2. mirror_host, mirror_owner and mirror_repo used to build url to your remote mirror repository. Repository URL is build like this:
    mirror_url="https://${access_login}:${access_token}@${mirror_host}/${mirror_owner}/${mirror_repo}.git"
        
  3. access_login is user with access to repository.
  4. access_token is password/secret/token that is used for authentication. On GitHub and GitLab you can create access tokens and use them (which is recommended).
  5. commit_name and commit_email used as committer information.
  6. elpa_clone_path is location of elpa_clone script for Emacs.

The configuration wizard is not maintained, but you can give it a try, as it should help you with token creation.

./configure

Using with CRON

$ ./configure
$ make install

You can also specify how often to sync mirror when running make install (defaults to every 4 hours) and location to resulting configuration file (defaults to $XDG_CONFIG_HOME/mirror-elpa.sh:

$ make install SCHEDULE="0 0 * * *" CONFIG_FILE="~/mirror-elpa.sh"

SCHEDULE can be set to any valid CRON expression.

Credits

Support

If you enjoy this project, you can support its development via GitHub Sponsors or Patreon.

About

(To) mirror Emacs Lisp Package Archive(s)

Resources

License

Contributing

Stars

Watchers

Forks

Sponsor this project

  •  

Packages

 
 
 

Contributors