arkitekt-next 0.7.36__py3-none-any.whl → 0.7.38__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of arkitekt-next might be problematic. Click here for more details.

arkitekt_next/__blok__.py CHANGED
@@ -14,6 +14,9 @@ from arkitekt_next.bloks.mount import MountBlok
14
14
  from arkitekt_next.bloks.internal_docker import InternalDockerBlok
15
15
  from arkitekt_next.bloks.socket import DockerSocketBlok
16
16
  from arkitekt_next.bloks.rekuest import RekuestBlok
17
+ from arkitekt_next.bloks.tailscale import TailscaleBlok
18
+ from arkitekt_next.bloks.secret import SecretBlok
19
+ from arkitekt_next.bloks.namegen import PreformedNamesBlok
17
20
 
18
21
 
19
22
  def get_bloks():
@@ -34,4 +37,7 @@ def get_bloks():
34
37
  InternalDockerBlok(),
35
38
  DockerSocketBlok(),
36
39
  RekuestBlok(),
40
+ TailscaleBlok(),
41
+ SecretBlok(),
42
+ PreformedNamesBlok(),
37
43
  ]
@@ -1,5 +1,6 @@
1
1
  from pydantic import BaseModel
2
2
  from typing import Dict, Any
3
+ from arkitekt_next.bloks.tailscale import TailscaleBlok
3
4
  from blok import blok, InitContext, Renderer, Panel
4
5
  from .livekit import LocalLiveKitBlok
5
6
  from .mikro import MikroBlok
@@ -29,7 +30,7 @@ class ArkitektBlok:
29
30
  )
30
31
  )
31
32
 
32
- def preflight(self, lok: LocalLiveKitBlok, mikro: MikroBlok, kabinet: KabinetBlok, rekuest: RekuestBlok, fluss: FlussBlok, gateway: GatewayBlok, internal_engine: InternalDockerBlok):
33
+ def preflight(self, lok: LocalLiveKitBlok, mikro: MikroBlok, kabinet: KabinetBlok, rekuest: RekuestBlok, fluss: FlussBlok, gateway: GatewayBlok, internal_engine: InternalDockerBlok, scale: TailscaleBlok):
33
34
  print (lok, mikro, kabinet, rekuest, fluss, gateway, internal_engine)
34
35
 
35
36
 
@@ -58,13 +58,13 @@ class FlussBlok:
58
58
  mount_repo = Option(
59
59
  subcommand="mount_repo",
60
60
  help="Should we mount the repo into the container?",
61
- is_flag=True,
61
+ type=bool,
62
62
  default=self.mount_repo,
63
63
  )
64
64
  build_repo = Option(
65
65
  subcommand="build_repo",
66
66
  help="Should we build the container from the repo?",
67
- is_flag=True,
67
+ type=bool,
68
68
  default=self.build_repo,
69
69
  )
70
70
  with_host = Option(
@@ -36,6 +36,15 @@ class GatewayBlok:
36
36
  self.public_ips = DEFAULT_PUBLIC_URLS
37
37
  self.public_hosts = DEFAULT_PUBLIC_HOSTS
38
38
 
39
+ def get_internal_host(self):
40
+ return "caddy"
41
+
42
+ def get_https_port(self):
43
+ return 443
44
+
45
+ def get_http_port(self):
46
+ return 80
47
+
39
48
  def preflight(self, init: InitContext, dns: DnsService):
40
49
  for key, value in init.kwargs.items():
41
50
  setattr(self, key, value)
@@ -1,7 +1,11 @@
1
1
  from typing import Dict, Any
2
2
  import secrets
3
3
 
4
+ from arkitekt_next.bloks.lok import LokBlok
5
+ from arkitekt_next.bloks.services.gateway import GatewayService
6
+ from arkitekt_next.bloks.socket import DockerSocketBlok
4
7
  from blok import blok, InitContext, ExecutionContext, Option
8
+ from blok.bloks.services.dns import DnsService
5
9
  from blok.tree import YamlFile, Repo
6
10
 
7
11
 
@@ -9,16 +13,12 @@ from blok.tree import YamlFile, Repo
9
13
  class InternalDockerBlok:
10
14
  def __init__(self) -> None:
11
15
  self.host = "internal_docker"
12
- self.command = (
13
- "arkitekt-next run prod --redeem-token=mylittletoken --url http://caddy:80"
14
- )
16
+
15
17
  self.image = "jhnnsrs/deployer:0.0.1-vanilla"
16
18
  self.instance_id = "INTERNAL_DOCKER"
17
19
 
18
- def get_dependencies(self):
19
- return ["live.arkitekt.docker_socket"]
20
20
 
21
- def preflight(self, init: InitContext):
21
+ def preflight(self, init: InitContext, gateway: GatewayService, lok: LokBlok, socket: DockerSocketBlok):
22
22
  for key, value in init.kwargs.items():
23
23
  setattr(self, key, value)
24
24
 
@@ -27,7 +27,15 @@ class InternalDockerBlok:
27
27
  if self.skip:
28
28
  return
29
29
 
30
- self._socket = deps["live.arkitekt.docker_socket"].register_socket(self.host)
30
+ self._socket = socket.register_socket(self.host)
31
+ self.gateway_host = gateway.get_internal_host()
32
+ self.gateway_port = gateway.get_http_port()
33
+
34
+ self.token = lok.retrieve_token()
35
+
36
+ self.command = (
37
+ f"arkitekt-next run prod --redeem-token={self.token} --url http://{self.gateway_host}:{self.gateway_port}"
38
+ )
31
39
 
32
40
  self.initialized = True
33
41
 
@@ -50,27 +58,21 @@ class InternalDockerBlok:
50
58
  context.docker_compose.set_nested("services", self.host, db_service)
51
59
 
52
60
  def get_options(self):
53
- with_command = Option(
54
- subcommand="command",
55
- help="The fakts url for connection",
56
- default=self.command,
57
- )
58
61
  with_host = Option(
59
62
  subcommand="host",
60
- help="The fakts url for connection",
63
+ help="The host of this service",
61
64
  default=self.host,
62
65
  )
63
66
  with_skip = Option(
64
67
  subcommand="skip",
65
- help="The fakts url for connection",
68
+ help="Should we skip creating this service?",
66
69
  default=False,
67
70
  type=bool,
68
- is_flag=True,
71
+
69
72
  )
70
73
 
71
74
  return [
72
75
  with_host,
73
- with_command,
74
76
  with_skip,
75
77
  ]
76
78
 
@@ -57,13 +57,13 @@ class KabinetBlok:
57
57
  mount_repo = Option(
58
58
  subcommand="mount_repo",
59
59
  help="Should we mount the repo into the container?",
60
- is_flag=True,
60
+ type=bool,
61
61
  default=self.mount_repo,
62
62
  )
63
63
  build_repo = Option(
64
64
  subcommand="build_repo",
65
65
  help="Should we build the container from the repo?",
66
- is_flag=True,
66
+ type=bool,
67
67
  default=self.build_repo,
68
68
  )
69
69
  with_host = Option(
@@ -77,7 +77,7 @@ class LocalLiveKitBlok:
77
77
  help="The fakts url for connection",
78
78
  default=False,
79
79
  type=bool,
80
- is_flag=True,
80
+
81
81
  )
82
82
 
83
83
  return [
@@ -5,6 +5,7 @@ from cryptography.hazmat.primitives import serialization as crypto_serialization
5
5
  from cryptography.hazmat.primitives.asymmetric import rsa
6
6
  from cryptography.hazmat.backends import default_backend as crypto_default_backend
7
7
  from typing import Dict
8
+ from arkitekt_next.bloks.secret import SecretBlok
8
9
  from arkitekt_next.bloks.services.admin import AdminService
9
10
  from arkitekt_next.bloks.services.db import DBService
10
11
  from arkitekt_next.bloks.services.gateway import GatewayService
@@ -145,15 +146,9 @@ class LokBlok:
145
146
  "accounts",
146
147
  ]
147
148
  self.token_expiry_seconds = 700000
149
+ self.preformed_redeem_tokens = [secrets.token_hex(16) for i in range(80)]
150
+ self.registered_tokens = {}
148
151
 
149
- def get_dependencies(self):
150
- return [
151
- "io.livekit.livekit",
152
- "live.arkitekt.postgres",
153
- "live.arkitekt.redis",
154
- "live.arkitekt.admin",
155
- "live.arkitekt.gateway",
156
- ]
157
152
 
158
153
  def retrieve_credentials(self) -> LokCredentials:
159
154
  return LokCredentials(
@@ -165,11 +160,17 @@ class LokBlok:
165
160
  f"fakts.service={service_name}",
166
161
  f"fakts.builder=arkitekt.{service_name}",
167
162
  ]
163
+
164
+ def retrieve_token(self, user: str = "admin") -> str:
165
+ new_token = self.secret_blok.retrieve_secret()
166
+ self.registered_tokens[user] = new_token
167
+
168
+ return new_token
168
169
 
169
170
  def register_scopes(self, scopes_dict: Dict[str, str]) -> LokCredentials:
170
171
  self.scopes = self.scopes | scopes_dict
171
172
 
172
- def preflight(self, init: InitContext, gateway: GatewayService, db: DBService, redis: RedisService, admin: AdminService, livekit: LivekitService, scopes: list[Dict[str, str]]):
173
+ def preflight(self, init: InitContext, gateway: GatewayService, db: DBService, redis: RedisService, admin: AdminService, secrets: SecretBlok, livekit: LivekitService, scopes: list[Dict[str, str]]):
173
174
  for key, value in init.kwargs.items():
174
175
  setattr(self, key, value)
175
176
 
@@ -183,6 +184,7 @@ class LokBlok:
183
184
  i, 80, self.host, strip_prefix=False
184
185
  )
185
186
 
187
+ self.secret_blok = secrets
186
188
  self.postgress_access = db.register_db(self.host)
187
189
  self.redis_access = redis.register()
188
190
  self.admin_access = admin.retrieve()
@@ -235,7 +237,7 @@ class LokBlok:
235
237
  "private_key": self.private_key,
236
238
  "public_key": self.public_key,
237
239
  "scopes": self.scopes,
238
- "redeem_tokens": [token for token in self.tokens],
240
+ "redeem_tokens": [token for token in self.registered_tokens],
239
241
  "groups": [group for group in self.groups],
240
242
  "deployment": {"name": self.deployment_name},
241
243
  "livekit": asdict(self.local_access),
@@ -270,82 +272,82 @@ class LokBlok:
270
272
 
271
273
  with_fakts_url = Option(
272
274
  subcommand="db_name",
273
- help="The fakts url for connection",
275
+ help="The name of the database",
274
276
  default="db_name",
277
+ show_default=True,
275
278
  )
276
279
  with_users = Option(
277
280
  subcommand="users",
278
- help="The fakts url for connection",
281
+ help="Users that should be greated by default. Format is name:password",
279
282
  default=["admin:admin"],
280
283
  multiple=True,
281
284
  type=USER,
285
+ show_default=True,
282
286
  )
283
287
  with_groups = Option(
284
288
  subcommand="groups",
285
- help="The fakts url for connection",
289
+ help="Groups that should be greated by default. Format is name:description",
286
290
  default=["admin:admin_group"],
287
291
  multiple=True,
288
292
  type=GROUP,
289
- )
290
- with_redeem_token = Option(
291
- subcommand="tokens",
292
- help="The fakts url for connection",
293
- default=[],
294
- multiple=True,
295
- type=TOKEN,
293
+ show_default=True,
296
294
  )
297
295
  with_scopes = Option(
298
296
  subcommand="scopes",
299
- help="The scopes",
297
+ help="Additional scopes that should be created (normally handled by the bloks)",
300
298
  default=[f"{key}:{value}" for key, value in self.scopes.items()],
301
299
  multiple=True,
302
300
  type=SCOPE,
303
301
  )
304
302
  with_repo = Option(
305
303
  subcommand="with_repo",
306
- help="The fakts url for connection",
304
+ help="Which repo should we use when building the service? Only active if build_repo or mount_repo is active",
307
305
  default=self.repo,
306
+ show_default=True,
308
307
  )
309
308
  with_repo = Option(
310
309
  subcommand="command",
311
- help="The fakts url for connection",
310
+ help="Which command should be run when starting the service?",
312
311
  default=self.command,
312
+ show_default=True,
313
313
  )
314
314
  mount_repo = Option(
315
315
  subcommand="mount_repo",
316
316
  help="The fakts url for connection",
317
- is_flag=True,
317
+ type=bool,
318
318
  default=False,
319
319
  )
320
320
  build_repo = Option(
321
321
  subcommand="build_repo",
322
- help="The fakts url for connection",
323
- is_flag=True,
322
+ help="Should we build the container from the repo?",
323
+ type=bool,
324
324
  default=False,
325
+ show_default=True,
325
326
  )
326
327
  with_host = Option(
327
328
  subcommand="host",
328
- help="The fakts url for connection",
329
+ help="Which internal hostname should be used",
329
330
  default=self.host,
331
+ show_default=True,
330
332
  )
331
333
  #
332
334
  with_public_key = Option(
333
335
  subcommand="public_key",
334
- help="The fakts url for connection",
336
+ help="The public key for the JWT creation",
335
337
  default=public_key,
336
338
  required=True,
337
339
  callback=validate_public_key,
338
340
  )
339
341
  with_private_key = Option(
340
342
  subcommand="private_key",
341
- help="The fakts url for connection",
343
+ help="The corresponding private key for the JWT creation",
342
344
  default=private_key,
343
345
  callback=validate_private_key,
344
346
  required=True,
345
347
  )
346
348
  with_secret_key = Option(
347
349
  subcommand="secret_key",
348
- help="The fakts url for connection",
350
+ help="The secret key to use for the django service",
349
351
  default=self.secret_key,
350
352
  )
351
353
 
@@ -357,7 +359,6 @@ class LokBlok:
357
359
  with_groups,
358
360
  build_repo,
359
361
  with_host,
360
- with_redeem_token,
361
362
  with_private_key,
362
363
  with_public_key,
363
364
  with_scopes,
@@ -23,7 +23,7 @@ class MikroBlok:
23
23
  def __init__(self) -> None:
24
24
  self.host = "mikro"
25
25
  self.command = "bash run-debug.sh"
26
- self.repo = "https://github.com/jhnnsrs/mikro-server-next"
26
+ self.repo = "https://github.com/arkitektio/mikro-server-next"
27
27
  self.scopes = {"read_image": "Read image from the database"}
28
28
  self.image = "jhnnsrs/mikro:next"
29
29
  self.mount_repo = False
@@ -68,13 +68,13 @@ class MikroBlok:
68
68
  mount_repo = Option(
69
69
  subcommand="mount_repo",
70
70
  help="The fakts url for connection",
71
- is_flag=True,
71
+ type=bool,
72
72
  default=self.mount_repo,
73
73
  )
74
74
  build_repo = Option(
75
75
  subcommand="build_repo",
76
76
  help="The fakts url for connection",
77
- is_flag=True,
77
+ type=bool,
78
78
  default=self.build_repo,
79
79
  )
80
80
  with_host = Option(
@@ -1,5 +1,9 @@
1
1
  import click
2
2
 
3
+ from arkitekt_next.bloks.services.config import ConfigService
4
+ from arkitekt_next.bloks.services.gateway import GatewayService
5
+ from arkitekt_next.bloks.services.name import NameService
6
+ from arkitekt_next.bloks.services.secret import SecretService
3
7
  from blok import blok, InitContext, ExecutionContext, Option
4
8
  from blok.tree import YamlFile, Repo
5
9
  from pydantic import BaseModel
@@ -50,20 +54,16 @@ class MinioBlok:
50
54
  self.preformed_access_keys = [secrets.token_hex(16) for i in range(100)]
51
55
  self.preformed_secret_keys = [secrets.token_hex(16) for i in range(100)]
52
56
 
53
- def get_identifier(self):
54
- return "live.arkitekt.s3"
55
57
 
56
- def get_dependencies(self):
57
- return ["live.arkitekt.config", "live.arkitekt.gateway"]
58
58
 
59
59
  def create_buckets(self, buckets: list[str]) -> S3Credentials:
60
- new_access_key = self.preformed_access_keys.pop()
61
- new_secret_key = self.preformed_secret_keys.pop()
60
+ new_access_key = self.secret_service.retrieve_secret()
61
+ new_secret_key = self.secret_service.retrieve_secret()
62
62
 
63
63
  bucket_map = {}
64
64
 
65
65
  for bucket in buckets:
66
- bucket_map[bucket] = self.preformed_bucket_names.pop()
66
+ bucket_map[bucket] = self.name_service.retrieve_name()
67
67
 
68
68
  self.buckets.extend(bucket_map.values())
69
69
 
@@ -81,19 +81,15 @@ class MinioBlok:
81
81
 
82
82
  return creds
83
83
 
84
- def preflight(self, init: InitContext):
84
+ def preflight(self, init: InitContext, secret: SecretService, name: NameService, gateway: GatewayService, config: ConfigService):
85
85
  for key, value in init.kwargs.items():
86
86
  setattr(self, key, value)
87
87
 
88
- self.preformed_bucket_names = list(
89
- init.kwargs.get("preformed_bucket_names", [])
90
- )
91
- self.preformed_access_keys = list(init.kwargs.get("preformed_access_keys", []))
92
- self.preformed_secret_keys = list(init.kwargs.get("preformed_secret_keys", []))
93
-
94
- init.dependencies["live.arkitekt.gateway"].expose_default(9000, self.host)
88
+ gateway.expose_default(9000, self.host)
89
+ self.secret_service = secret
90
+ self.name_service = name
95
91
 
96
- self.config_path = init.dependencies["live.arkitekt.config"].get_path(
92
+ self.config_path = config.get_path(
97
93
  self.host + ".yaml"
98
94
  )
99
95
 
@@ -151,30 +147,9 @@ class MinioBlok:
151
147
  help="The fakts url for connection",
152
148
  default=self.password,
153
149
  )
154
- with_preformed_bucket_names = Option(
155
- subcommand="preformed_bucket_names",
156
- help="The fakts url for connection",
157
- multiple=True,
158
- default=self.preformed_bucket_names,
159
- )
160
- with_preformed_acces_key = Option(
161
- subcommand="preformed_access_keys",
162
- help="The fakts url for connection",
163
- multiple=True,
164
- default=self.preformed_access_keys,
165
- )
166
- with_preformed_secret_keys = Option(
167
- subcommand="preformed_secret_keys",
168
- help="The fakts url for connection",
169
- multiple=True,
170
- default=self.preformed_secret_keys,
171
- )
172
150
 
173
151
  return [
174
152
  with_host,
175
153
  with_password,
176
154
  with_username,
177
- with_preformed_bucket_names,
178
- with_preformed_acces_key,
179
- with_preformed_secret_keys,
180
155
  ]
@@ -0,0 +1,34 @@
1
+ from pydantic import BaseModel
2
+ from typing import Dict, Any
3
+ from arkitekt_next.bloks.services.name import NameService
4
+ from blok import blok, InitContext, Option, ExecutionContext
5
+ from blok.tree import YamlFile
6
+ from arkitekt_next.bloks.services.secret import SecretService
7
+ import secrets
8
+ import namegenerator
9
+
10
+ @blok(NameService)
11
+ class PreformedNamesBlok:
12
+ def __init__(self) -> None:
13
+ self.preformed_names = [namegenerator.gen() for _ in range(100)]
14
+ self.used_names = []
15
+
16
+ def preflight(self, init: InitContext, preformed_names: list[str]):
17
+ self.preformed_names = list(preformed_names)
18
+ self.used_names = []
19
+
20
+ def retrieve_name(self) -> str:
21
+ name = self.preformed_names.pop()
22
+ self.used_names.append(name)
23
+ return name
24
+
25
+
26
+ def get_options(self):
27
+ config_path = Option(
28
+ subcommand="preformed_names",
29
+ help="A list of preformed names",
30
+ default=self.preformed_names,
31
+ multiple=True,
32
+ )
33
+
34
+ return [config_path]
@@ -65,7 +65,7 @@ class RedisBlok:
65
65
  with_skip = Option(
66
66
  subcommand="skip",
67
67
  help="Skip docker creation (if using external redis?)",
68
- is_flag=True,
68
+ type=bool,
69
69
  default=self.skip,
70
70
  )
71
71
  with_image = Option(
@@ -47,23 +47,25 @@ class RekuestBlok:
47
47
  with_repo = Option(
48
48
  subcommand="with_repo",
49
49
  help="Which repo should we use when building the service? Only active if build_repo or mount_repo is active",
50
+ type=str,
50
51
  default=self.repo,
51
52
  )
52
53
  with_command = Option(
53
54
  subcommand="command",
54
55
  help="Which command should be run when starting the service",
56
+ type=str,
55
57
  default=self.command,
56
58
  )
57
59
  mount_repo = Option(
58
60
  subcommand="mount_repo",
59
61
  help="Should we mount the repo into the container?",
60
- is_flag=True,
62
+ type=bool,
61
63
  default=self.mount_repo,
62
64
  )
63
65
  build_repo = Option(
64
66
  subcommand="build_repo",
65
67
  help="Should we build the container from the repo?",
66
- is_flag=True,
68
+ type=bool,
67
69
  default=self.build_repo,
68
70
  )
69
71
  with_host = Option(
@@ -0,0 +1,33 @@
1
+ from pydantic import BaseModel
2
+ from typing import Dict, Any
3
+ from blok import blok, InitContext, Option, ExecutionContext
4
+ from blok.tree import YamlFile
5
+ from arkitekt_next.bloks.services.secret import SecretService
6
+ import secrets
7
+
8
+ @blok(SecretService)
9
+ class SecretBlok:
10
+ def __init__(self) -> None:
11
+ self.preformed_secrets = [secrets.token_urlsafe(32) for _ in range(100)]
12
+ self.registered_secrets = []
13
+
14
+ def preflight(self, init: InitContext, preformed_secrets: list[str]):
15
+ self.preformed_secrets = list(preformed_secrets)
16
+
17
+ def retrieve_secret(self) -> str:
18
+ new_secret = self.preformed_secrets.pop()
19
+ self.registered_secrets.append(new_secret)
20
+ return new_secret
21
+
22
+
23
+
24
+ def get_options(self):
25
+ config_path = Option(
26
+ subcommand="preformed_secrets",
27
+ help="Which path to use for configs",
28
+ default=self.preformed_secrets,
29
+ multiple=True,
30
+ show_default=False,
31
+ )
32
+
33
+ return [config_path]
@@ -17,4 +17,14 @@ class GatewayService(Protocol):
17
17
 
18
18
  def expose_port(self, port: int, host: str, tls: bool = False):
19
19
  ...
20
+
21
+ def get_internal_host(self):
22
+ ...
23
+
24
+
25
+ def get_https_port(self):
26
+ ...
27
+
28
+ def get_http_port(self):
29
+ ...
20
30
 
@@ -0,0 +1,12 @@
1
+ from typing import Dict, Any, Protocol
2
+ from blok import blok, InitContext, Option
3
+ from blok import service
4
+ from dataclasses import dataclass
5
+
6
+
7
+
8
+ @service("live.arkitekt.names")
9
+ class NameService(Protocol):
10
+
11
+ def retrieve_name(self) -> str:
12
+ pass
@@ -0,0 +1,17 @@
1
+ from typing import Dict, Any, Protocol
2
+ from blok import blok, InitContext, Option
3
+ from blok import service
4
+ from dataclasses import dataclass
5
+
6
+ @dataclass
7
+ class AdminCredentials:
8
+ password: str
9
+ username: str
10
+ email: str
11
+
12
+
13
+ @service("live.arkitekt.secrets")
14
+ class SecretService(Protocol):
15
+
16
+ def retrieve_secret() -> str:
17
+ pass
@@ -0,0 +1,68 @@
1
+ from pydantic import BaseModel
2
+ from typing import Dict, Any
3
+ from arkitekt_next.bloks.services.mount import MountService
4
+ from blok import blok, InitContext, Option, ExecutionContext
5
+ from arkitekt_next.bloks.services.gateway import GatewayService
6
+ from blok.bloks.services.dns import DnsService
7
+ from blok.tree import YamlFile
8
+
9
+
10
+ @blok("live.arkitekt.tailscale")
11
+ class TailscaleBlok:
12
+
13
+ def __init__(self, name: str = "arkitekt") -> None:
14
+ self.name = name
15
+
16
+ def preflight(self, gateway: GatewayService, mount_service: MountService, dns: DnsService, net_name: str, auth_key: str, host_name: str):
17
+ assert auth_key, "You need to provide an auth_key"
18
+
19
+ self.caddy_service = gateway.get_internal_host()
20
+ self.caddy_port = gateway.get_http_port()
21
+ self.mount = mount_service.register_mount("tailscale_state", {})
22
+ self.tailnet_name = net_name
23
+ self.auth_key = auth_key
24
+ self.dns_service = dns.get_dns_result()
25
+ self.host_name = host_name
26
+
27
+ def build(self, ex: ExecutionContext):
28
+
29
+ if not self.tailnet_name:
30
+ # Trying to automatically find the hostname
31
+ for i in self.dns_service.hostnames:
32
+ if i.endswith(".ts.net"):
33
+ self.tailnet_name = i.split(".")[1]
34
+ break
35
+
36
+ service = {
37
+ "image": "jhnnsrs/tailproxy:latest",
38
+ "volumes": [
39
+ f"{self.mount}:/var/lib/tailscale" # Persist the tailscale state directory
40
+ ],
41
+ "environment": [
42
+ "TS_STATE_DIR=/var/lib/tailscale",
43
+ f"TS_AUTH_KEY={self.auth_key}",
44
+ f"TS_HOSTNAME={self.host_name}",
45
+ f"TS_TAILNET={self.tailnet_name}",
46
+ f"CADDY_TARGET={self.caddy_service}:{self.caddy_port}",
47
+ ],
48
+
49
+
50
+ }
51
+
52
+ ex.docker_compose.set_nested("services", "tailscale_proxy", service)
53
+
54
+ def get_options(self):
55
+ return [Option(
56
+ subcommand="net_name",
57
+ help="The name of your tailnet",
58
+ type=str,
59
+ ), Option(
60
+ subcommand="auth_key",
61
+ help="The auth_key of your tailnet",
62
+ type=str,
63
+ ),Option(
64
+ subcommand="host_name",
65
+ help="The hostname of your tailnet",
66
+ default=self.name,
67
+ type=str,
68
+ )]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: arkitekt-next
3
- Version: 0.7.36
3
+ Version: 0.7.38
4
4
  Summary: client for the arkitekt_next platform
5
5
  License: MIT
6
6
  Author: jhnnsrs
@@ -17,7 +17,7 @@ Provides-Extra: all
17
17
  Provides-Extra: cli
18
18
  Provides-Extra: server
19
19
  Requires-Dist: blok (>=0.0.8) ; (python_version >= "3.8" and python_version < "4.0") and (extra == "all" or extra == "server")
20
- Requires-Dist: cryptography (>=40.0.8) ; (python_version >= "3.8" and python_version < "4.0") and (extra == "server")
20
+ Requires-Dist: cryptography (>=40.0.8) ; (python_version >= "3.8" and python_version < "4.0") and (extra == "all" or extra == "server")
21
21
  Requires-Dist: dokker (>=0.1.21)
22
22
  Requires-Dist: fakts (>=0.5.0)
23
23
  Requires-Dist: fluss-next (>=0.1.69) ; extra == "all"
@@ -25,6 +25,7 @@ Requires-Dist: herre (>=0.4.3)
25
25
  Requires-Dist: kabinet (>=0.1.7) ; (python_version >= "3.9" and python_version < "4.0") and (extra == "all")
26
26
  Requires-Dist: koil (>=0.3.6)
27
27
  Requires-Dist: mikro-next (>=0.1.24) ; (python_version >= "3.10" and python_version < "4.0") and (extra == "all")
28
+ Requires-Dist: namegenerator (>=1.0.6) ; (python_version >= "3.8" and python_version < "4.0") and (extra == "all" or extra == "server")
28
29
  Requires-Dist: netifaces (>=0.11.0) ; (python_version >= "3.8" and python_version < "4.0") and (extra == "all" or extra == "server")
29
30
  Requires-Dist: reaktion-next (>=0.1.59) ; (python_version >= "3.8" and python_version < "4.0") and (extra == "all")
30
31
  Requires-Dist: rekuest-next (>=0.2.13) ; (python_version >= "3.8" and python_version < "4.0") and (extra == "cli" or extra == "all")
@@ -1,4 +1,4 @@
1
- arkitekt_next/__blok__.py,sha256=k4ZLfVMDgdkGXHrG3ilX7G-siKG3g0wSzat-c6eMciw,1234
1
+ arkitekt_next/__blok__.py,sha256=MednehD5TP0rhi4Y3JGOinwTVfja-0F-YliY2p83hkU,1476
2
2
  arkitekt_next/__init__.py,sha256=KFM_HlnIQWX7hXSZnYba3rdmZrsBE69K58rwh8ewxoM,970
3
3
  arkitekt_next/apps/__init__.py,sha256=cx_5Y-RkJFkSQJH-hUEC_L3eW1jU2E426c4e6_csIyM,42
4
4
  arkitekt_next/apps/easy.py,sha256=8eu-0DCWit2Ok4SPw_QCyriBZHPnLc1oK9qxPUxnElg,3135
@@ -14,33 +14,38 @@ arkitekt_next/apps/service/herre_qt.py,sha256=GntkKHmwcQqEFab02SWwdd3xONo0fLVGEP
14
14
  arkitekt_next/apps/types.py,sha256=cKRqHyKlNcGamPUxzvY0wyz0sEI4sBPa4CnvFnT1sTo,1140
15
15
  arkitekt_next/bloks/__init__.py,sha256=gXny6-WJ3alV1__xveI_0wcvgDuglR1WB7v7-8h1Olo,30
16
16
  arkitekt_next/bloks/admin.py,sha256=MlUQUYCHxCWtSD75mVHgs3DcDa0s8_D6_AIBslnYjZw,1300
17
- arkitekt_next/bloks/arkitekt.py,sha256=-ZITnWpkzpniUZQ7ZPjCH_RVqyCNPBtYnXWNTHd4eYw,1185
17
+ arkitekt_next/bloks/arkitekt.py,sha256=1h2fyJK-TcuiOVFyE7iO2S1jwLv52APsQpfxddmHWjk,1263
18
18
  arkitekt_next/bloks/config.py,sha256=SqJg9kB0AQ62b_WpIKgJ8Jpcqpc-AKN7gdEj87O-UGY,1268
19
- arkitekt_next/bloks/fluss.py,sha256=0It4jxafGH-ehzXvd1eC9Tq9ZP4Kjra24eaHBCIaHJM,2820
19
+ arkitekt_next/bloks/fluss.py,sha256=WXsE1M-0vDCVj5Fxi6MvHcPQiezkJPQ5GvUq93t4nt8,2814
20
20
  arkitekt_next/bloks/funcs.py,sha256=6QImH3eOSd6KXd8XfaulexAzy16A_J8GJi58Q18MQms,2641
21
- arkitekt_next/bloks/gateway.py,sha256=pym9pw8ycGgTzeskirkUZ19akvCitLabgQlU1r-wZdM,5021
22
- arkitekt_next/bloks/internal_docker.py,sha256=HWGgt4Jjr1ftEFwkYiw7m02eTiNAK5vaRYVtn0Jskd8,2255
23
- arkitekt_next/bloks/kabinet.py,sha256=ELGAkBQWarS5A-leTE2tXLgwrcXQBPz_FgLbMkYdJcU,3002
24
- arkitekt_next/bloks/livekit.py,sha256=Es0CJcQJJjyYD4OBa3_6K8bHmQRsikrECgnPflFCO4E,2694
25
- arkitekt_next/bloks/lok.py,sha256=7Fxk8U-hX7MgnIj1C1vGTA7yPBDTnqRLL31vPzAbEVE,11996
26
- arkitekt_next/bloks/mikro.py,sha256=A0Q3SkVpZYYp1nhQFiW6gCzv5D0h8fKm_p8KdoJauXI,2817
27
- arkitekt_next/bloks/minio.py,sha256=XkhApIyM7wwI1NPFBZWi5ES0grzDXPbe_RwEHCCxZcs,5823
21
+ arkitekt_next/bloks/gateway.py,sha256=1seqZkU0yMai60JB0Rz1J--uNv21osiTVZVSjlusRjE,5184
22
+ arkitekt_next/bloks/internal_docker.py,sha256=q9gPPtU1m0-0eeqF4zxtCELp4lF8TVZSJi1qVwnSWus,2421
23
+ arkitekt_next/bloks/kabinet.py,sha256=gvoXeA4W6Aoc26wWK8nN9i6Gj5bxYE3by28MTLtJNyM,2995
24
+ arkitekt_next/bloks/livekit.py,sha256=8_7YgsTnV3zZ_RonZZaOHyKkCoiKqLVv6-h74yGlB0A,2681
25
+ arkitekt_next/bloks/lok.py,sha256=x1bu2b03sARVF4mxSBJzzdyCNJVx0feyhCz1qWjRRN4,12466
26
+ arkitekt_next/bloks/mikro.py,sha256=x58fbw6INDfiRYwMRFYm8RIygmXoYj28gtn7mS6bEro,2814
27
+ arkitekt_next/bloks/minio.py,sha256=6Mi1flePiwIA-durcRsQSE3OtCYwGzVLTJI7jHMrlgk,4918
28
28
  arkitekt_next/bloks/mount.py,sha256=d14w7bMiaWbl5wgvanh4PwfIqEYsDEsw91360xfX0fU,1031
29
+ arkitekt_next/bloks/namegen.py,sha256=0k4PYya5J4EQyt3XZ3UKhDlO_k29pmUEQSaklZGN8MA,1035
29
30
  arkitekt_next/bloks/postgres.py,sha256=FRUF2fobUlU6OmK1VC7aN_WuX1NctLmZhzJJA1uOOeY,2773
30
- arkitekt_next/bloks/redis.py,sha256=XKuujfu1j85IZEab9ZG2m0G09g7Jba8o28q2PIBg_0I,2134
31
- arkitekt_next/bloks/rekuest.py,sha256=NfYbobDzlpTfPf88_-YwEDTwgOCg-OTLwiaWw5vssNU,3007
31
+ arkitekt_next/bloks/redis.py,sha256=_ddmcD3WwX7VA7zzzQ7-yjSM7f4reV0C8Pl70s7R2k8,2130
32
+ arkitekt_next/bloks/rekuest.py,sha256=_Er2mgiH0bQS62PWlGDolulpLkeYrQJ8TvQ2jqf6aOU,3044
33
+ arkitekt_next/bloks/secret.py,sha256=P4Z56FhcgVD0KbokhcMNAXwDjo_86rI99nWh3gUGXSQ,1014
32
34
  arkitekt_next/bloks/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
33
35
  arkitekt_next/bloks/services/admin.py,sha256=OXMAHph5lABNPFsXm8aboWffJ7CzSSNvke7xpmj9raI,463
34
36
  arkitekt_next/bloks/services/config.py,sha256=BLtbKXRRWmuZxvaaksuxt9EiDcazYwKL_IUIRhXBin8,393
35
37
  arkitekt_next/bloks/services/db.py,sha256=jMO751KJYjNmvHD0tOTWgkkemwTXc6mLHAge_i68JSA,600
36
- arkitekt_next/bloks/services/gateway.py,sha256=3tA1pS2vniVC3LhJ4O6chGRG6wUA44EPLAML4aiHm3k,530
38
+ arkitekt_next/bloks/services/gateway.py,sha256=YUpz7qkqfOTXS74gU0C7s3o7MHe_9xQJHQLWg7aGhyc,662
37
39
  arkitekt_next/bloks/services/livekit.py,sha256=5u-GThgKsgXiiobEL4arm3JJOgNTZae15Q-75i-4D8g,366
38
40
  arkitekt_next/bloks/services/lok.py,sha256=OYC5BVr3MxeP8AuARO56UFL4490Yygcscdm5DQq-fVs,517
39
41
  arkitekt_next/bloks/services/mount.py,sha256=MDlwHl5cTfBO8IgkofuFjQBbfIMKDm_R9suWkiyVG48,289
42
+ arkitekt_next/bloks/services/name.py,sha256=ZMDlZwnSaoIUj7STlpFo32nHKMuOibKzetYWSjh-t-c,254
40
43
  arkitekt_next/bloks/services/redis.py,sha256=d5cSk2v6A6CvYULocwd2Cnx9RkHKYHmZT1mZmZQNKgs,633
41
44
  arkitekt_next/bloks/services/s3.py,sha256=njXlLzUssj46w90bMdqO-7HSAVQtZHH2r1yVNlR-mfU,492
45
+ arkitekt_next/bloks/services/secret.py,sha256=iUG1ZH_dR0tL48rueNOK2ILjEnyqNJjQCY-4KKrB_Zg,342
42
46
  arkitekt_next/bloks/services/socket.py,sha256=eXACQPldS9I1xGVDcbF6LrVkHHsBcjvG1VtlvHnM-14,427
43
47
  arkitekt_next/bloks/socket.py,sha256=YIrSKfQezrsKwRKDPdT1aXhlQzjgnx_UaNaQ9LiEfGY,1008
48
+ arkitekt_next/bloks/tailscale.py,sha256=YXsiIxjqJV5WeQTO81yIa2Ajj40K-95X0cxH46Sq66c,2356
44
49
  arkitekt_next/builders.py,sha256=8HeQsNqyxpbFsnTrA9AAm0_BqxGjU1_ylS1Z-hbjAFw,6074
45
50
  arkitekt_next/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
46
51
  arkitekt_next/cli/commands/call/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -140,8 +145,8 @@ arkitekt_next/qt/utils.py,sha256=MgBPtPmCSBkIuATov3UgREESwxAHh77lWNNxyE7Qs48,773
140
145
  arkitekt_next/service_registry.py,sha256=pczUuP_Nve7OYwB7-oDBLIw6bkjZPnzL3xFca5TF1io,3405
141
146
  arkitekt_next/tqdm.py,sha256=DlrxPluHao7TvW-Cqgt0UokRS-fM2_ZNiWiddqvCqCc,1488
142
147
  arkitekt_next/utils.py,sha256=gmKWy9M51vimohmmaoIpAJ0CaB22TFP0w3JszRrwiak,2379
143
- arkitekt_next-0.7.36.dist-info/LICENSE,sha256=YZ2oRjC248t-GpoEyw7J13vwKYNG6zhYMaEAix6EzF0,1089
144
- arkitekt_next-0.7.36.dist-info/METADATA,sha256=AdGBXeVCXQPdWaVn5OPOJ_y-1RFMYVtuDcr2JceNMZ0,5901
145
- arkitekt_next-0.7.36.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
146
- arkitekt_next-0.7.36.dist-info/entry_points.txt,sha256=-hxikQx4xZ6TiOnWVDOlTN_kcAISgGFvTHXIchsCHSc,60
147
- arkitekt_next-0.7.36.dist-info/RECORD,,
148
+ arkitekt_next-0.7.38.dist-info/LICENSE,sha256=YZ2oRjC248t-GpoEyw7J13vwKYNG6zhYMaEAix6EzF0,1089
149
+ arkitekt_next-0.7.38.dist-info/METADATA,sha256=NJrnRs82cPUTEThfUuwjRUAm0W1lgcLoVqcT7FITWzQ,6055
150
+ arkitekt_next-0.7.38.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
151
+ arkitekt_next-0.7.38.dist-info/entry_points.txt,sha256=-hxikQx4xZ6TiOnWVDOlTN_kcAISgGFvTHXIchsCHSc,60
152
+ arkitekt_next-0.7.38.dist-info/RECORD,,