forked from michael.heier/citadel-core
Compare commits
161 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
419522f138 | ||
|
858c1e68c8 | ||
|
6e74290691 | ||
|
62d51aa807 | ||
|
781299fa1a | ||
|
4eb9819cf9 | ||
|
9a6501a80e | ||
|
d45da547d6 | ||
|
80ead94dbd | ||
|
a5e74fa1d2 | ||
|
f6dae9c646 | ||
|
3cec30340b | ||
|
c89d00ad7a | ||
|
bc60190df5 | ||
|
611d4a166b | ||
|
56946a9812 | ||
|
6b29a76d81 | ||
|
1d1200fcfd | ||
|
1cdbe10a07 | ||
|
969d4e7796 | ||
|
3cc9b69fca | ||
|
6d1013932d | ||
|
eaab1715e0 | ||
|
4692a94b5e | ||
|
add94a946d | ||
|
89da639247 | ||
|
92aed920b9 | ||
|
e5b24967d1 | ||
|
0f8c95fea3 | ||
|
8f1807c57d | ||
|
c4126fae93 | ||
|
f95bbb66f5 | ||
|
16c9dbe615 | ||
|
06a40c67d3 | ||
|
1e3556ac1f | ||
|
8a8ac646e2 | ||
|
4f808de093 | ||
|
a9018d1570 | ||
|
30ba84ddbb | ||
|
f4f8b2274c | ||
|
f8139f5642 | ||
|
19029a20ef | ||
|
ecb3456206 | ||
|
14b58e75c6 | ||
|
a2aa824b85 | ||
|
b1bf16f787 | ||
|
aecf5e6ff2 | ||
|
555e148996 | ||
|
cff5362557 | ||
|
d72e128b2f | ||
|
f62abae4fc | ||
|
09bb3c3367 | ||
|
d8cf6de9c4 | ||
|
bf0879f049 | ||
|
3e58ccc60e | ||
|
91f8a88879 | ||
|
ddcc73c4b6 | ||
|
fdef8439b3 | ||
|
dbd0991a78 | ||
|
895e3ac842 | ||
|
26aab65052 | ||
|
45941daee9 | ||
|
ff463ba644 | ||
|
a768f0ff8c | ||
|
d6d8f3c17c | ||
|
a098b0a809 | ||
|
9563dd6c2f | ||
|
f6c3f7a192 | ||
|
98a16c4d6e | ||
|
ab8b83101c | ||
|
542b686313 | ||
|
115c126616 | ||
|
68c58767e2 | ||
|
28e2b64a70 | ||
|
64fff5b494 | ||
|
a600fd4946 | ||
|
6cca5a0ce4 | ||
|
c678bbef24 | ||
|
bd3d4ea14e | ||
|
f732db4fcb | ||
|
7677695e95 | ||
|
c1730d4e73 | ||
|
77569b829d | ||
|
a721f79b49 | ||
|
ba951feee3 | ||
|
53b23c557e | ||
|
670f7c15de | ||
|
ee99fa3918 | ||
|
5e7ba77ea1 | ||
|
0dae2c7743 | ||
|
5ec63b4fa2 | ||
|
82e9aaac10 | ||
|
c701ceb8db | ||
|
1b8ec58355 | ||
|
81c4059c78 | ||
|
d821fb2f39 | ||
|
05102893fd | ||
|
24a4182289 | ||
|
0515b5b91d | ||
|
06fefc0d02 | ||
|
9ba9946a3d | ||
|
e073c5059f | ||
|
91de46b8be | ||
|
149eaee0b5 | ||
|
db0f0a6ffd | ||
|
877c468a74 | ||
|
5f20686c76 | ||
|
911988ff37 | ||
|
81cfb4530f | ||
|
9a885bca39 | ||
|
ce1f6b33c7 | ||
|
4a7e9f5765 | ||
|
2429b77e63 | ||
|
944e390e40 | ||
|
32e69f745c | ||
|
aedba482c2 | ||
|
6cdc4c2c33 | ||
|
ece6df33b8 | ||
|
e599cc0a92 | ||
|
606bbabbd6 | ||
|
8bb01f2884 | ||
|
fac17405c8 | ||
|
5986af3a0f | ||
|
b13f046e53 | ||
|
f6ff9b76b2 | ||
|
a1ec559e5e | ||
|
bace00f25d | ||
|
2d9e2ae4d8 | ||
|
001c4edc11 | ||
|
7551771109 | ||
|
987f48e78d | ||
|
c862ddc9c7 | ||
|
afde8fb530 | ||
|
06aa65fa92 | ||
|
69bae236c4 | ||
|
88969f6641 | ||
|
96f942e7a0 | ||
|
f3018307d4 | ||
|
2d4f1adfe5 | ||
|
efadad6887 | ||
|
8a54cda14e | ||
|
33eba7f156 | ||
|
1d31c10953 | ||
|
242046d0c3 | ||
|
5b282751e2 | ||
|
d1e82d2d01 | ||
|
dca6847d4b | ||
|
aa1db0403d | ||
|
12c93c5ebb | ||
|
1a6c5df241 | ||
|
4d74408ae9 | ||
|
11a81de9ee | ||
|
8a582fc0c3 | ||
|
66f82f3a5c | ||
|
2c2138f075 | ||
|
ed6bd73968 | ||
|
3cfdc6e9ca | ||
|
dceb5e945e | ||
|
75403439cc | ||
|
c8ae197023 | ||
|
c152dbd622 |
5
.gitignore
vendored
5
.gitignore
vendored
|
@ -26,6 +26,7 @@ fulcrumx/*
|
|||
nginx/*
|
||||
redis/*
|
||||
events/signals/*
|
||||
elements/*
|
||||
docker-compose.override.yml
|
||||
|
||||
# Commit these empty directories
|
||||
|
@ -47,8 +48,12 @@ db/citadel-seed/*
|
|||
!redis/.gitkeep
|
||||
!fulcrumx/.gitkeep
|
||||
!events/signals/.gitkeep
|
||||
!elements/.gitkeep
|
||||
|
||||
!**/*.license
|
||||
services/installed.json
|
||||
services/installed.yml
|
||||
|
||||
c-lightning/*
|
||||
!c-lightning/.gitkeep
|
||||
events/karen
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
# A collection of fully FLOSS app definitions and FLOSS apps for Citadel.
|
||||
https://github.com/runcitadel/apps v3-stable
|
||||
https://github.com/runcitadel/apps c-lightning-v3
|
||||
|
||||
# Some apps modified version of Umbrel apps, and their app definitions aren't FLOSS yet.
|
||||
# Include them anyway, but as a separate repo.
|
||||
# Add a # to the line below to disable the repo and only use FLOSS apps.
|
||||
https://github.com/runcitadel/apps-nonfree v3-stable
|
||||
https://github.com/runcitadel/apps-nonfree v3-dev
|
||||
|
|
|
@ -99,6 +99,7 @@ properties:
|
|||
items:
|
||||
type: string
|
||||
enum:
|
||||
- c-lightning
|
||||
- lnd
|
||||
- bitcoind
|
||||
- electrum
|
||||
|
|
|
@ -75,7 +75,7 @@ def is_builtin_type(obj):
|
|||
def classToDict(theClass):
|
||||
obj: dict = {}
|
||||
for key, value in theClass.__dict__.items():
|
||||
if value is None or (isinstance(value, list) and len(value) == 0):
|
||||
if type(value).__name__ == "NoneType" or (isinstance(value, list) and len(value) == 0):
|
||||
continue
|
||||
if isinstance(value, list):
|
||||
newList = []
|
||||
|
@ -83,7 +83,8 @@ def classToDict(theClass):
|
|||
if is_builtin_type(element):
|
||||
newList.append(element)
|
||||
else:
|
||||
newList.append(classToDict(element))
|
||||
if type(element).__name__ != "NoneType":
|
||||
newList.append(classToDict(element))
|
||||
obj[key] = newList
|
||||
elif isinstance(value, dict):
|
||||
newDict = {}
|
||||
|
@ -95,8 +96,7 @@ def classToDict(theClass):
|
|||
obj[key] = newDict
|
||||
elif is_builtin_type(value):
|
||||
obj[key] = value
|
||||
else:
|
||||
#print(value)
|
||||
elif type(value).__name__ != "NoneType":
|
||||
obj[key] = classToDict(value)
|
||||
return obj
|
||||
|
||||
|
|
24
app/lib/composegenerator/next/stage1.py
Normal file
24
app/lib/composegenerator/next/stage1.py
Normal file
|
@ -0,0 +1,24 @@
|
|||
from lib.citadelutils import classToDict
|
||||
from lib.composegenerator.shared.env import validateEnv
|
||||
|
||||
from lib.composegenerator.v3.types import App, generateApp
|
||||
from lib.composegenerator.v3.generate import convertContainerPermissions
|
||||
|
||||
def createCleanConfigFromV3(app: dict, nodeRoot: str):
|
||||
parsedApp: App = generateApp(app)
|
||||
for container in range(len(parsedApp.containers)):
|
||||
# TODO: Make this dynamic and not hardcoded
|
||||
if parsedApp.containers[container].requires and "c-lightning" in parsedApp.containers[container].requires:
|
||||
parsedApp.containers[container] = None
|
||||
parsedApp = convertContainerPermissions(parsedApp)
|
||||
parsedApp = validateEnv(parsedApp)
|
||||
finalApp = classToDict(parsedApp)
|
||||
try:
|
||||
finalApp['permissions'] = finalApp['metadata']['dependencies']
|
||||
except:
|
||||
finalApp['permissions'] = []
|
||||
finalApp['id'] = finalApp['metadata']['id']
|
||||
del finalApp['metadata']
|
||||
# Set version of the cache file format
|
||||
finalApp['version'] = "1"
|
||||
return finalApp
|
|
@ -44,7 +44,9 @@ def permissions():
|
|||
"environment_allow": [
|
||||
"C_LIGHTNING_IP"
|
||||
],
|
||||
"volumes": []
|
||||
"volumes": [
|
||||
'${C_LIGHTNING_DATA_DIR}:/c-lightning:ro'
|
||||
]
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
@ -40,13 +40,14 @@ def validateEnvStringOrListorDict(env: Union[str, Union[list, dict]], existingEn
|
|||
def validateEnv(app: App):
|
||||
# For every container of the app, check if all env vars in the strings in environment are defined in env
|
||||
for container in app.containers:
|
||||
if container.environment_allow:
|
||||
existingEnv = container.environment_allow
|
||||
del container.environment_allow
|
||||
else:
|
||||
existingEnv = []
|
||||
if container.environment:
|
||||
validateEnvStringOrListorDict(container.command, existingEnv, app.metadata.id, container.name)
|
||||
validateEnvStringOrListorDict(container.entrypoint, existingEnv, app.metadata.id, container.name)
|
||||
validateEnvStringOrListorDict(container.environment, existingEnv, app.metadata.id, container.name)
|
||||
if container is not None:
|
||||
if container.environment_allow:
|
||||
existingEnv = container.environment_allow
|
||||
del container.environment_allow
|
||||
else:
|
||||
existingEnv = []
|
||||
if container.environment:
|
||||
validateEnvStringOrListorDict(container.command, existingEnv, app.metadata.id, container.name)
|
||||
validateEnvStringOrListorDict(container.entrypoint, existingEnv, app.metadata.id, container.name)
|
||||
validateEnvStringOrListorDict(container.environment, existingEnv, app.metadata.id, container.name)
|
||||
return app
|
||||
|
|
|
@ -23,6 +23,8 @@ def getFreePort(networkingFile: str, appId: str):
|
|||
10009,
|
||||
# LND REST
|
||||
8080,
|
||||
# Sparko
|
||||
9737,
|
||||
# Electrum Server
|
||||
50001,
|
||||
# Tor Proxy
|
||||
|
|
|
@ -16,20 +16,21 @@ from lib.composegenerator.shared.const import permissions
|
|||
|
||||
def convertContainerPermissions(app: App) -> App:
|
||||
for container in app.containers:
|
||||
for permission in app.metadata.dependencies:
|
||||
if isinstance(permission, str):
|
||||
if permission in permissions():
|
||||
container.environment_allow.extend(permissions()[permission]['environment_allow'])
|
||||
container.volumes.extend(permissions()[permission]['volumes'])
|
||||
else:
|
||||
print("Warning: app {} defines unknown permission {}".format(app.metadata.name, permission))
|
||||
else:
|
||||
for subPermission in permission:
|
||||
if subPermission in permissions():
|
||||
container.environment_allow.extend(permissions()[subPermission]['environment_allow'])
|
||||
container.volumes.extend(permissions()[subPermission]['volumes'])
|
||||
if container is not None:
|
||||
for permission in app.metadata.dependencies:
|
||||
if isinstance(permission, str):
|
||||
if permission in permissions():
|
||||
container.environment_allow.extend(permissions()[permission]['environment_allow'])
|
||||
container.volumes.extend(permissions()[permission]['volumes'])
|
||||
else:
|
||||
print("Warning: app {} defines unknown permission {}".format(app.metadata.name, subPermission))
|
||||
print("Warning: app {} defines unknown permission {}".format(app.metadata.name, permission))
|
||||
else:
|
||||
for subPermission in permission:
|
||||
if subPermission in permissions():
|
||||
container.environment_allow.extend(permissions()[subPermission]['environment_allow'])
|
||||
container.volumes.extend(permissions()[subPermission]['volumes'])
|
||||
else:
|
||||
print("Warning: app {} defines unknown permission {}".format(app.metadata.name, subPermission))
|
||||
return app
|
||||
|
||||
def convertDataDirToVolumeGen3(app: App) -> AppStage2:
|
||||
|
@ -62,8 +63,15 @@ def convertDataDirToVolumeGen3(app: App) -> AppStage2:
|
|||
# Also skip the container if container.lnd_mount_dir contains a :
|
||||
if container.mounts.bitcoin.find(":") == -1:
|
||||
container.volumes.append('${BITCOIN_DATA_DIR}:' + container.mounts.bitcoin)
|
||||
del container.mounts
|
||||
|
||||
if container.mounts.c_lightning:
|
||||
if not 'c-lightning' in app.metadata.dependencies:
|
||||
print("Warning: container {} of app {} defines c-lightning mount dir but doesn't request c-lightning permission".format(container.name, app.metadata.name))
|
||||
# Skip this container
|
||||
continue
|
||||
# Also skip the container if container.lnd_mount_dir contains a :
|
||||
if container.mounts.c_lightning.find(":") == -1:
|
||||
container.volumes.append('${C_LIGHTNING_DATA_DIR}:' + container.mounts.c_lightning)
|
||||
del container.mounts
|
||||
return app
|
||||
|
||||
def createComposeConfigFromV3(app: dict, nodeRoot: str):
|
||||
|
@ -73,7 +81,7 @@ def createComposeConfigFromV3(app: dict, nodeRoot: str):
|
|||
newApp: App = generateApp(app)
|
||||
for container in newApp.containers:
|
||||
# TODO: Make this dynamic and not hardcoded
|
||||
if container.requires and "c-lightning" in container.requires:
|
||||
if container.requires and "lnd" in container.requires:
|
||||
ignoredContainers.append(container.name)
|
||||
container.ignored = True
|
||||
elif container.requires:
|
||||
|
|
|
@ -69,7 +69,7 @@ def getAppYml(name):
|
|||
sourceMap = {
|
||||
name: {
|
||||
"githubRepo": "runcitadel/core",
|
||||
"branch": "v2"
|
||||
"branch": "c-lightning-v3"
|
||||
}
|
||||
}
|
||||
url = 'https://raw.githubusercontent.com/{}/{}/apps/{}/app.yml'.format(sourceMap[name]["githubRepo"], sourceMap[name]["branch"], name)
|
||||
|
@ -228,6 +228,7 @@ def compose(app, arguments):
|
|||
subprocess.call("chmod -R 770 {}".format(os.path.join(appDataDir, app, "data", "nextcloud")), shell=True)
|
||||
os.environ["BITCOIN_DATA_DIR"] = os.path.join(nodeRoot, "bitcoin")
|
||||
os.environ["LND_DATA_DIR"] = os.path.join(nodeRoot, "lnd")
|
||||
os.environ["C_LIGHTNING_DATA_DIR"] = os.path.join(nodeRoot, "c-lightning")
|
||||
# List all hidden services for an app and put their hostname in the environment
|
||||
hiddenServices: List[str] = getAppHiddenServices(app)
|
||||
for service in hiddenServices:
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
import os
|
||||
import yaml
|
||||
|
||||
from lib.composegenerator.next.stage1 import createCleanConfigFromV3
|
||||
from lib.composegenerator.v2.networking import getMainContainer
|
||||
from lib.composegenerator.v1.networking import getFreePort
|
||||
from lib.entropy import deriveEntropy
|
||||
|
@ -40,6 +41,7 @@ def getAppRegistry(apps, app_path):
|
|||
app_metadata = []
|
||||
for app in apps:
|
||||
app_yml_path = os.path.join(app_path, app, 'app.yml')
|
||||
app_cache_path = os.path.join(app_path, app, 'app.cache.json')
|
||||
if os.path.isfile(app_yml_path):
|
||||
try:
|
||||
with open(app_yml_path, 'r') as f:
|
||||
|
@ -57,6 +59,8 @@ def getAppRegistry(apps, app_path):
|
|||
getPortsOldApp(app_yml, app)
|
||||
else:
|
||||
getPortsV3App(app_yml, app)
|
||||
with open(app_cache_path, 'w') as f:
|
||||
json.dump(createCleanConfigFromV3(app_yml, os.path.dirname(app_path)), f)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
print("App {} is invalid!".format(app))
|
||||
|
|
|
@ -93,7 +93,7 @@ def findAndValidateApps(dir: str):
|
|||
if 'dependencies' in appyml['metadata']:
|
||||
for dependency in appyml['metadata']['dependencies']:
|
||||
if isinstance(dependency, str):
|
||||
if dependency not in apps and dependency not in ["bitcoind", "lnd", "electrum"]:
|
||||
if dependency not in apps and dependency not in ["bitcoind", "lnd", "electrum", "c-lightning"]:
|
||||
print("WARNING: App '{}' has unknown dependency '{}'".format(app, dependency))
|
||||
apps.remove(app)
|
||||
should_continue=False
|
||||
|
@ -118,7 +118,7 @@ def findAndValidateApps(dir: str):
|
|||
for permission in container['permissions']:
|
||||
if permission not in appyml['metadata']['dependencies'] and permission not in ["root", "hw"]:
|
||||
print("WARNING: App {}'s container '{}' requires the '{}' permission, but the app doesn't list it in it's dependencies".format(app, container['name'], permission))
|
||||
apps.remove(app)
|
||||
#apps.remove(app)
|
||||
# Skip to the next iteration of the loop
|
||||
continue
|
||||
return apps
|
||||
|
|
0
c-lightning/.gitkeep
Normal file
0
c-lightning/.gitkeep
Normal file
|
@ -108,7 +108,7 @@ services:
|
|||
ipv4_address: $DASHBOARD_IP
|
||||
manager:
|
||||
container_name: manager
|
||||
image: ghcr.io/runcitadel/manager:feat-karen-v2@sha256:61dfc6a23bb6603096673e517ec058730ca7e1fbe251df38760c2860d03b1dd0
|
||||
image: ghcr.io/runcitadel/manager:v0.0.13@sha256:3ced2643e12253fea46abb48a69dcd999d69d3d86ed9956ae0298d4f6be4f06d
|
||||
depends_on:
|
||||
- tor
|
||||
- redis
|
||||
|
@ -169,10 +169,12 @@ services:
|
|||
- bitcoin
|
||||
- lightning
|
||||
- redis
|
||||
- c-lightning
|
||||
command: sh -c "./wait-for-manager.sh $MANAGER_IP && ./start.sh"
|
||||
restart: on-failure
|
||||
volumes:
|
||||
- ${PWD}/lnd:/lnd
|
||||
- ${PWD}/c-lightning:/c-lightning
|
||||
- jwt-public-key:/jwt-public-key
|
||||
environment:
|
||||
PORT: '3005'
|
||||
|
@ -185,6 +187,7 @@ services:
|
|||
JWT_PUBLIC_KEY_FILE: /jwt-public-key/jwt.pem
|
||||
DEVICE_HOSTS: ${DEVICE_HOSTS:-"http://citadel.local"}
|
||||
UNSAFE_REMOVE_CORS_CHECK: true
|
||||
LIGHTNING_IMPL: c-lightning
|
||||
networks:
|
||||
default:
|
||||
ipv4_address: $MIDDLEWARE_IP
|
||||
|
@ -222,6 +225,21 @@ services:
|
|||
networks:
|
||||
default:
|
||||
ipv4_address: $ELECTRUM_IP
|
||||
c-lightning:
|
||||
container_name: c-lightning
|
||||
image: ghcr.io/runcitadel/core-ln:main@sha256:827264070bb07b74d695ca8e6505a241c1a8fbbef84b7a88cdee258811eb3112
|
||||
environment:
|
||||
LIGHTNINGD_NETWORK: bitcoin
|
||||
CL_REST_STATE_DIR: /data/.lightning
|
||||
restart: on-failure
|
||||
volumes:
|
||||
- ${PWD}/c-lightning:/data/.lightning
|
||||
- ${PWD}/bitcoin:/data/.bitcoin
|
||||
ports:
|
||||
- $SPARKO_RPC_PORT:$SPARKO_RPC_PORT
|
||||
networks:
|
||||
default:
|
||||
ipv4_address: $C_LIGHTNING_IP
|
||||
redis:
|
||||
container_name: redis
|
||||
image: redis:7.0.0-bullseye@sha256:ad0705f2e2344c4b642449e658ef4669753d6eb70228d46267685045bf932303
|
||||
|
@ -235,6 +253,17 @@ services:
|
|||
networks:
|
||||
default:
|
||||
ipv4_address: $REDIS_IP
|
||||
liquid:
|
||||
container_name: liquid
|
||||
image: ghcr.io/runcitadel/elements:master@sha256:94fe4368b62088d484931cf35ef27dd4ef538af4f3a59e100fdaa6a10b13ab12
|
||||
volumes:
|
||||
- ${PWD}/elements:/data/.elements
|
||||
restart: on-failure
|
||||
stop_grace_period: 1m
|
||||
init: true
|
||||
networks:
|
||||
default:
|
||||
ipv4_address: $LIQUID_IP
|
||||
networks:
|
||||
default:
|
||||
name: citadel_main_network
|
||||
|
|
0
elements/.gitkeep
Normal file
0
elements/.gitkeep
Normal file
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"version": "0.0.3",
|
||||
"name": "Citadel 0.0.3",
|
||||
"version": "0.0.4-liquid.1",
|
||||
"name": "Citadel 0.0.4 Release Candidate 1",
|
||||
"requires": ">=0.0.1",
|
||||
"notes": "This update fixes multiple bugs on the dashboard and contains a rewritten app system to prepare for Core Lightning compatibility. We also added a new dark mode toggle and updated the instructions to get a Lightning address."
|
||||
"notes": "This update fixes multiple bugs in the 0.0.4 release."
|
||||
}
|
||||
|
|
46
scripts/configure
vendored
46
scripts/configure
vendored
|
@ -6,7 +6,7 @@
|
|||
|
||||
import sys
|
||||
import os
|
||||
from lib.rpcauth import get_data
|
||||
from lib.rpcauth import get_data, generate_password
|
||||
import re
|
||||
import subprocess
|
||||
import json
|
||||
|
@ -161,6 +161,16 @@ if reconfiguring:
|
|||
NGINX_SSL_PORT="443"
|
||||
if 'UPDATE_CHANNEL' in dotenv and dotenv['UPDATE_CHANNEL'] != "main" and dotenv['UPDATE_CHANNEL'] != "migration":
|
||||
UPDATE_CHANNEL=dotenv['UPDATE_CHANNEL']
|
||||
if 'SPARKO_RPC_USER' in dotenv and 'SPARKO_RPC_PASS' in dotenv:
|
||||
SPARKO_RPC_USER=dotenv['SPARKO_RPC_USER']
|
||||
SPARKO_RPC_PASS=dotenv['SPARKO_RPC_PASS']
|
||||
else:
|
||||
SPARKO_RPC_USER="citadel"
|
||||
SPARKO_RPC_PASS=generate_password()
|
||||
if 'SPARKO_RPC_PORT' in dotenv:
|
||||
SPARKO_RPC_PORT=dotenv['SPARKO_RPC_PORT']
|
||||
else:
|
||||
SPARKO_RPC_PORT=9737
|
||||
else:
|
||||
# Generate RPC credentials
|
||||
print("Generating auth credentials\n")
|
||||
|
@ -168,6 +178,10 @@ else:
|
|||
BITCOIN_RPC_DETAILS=get_data(BITCOIN_RPC_USER)
|
||||
BITCOIN_RPC_AUTH=BITCOIN_RPC_DETAILS['auth']
|
||||
BITCOIN_RPC_PASS=BITCOIN_RPC_DETAILS['password']
|
||||
SPARKO_RPC_USER="citadel"
|
||||
SPARKO_RPC_PASS=generate_password()
|
||||
|
||||
SPARKO_RPC_PORT="9737"
|
||||
|
||||
# Pull Tor image and generate Tor password
|
||||
print("Generating Tor password\n")
|
||||
|
@ -186,8 +200,11 @@ BOLT_DB_OPTIONS=""
|
|||
CHANNEL_LIMITATIONS=""
|
||||
BASEFEE = "bitcoin.basefee=0"
|
||||
EXTERNAL_IP = ""
|
||||
C_LIGHTNING_TOR_ADDR = ""
|
||||
if os.path.isfile('./tor/data/bitcoin-p2p/hostname'):
|
||||
EXTERNAL_IP="externalip=" + open('./tor/data/bitcoin-p2p/hostname').read()
|
||||
if os.path.isfile('./tor/data/c-lightning/hostname'):
|
||||
C_LIGHTNING_TOR_ADDR = open('./tor/data/c-lightning/hostname').read().strip()
|
||||
|
||||
if os.path.isfile("./lnd/lnd.conf"):
|
||||
with open("./lnd/lnd.conf", 'r') as file:
|
||||
|
@ -212,6 +229,16 @@ if os.path.isfile("./lnd/lnd.conf"):
|
|||
if line.startswith("db.bolt.auto-compact"):
|
||||
BOLT_DB_OPTIONS += "\n" + line.strip()
|
||||
|
||||
C_LIGHTNING_ALIAS_AND_COLOR = ""
|
||||
if os.path.isfile("./c-lightning/config"):
|
||||
with open("./c-lightning/config", 'r') as file:
|
||||
for line in file:
|
||||
if line.startswith("alias="):
|
||||
C_LIGHTNING_ALIAS_AND_COLOR += "\n" + line.strip()
|
||||
if line.startswith("rgb="):
|
||||
C_LIGHTNING_ALIAS_AND_COLOR += "\n" + line.strip()
|
||||
|
||||
|
||||
if BOLT_DB_OPTIONS != "":
|
||||
BOLT_DB_OPTIONS = "[bolt]\n" + BOLT_DB_OPTIONS
|
||||
|
||||
|
@ -268,6 +295,7 @@ APPS_TOR_IP="10.21.21.12"
|
|||
APPS_2_TOR_IP="10.21.21.13"
|
||||
APPS_3_TOR_IP="10.21.21.14"
|
||||
REDIS_IP="10.21.21.15"
|
||||
C_LIGHTNING_IP="10.21.21.16"
|
||||
|
||||
# Ports
|
||||
BITCOIN_RPC_PORT="8332"
|
||||
|
@ -282,6 +310,16 @@ ELECTRUM_PORT="50001"
|
|||
TOR_PROXY_PORT="9050"
|
||||
TOR_CONTROL_PORT="29051"
|
||||
|
||||
# Hardcoded for now, they will be dynamic later
|
||||
LIQUID_IP="10.21.21.17"
|
||||
# TODO: Check the "standard ports here"
|
||||
LIQUID_P2P_PORT = 7042
|
||||
LIQUID_RPC_PORT = 7043
|
||||
LIQUID_RPC_USER="citadel"
|
||||
liquidRpcData=get_data(LIQUID_RPC_USER)
|
||||
LIQUID_RPC_AUTH=liquidRpcData['auth']
|
||||
LIQUID_RPC_PASS=liquidRpcData['password']
|
||||
|
||||
DEVICE_HOSTNAME=""
|
||||
try:
|
||||
DEVICE_HOSTNAME=subprocess.check_output("hostname").decode("utf-8").strip()
|
||||
|
@ -334,8 +372,10 @@ templates_to_build = {
|
|||
"./templates/bitcoin-sample.conf": "./bitcoin/bitcoin.conf",
|
||||
"./templates/.env-sample": "./.env",
|
||||
"./templates/electrs-sample.toml": "./electrs/electrs.toml",
|
||||
"./templates/nginx-sample.conf": "./nginx/nginx.conf",
|
||||
"./templates/c-lightning-sample.conf": "./c-lightning/config",
|
||||
"./templates/fulcrumx-sample.conf": "./fulcrumx/fulcrumx.conf",
|
||||
"./templates/nginx-sample.conf": "./nginx/nginx.conf"
|
||||
"./templates/elements-sample.conf": "./elements/elements.conf"
|
||||
}
|
||||
|
||||
print("Generating configuration files...")
|
||||
|
@ -372,7 +412,7 @@ elif not updating:
|
|||
print("Updating apps...\n")
|
||||
os.system('./scripts/app --invoked-by-configure generate')
|
||||
print("Configuring permissions...\n")
|
||||
os.system('chown -R 1000:1000 {}'.format(CITADEL_ROOT))
|
||||
#os.system('chown -R 1000:1000 {}'.format(CITADEL_ROOT))
|
||||
# Touch status_dir/configured
|
||||
with open(status_dir+'/configured', 'w') as file:
|
||||
file.write('')
|
||||
|
|
|
@ -143,9 +143,9 @@ if [[ "${1}" == "--run" ]]; then
|
|||
|
||||
echo
|
||||
echo "Lightning logs"
|
||||
echo "--------------"
|
||||
echo "--------"
|
||||
echo
|
||||
docker compose logs --tail=30 lightning
|
||||
docker compose logs --tail=30 c-lightning
|
||||
|
||||
echo
|
||||
echo "Electrum logs"
|
||||
|
|
|
@ -11,6 +11,7 @@ app-data/*
|
|||
apps/networking.json
|
||||
nginx/*
|
||||
services/installed.yml
|
||||
c-lightning/*
|
||||
apps/sourceMap.json
|
||||
apps/.updateignore
|
||||
fulcrumx/*
|
||||
|
|
|
@ -6,3 +6,4 @@ tor/torrc-apps-3
|
|||
tor/torrc-core
|
||||
electrs/electrs.toml
|
||||
apps/docker-compose.common.yml
|
||||
c-lightning/.gitkeep
|
||||
|
|
|
@ -25,14 +25,6 @@ echo
|
|||
|
||||
IS_MIGRATING=0
|
||||
|
||||
# If ${CITADEL_ROOT}/c-lightning exists, fail
|
||||
if [[ -d "${CITADEL_ROOT}/c-lightning" ]]; then
|
||||
echo "This update is not compatible with the c-lightning beta."
|
||||
cat <<EOF > "$CITADEL_ROOT"/statuses/update-status.json
|
||||
{"state": "installing", "progress": 1, "description": "This update is not compatible with c-lightning", "updateTo": "$RELEASE"}
|
||||
EOF
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Make Citadel OS specific updates
|
||||
if [[ ! -z "${CITADEL_OS:-}" ]]; then
|
||||
|
|
|
@ -28,6 +28,7 @@ BITCOIN_ZMQ_RAWTX_PORT=<bitcoin-zmq-rawtx-port>
|
|||
BITCOIN_ZMQ_HASHBLOCK_PORT=<bitcoin-zmq-hashblock-port>
|
||||
BITCOIN_ZMQ_SEQUENCE_PORT=<bitcoin-zmq-sequence-port>
|
||||
LND_IP=<lnd-ip>
|
||||
C_LIGHTNING_IP=<c-lightning-ip>
|
||||
LND_GRPC_PORT=<lnd-grpc-port>
|
||||
LND_REST_PORT=<lnd-rest-port>
|
||||
ELECTRUM_IP=<electrum-ip>
|
||||
|
@ -41,3 +42,10 @@ APPS_2_TOR_IP=<apps-2-tor-ip>
|
|||
APPS_3_TOR_IP=<apps-3-tor-ip>
|
||||
DOCKER_BINARY=<docker-binary>
|
||||
UPDATE_CHANNEL=<update-channel>
|
||||
SPARKO_RPC_PORT=<sparko-rpc-port>
|
||||
SPARKO_RPC_USER='<sparko-rpc-user>'
|
||||
SPARKO_RPC_PASS='<sparko-rpc-pass>'
|
||||
LIQUID_RPC_USER='<liquid-rpc-user>'
|
||||
LIQUID_RPC_PASS='<liquid-rpc-pass>'
|
||||
LIQUID_RPC_AUTH='<liquid-rpc-auth>'
|
||||
LIQUID_IP=<liquid-ip>
|
||||
|
|
41
templates/c-lightning-sample.conf
Normal file
41
templates/c-lightning-sample.conf
Normal file
|
@ -0,0 +1,41 @@
|
|||
<bitcoin-network>
|
||||
|
||||
bitcoin-datadir=/data/.bitcoin
|
||||
|
||||
bitcoin-rpcuser=<bitcoin-rpc-user>
|
||||
|
||||
bitcoin-rpcpassword=<bitcoin-rpc-pass>
|
||||
|
||||
bitcoin-rpcconnect=<bitcoin-ip>
|
||||
|
||||
bitcoin-rpcport=<bitcoin-rpc-port>
|
||||
|
||||
experimental-onion-messages
|
||||
|
||||
experimental-offers
|
||||
|
||||
bind-addr=0.0.0.0:9735
|
||||
|
||||
announce-addr=<c-lightning-tor-addr>
|
||||
|
||||
proxy=<tor-proxy-ip>:<tor-proxy-port>
|
||||
|
||||
always-use-proxy=true
|
||||
|
||||
<c-lightning-alias-and-color>
|
||||
|
||||
sparko-host=0.0.0.0
|
||||
sparko-port=<sparko-rpc-port>
|
||||
|
||||
# the tls path is just the directory where your self-signed key and certificate are.
|
||||
# (see below for code snippets that generate them on Linux)
|
||||
# the path is relative to your lightning-dir, so "sparko-tls" will translate to "~/.lightning/bitcoin/sparko-tls/"
|
||||
# (you can also use an absolute path)
|
||||
# if not specified the app will run without TLS (as http://)
|
||||
sparko-tls-path=sparko-tls
|
||||
|
||||
# login credentials for using the wallet app.
|
||||
# under the hood these are translated into an access key with full access.
|
||||
# the default login is none, which doesn't allow you to use the wallet app,
|
||||
# but you can still use the /rpc endpoint with other keys specified at sparko-keys=
|
||||
sparko-login=<sparko-rpc-user>:<sparko-rpc-pass>
|
42
templates/elements-sample.conf
Normal file
42
templates/elements-sample.conf
Normal file
|
@ -0,0 +1,42 @@
|
|||
# SPDX-FileCopyrightText: 2021-2022 Citadel and contributors
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
# Please note: This file can't be changed, any changes will be overwritten the next time you start Citadel.
|
||||
|
||||
# Tor
|
||||
proxy=<tor-proxy-ip>:<tor-proxy-port>
|
||||
listen=1
|
||||
|
||||
chain=liquidv1
|
||||
|
||||
# Bitcoind connection
|
||||
mainchainrpchost=<bitcoin-ip>
|
||||
mainchainrpcport=<bitcoin-rpc-port>
|
||||
mainchainrpcuser=<bitcoin-rpc-user>
|
||||
mainchainrpcpassword=<bitcoin-rpc-pass>
|
||||
|
||||
# Connections
|
||||
rpcallowip=<gateway-ip>/16
|
||||
rpcallowip=127.0.0.1
|
||||
|
||||
# Memory
|
||||
dbcache=200
|
||||
maxmempool=300
|
||||
|
||||
# Indexes
|
||||
txindex=1
|
||||
blockfilterindex=1
|
||||
|
||||
# SPV
|
||||
peerbloomfilters=1
|
||||
peerblockfilters=1
|
||||
|
||||
<external-ip>
|
||||
|
||||
rpcuser=<liquid-rpc-user>
|
||||
rpcpassword=<liquid-rpc-pass>
|
||||
rpcport=<liquid-rpc-port>
|
||||
port=<liquid-p2p-port>
|
||||
rpcbind=<liquid-ip>
|
||||
rpcbind=127.0.0.1
|
|
@ -32,5 +32,13 @@ HiddenServicePort <lnd-rest-port> <lnd-ip>:<lnd-rest-port>
|
|||
HiddenServiceDir /var/lib/tor/lnd-grpc
|
||||
HiddenServicePort <lnd-grpc-port> <lnd-ip>:<lnd-grpc-port>
|
||||
|
||||
# c-lightning Hidden Service
|
||||
HiddenServiceDir /var/lib/tor/c-lightning
|
||||
HiddenServicePort 9735 <c-lightning-ip>:9735
|
||||
|
||||
# c-lightning sparko Hidden Service
|
||||
HiddenServiceDir /var/lib/tor/c-lightning-sparko
|
||||
HiddenServicePort 9737 <c-lightning-ip>:9737
|
||||
|
||||
HashedControlPassword <tor-hashed-password>
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user