Skip to content

Commit 67367db

Browse files
authored
Added GitSave (#137)
1 parent 14f92d0 commit 67367db

File tree

5 files changed

+125
-14
lines changed

5 files changed

+125
-14
lines changed

README.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ If you would like to add your own config, you can use the [service-template](tem
9090
| 🗂️ **Copyparty** | A self-hosted file server with accelerated resumable uploads. | [Details](services/copyparty) |
9191
| 💸 **Wallos** | An open-source, self-hostable web app to track and manage your recurring subscriptions and expenses, with multi-currency support, customizable categories, and statistics. | [Details](services/wallos) |
9292
| 🧑‍🧑‍🧒‍🧒 **Gramps Web** | A web-based genealogy platform for collaborative family tree browsing, editing, AI-powered chat, media tagging, mapping, charts, search, and reporting. | [Details](services/grampsweb) |
93-
| **Subtrackr** | A self-hosted web app to track subscriptions, renewal dates, costs, and payment methods. | [Details](services/subtrackr) |
93+
| **Subtrackr** | A self-hosted web app to track subscriptions, renewal dates, costs, and payment methods. | [Details](services/subtrackr) |
9494

9595
### 📊 Dashboards and Visualization
9696

@@ -101,19 +101,20 @@ If you would like to add your own config, you can use the [service-template](tem
101101

102102
### 🛠️ Development Tools
103103

104-
| 🛠️ Service | 📝 Description | 🔗 Link |
105-
| ------------------------ | ---------------------------------------------------------------------------------------- | ----------------------------------- |
106-
| 🔧 **Cyberchef** | A web app for encryption, encoding, compression, and data analysis. | [Details](services/cyberchef) |
107-
| 🔍 **searXNG** | A free internet metasearch engine which aggregates results from various search services. | [Details](services/searxng) |
108-
| 🖥️ **Node-RED** | A flow-based development tool for visual programming. | [Details](services/nodered) |
109-
| 🖥️ **IT-Tools** | A collection of handy online tools for developers and sysadmins. | [Details](services/it-tools) |
110-
| 🖥️ **Dozzle** | A real-time log viewer for Docker containers. | [Details](services/dozzle) |
111-
| 🖥️ **Portainer** | A lightweight management UI which allows you to easily manage your Docker environments. | [Details](services/portainer) |
112-
| 🖥️ **Gokapi** | A lightweight self-hosted file sharing platform. | [Details](services/gokapi) |
113-
| 🖥️ **Homarr** | A sleek dashboard for all your Homelab services. | [Details](services/homarr) |
114-
| 🖥️ **Changedetection.io** | A tool for monitoring website changes. | [Details](services/changedetection) |
115-
| 🛠️ **Coder** | Self-hosted cloud dev environments with browser IDEs, Terraform-managed workspaces. | [Details](services/coder) |
116-
| 🔁 **FossFLOW** | A self-hosted tool to make beautiful isometric infrastructure diagrams. | [Details](services/fossflow) |
104+
| 🛠️ Service | 📝 Description | 🔗 Link |
105+
| ------------------------ | --------------------------------------------------------------------------------------------------- | ----------------------------------- |
106+
| 🔧 **Cyberchef** | A web app for encryption, encoding, compression, and data analysis. | [Details](services/cyberchef) |
107+
| 🔍 **searXNG** | A free internet metasearch engine which aggregates results from various search services. | [Details](services/searxng) |
108+
| 🖥️ **Node-RED** | A flow-based development tool for visual programming. | [Details](services/nodered) |
109+
| 🖥️ **IT-Tools** | A collection of handy online tools for developers and sysadmins. | [Details](services/it-tools) |
110+
| 🖥️ **Dozzle** | A real-time log viewer for Docker containers. | [Details](services/dozzle) |
111+
| 🖥️ **Portainer** | A lightweight management UI which allows you to easily manage your Docker environments. | [Details](services/portainer) |
112+
| 🖥️ **Gokapi** | A lightweight self-hosted file sharing platform. | [Details](services/gokapi) |
113+
| 🖥️ **Homarr** | A sleek dashboard for all your Homelab services. | [Details](services/homarr) |
114+
| 🖥️ **Changedetection.io** | A tool for monitoring website changes. | [Details](services/changedetection) |
115+
| 🛠️ **Coder** | Self-hosted cloud dev environments with browser IDEs, Terraform-managed workspaces. | [Details](services/coder) |
116+
| 🔁 **FossFLOW** | A self-hosted tool to make beautiful isometric infrastructure diagrams. | [Details](services/fossflow) |
117+
| **GitSave** | A self-hosted service to back up your GitHub repositories via a simple REST API and scheduled runs. | [Details](services/gitsave) |
117118

118119
### 📈 Monitoring and Analytics
119120

services/gitsave/.env

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#version=1.0
2+
#url=https://github.com/2Tiny2Scale/tailscale-docker-sidecar-configs
3+
#COMPOSE_PROJECT_NAME= // only use in multiple deployments on the same infra
4+
SERVICE=gitsave
5+
IMAGE_URL=timwitzdam/gitsave
6+
SERVICEPORT=3000
7+
TS_AUTHKEY=
8+
DNS_SERVER=9.9.9.9
9+
10+
# You can generate a JWT_SECRET here: https://jwtsecrets.com/#generator
11+
JWT_SECRET="REPLACE_THIS"
12+
DISABLE_AUTH=false
13+
ENCRYPTION_SECRET="REPLACE_THIS_WITH_32_CHARACTERS_SECRET"

services/gitsave/README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# GitSave with Tailscale Sidecar Configuration
2+
3+
This Docker Compose configuration sets up [**GitSave**](https://github.com/TimWitzdam/GitSave) with Tailscale as a sidecar container, enabling secure access to your self-hosted GitHub repository backup solution from anywhere on your private Tailscale network. With this setup, your GitSave instance remains fully private and accessible only from authorized devices.
4+
5+
## GitSave
6+
7+
[**GitSave**](https://github.com/TimWitzdam/GitSave) is a self-hosted tool for automatically backing up your GitHub repositories. It runs as a lightweight web service with a simple REST API and can be scheduled or triggered manually. Designed for developers, teams, and organizations who want to keep a secure copy of their code outside GitHub, GitSave ensures your projects remain safe and accessible under your own control.
8+
9+
## Key Features
10+
11+
* **Automated Backups** – Regularly back up all your GitHub repositories with minimal setup.
12+
* **REST API Interface** – Trigger backups or manage configurations programmatically.
13+
* **Simple Configuration** – Connect with your GitHub account via a personal access token.
14+
* **Dockerized Deployment** – Run in a containerized environment for easy setup and portability.
15+
* **Lightweight & Fast** – Written in Go for speed and efficiency with minimal resource usage.
16+
* **Self-Hosted & Secure** – Maintain full control of your backup data on your own infrastructure.
17+
18+
## Configuration Overview
19+
20+
In this deployment, the `tailscale-gitsave` service runs the Tailscale client to establish a secure private network. The `gitsave` container uses `network_mode: service:tailscale-gitsave` to route all traffic through the Tailscale interface. This ensures that your GitHub backup service and its API endpoints are only accessible via Tailscale, preventing public exposure.

services/gitsave/config/serve.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"TCP": {
3+
"443": {
4+
"HTTPS": true
5+
}
6+
},
7+
"Web": {
8+
"${TS_CERT_DOMAIN}:443": {
9+
"Handlers": {
10+
"/": {
11+
"Proxy": "http://127.0.0.1:3000"
12+
}
13+
}
14+
}
15+
}
16+
}
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
services:
2+
# Make sure you have updated/checked the .env file with the correct variables.
3+
# All the ${ xx } need to be defined there.
4+
# Tailscale Sidecar Configuration
5+
tailscale:
6+
image: tailscale/tailscale:latest # Image to be used
7+
container_name: tailscale-${SERVICE} # Name for local container management
8+
hostname: ${SERVICE} # Name used within your Tailscale environment
9+
environment:
10+
- TS_AUTHKEY=${TS_AUTHKEY}
11+
- TS_STATE_DIR=/var/lib/tailscale
12+
- TS_SERVE_CONFIG=/config/serve.json # Tailsacale Serve configuration to expose the web interface on your local Tailnet - remove this line if not required
13+
- TS_USERSPACE=false
14+
- TS_ENABLE_HEALTH_CHECK=true # Enable healthcheck endpoint: "/healthz"
15+
- TS_LOCAL_ADDR_PORT=127.0.0.1:41234 # The <addr>:<port> for the healthz endpoint
16+
#- TS_ACCEPT_DNS=true # Uncomment when using MagicDNS
17+
volumes:
18+
- ${PWD}/config:/config # Config folder used to store Tailscale files - you may need to change the path
19+
- ${PWD}/ts/state:/var/lib/tailscale # Tailscale requirement - you may need to change the path
20+
devices:
21+
- /dev/net/tun:/dev/net/tun # Network configuration for Tailscale to work
22+
cap_add:
23+
- net_admin # Tailscale requirement
24+
#ports:
25+
# - 0.0.0.0:${SERVICEPORT}:${SERVICEPORT} # Binding port ${SERVICE}PORT to the local network - may be removed if only exposure to your Tailnet is required
26+
# If any DNS issues arise, use your preferred DNS provider by uncommenting the config below
27+
#dns:
28+
# - ${DNS_SERVER}
29+
healthcheck:
30+
test: ["CMD", "wget", "--spider", "-q", "http://127.0.0.1:41234/healthz"] # Check Tailscale has a Tailnet IP and is operational
31+
interval: 1m # How often to perform the check
32+
timeout: 10s # Time to wait for the check to succeed
33+
retries: 3 # Number of retries before marking as unhealthy
34+
start_period: 10s # Time to wait before starting health checks
35+
restart: always
36+
37+
# ${SERVICE}
38+
application:
39+
image: ${IMAGE_URL} # Image to be used
40+
network_mode: service:tailscale # Sidecar configuration to route ${SERVICE} through Tailscale
41+
container_name: app-${SERVICE} # Name for local container management
42+
environment:
43+
- PUID=1000
44+
- PGID=1000
45+
- TZ=Europe/Amsterdam
46+
- JWT_SECRET=${JWT_SECRET:?error}
47+
- DISABLE_AUTH=${DISABLE_AUTH:?error}
48+
- ENCRYPTION_SECRET=${ENCRYPTION_SECRET:?error}
49+
volumes:
50+
- ${PWD}/${SERVICE}-data/gitsave:/app/data
51+
- ${PWD}/${SERVICE}-data/backups:/app/backups
52+
depends_on:
53+
tailscale:
54+
condition: service_healthy
55+
healthcheck:
56+
test: ["CMD", "pgrep", "-f", "${SERVICE}"] # Check if ${SERVICE} process is running
57+
interval: 1m # How often to perform the check
58+
timeout: 10s # Time to wait for the check to succeed
59+
retries: 3 # Number of retries before marking as unhealthy
60+
start_period: 30s # Time to wait before starting health checks
61+
restart: always

0 commit comments

Comments
 (0)