• Stars
    star
    106
  • Rank 314,481 (Top 7 %)
  • Language
    Go
  • License
    GNU Affero Genera...
  • Created over 1 year ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Simple tool to back up all repos on a GitHub/Gitea account to a local folder.

Octarchive

Logo

Simple tool to back up all repos on a GitHub/Gitea account to a local folder.

hydrun CI Docker CI Go Version Go Reference Matrix Binary Downloads

Overview

Octarchive is a simple backup utility that clones all repos from a GitHub/Gitea account to a local folder for storage.

It enables you too ...

  • Backup your work: In case your GitHub account is breached or gets banned, Octarchive ensures you always have a local copy available.
  • Mirror your account: If your internet connection is slow or GitHub is banned in your jurisdiction, you can use Octarchive and a web server to mirror your repos.
  • Automate processes: By exposing all of your repos to the filesystem, otherwise tedious processes such as bumping copyright dates or updating names become easy.

Installation

Containerized

You can get the OCI image like so:

$ podman pull ghcr.io/pojntfx/octarchive

Natively

Static binaries are available on GitHub releases.

On Linux, you can install them like so:

$ curl -L -o /tmp/octarchive "https://github.com/pojntfx/octarchive/releases/latest/download/octarchive.linux-$(uname -m)"
$ sudo install /tmp/octarchive /usr/local/bin

On macOS, you can use the following:

$ curl -L -o /tmp/octarchive "https://github.com/pojntfx/octarchive/releases/latest/download/octarchive.darwin-$(uname -m)"
$ sudo install /tmp/octarchive /usr/local/bin

On Windows, the following should work (using PowerShell as administrator):

PS> Invoke-WebRequest https://github.com/pojntfx/octarchive/releases/latest/download/octarchive.windows-x86_64.exe -OutFile \Windows\System32\octarchive.exe

You can find binaries for more operating systems and architectures on GitHub releases.

Usage

1. Do a manual backup with octarchive

First, export your GitHub (or Gitea) API token like so:

$ export GITHUB_TOKEN='mygithubtoken'

If you're using Gitea, also export your API endpoint like so:

$ export GITHUB_API='https://try.gitea.io/api/'

Now, start the manual backup, including all the repos of the organizations that you're part of:

$ octarchive --orgs
{"level":"info","time":"2022-08-15T00:25:39+02:00","message":"Getting user"}
{"level":"info","time":"2022-08-15T00:25:40+02:00","message":"Getting organizations for user"}
# ...
Cloning   6% [========>                                                                                                                                                           ] (16/263, 7 repo/s) [1s:32s]{"level":"info","cloneURL":"https://github.com/pojntfx/dwm.git","filePath":"/home/pojntfx/.local/share/octarchive/var/lib/octarchive/data/1660518181/pojntfx/dwm","time":"2022-08-15T01:03:09+02:00","message":"Cloning repo"}
# ...

You should now find the repos in ${HOME}/.local/share/octarchive/var/lib/octarchive/data.

For more information, see the reference.

2. Schedule backups with systemd Timers

In most cases, you'll want to schedule backups periodically; an excellent way to do so is to use systemd Timers. To schedule a weekly backup of all of your repos, run the following:

$ sudo tee /etc/systemd/system/octarchive.service<<'EOT'
[Unit]
Description=Octarchive backup

[Service]
Type=oneshot
ExecStart=/usr/local/bin/octarchive --orgs
Environment="HOME=/root"
Environment="GITHUB_TOKEN=mygithubtoken"

[Install]
WantedBy=multi-user.target
EOT
$ sudo tee /etc/systemd/system/octarchive.timer<<'EOT'
[Unit]
Description=Run Octarchive weekly

[Timer]
OnCalendar=weekly
Persistent=true

[Install]
WantedBy=timers.target
EOT
$ sudo systemctl daemon-reload
$ sudo systemctl enable octarchive.timer --now

Note that this will create a fresh directory every time you run the backup, which might fill up your disk space quite quickly; if you want to instead remove the old backup every time you do a new one, append --timestamp current to the ExecStart line of the service.

You should find the repos in /root/.local/share/octarchive/var/lib/octarchive/data.

For more information, see the reference.

🚀 That's it! We hope you enjoy using Octarchive.

Reference

Command Line Arguments

$ octarchive --help
Usage of octarchive:
  -api string
        GitHub/Gitea API endpoint to use (can also be set using the GITHUB_API env variable) (default "https://api.github.com/")
  -concurrency int
        Maximum amount of repositories to clone concurrently (default 20)
  -dst string
        Base directory to clone repos into (default "/home/pojntfx/.local/share/octarchive/var/lib/octarchive/data")
  -fresh
        Clear timestamp directory before starting to clone
  -orgs
        Also clone repos of all orgs that the user is part of
  -timestamp string
        Timestamp to use as the directory for this clone session (default "1660513831")
  -token string
        GitHub/Gitea API access token (can also be set using the GITHUB_TOKEN env variable)
  -verbose int
        Verbosity level (0 is disabled, default is info, 7 is trace) (default 5)

Environment Variables

You can set the following environment variables, which correspond to the values that can be set using the following flags:

Environment Variable Flag
GITHUB_API --api
GITHUB_TOKEN --token

Acknowledgements

Contributing

To contribute, please use the GitHub flow and follow our Code of Conduct.

To build and start a development version of Octarchive locally, run the following:

$ git clone https://github.com/pojntfx/octarchive.git
$ cd octarchive
$ make depend
$ make && sudo make install
$ export GITHUB_TOKEN='mygithubtoken'
$ octarchive

Have any questions or need help? Chat with us on Matrix!

License

Octarchive (c) 2023 Felicitas Pojtinger and contributors

SPDX-License-Identifier: AGPL-3.0

More Repositories

1

weron

Overlay networks based on WebRTC.
Go
1,375
star
2

go-nbd

Pure Go NBD server and client library.
Go
326
star
3

multiplex

Watch torrents with your friends.
Go
205
star
4

bofied

Modern network boot server.
Go
162
star
5

liwasc

List, wake and scan nodes in a network.
Go
157
star
6

keygaen

Sign, verify, encrypt and decrypt data with PGP in your browser.
Go
110
star
7

htorrent

HTTP to BitTorrent gateway with seeking support.
Go
110
star
8

ram-dl

A tool to download more RAM (yes, seriously!)
Go
86
star
9

gon2n

Go bindings, management daemons and CLIs for n2n edges and supernodes.
Go
76
star
10

pojde

Develop from any device with a browser.
Shell
64
star
11

r3map

High-performance remote memory region mounts and migrations in user space.
Go
64
star
12

tinynet

A `net` implementation for Go and TinyGo based on unisockets, targeting both WebAssembly and native platforms.
Go
47
star
13

hydrapp

Build fast apps that run everywhere with Go and a browser engine of your choice.
Go
38
star
14

stfs

Simple Tape File System (STFS), a file system for tapes and tar files.
Go
34
star
15

unisockets

A universal Berkeley sockets implementation for both WebAssembly (based on WebRTC) and native platforms with bindings for C, Go and TinyGo.
TypeScript
34
star
16

alpimager

Build custom Alpine Linux images with Docker.
Go
29
star
17

panrpc

Language-, transport- and serialization-agnostic RPC framework with remote closure support that allows exposing and calling functions on both clients and servers.
TypeScript
26
star
18

nextcloud-talk-bot-framework

A framework for writing Nextcloud Talk chatbots with every language that supports gRPC.
Go
24
star
19

html2goapp

CLI and web app to convert HTML markup to go-app.dev's syntax.
Go
18
star
20

webnetes

Peer-to-Peer Computing Platform for the Browser and Node.
TypeScript
17
star
21

skysweeper

Automatically delete your old skeets from Bluesky.
TypeScript
16
star
22

networked-linux-memsync

Efficient Synchronization of Linux Memory Regions over a Network: A Comparative Study and Implementation (Bachelor's Thesis)
Jupyter Notebook
14
star
23

nextcloud-talk-bot-jitsi

A bot for Nextcloud Talk that creates Jitsi meetings.
JavaScript
14
star
24

hydrun

Execute a command for the current directory on multiple architectures and operating systems.
Go
10
star
25

felicitas.pojtinger.com

My personal site.
HTML
9
star
26

connmapper

Visualize your system's internet connections on a globe.
TypeScript
9
star
27

uni-itsec-notes

Notes for the IT security course at HdM Stuttgart.
Makefile
9
star
28

xeus-cling-binaries

Weekly builds of https://github.com/jupyter-xeus/xeus-cling.
Shell
9
star
29

uni-bwl-notes

Notes for the Planung und Kalkulation von IT-Projekten (econ 101) course at HdM Stuttgart.
Makefile
9
star
30

tapisk

Expose a tape drive as a block device.
Go
8
star
31

deliverance

Universal document publishing system.
Makefile
8
star
32

goit

Get a OIDC token from your terminal.
Go
8
star
33

growlapse

Visualize plant growth over time with Go, WebDAV and WASM; @pojntfx's entry for #growlab.
Go
8
star
34

invaentory

Quickly find all IPv6 and IPv4 hosts in a LAN.
Go
7
star
35

bagop

Build for all Go-supported platforms by default, disable those which you don't want.
Go
7
star
36

rpiplay-binaries

Weekly builds of https://github.com/FD-/RPiPlay.
Shell
6
star
37

webpipe

Share files, sockets, pipes and char devices over WebRTC.
Go
6
star
38

uni-appsecurity-notes

Notes for the Anwendungssicherheit (app security) course at HdM Stuttgart.
6
star
39

webnetesctl

Frontend for webnetes, the peer-to-peer computing platform for the browser and node.
TypeScript
6
star
40

adwaita-gtk-ubuntu

A modern Ambiance replacement that keeps Ubuntu's identity while staying upstream.
CSS
6
star
41

ipxe-binaries

Weekly builds of https://ipxe.org/, with an embedded script that chainloads /config.ipxe.
Shell
5
star
42

grpc-examples

gRPC example microservices in Go, Rust, C#, Python and JavaScript.
JavaScript
5
star
43

cadmium-builds

Weekly builds of https://github.com/Maccraft123/Cadmium.
Shell
5
star
44

uni-db1-notes

Personal notes for the DB1 course at HdM Stuttgart.
Makefile
5
star
45

consumat.io

Track, plan and enjoy content.
5
star
46

go-app-grpc-chat-frontend-web

Web frontend for an example chat application using the `go-app` package and gRPC over WebSockets (like gRPC-Web).
Go
5
star
47

appl-alg-interpreter-binaries

Weekly builds and source mirror for Prof. Dr. Fridtjof Toenniessen's ApplAlgInterpreter.
Java
5
star
48

the-commitment

A contract requiring you to do one daily public OSS contribution, while allowing time for rest.
5
star
49

learn-chinese-platform

A modern and libre way to learn Chinese.
TypeScript
4
star
50

uni-algodat-notes

Personal notes and snippets for the Algorithms and Data Structures course at HdM Stuttgart.
Go
4
star
51

box

Setup for my personal (pet) server.
Makefile
4
star
52

uni-distributedsystems-notes

Notes for the distributed systems course at HdM Stuttgart.
4
star
53

go-isc-dhcp

Management daemons and CLIs for the ISC DHCP server and client.
Go
4
star
54

donna

Minimal personal CRM.
Go
3
star
55

atmosfeed

Create fully custom Bluesky feeds with Wasm modules, powered by Scale Functions.
TypeScript
3
star
56

keystoregaen

Generate Java keystores in your browser.
Go
3
star
57

saltpanelo

Fast, smart and secure service mesh.
Go
3
star
58

image-builder

A tool to build KubeVirt disk images. Based on @Tedezed's implementation.
Shell
3
star
59

minitel

Instructions on how to use a Minitel as a Linux terminal.
3
star
60

nebulark

Distribute your workload to the edge.
JavaScript
3
star
61

ppc32-builds

CI/CD build configurations to get binaries for projects on 32-Bit PowerPC (ppc32) machines.
Shell
2
star
62

uni-se1-notes

Assignments for the SE1 course of HDM Stuttgart, as Jupyter notebooks.
Jupyter Notebook
2
star
63

adwaita-gtk-ubuntu-legacy

To test out whether it may be a better idea to use Adwaita instead of Ambiance in LTS if Communitheme won't be done in time.
SCSS
2
star
64

SwiftUIMenuBar

A menu bar app for macOS built with SwiftUI.
Swift
2
star
65

gon2n-frontend

React frontend for @pojntfx/gon2n.
TypeScript
2
star
66

xeus-sql-binaries

Weekly builds of https://github.com/jupyter-xeus/xeus-sql.
Shell
2
star
67

glode

Compute, Network and Storage Node based on WASM, libp2p and IPFS.
TypeScript
2
star
68

bagccgop

Build for all gccgo-supported platforms by default, disable those which you don't want (bagop with CGo support).
Go
2
star
69

weron-archive

Overlay networks based on WebRTC.
Go
2
star
70

consumat.io-api

API spec for https://github.com/alphahorizonio/consumat.io.
2
star
71

gnome-shell-extension-sticky-app

A GNOME shell extension to toggle an app's visibility.
JavaScript
2
star
72

birdid

Bird + Cupid: Find the first interaction between two Twitter users
Go
2
star
73

go-cuse

CUSE bindings for Go.
Go
2
star
74

uni-webdev-backend-notes

Notes for the webdev backend course at HdM Stuttgart.
2
star
75

uni-netpractice-notes

Notes for the Praktikum Rechnernetze (networking practice) course at HdM Stuttgart.
2
star
76

mepi

Middle Earth Property Insurance, a uni project of @jakwai01, @dentremor, @lucas-goldner and @pojntfx for HdM Stuttgart.
2
star
77

consumat.io-frontend

Frontend for https://github.com/alphahorizonio/consumat.io.
TypeScript
2
star
78

jitsi-meet-node-client

A NodeJS client for Jitsi Meet.
JavaScript
2
star
79

ports2packets

Generates a CSV file with the packets that are to be sent in order to check if a UDP port is open.
Go
2
star
80

papilio

CLI and web app to configure the Terminus FE and SL series of USB Hubs.
Go
2
star
81

mosalink-archive

Archive of research from 2017 on AX.25 mesh networks with batman-adv and eoax.
1
star
82

skytheon

Cross-post between Bluesky, Mastodon and Twitter in all directions with ease.
Go
1
star
83

pojde-rs

Experimental Rust implementation of https://github.com/pojntfx/pojde.
Rust
1
star
84

go-auth-utils

Simple auth utilities for Go to secure web APIs with.
Go
1
star
85

webwormhole-binaries

Weekly builds of https://github.com/saljam/webwormhole.
Shell
1
star
86

clusterplatform

The Lean Distributed Cloud Computing System.
JavaScript
1
star
87

gopojde

Experimental Go implementation of https://github.com/pojntfx/pojde.
Go
1
star
88

tftpdd

TFTP server daemon.
Go
1
star
89

go-app-experiments

Experiments with the `go-app` package
Go
1
star
90

uni-hacking-notes

Notes for the hacking (IT-Sicherheit: Angriff & Verteidigung) course at HdM Stuttgart.
1
star
91

csv2go

Generates Go code containing a multi-dimensional array with the contents of a CSV file.
Go
1
star
92

ruby-packer-binaries

Weekly builds of https://github.com/metanorma/ruby-packer.
Shell
1
star
93

connaections

The TCP and UDP connections of a node, as an API. See https://github.com/pojntfx/connaections-frontend-web/ for a web frontend.
Go
1
star
94

jmather

A grpc-java example project for teaching GitHub Flow to the SE1 course at HdM Stuttgart University.
Java
1
star
95

simple-direct-democracy-backend

Fast and minimal backend for a simple direct democracy's suggestion and voting system.
JavaScript
1
star
96

ipxebuilderd

Build daemon and CLI for iPXE.
Go
1
star
97

uni-supply-chain-paper

A paper on supply chain security in software development for Uni.
1
star
98

documatio

In goes Markdown, out come indexed HTML and PDF slides and documents.
Shell
1
star
99

transcommunal-confederation

Flags etc. of the Transcommunal Confederation and it's communes.
1
star
100

uni-webtopics-notes

Notes for the Spezielle Themen fĂźr Web-Anwendungen (special topics for web applications) course at HdM Stuttgart.
1
star