Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ninrod/emacs-antiproxy

:unlock: anti proxy/firewall setup using git repo mirrors of package archives. (local melpa)
https://github.com/ninrod/emacs-antiproxy

emacs firewall local melpa proxy

Last synced: 3 months ago
JSON representation

:unlock: anti proxy/firewall setup using git repo mirrors of package archives. (local melpa)

Awesome Lists containing this project

README

        

* Setting up emacs with a local MELPA

- =important note:= do check upfront if these procedures are ok within your company's security policies.
- This is very useful when you are behind a corporate firewall or a slow proxy or even in a situation where you have no internet connection and want to hack in emacs and want to tweak your configuration.

** option 1) @d12frosted elpa mirror
*** setup

1. git clone [[https://github.com/d12frosted/elpa-mirror][d12frosted' elpa mirror]] or just put the repo inside an usb stick and place the repo in the =~/.emacs.d/mirror-elpa= folder (use the `--depth 1` option to grab just the last commit):

#+BEGIN_SRC sh
$ git clone --depth 1 https://github.com/d12frosted/elpa-mirror.git
#+END_SRC

2. place the provided =init.el= file in =~/.emacs.d=.
3. use the timeless and infinitely powerful editor at will.

*** init.el
#+BEGIN_SRC emacs-lisp
(require 'package)

(setq package-enable-at-startup nil)
(setq package-archives '(("melpa" . "~/.emacs.d/mirror-elpa/melpa/")
("org" . "~/.emacs.d/mirror-elpa/org/")
("gnu" . "~/.emacs.d/mirror-elpa/gnu/")))
(package-initialize)

(unless (package-installed-p 'use-package) ; Bootstrap John Wigley's `use-package'
(package-refresh-contents)
(package-install 'use-package))

(use-package evil ; this will install evil mode even without an internet connection.
:ensure t
:config
(evil-mode))
#+END_SRC

*** advantages

- You now have unlimited access to all of [[http://melpa.org][melpa]], [[http://elpa.gnu.org][elpa]] and [[http://orgmode.org/][orgmode]] without having to send/receive a single network packet.
- this also means that instead of taking minutes do download your 100+ packages, it now takes nanoseconds.

*** disadvantages

- You have to rely on @[[http://github.com/d12frosted][d12frosted]] to manually update the whole mirror. But he does a very good job at it.

** option 2) Redguardtoo's elpa-mirror
*** setup
1. generate your thin-mirror out of your ~/.emacs.d/elpa folder using [[https://github.com/redguardtoo/][@redguartoo's]] [[https://github.com/redguardtoo/elpa-mirror][elpa-mirror]] =elpamr-create-mirror-for-installed= command.
2. move this thin generated mirror to =~/.emacs.d/thin-elpa-mirror/=
*** init.el

#+BEGIN_SRC emacs-lisp
(require 'package)
(setq package-enable-at-startup nil)
(setq package-archives '(("melpa" . "~/.emacs.d/thin-elpa-mirror/")))
(package-initialize)

(unless (package-installed-p 'use-package) ; Bootstrap John Wigley's `use-package'
(package-refresh-contents)
(package-install 'use-package))

(use-package evil ; this will install evil mode even without an internet connection.
:ensure t
:config
(evil-mode))
#+END_SRC

*** advantages

- The advantage is that you don't have to wait for @[[http://github.com/d12frosted][d12frosted]] to update his mirror.

*** disadvantage

- The disadvantage is that you are confined to the packages that you use, e.g., you can't try out new packages.

* LICENSE

copyright (C) 2016-2021 - Filipe Correa Lima da Silva
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3
or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
A copy of the license is included in the section entitled "GNU
Free Documentation License".

[[https://www.gnu.org/licenses/fdl.html#addendum][GNU Free Documentation License - 1.3]]