Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ services:
- sh
- -c
# Customize network ('mainnet' or 'testnet') and RPC address/port if needed
- python initialize.py -net 'mainnet' -rpc '127.0.0.1:10009' -wn && python controller.py runserver 0.0.0.0:8889 > /var/log/lndg-controller.log 2>&1
- python initialize.py -net 'mainnet' -rpc '127.0.0.1:10009' -wn && python controller.py runserver 0.0.0.0:8889
# Use host network mode for simplicity, adjust if needed
network_mode: "host"
```
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ services:
command:
- sh
- -c
- python initialize.py -net 'mainnet' -rpc 'localhost:10009' -wn && python controller.py runserver 0.0.0.0:8000 > /app/data/lndg-controller.log 2>&1
- python initialize.py -net 'mainnet' -rpc 'localhost:10009' -wn && python controller.py runserver 0.0.0.0:8000
ports:
- 8889:8000
2 changes: 1 addition & 1 deletion gui/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def logs(request):
try:
count = request.GET.get('tail', 20)
grep = request.GET.get('grep', None)
logfile = 'data/lndg-controller.log'
logfile = path.join(settings.BASE_DIR, 'data/lndg-controller.log')
file_size = path.getsize(logfile)-2
if file_size == 0:
logs = ['Logs are empty....']
Expand Down
4 changes: 2 additions & 2 deletions initialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,15 +189,15 @@ def write_settings(node_ip, lnd_tls_path, lnd_macaroon_path, lnd_database_path,
'app-file': {
'level': 'INFO',
'class': 'logging.handlers.RotatingFileHandler',
'filename': 'data/lndg-controller.log',
'filename': os.path.join(BASE_DIR, 'data/lndg-controller.log'),
'maxBytes': 25*(1024*1024),
'backupCount': 5,
'formatter': 'verbose',
},
'web-file': {
'level': 'INFO',
'class': 'logging.handlers.RotatingFileHandler',
'filename': 'data/lndg-web.log',
'filename': os.path.join(BASE_DIR, 'data/lndg-web.log'),
'maxBytes': 25*(1024*1024),
'backupCount': 5,
'formatter': 'verbose',
Expand Down
5 changes: 3 additions & 2 deletions systemd.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ Description=Backend Controller For Lndg
Environment=PYTHONUNBUFFERED=1
User=<run_as_user>
Group=<run_as_user>
WorkingDirectory=/home/<run_as_user>/lndg
ExecStart=/home/<run_as_user>/lndg/.venv/bin/python /home/<run_as_user>/lndg/controller.py
StandardOutput=append:/var/log/lndg-controller.log
StandardError=append:/var/log/lndg-controller.log
StandardOutput=journal
StandardError=journal
Restart=always
RestartSec=60s
[Install]
Expand Down
5 changes: 3 additions & 2 deletions systemd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ Description=Run Backend Controller For Lndg
Environment=PYTHONUNBUFFERED=1
User=$INSTALL_USER
Group=$INSTALL_USER
WorkingDirectory=$LNDG_DIR
ExecStart=$LNDG_DIR/.venv/bin/python $LNDG_DIR/controller.py
StandardOutput=append:/var/log/lndg-controller.log
StandardError=append:/var/log/lndg-controller.log
StandardOutput=journal
StandardError=journal
Restart=always
RestartSec=60s
[Install]
Expand Down