mirror of
https://github.com/ralscha/contactshare.git
synced 2026-10-09 08:18:22 +02:00
No description
- Go 96.4%
- Dockerfile 3.6%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .dockerignore | ||
| .env.example | ||
| .gitignore | ||
| .golangci.yml | ||
| Dockerfile | ||
| go.mod | ||
| go.sum | ||
| LICENSE | ||
| main.go | ||
| README.md | ||
| Taskfile.yml | ||
Contact Share
A simple web application to share your personal contact information via QR code and downloadable vCard.
Contact Information Supported
- Phone Number
- Bluesky Profile
- GitHub Profile
- Facebook Profile
Prerequisites
- Go 1.25 or higher
- A
.envfile with your personal information (see Setup below)
Setup
-
Clone the repository
git clone <your-repo-url> cd contactshare -
Copy the example environment file
cp .env.example .env -
Edit
.envwith your personal information# Required NAME="Your Name" # Optional - Add the ones you want to share EMAIL="your.email@example.com" PHONE="+1234567890" BLUESKY="https://bsky.app/profile/your.handle" GITHUB="https://github.com/yourusername" WHATSAPP="https://wa.me/1234567890" FACEBOOK="https://facebook.com/yourprofile" # Server configuration BASE_URL="https://info.base.com" PORT=8080 -
Install dependencies
go mod download -
Run the application
go run main.goThe server will start on
http://localhost:8080
Building for Production
go build -o contactshare main.go
./contactshare
Docker Deployment
-
Build the Docker image
docker build -t contactshare . -
Run the container
docker run -d -p 8080:8080 --env-file .env contactshareOr with environment variables:
docker run -d -p 8080:8080 \ -e NAME="Your Name" \ -e EMAIL="your@email.com" \ -e BASE_URL="https://info.base.com" \ contactshare
Endpoints
GET /- Main contact information pageGET /qr- QR code image (PNG) pointing to your BASE_URLGET /contact.vcf- Download vCard fileGET /health- Health check endpoint (returns JSON status)GET /favicon.ico- Favicon (1x1 transparent PNG)
Environment Variables
| Variable | Required | Description | Example |
|---|---|---|---|
NAME |
Yes | Your full name | "John Doe" |
EMAIL |
No | Email address | "john@example.com" |
PHONE |
No | Phone number | "+1234567890" |
BLUESKY |
No | Bluesky profile URL | "https://bsky.app/profile/user.bsky.social" |
GITHUB |
No | GitHub profile URL | "https://github.com/username" |
WHATSAPP |
No | WhatsApp chat URL | "https://wa.me/1234567890" |
FACEBOOK |
No | Facebook profile URL | "https://facebook.com/username" |
BASE_URL |
No | Your domain URL | "https://info.base.com" |
PORT |
No | Server port (default: 8080) | "8080" |
Deployment
Systemd Service (Linux)
Create /etc/systemd/system/contactshare.service:
[Unit]
Description=Contact Share Service
After=network.target
[Service]
Type=simple
User=www-data
WorkingDirectory=/opt/contactshare
EnvironmentFile=/opt/contactshare/.env
ExecStart=/opt/contactshare/contactshare
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.target
Enable and start:
sudo systemctl enable contactshare
sudo systemctl start contactshare
Reverse Proxy (Caddy)
info.base.com {
reverse_proxy localhost:8080
}
License
MIT