working
This commit is contained in:
parent
feefd59b80
commit
1d6f58ab8b
6 changed files with 98 additions and 1 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -2,4 +2,5 @@ dist/
|
|||
*.pyc
|
||||
__pycache__/
|
||||
.DS_Store
|
||||
deploy.config
|
||||
|
||||
|
|
|
|||
39
Makefile
Normal file
39
Makefile
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
SHELL := /bin/bash
|
||||
.PHONY: build serve deploy help
|
||||
|
||||
# Default target
|
||||
help:
|
||||
@echo "Available targets:"
|
||||
@echo " make build - Build the static site"
|
||||
@echo " make serve - Serve the site locally on port 8000"
|
||||
@echo " make deploy - Deploy the built site to remote server"
|
||||
@echo ""
|
||||
@echo "For deployment, copy deploy.config.example to deploy.config and fill in your details"
|
||||
|
||||
# Build the site
|
||||
build:
|
||||
@echo "Building site..."
|
||||
python3 build.py
|
||||
|
||||
# Serve locally
|
||||
serve: build
|
||||
@echo "Serving site at http://localhost:8000"
|
||||
@echo "Press Ctrl+C to stop"
|
||||
cd dist && python3 -m http.server 8000
|
||||
|
||||
# Deploy to remote server
|
||||
deploy: build
|
||||
@if [ ! -f deploy.config ]; then \
|
||||
echo "Error: deploy.config not found!"; \
|
||||
echo "Copy deploy.config.example to deploy.config and fill in your details."; \
|
||||
exit 1; \
|
||||
fi
|
||||
@echo "Deploying to remote server..."
|
||||
@source deploy.config; \
|
||||
SSH_CMD="ssh"; \
|
||||
if [ -n "$$SSH_PORT" ]; then SSH_CMD="$$SSH_CMD -p $$SSH_PORT"; fi; \
|
||||
if [ -n "$$SSH_KEY" ]; then SSH_CMD="$$SSH_CMD -i $$SSH_KEY"; fi; \
|
||||
rsync -avz --delete -e "$$SSH_CMD" \
|
||||
dist/ $$REMOTE_USER@$$REMOTE_HOST:$$REMOTE_PATH
|
||||
@echo "✓ Deployment complete!"
|
||||
|
||||
17
README.md
17
README.md
|
|
@ -4,10 +4,27 @@ Static site generator for sharing self-hosted service information.
|
|||
|
||||
## Usage
|
||||
|
||||
### Build the site
|
||||
```bash
|
||||
make build
|
||||
```
|
||||
or
|
||||
```bash
|
||||
python3 build.py
|
||||
```
|
||||
|
||||
### Serve locally
|
||||
```bash
|
||||
make serve
|
||||
```
|
||||
Serves the site at http://localhost:8000
|
||||
|
||||
### Deploy to remote server
|
||||
```bash
|
||||
make deploy
|
||||
```
|
||||
Before deploying, copy `deploy.config.example` to `deploy.config` and fill in your server details.
|
||||
|
||||
Edit `config/services.json` to customize content. Output is generated in `dist/`.
|
||||
|
||||
## Structure
|
||||
|
|
|
|||
21
caddy.bitcoininfra.contrapeso.xyz.conf
Normal file
21
caddy.bitcoininfra.contrapeso.xyz.conf
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
bitcoininfra.contrapeso.xyz {
|
||||
# Root directory where the static files are located
|
||||
root * /var/www/bitcoin-services-home/
|
||||
|
||||
# Enable file server to serve static files
|
||||
file_server
|
||||
|
||||
# Optional: Enable compression
|
||||
encode gzip zstd
|
||||
|
||||
# Optional: Set security headers
|
||||
header {
|
||||
# Security headers
|
||||
X-Content-Type-Options "nosniff"
|
||||
X-Frame-Options "DENY"
|
||||
X-XSS-Protection "1; mode=block"
|
||||
Referrer-Policy "strict-origin-when-cross-origin"
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"site": {
|
||||
"title": "COUNTER BITCOIN SERVICES",
|
||||
"title": "COUNTERWEIGHT'S BITCOIN SERVICES",
|
||||
"subtitle": "Self-Hosted Infrastructure Available for the Public",
|
||||
"description": "Welcome to my self-hosted services Bitcoin hub. I run this for myself, but you are welcome to use it as well free of cost.\nIf you feel like helping pay the bills, you can send some sats to infra@wallet.contrapeso.xyz."
|
||||
},
|
||||
|
|
|
|||
19
deploy.config.example
Normal file
19
deploy.config.example
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
# Deployment Configuration
|
||||
# Copy this file to deploy.config and fill in your actual values
|
||||
# deploy.config is gitignored and will not be committed
|
||||
|
||||
# Remote server hostname or IP address
|
||||
REMOTE_HOST=example.com
|
||||
|
||||
# Remote server username
|
||||
REMOTE_USER=username
|
||||
|
||||
# Remote path where the site should be deployed (absolute path)
|
||||
REMOTE_PATH=/var/www/bitcoin-services-home
|
||||
|
||||
# Optional: SSH port (defaults to 22 if not specified)
|
||||
# SSH_PORT=22
|
||||
|
||||
# Optional: Path to SSH private key (if not using default ~/.ssh/id_rsa)
|
||||
# SSH_KEY=~/.ssh/id_rsa
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue