Files
aitbc/simple-domain-solution.md
oib ff5486fe08 ```
chore: refactor logging module, update genesis timestamp, remove model relationships, and reorganize routers

- Rename logging.py to logger.py and update import paths in poa.py and main.py
- Update devnet genesis timestamp to 1766828620
- Remove SQLModel Relationship declarations from Block, Transaction, and Receipt models
- Add SessionDep type alias and get_session dependency in coordinator-api deps
- Reorganize coordinator-api routers: replace explorer/registry with exchange, users, marketplace
2025-12-28 21:05:53 +01:00

2.7 KiB

Simple Domain Solution for AITBC

Problem

  • Incus container exists but you don't have access
  • Services need to run locally
  • Domain https://aitbc.bubuit.net needs to access local services

Solution Options

Create SSH tunnels from your server to your local machine:

# On your server (aitbc.bubuit.net):
ssh -R 8000:localhost:8000 -R 9080:localhost:9080 -R 3001:localhost:3001 -R 3002:localhost:3002 user@your-local-ip

# Then update nginx on server to proxy to localhost ports

Option 2: Run Services Directly on Server

Copy the AITBC project to your server and run there:

# On server:
git clone https://gitea.bubuit.net/oib/aitbc.git
cd aitbc
./run-local-services.sh

Option 3: Use Local Nginx

Run nginx locally and edit your hosts file:

# 1. Install nginx locally if not installed
sudo apt install nginx

# 2. Copy config
sudo cp nginx-local.conf /etc/nginx/sites-available/aitbc
sudo ln -s /etc/nginx/sites-available/aitbc /etc/nginx/sites-enabled/
sudo rm /etc/nginx/sites-enabled/default

# 3. Test and reload
sudo nginx -t
sudo systemctl reload nginx

# 4. Edit hosts file
echo "127.0.0.1 aitbc.bubuit.net" | sudo tee -a /etc/hosts

# 5. Access at http://aitbc.bubuit.net

Option 4: Cloudflare Tunnel (Easiest)

Use Cloudflare tunnel to expose local services:

# 1. Install cloudflared
wget -q https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb
sudo dpkg -i cloudflared-linux-amd64.deb

# 2. Login
cloudflared tunnel login

# 3. Create tunnel
cloudflared tunnel create aitbc

# 4. Create config file ~/.cloudflared/config.yml:
tunnel: aitbc
ingress:
  - hostname: aitbc.bubuit.net
    service: http://localhost:3001
  - path: /api
    service: http://localhost:8000
  - path: /admin
    service: http://localhost:8000
  - path: /rpc
    service: http://localhost:9080
  - path: /Exchange
    service: http://localhost:3002
  - service: http_status:404

# 5. Run tunnel
cloudflared tunnel run aitbc

Current Status

Services running locally:

Domain access not configured

Quick Test

To test if the domain routing would work, you can:

  1. Edit your local hosts file:
echo "127.0.0.1 aitbc.bubuit.net" | sudo tee -a /etc/hosts
  1. Install and configure nginx locally (see Option 3)

  2. Access http://aitbc.bubuit.net in your browser

Recommendation

Use Option 4 (Cloudflare Tunnel) as it's:

  • Free
  • Secure (HTTPS)
  • No port forwarding needed
  • Works with dynamic IPs
  • Easy to set up