121 Commits

Author SHA1 Message Date
2647f75ed6 added anyone proxy support 2025-08-10 16:34:11 +03:00
2015d454eb contribution related changes 2025-08-09 21:44:26 +03:00
3585c4c28d updated readme quick start 2025-08-09 21:13:29 +03:00
fbfea68f02 feat: improve dev-local bootstrap behavior and add client defaults logging 2025-08-09 17:55:21 +03:00
cf36d301d5 feat: add dev-local mode for localhost testing with auto-discovery of bootstrap peers 2025-08-09 17:50:02 +03:00
e76ad5cf16 feat: add NETWORK_DEV_LOCAL flag to force localhost defaults for DB and bootstrap peers 2025-08-09 17:34:59 +03:00
93d27e95d4 docs: update client configuration docs and standardize network defaults 2025-08-09 17:28:41 +03:00
7bcf32e527 feat: add configurable database endpoints with multiaddr to HTTP URL conversion 2025-08-09 17:04:36 +03:00
26e2bbb477 feat: improve logging for peer discovery and connection monitoring 2025-08-09 12:10:15 +03:00
2daa86bd3c refactor: remove legacy peer discovery and connectivity code 2025-08-09 12:01:30 +03:00
6301ed9182 refactor: split network client code into focused modules and extract config mapping
The changes reorganize the network client code by splitting it into focused modules for better maintainability, including
2025-08-09 12:00:35 +03:00
e037773ece refactor: split pubsub manager into focused modules and add env config support 2025-08-09 11:44:24 +03:00
27f2460bf2 feat: implement graceful shutdown and improve cluster join reliability 2025-08-09 08:57:11 +03:00
a38cc08809 feat: skip leadership wait for rqlite nodes with existing state and add ports 4002/5002 to clear script 2025-08-09 08:45:47 +03:00
355c1c66b9 feat: add configurable P2P port for node startup in Makefile and CLI flags 2025-08-09 08:38:44 +03:00
a59d0f1fd6 feat: add configurable RQLite host advertising modes (auto/localhost/ip) 2025-08-09 08:19:18 +03:00
05798471dd fix: standardize rqlite join addresses to use host:port format without http scheme 2025-08-08 20:30:46 +03:00
b744f7f513 refactor: standardize ports (LibP2P 4001, RQLite 5001/7001) and remove .env configuration 2025-08-08 20:09:28 +03:00
8d57fc8f98 Remove bootstrap main.go file as part of project restructuring 2025-08-07 08:40:38 +03:00
d32a6934e9 Enhance AI_CONTEXT.md with additional functional requirements and improve formatting for clarity; include detailed descriptions for database operations, key-value storage, pub/sub messaging, and peer discovery. 2025-08-06 20:47:03 +03:00
9b69aa4432 Update documentation to reflect changes in node startup commands; unify bootstrap and regular node commands to use make run-node for improved clarity and ease of use. 2025-08-06 20:43:49 +03:00
f62b9c6423 Merge branch 'main' of https://git.debros.io/DeBros/network 2025-08-06 20:25:51 +03:00
8d9996e87a Add new main files for bootstrap and unified-node commands 2025-08-06 19:59:09 +03:00
9de528815c Disable RQLite authentication for testing
- Remove -auth flag from RQLite startup command
- Remove authentication credential loading logic
- Simplify join address handling without credentials
- Clean up unused authentication helper functions

This allows testing basic cluster functionality without auth complexity.
2025-08-06 13:35:50 +03:00
3af1b58eb4 Add comprehensive production security for RQLite clustering
Production Security Features:
- RQLite authentication with secure user management
- Firewall configuration with IP-based restrictions
- Automated credential generation and storage
- Authenticated cluster join addresses
- Credential masking in logs for security
- Helper scripts for secure RQLite connections

Network Architecture:
- Port 4000: Public LibP2P P2P (encrypted)
- Port 4001/4002: RQLite cluster (IP-restricted to cluster members)
- UFW firewall rules restricting RQLite access to cluster IPs only

Security Components:
- /opt/debros/configs/rqlite-users.json: User authentication
- /opt/debros/keys/rqlite-cluster-auth: Secure credential storage
- Automatic credential masking in logs
- Production-ready setup script

This implements enterprise-grade security for public network deployment
while maintaining seamless cluster communication between trusted nodes.
2025-08-06 13:29:09 +03:00
16a70a03aa Add comprehensive network connectivity diagnostics
- Add automated network diagnostics for RQLite join addresses
- Test port connectivity with netcat, HTTP responses, ping, and DNS
- Provide detailed troubleshooting information in logs
- Help identify exact causes of RQLite cluster join failures
- Test connectivity before attempting RQLite cluster join

This will help diagnose the 'invalid join address' error by showing exactly
why the connection to 57.129.81.31:4001 is failing.
2025-08-06 13:08:27 +03:00
56f0a01b79 Add RQLite join address connectivity testing
- Test join address reachability before attempting to join cluster
- Fall back to starting new cluster if join address is unreachable
- Add comprehensive logging for join address testing
- Prevent RQLite fatal errors when bootstrap node is down

This fixes the issue where secondary nodes fail with 'invalid join address'
when the primary bootstrap node is not accessible on port 4001.
2025-08-06 13:05:58 +03:00
e6a305a8a7 Fix RQLite join address validation and improve error handling
- Replace hardcoded fallback IP with localhost for better compatibility
- Add join address format validation
- Improve logging for better troubleshooting
- Add detailed RQLite startup logging with full args
2025-08-06 13:00:55 +03:00
79efd7b2c5 Fix RQLite advertised addresses for proper cluster formation
- Add automatic external IP detection for RQLite advertised addresses
- Use 0.0.0.0 for binding but actual IP for advertising to other nodes
- Add -http-adv-addr and -raft-adv-addr parameters to RQLite startup
- Resolves 'advertised HTTP address is not routable' error
- Enables proper RQLite cluster formation between nodes
2025-08-06 11:29:06 +03:00
2181b5ced0 Fix RQLite bind addresses to allow external connections
- Change RQLite HTTP bind from localhost to 0.0.0.0
- Change RQLite Raft bind from localhost to 0.0.0.0
- This allows secondary bootstrap nodes and regular nodes to join the cluster
- Resolves 'invalid join address' error for secondary bootstrap nodes
2025-08-06 11:24:40 +03:00
b529c32742 Update pkg/constants/bootstrap.go 2025-08-06 05:56:45 +00:00
089916b5dd Fix port conflict between RQLite and LibP2P
CRITICAL FIX: Separate RQLite and LibP2P ports to prevent service startup failures

Changes:
- LibP2P now uses port 4000 (was conflicting with RQLite on 4001)
- RQLite continues to use port 4001 for HTTP API
- RQLite Raft uses port 4002
- Updated bootstrap peer configurations to use port 4000
- Updated install script port configurations
- Fixed firewall configuration to allow correct ports

This resolves the 'bind: address already in use' error that was preventing
the debros-node service from starting properly.
2025-08-06 08:44:23 +03:00
cc276ccc22 Fix install script service management to only use debros-node
- Remove references to debros-bootstrap service in update logic
- Standardize on single debros-node service for all node types
- Fix service stopping/starting during updates
- Clean up legacy service references
2025-08-06 08:39:44 +03:00
79d4a3980f Add peer-id command to CLI for easy peer ID retrieval 2025-08-06 08:39:14 +03:00
dfa4de33b4 Fix multi-bootstrap RQLite cluster setup
- Primary bootstrap (57.129.81.31): starts new cluster (no join address)
- Secondary bootstrap (38.242.250.186): joins primary bootstrap cluster
- Regular nodes: join primary bootstrap cluster

This allows both VPS servers to be bootstrap nodes while forming a
proper RQLite cluster where the secondary bootstrap joins the primary
instead of trying to start its own independent cluster.

Should resolve the leadership establishment timeout on the second VPS.
2025-08-06 08:21:21 +03:00
37bf582932 Fix bootstrap node detection to prevent self-join in RQLite
The VPS at 57.129.81.31 was incorrectly trying to join itself as a
regular node instead of being detected as a bootstrap node.

Added isLocalIP() function to check if bootstrap peer IPs match
local machine IPs using 'ip addr show' and 'hostname -I' commands.

This should resolve the 'invalid join address' error where the
bootstrap node was trying to join http://57.129.81.31:4001 (itself).
2025-08-06 08:14:29 +03:00
5cef68c132 Fix bootstrap peer ID mismatch for 57.129.81.31
The actual running bootstrap node has peer ID:
12D3KooWJvJj94TmNwG1sntDWgAXi7MN3xxLLkoQzgHX6gQ22eKi

But the constants file had the wrong peer ID:
12D3KooWQRK2duw5B5LXi8gA7HBBFiCsLvwyph2ZU9VBmvbE1Nei

This mismatch was causing nodes to fail to connect to the bootstrap
node, leading to the 'invalid join address' error from RQLite.
2025-08-06 08:10:28 +03:00
480354267a Fix RQLite join address for regular nodes
- Regular nodes now join actual bootstrap nodes instead of localhost:4001
- Extract IP from bootstrap peer multiaddrs for RQLite join address
- Add fallback to first known bootstrap node (57.129.81.31:4001)
- This fixes the 'fatal: http://localhost:4001 is an invalid join address' error

Regular nodes will now properly join the RQLite cluster of bootstrap nodes
instead of trying to join themselves, which was causing startup failures.
2025-08-06 08:02:43 +03:00
3975b5a59d Fix debros-node service failing due to invalid -port flag
- Remove invalid -port flag from systemd service ExecStart command
- The node binary doesn't support -port flag, it uses hardcoded port 4001
- Fix variable name RAFT_NODE_PORT to RAFT_PORT in two places
- Update check_existing_installation to only check for node binary since bootstrap binary was removed

This resolves the service startup failure where the service was exiting with:
'flag provided but not defined: -port'
2025-08-06 07:51:23 +03:00
b9ef151643 Merge branch 'main' of https://git.debros.io/DeBros/network 2025-08-05 22:28:34 +03:00
cd74a2df68 Refactor node and bootstrap configurations for improved clarity and consistency; unify RQLite and Raft ports across nodes, update environment setup, and enhance logging for node operations. 2025-08-05 22:28:12 +03:00
f470884b42 Fix spacing issues in install script that were causing command failures
- Fixed variable references with extra spaces that caused chmod commands to fail
- Corrected '' variable interpolation in permission commands
- Script now properly sets directory permissions without syntax errors
2025-08-04 19:03:11 +03:00
0a0756d4da Update RQLite raft port to 7001 in configuration files 2025-08-04 18:51:42 +03:00
cad45efb71 Refactor go.mod to remove indirect dependency on godotenv and update RQLite node configuration 2025-08-04 18:51:11 +03:00
bf32cc2a49 Add production environment support for bootstrap peers and RQLite connections 2025-08-04 18:31:49 +03:00
9832e97ed8 Add additional bootstrap peer IDs for enhanced connectivity 2025-08-04 17:25:21 +03:00
7fd9870d0f Update bootstrap address for improved peer connectivity 2025-08-04 17:22:14 +03:00
115b64d8d2 Add additional bootstrap addresses for improved connectivity 2025-08-04 17:15:01 +03:00
0cabfd6381 Clean up output messages: remove duplicate 'node' and Node Type line
- Remove duplicate 'node node' references in service start messages
- Remove 'Node Type: node' line from completion output
- Simplify service messages to 'Starting/Started DeBros Network service'
- Simplify final success messages to remove redundant 'node' references
- Clean, professional output without confusing terminology duplication
2025-08-04 17:01:29 +03:00
d447f6546b Force NODE_TYPE to 'node' in update mode to complete bootstrap migration
- Remove logic that detects existing bootstrap.yaml and sets NODE_TYPE to 'bootstrap'
- Always use NODE_TYPE='node' in update mode for consistent terminology
- This ensures all services, configs, and outputs use 'node' terminology
- Completes the full migration from bootstrap to node naming convention
- Existing bootstrap installations will be updated to use node terminology
2025-08-04 16:58:07 +03:00