Compare commits

...

161 Commits

Author SHA1 Message Date
AaronDewes
419522f138 Merge remote-tracking branch 'origin/c-lightning' into liquid 2022-05-24 05:52:06 +00:00
AaronDewes
858c1e68c8 Merge branch 'beta' into liquid 2022-05-24 05:47:58 +00:00
AaronDewes
6e74290691 Merge branch 'stable' into beta 2022-05-24 05:39:59 +00:00
AaronDewes
62d51aa807 0.0.4 rc1 2022-05-22 14:34:09 +00:00
AaronDewes
781299fa1a Update manager 2022-05-22 13:10:26 +00:00
AaronDewes
4eb9819cf9 Remove leftovers from WIP karen v2 2022-05-22 13:08:07 +00:00
AaronDewes
9a6501a80e Merge remote-tracking branch 'origin/karen-v2' into beta 2022-05-22 13:07:12 +00:00
AaronDewes
d45da547d6 Merge branch 'stable' into beta 2022-05-22 13:06:30 +00:00
Aaron Dewes
80ead94dbd
Remove unused import 2022-05-20 10:12:53 +02:00
Aaron Dewes
a5e74fa1d2
Remove log 2022-05-19 19:03:55 +02:00
AaronDewes
f6dae9c646 Add karen v2 2022-05-19 10:41:21 +00:00
AaronDewes
3cec30340b Generate cache files for compose generator 2022-05-16 09:10:52 +00:00
AaronDewes
c89d00ad7a Fix app.yml generation 2022-05-16 07:51:46 +00:00
AaronDewes
bc60190df5 Merge branch 'stable' into c-lightning 2022-05-16 07:47:08 +00:00
AaronDewes
611d4a166b Add Karen v2 demo 2022-05-16 07:19:50 +00:00
AaronDewes
56946a9812 Put the latest beta into info.json 2022-05-16 06:11:47 +00:00
AaronDewes
6b29a76d81 Switch app store to beta branch 2022-05-16 06:11:07 +00:00
AaronDewes
1d1200fcfd Update Core lightning 2022-05-11 08:22:40 +00:00
AaronDewes
1cdbe10a07 Merge branch 'c-lightning' into liquid 2022-05-06 18:59:57 +00:00
AaronDewes
969d4e7796 Merge branch 'beta' into c-lightning 2022-05-01 18:17:48 +00:00
AaronDewes
3cc9b69fca Add support for udpPorts 2022-05-01 18:16:34 +00:00
AaronDewes
6d1013932d Merge branch 'beta' into c-lightning 2022-05-01 00:44:05 +00:00
AaronDewes
eaab1715e0 Update dashboard 2022-05-01 00:43:55 +00:00
AaronDewes
4692a94b5e Bump version 2022-05-01 00:17:55 +00:00
AaronDewes
add94a946d Merge branch 'beta' into c-lightning 2022-05-01 00:17:12 +00:00
AaronDewes
89da639247 Update containers 2022-05-01 00:16:10 +00:00
AaronDewes
92aed920b9 Bump version 2022-04-30 11:35:35 +00:00
Aaron Dewes
e5b24967d1
Fix updates 2022-04-30 13:34:44 +02:00
AaronDewes
0f8c95fea3 Bump version 2022-04-30 11:21:39 +00:00
AaronDewes
8f1807c57d Minor fix 2022-04-30 11:21:26 +00:00
AaronDewes
c4126fae93 Update dashboard 2022-04-30 11:20:18 +00:00
AaronDewes
f95bbb66f5 Better app updating UI 2022-04-30 11:07:11 +00:00
AaronDewes
16c9dbe615 Bump version 2022-04-30 11:03:53 +00:00
AaronDewes
06a40c67d3 Update dashboard 2022-04-30 11:03:48 +00:00
AaronDewes
1e3556ac1f Fix for c-lightning 2022-04-30 11:02:19 +00:00
AaronDewes
8a8ac646e2 Bump version 2022-04-30 08:05:23 +00:00
AaronDewes
4f808de093 Update dashboard 2022-04-30 08:03:48 +00:00
AaronDewes
a9018d1570 Update debug script for c-lightning 2022-04-30 08:02:56 +00:00
AaronDewes
30ba84ddbb Merge remote-tracking branch 'origin/beta' into c-lightning 2022-04-30 08:01:53 +00:00
AaronDewes
f4f8b2274c Merge branch 'beta' of https://github.com/runcitadel/core into beta 2022-04-26 18:43:40 +00:00
AaronDewes
f8139f5642 Fix port assignment 2022-04-26 18:42:53 +00:00
Philipp Walter
19029a20ef
fix: update container names in debug scripts (#18)
* fix: update container names in debug scripts

* fix: use spelling for Docker Compose v2 los
2022-04-23 18:09:41 +02:00
AaronDewes
ecb3456206 Fix minor bug 2022-04-23 14:56:33 +00:00
AaronDewes
14b58e75c6 Update c-lightning 2022-04-22 18:46:36 +00:00
AaronDewes
a2aa824b85 Merge remote-tracking branch 'origin/beta' into c-lightning 2022-04-22 18:43:56 +00:00
AaronDewes
b1bf16f787 Update manager 2022-04-22 15:18:46 +00:00
AaronDewes
aecf5e6ff2 Update some containers 2022-04-22 14:44:42 +00:00
AaronDewes
555e148996 Update LND to v0.14.3-beta 2022-04-22 14:05:05 +00:00
AaronDewes
cff5362557 Another fix 2022-04-10 19:27:18 +00:00
AaronDewes
d72e128b2f Try fixes 2022-04-10 19:22:54 +00:00
AaronDewes
f62abae4fc Merge branch 'beta' into c-lightning 2022-04-10 19:16:45 +00:00
AaronDewes
09bb3c3367 Some more fixes 2022-04-10 19:15:18 +00:00
AaronDewes
d8cf6de9c4 Fix more 2022-04-10 19:13:30 +00:00
AaronDewes
bf0879f049 Fix 2022-04-10 19:08:07 +00:00
AaronDewes
3e58ccc60e Fix 2022-04-10 19:06:57 +00:00
AaronDewes
91f8a88879 Merge branch 'beta' into c-lightning 2022-04-10 19:02:18 +00:00
AaronDewes
ddcc73c4b6 Fix 2022-04-10 18:54:24 +00:00
AaronDewes
fdef8439b3 Merge branch 'beta' into c-lightning 2022-04-10 18:25:18 +00:00
AaronDewes
dbd0991a78 Fix schema 2022-04-10 09:47:17 +00:00
AaronDewes
895e3ac842 Improve app.yml spec 2022-04-10 07:16:08 +00:00
AaronDewes
26aab65052 Change repo 2022-04-09 19:40:36 +00:00
AaronDewes
45941daee9 More improvements and breaking changes 2022-04-09 19:39:19 +00:00
Aaron Dewes
ff463ba644
Update docker-compose.yml 2022-04-08 21:32:43 +02:00
AaronDewes
a768f0ff8c Add support for c-lightning to app.yml v3 2022-04-08 10:24:39 +00:00
AaronDewes
d6d8f3c17c Fix fallback URL 2022-04-08 10:22:48 +00:00
AaronDewes
a098b0a809 Merge remote-tracking branch 'origin/beta' into c-lightning 2022-04-08 10:21:46 +00:00
AaronDewes
9563dd6c2f Update c-lightning 2022-04-08 10:19:56 +00:00
AaronDewes
f6c3f7a192 Citadel 0.0.3 Beta 1 2022-04-07 17:46:20 +00:00
AaronDewes
98a16c4d6e Fix logic bug 2022-04-07 17:35:24 +00:00
AaronDewes
ab8b83101c Merge branch 'app-v3' into beta 2022-04-07 17:09:55 +00:00
AaronDewes
542b686313 Fix app updates 2022-04-07 17:09:23 +00:00
AaronDewes
115c126616 Fix type 2022-04-07 17:05:02 +00:00
AaronDewes
68c58767e2 Prepare for apps which support either one or another dependency 2022-04-07 16:56:16 +00:00
AaronDewes
28e2b64a70 Use v3 app repo 2022-04-07 16:33:03 +00:00
AaronDewes
64fff5b494 Fix typo 2022-04-07 15:27:15 +00:00
AaronDewes
a600fd4946 App.yml v3 (draft) 2022-04-07 13:24:48 +00:00
Aaron Dewes
6cca5a0ce4
Update docker-compose.yml 2022-03-30 19:09:50 +02:00
AaronDewes
c678bbef24 Merge branch 'c-lightning' into liquid 2022-03-27 12:18:51 +00:00
AaronDewes
bd3d4ea14e Update middleware 2022-03-27 12:16:41 +00:00
Aaron Dewes
f732db4fcb
Fix elements config 2022-03-27 10:19:10 +02:00
Aaron Dewes
7677695e95
Update elements 2022-03-27 10:07:31 +02:00
AaronDewes
c1730d4e73 Update elements 2022-03-25 06:45:45 +00:00
AaronDewes
77569b829d Merge branch 'c-lightning' into liquid 2022-03-25 06:44:39 +00:00
AaronDewes
a721f79b49 Merge branch 'beta' into c-lightning 2022-03-25 06:44:26 +00:00
AaronDewes
ba951feee3 Next beta 2022-03-25 06:43:20 +00:00
AaronDewes
53b23c557e Update dashboard 2022-03-25 06:42:28 +00:00
AaronDewes
670f7c15de Merge branch 'stable' into beta 2022-03-25 06:41:09 +00:00
Aaron Dewes
ee99fa3918
Update docker-compose.yml 2022-03-23 16:00:07 +01:00
Aaron Dewes
5e7ba77ea1
Update docker-compose.yml 2022-03-23 14:20:49 +01:00
Aaron Dewes
0dae2c7743
Update docker-compose.yml 2022-03-23 10:58:14 +01:00
Aaron Dewes
5ec63b4fa2
Update docker-compose.yml 2022-03-23 10:56:37 +01:00
Aaron Dewes
82e9aaac10
Update docker-compose.yml 2022-03-23 10:55:47 +01:00
Aaron Dewes
c701ceb8db
Update elements 2022-03-23 07:13:52 +01:00
Aaron Dewes
1b8ec58355
Update to latest experimental middleware 2022-03-22 20:58:27 +01:00
Aaron Dewes
81c4059c78
Update docker-compose.yml 2022-03-22 17:41:59 +01:00
AaronDewes
d821fb2f39 Fix liquid 2022-03-22 11:21:52 +00:00
AaronDewes
05102893fd WIP: Add liquid container 2022-03-22 07:38:36 +00:00
AaronDewes
24a4182289 Start working on Liquid integration 2022-03-22 07:17:38 +00:00
AaronDewes
0515b5b91d Next beta version 2022-03-21 08:43:28 +00:00
Aaron Dewes
06fefc0d02
Update docker-compose.yml 2022-03-21 09:23:01 +01:00
Aaron Dewes
9ba9946a3d
Update docker-compose.yml 2022-03-20 14:36:57 +01:00
AaronDewes
e073c5059f More fixes 2022-03-20 09:00:08 +00:00
AaronDewes
91de46b8be More c-lightning fixes 2022-03-19 22:06:39 +00:00
AaronDewes
149eaee0b5 Fix typo 2022-03-19 21:40:01 +00:00
AaronDewes
db0f0a6ffd WIP: Sparko 2022-03-19 21:32:35 +00:00
AaronDewes
877c468a74 Merge remote-tracking branch 'origin/proposal/0.0.2' into c-lightning 2022-03-19 21:16:47 +00:00
Aaron Dewes
5f20686c76
Update manager 2022-03-19 17:24:13 +01:00
Philipp Walter
911988ff37
fix: update lightning container name 2022-03-19 17:13:50 +01:00
AaronDewes
81cfb4530f More cleanups to the reserved ports list 2022-03-19 15:59:57 +00:00
AaronDewes
9a885bca39 Start cleaning the ports list 2022-03-19 15:56:47 +00:00
AaronDewes
ce1f6b33c7 Update dashboard to 0.0.9 2022-03-19 15:33:29 +00:00
AaronDewes
4a7e9f5765 More information for c-lightning users 2022-03-19 15:32:05 +00:00
AaronDewes
2429b77e63 More improvements to the app CLI 2022-03-19 15:29:51 +00:00
AaronDewes
944e390e40 Add WIP release notes for 0.0.2 2022-03-19 15:27:08 +00:00
AaronDewes
32e69f745c Fix stop script 2022-03-19 15:19:30 +00:00
Aaron Dewes
aedba482c2
Update c-lightning 2022-03-17 18:50:19 +01:00
AaronDewes
6cdc4c2c33 Merge branch 'beta' into c-lightning 2022-03-17 15:26:23 +00:00
AaronDewes
ece6df33b8 Next beta 2022-03-17 15:09:59 +00:00
AaronDewes
e599cc0a92 Fix stop script 2022-03-17 15:09:41 +00:00
AaronDewes
606bbabbd6 Citadel 0.0.2 beta 1 2022-03-17 08:55:45 +00:00
Aaron Dewes
8bb01f2884 Improve app manager wrapper script 2022-03-17 09:43:59 +01:00
AaronDewes
fac17405c8 Update some containers 2022-03-17 08:23:11 +00:00
Philipp Walter
5986af3a0f
build: update core images 2022-03-15 13:34:25 +01:00
Philipp Walter
b13f046e53
build: don't run manager & middleware as root 2022-03-15 13:34:23 +01:00
Philipp Walter
f6ff9b76b2
clean up println statements 2022-03-15 13:33:58 +01:00
Philipp Walter
a1ec559e5e
set DEVICE_HOSTNAME env var 2022-03-15 13:33:57 +01:00
Philipp Walter
bace00f25d
add network settings for new UI (development) 2022-03-15 13:33:57 +01:00
Aaron Dewes
2d9e2ae4d8
Update manager to 0.0.6 2022-03-13 15:33:58 +01:00
Aaron Dewes
001c4edc11
Fix update channel script 2022-03-12 17:24:49 +01:00
Aaron Dewes
7551771109
Update info.json 2022-03-12 15:03:57 +01:00
AaronDewes
987f48e78d Merge remote-tracking branch 'origin/beta' into c-lightning 2022-03-12 11:59:56 +00:00
Aaron Dewes
c862ddc9c7
Update FulcrumX 2022-03-11 12:21:45 +01:00
AaronDewes
afde8fb530 Update docker-compose 2022-03-11 06:20:52 +00:00
AaronDewes
06aa65fa92 More work on service managment 2022-03-11 06:18:31 +00:00
AaronDewes
69bae236c4 Stop installed apps during update 2022-03-11 05:58:53 +00:00
AaronDewes
88969f6641 More fixes for host mode apps 2022-03-10 19:04:54 +00:00
AaronDewes
96f942e7a0 Fixes for apps which use the host network 2022-03-10 18:59:24 +00:00
AaronDewes
f3018307d4 Some FulcrumX fixes 2022-03-10 18:43:36 +00:00
AaronDewes
2d4f1adfe5 Some fixes 2022-03-10 18:35:15 +00:00
AaronDewes
efadad6887 Update FulcrumX 2022-03-10 16:14:55 +00:00
AaronDewes
8a54cda14e Some fixes 2022-03-09 12:12:31 +00:00
AaronDewes
33eba7f156 More work on fulcrum/electrs switching 2022-03-09 11:55:44 +00:00
AaronDewes
1d31c10953 Start working on Fulcrum support 2022-03-09 11:36:52 +00:00
Aaron Dewes
242046d0c3 Merge branch 'stable' of github.com:runcitadel/core into c-lightning 2022-03-07 17:52:42 +01:00
Aaron Dewes
5b282751e2 Remove c-lightning check 2022-03-01 20:37:43 +01:00
Aaron Dewes
d1e82d2d01 Merge branch 'stable' into c-lightning 2022-03-01 15:51:11 +01:00
Aaron Dewes
dca6847d4b Switch middleware to c-lightning 2022-02-26 13:59:54 +01:00
Aaron Dewes
aa1db0403d More fixes 2022-02-26 12:46:28 +01:00
Aaron Dewes
12c93c5ebb Update dashboard 2022-02-25 23:11:55 +01:00
Aaron Dewes
1a6c5df241 Update dashboard 2022-02-25 20:55:01 +01:00
Aaron Dewes
4d74408ae9 Fix c-lightning dependency 2022-02-25 20:38:13 +01:00
Aaron Dewes
11a81de9ee More c-lightning work 2022-02-25 20:30:06 +01:00
Aaron Dewes
8a582fc0c3 Merge branch 'main' into c-lightning 2022-02-25 15:06:33 +01:00
Aaron Dewes
66f82f3a5c
Remove update prompt 2022-02-25 14:42:34 +01:00
Aaron Dewes
2c2138f075 Don't fail if app doesn't exist 2022-02-19 18:26:37 +01:00
Aaron Dewes
ed6bd73968 Merge branch 'main' into c-lightning 2022-02-19 17:10:52 +01:00
Aaron Dewes
3cfdc6e9ca Publish 0.5.21 to c-lightning users 2022-02-12 10:04:32 +01:00
Aaron Dewes
dceb5e945e Update .updateinclude 2022-02-12 10:04:32 +01:00
Aaron Dewes
75403439cc Ignore c-lightning for updates 2022-02-12 10:04:29 +01:00
Aaron Dewes
c8ae197023 Use c-lightning apps branch 2022-02-12 10:04:08 +01:00
Aaron Dewes
c152dbd622 WIP: Integrate c-lightning into the app system 2022-02-12 10:04:08 +01:00
25 changed files with 262 additions and 52 deletions

5
.gitignore vendored
View File

@ -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

View File

@ -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

View File

@ -99,6 +99,7 @@ properties:
items:
type: string
enum:
- c-lightning
- lnd
- bitcoind
- electrum

View File

@ -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

View 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

View File

@ -44,7 +44,9 @@ def permissions():
"environment_allow": [
"C_LIGHTNING_IP"
],
"volumes": []
"volumes": [
'${C_LIGHTNING_DATA_DIR}:/c-lightning:ro'
]
},
}

View File

@ -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

View File

@ -23,6 +23,8 @@ def getFreePort(networkingFile: str, appId: str):
10009,
# LND REST
8080,
# Sparko
9737,
# Electrum Server
50001,
# Tor Proxy

View File

@ -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:

View File

@ -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:

View File

@ -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))

View File

@ -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
View File

View 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
View File

View 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
View File

@ -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('')

View File

@ -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"

View File

@ -11,6 +11,7 @@ app-data/*
apps/networking.json
nginx/*
services/installed.yml
c-lightning/*
apps/sourceMap.json
apps/.updateignore
fulcrumx/*

View File

@ -6,3 +6,4 @@ tor/torrc-apps-3
tor/torrc-core
electrs/electrs.toml
apps/docker-compose.common.yml
c-lightning/.gitkeep

View File

@ -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

View File

@ -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>

View 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>

View 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

View File

@ -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>