You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
woikos d41c332d06
Add NRC (Nostr Relay Connect) protocol and web UI (v0.48.9)
5 days ago
..
docker-policy extend script test to two read two write to ensure script continues running 2 months ago
sprocket Implement policy-based event filtering and add integration tests 2 months ago
BOOTSTRAP.md curl|bash deploy script 2 months ago
DOCKER_TESTING.md remove dgraph completely 1 month ago
Dockerfile.deploy-test Add serve mode, fix binary tags, document CLI tools, improve Docker 2 months ago
GITEA_MIGRATION.md some more gitea 2 months ago
GITEA_QUICKSTART.md some more gitea 2 months ago
GITEA_SSH_SETUP.md some more gitea 2 months ago
README.md remove dgraph completely 1 month ago
README_BUILD.md Implement multi-platform build system with pure Go support 2 months ago
benchmark.sh Add serve mode, fix binary tags, document CLI tools, improve Docker 2 months ago
bootstrap.sh curl|bash deploy script 2 months ago
build-all-platforms.sh fix workflow to fetch libsecp256k1.so 2 months ago
build-wasm.sh Add NRC (Nostr Relay Connect) protocol and web UI (v0.48.9) 5 days ago
deploy.sh Add serve mode, fix binary tags, document CLI tools, improve Docker 2 months ago
docker-build.sh optimizing badger cache, won a 10-15% improvement in most benchmarks 2 months ago
docker-compose-test.yml optimizing badger cache, won a 10-15% improvement in most benchmarks 2 months ago
enable-archive.sh Add script to enable archive features on deployment 1 week ago
gitea-migrate-repos.sh some more gitea 2 months ago
gitea-ssh-setup.sh some more gitea 2 months ago
gitea.service gitea 2 months ago
giteainstall.sh fix paths 2 months ago
migrate-badger-config.sh optimizing badger cache, won a 10-15% improvement in most benchmarks 2 months ago
orly.service Improve logging and handling for WebSocket message processing, delivery, and diagnostics. 3 months ago
platform-detect.sh Implement multi-platform build system with pure Go support 2 months ago
relaytester-install.sh Update relay tester scripts to use `/tmp/orlytest` for temporary data storage and adjust cleanup logic 4 months ago
relaytester-test.sh Update relay tester scripts to use `/tmp/orlytest` for temporary data storage and adjust cleanup logic 4 months ago
reload.sh initial addition of essential crypto, encoders, workflows and LLM instructions 5 months ago
run-market-and-orly.sh Improve logging and handling for WebSocket message processing, delivery, and diagnostics. 3 months ago
run-market-probe.sh Improve logging and handling for WebSocket message processing, delivery, and diagnostics. 3 months ago
run-orly.sh Implement multi-platform build system with pure Go support 2 months ago
run-policy-filter-test.sh Refactor crypto package to use p256k1 signer 2 months ago
run-policy-test.sh Enhance logging and add policy test client 3 months ago
run-relay-and-seed.sh Add `run-relay-and-seed.sh` script, remove redundant JS library mappings, and improve logging consistency. 3 months ago
run-relay-pprof.sh Remove spider functionality and related configurations 3 months ago
runtests.sh Add serve mode, fix binary tags, document CLI tools, improve Docker 2 months ago
test-deploy-docker.sh Update dependencies and enhance deployment scripts 3 months ago
test-deploy-local.sh Implement multi-platform build system with pure Go support 2 months ago
test-docker.sh optimizing badger cache, won a 10-15% improvement in most benchmarks 2 months ago
test-managed-acl.sh Implement multi-platform build system with pure Go support 2 months ago
test-neo4j-integration.sh Add Neo4j integration tests and query rate-limiting logic 1 month ago
test-subscription-stability.sh Implement comprehensive WebSocket subscription stability fixes 2 months ago
test-subscriptions.sh Implement comprehensive WebSocket subscription stability fixes 2 months ago
test-workflow-act.sh Refactor crypto package to use p256k1 signer 2 months ago
test-workflow-local.sh Implement multi-platform build system with pure Go support 2 months ago
test.sh Add serve mode, fix binary tags, document CLI tools, improve Docker 2 months ago
test_policy.sh Implement multi-platform build system with pure Go support 2 months ago
update-embedded-web.sh Remove `dist` directory and streamline build artifacts. 4 months ago

README.md

ORLY Scripts Directory

This directory contains automation scripts for building, testing, and deploying ORLY.

Quick Reference

Build & Deploy

./build-all-platforms.sh    # Build for multiple platforms
./deploy.sh                 # Deploy to systemd
./update-embedded-web.sh    # Build and embed web UI

Testing

./test.sh                   # Run all Go tests
./test-docker.sh            # Run integration tests in containers

Script Descriptions

Docker Integration Scripts

docker-build.sh

Builds Docker images for ORLY and optionally relay-tester.

Usage:

./docker-build.sh                   # ORLY only
./docker-build.sh --with-tester     # ORLY + relay-tester

Output:

  • orly:latest
  • orly-relay-tester:latest (if --with-tester)

docker-compose-test.yml

Full-stack docker-compose with ORLY and relay-tester.

Services:

  • orly: Relay with Badger backend
  • relay-tester: Protocol tests (optional, profile: test)

Features:

  • Health checks for all services
  • Custom network with DNS
  • Persistent volumes

test-docker.sh

Comprehensive integration testing in Docker containers.

Usage:

./test-docker.sh                              # Basic test
./test-docker.sh --relay-tester               # Run relay-tester
./test-docker.sh --keep-running               # Keep containers running
./test-docker.sh --skip-build                 # Use existing images
./test-docker.sh --relay-tester --keep-running  # Full test + keep running

What it does:

  1. Stops any existing containers
  2. Optionally rebuilds images
  3. Starts ORLY and waits for health
  4. Verifies connectivity
  5. Optionally runs relay-tester
  6. Shows status and endpoints
  7. Cleanup (unless --keep-running)

Build Scripts

build-all-platforms.sh

Cross-compiles ORLY for multiple platforms.

Platforms:

  • linux/amd64
  • linux/arm64
  • darwin/amd64
  • darwin/arm64

Output: dist/ directory with platform-specific binaries

update-embedded-web.sh

Builds the Svelte web UI and embeds it in ORLY binary.

Steps:

  1. Builds web UI with bun
  2. Generates embedded assets
  3. Rebuilds ORLY with embedded UI

Deployment Scripts

deploy.sh

Automated deployment with systemd service.

What it does:

  1. Installs Go if needed
  2. Builds ORLY with embedded web UI
  3. Installs to ~/.local/bin/orly
  4. Creates systemd service
  5. Enables and starts service
  6. Sets up port binding capabilities

Test Scripts

test.sh

Runs all Go tests in the project.

Usage:

./test.sh          # All tests
TEST_LOG=1 ./test.sh  # With logging

Environment Variables

Common Variables

# Logging
export ORLY_LOG_LEVEL=debug              # Log verbosity
export TEST_LOG=1                        # Enable test logging

# Server
export ORLY_PORT=3334                    # HTTP/WebSocket port
export ORLY_LISTEN=0.0.0.0               # Listen address

# Data
export ORLY_DATA_DIR=/path/to/data       # Data directory

# Database backend
export ORLY_DB_TYPE=badger               # Use badger backend (default)
export ORLY_DB_TYPE=neo4j                # Use Neo4j backend

Script-Specific Variables

# Docker scripts
export SKIP_BUILD=true                   # Skip image rebuild
export KEEP_RUNNING=true                 # Don't cleanup containers

File Organization

scripts/
├── README.md                    # This file
├── DOCKER_TESTING.md           # Docker testing guide
│
├── docker-build.sh             # Build docker images
├── docker-compose-test.yml     # Full stack docker config
├── test-docker.sh              # Run docker integration tests
│
├── build-all-platforms.sh      # Cross-compile
├── deploy.sh                   # Deploy to systemd
├── update-embedded-web.sh      # Build web UI
└── test.sh                     # Run Go tests

Workflows

Local Development

# 1. Run ORLY locally
./orly

# 2. Test changes
go run cmd/relay-tester/main.go -url ws://localhost:3334

# 3. Run unit tests
./scripts/test.sh

Docker Development

# 1. Build and test in containers
./scripts/test-docker.sh --relay-tester --keep-running

# 2. Make changes

# 3. Rebuild just ORLY
cd scripts
docker-compose -f docker-compose-test.yml up -d --build orly

# 4. View logs
docker logs orly-relay -f

# 5. Stop when done
docker-compose -f docker-compose-test.yml down

CI/CD Testing

# Quick test (no containers)
./scripts/test.sh

# Full integration test
./scripts/test-docker.sh --relay-tester

# Build for deployment
./scripts/build-all-platforms.sh

Production Deployment

# Deploy with systemd
./scripts/deploy.sh

# Check status
systemctl status orly

# View logs
journalctl -u orly -f

# Update
./scripts/deploy.sh  # Rebuilds and restarts

Troubleshooting

Port Conflicts

# Find what's using port 3334
lsof -i :3334
netstat -tlnp | grep 3334

# Kill process
kill $(lsof -t -i :3334)

# Or use different port
export ORLY_PORT=3335

Docker Build Failures

# Clear docker cache
docker builder prune

# Rebuild from scratch
docker build --no-cache -t orly:latest -f Dockerfile .

# Check Dockerfile syntax
docker build --dry-run -f Dockerfile .

Permission Issues

# Fix script permissions
chmod +x scripts/*.sh

# Fix docker socket
sudo usermod -aG docker $USER
newgrp docker

Best Practices

  1. Always use scripts from project root

    ./scripts/test-docker.sh  # Good
    cd scripts && ./test-docker.sh  # May have path issues
    
  2. Check prerequisites before running

    # Check docker
    docker --version
    docker-compose --version
    
  3. Clean up after testing

    # Stop containers
    cd scripts && docker-compose -f docker-compose-test.yml down
    
    # Remove volumes if needed
    docker-compose -f docker-compose-test.yml down -v
    
  4. Use --keep-running for debugging

    ./scripts/test-docker.sh --keep-running
    # Inspect, debug, make changes
    docker-compose -f scripts/docker-compose-test.yml down
    
  5. Check logs on failures

    # Container logs
    docker logs orly-relay --tail 100
    
    # Test output
    ./scripts/test.sh 2>&1 | tee test.log
    

Contributing

When adding new scripts:

  1. Add executable permission

    chmod +x scripts/new-script.sh
    
  2. Use bash strict mode

    #!/bin/bash
    set -e  # Exit on error
    
  3. Add help text

    if [ "$1" == "--help" ]; then
        echo "Usage: $0 [options]"
        exit 0
    fi
    
  4. Document in this README

    • Add to appropriate section
    • Include usage examples
    • Note any requirements
  5. Test on fresh system

    # Use Docker to test
    docker run --rm -v $(pwd):/app -w /app ubuntu:latest ./scripts/new-script.sh