scripticus-server 0.1.0__tar.gz

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.
@@ -0,0 +1,62 @@
1
+ Metadata-Version: 2.4
2
+ Name: scripticus-server
3
+ Version: 0.1.0
4
+ Summary: A package manager and registry for scripts — index service
5
+ License-Expression: MIT
6
+ Requires-Dist: fastapi>=0.115
7
+ Requires-Dist: uvicorn>=0.30
8
+ Requires-Python: >=3.11
9
+ Description-Content-Type: text/markdown
10
+
11
+ # Scripticus server
12
+
13
+ The index service for [Scripticus](https://github.com/kevinchannon/scripticus),
14
+ a package manager and registry for scripts. The server provides
15
+ manifest-aware search, version and dependency resolution, and the publish
16
+ path for a Scripticus registry. Installing this package provides the
17
+ `scripticus-svr` command.
18
+
19
+ ## Running the server
20
+
21
+ `scripticus-svr` starts the service, printing its version and address on
22
+ start-up:
23
+
24
+ ```console
25
+ $ scripticus-svr --host 0.0.0.0 --port 8000
26
+ scripticus-svr 0.1.0 — serving on http://0.0.0.0:8000 (interactive API docs at http://0.0.0.0:8000/docs)
27
+ ```
28
+
29
+ Both options are optional; the default is `127.0.0.1:8000`. The API is
30
+ self-describing: interactive docs are served at `/docs` and the OpenAPI
31
+ spec at `/openapi.json`.
32
+
33
+ ### Health check
34
+
35
+ `GET /health` returns `200` with `{"status": "ok"}` while the service is
36
+ up. It is deliberately unauthenticated — it's a liveness probe for load
37
+ balancers and container orchestrators.
38
+
39
+ ### Docker
40
+
41
+ The repository ships a `docker-compose.yml` running the index service as a
42
+ single container:
43
+
44
+ ```console
45
+ $ docker compose up -d
46
+ $ curl http://localhost:8000/health
47
+ {"status":"ok"}
48
+ ```
49
+
50
+ The intended v1 deployment pairs the index service with a Gitea instance
51
+ that provides storage, authentication, and namespace ownership; Gitea
52
+ integration doesn't exist yet, so the compose file is currently
53
+ server-only and does not stand up a working registry.
54
+
55
+ Once Gitea is part of the bundle: accounts and organisations are managed
56
+ in Gitea; a Scripticus namespace is a Gitea user or organisation, claimed
57
+ first-come-first-served, and publish rights follow Gitea's own membership
58
+ and ACLs. The `library` namespace is reserved.
59
+
60
+ ## Licence
61
+
62
+ MIT
@@ -0,0 +1,52 @@
1
+ # Scripticus server
2
+
3
+ The index service for [Scripticus](https://github.com/kevinchannon/scripticus),
4
+ a package manager and registry for scripts. The server provides
5
+ manifest-aware search, version and dependency resolution, and the publish
6
+ path for a Scripticus registry. Installing this package provides the
7
+ `scripticus-svr` command.
8
+
9
+ ## Running the server
10
+
11
+ `scripticus-svr` starts the service, printing its version and address on
12
+ start-up:
13
+
14
+ ```console
15
+ $ scripticus-svr --host 0.0.0.0 --port 8000
16
+ scripticus-svr 0.1.0 — serving on http://0.0.0.0:8000 (interactive API docs at http://0.0.0.0:8000/docs)
17
+ ```
18
+
19
+ Both options are optional; the default is `127.0.0.1:8000`. The API is
20
+ self-describing: interactive docs are served at `/docs` and the OpenAPI
21
+ spec at `/openapi.json`.
22
+
23
+ ### Health check
24
+
25
+ `GET /health` returns `200` with `{"status": "ok"}` while the service is
26
+ up. It is deliberately unauthenticated — it's a liveness probe for load
27
+ balancers and container orchestrators.
28
+
29
+ ### Docker
30
+
31
+ The repository ships a `docker-compose.yml` running the index service as a
32
+ single container:
33
+
34
+ ```console
35
+ $ docker compose up -d
36
+ $ curl http://localhost:8000/health
37
+ {"status":"ok"}
38
+ ```
39
+
40
+ The intended v1 deployment pairs the index service with a Gitea instance
41
+ that provides storage, authentication, and namespace ownership; Gitea
42
+ integration doesn't exist yet, so the compose file is currently
43
+ server-only and does not stand up a working registry.
44
+
45
+ Once Gitea is part of the bundle: accounts and organisations are managed
46
+ in Gitea; a Scripticus namespace is a Gitea user or organisation, claimed
47
+ first-come-first-served, and publish rights follow Gitea's own membership
48
+ and ACLs. The `library` namespace is reserved.
49
+
50
+ ## Licence
51
+
52
+ MIT
@@ -0,0 +1,24 @@
1
+ [project]
2
+ name = "scripticus-server"
3
+ version = "0.1.0"
4
+ description = "A package manager and registry for scripts — index service"
5
+ readme = "README.md"
6
+ requires-python = ">=3.11"
7
+ license = "MIT"
8
+ dependencies = [
9
+ "fastapi>=0.115",
10
+ "uvicorn>=0.30",
11
+ ]
12
+
13
+ [project.scripts]
14
+ scripticus-svr = "scripticus_server.main:main"
15
+
16
+ [dependency-groups]
17
+ dev = [
18
+ "pytest>=8",
19
+ "httpx2>=0.1",
20
+ ]
21
+
22
+ [build-system]
23
+ requires = ["uv_build>=0.11,<0.12"]
24
+ build-backend = "uv_build"
@@ -0,0 +1,3 @@
1
+ from importlib.metadata import version
2
+
3
+ __version__ = version("scripticus-server")
@@ -0,0 +1,29 @@
1
+ from typing import Literal
2
+
3
+ from fastapi import FastAPI
4
+ from pydantic import BaseModel
5
+
6
+ from scripticus_server import __version__
7
+
8
+ app = FastAPI(
9
+ title="Scripticus index service",
10
+ description=(
11
+ "Manifest-aware search, version and dependency resolution, and the "
12
+ "publish path for a Scripticus registry."
13
+ ),
14
+ version=__version__,
15
+ )
16
+
17
+
18
+ # Local to the server on purpose: a liveness shape is not part of the
19
+ # package contract, so it doesn't meet the schema/ admission rule (D29).
20
+ class HealthStatus(BaseModel):
21
+ status: Literal["ok"] = "ok"
22
+
23
+
24
+ # Unauthenticated by design: a liveness probe carries nothing worth gating,
25
+ # and the index service stays out of the ACL business anyway (D24). Leave it
26
+ # open even once other endpoints grow auth.
27
+ @app.get("/health")
28
+ def health() -> HealthStatus:
29
+ return HealthStatus()
@@ -0,0 +1,45 @@
1
+ import argparse
2
+
3
+ import uvicorn
4
+
5
+ from scripticus_server import __version__
6
+ from scripticus_server.app import app
7
+
8
+
9
+ def _parse_args(argv: list[str] | None = None) -> argparse.Namespace:
10
+ parser = argparse.ArgumentParser(
11
+ prog="scripticus-svr",
12
+ description=(
13
+ "Scripticus index service — search, resolution, and publishing "
14
+ "for shared scripts."
15
+ ),
16
+ )
17
+ parser.add_argument(
18
+ "--host",
19
+ default="127.0.0.1",
20
+ help="Interface to bind to (default: %(default)s).",
21
+ )
22
+ parser.add_argument(
23
+ "--port",
24
+ type=int,
25
+ default=8000,
26
+ help="Port to serve on (default: %(default)s).",
27
+ )
28
+ return parser.parse_args(argv)
29
+
30
+
31
+ def _banner(host: str, port: int) -> str:
32
+ return (
33
+ f"scripticus-svr {__version__} — serving on http://{host}:{port} "
34
+ f"(interactive API docs at http://{host}:{port}/docs)"
35
+ )
36
+
37
+
38
+ def main(argv: list[str] | None = None) -> None:
39
+ args = _parse_args(argv)
40
+ print(_banner(args.host, args.port), flush=True)
41
+ uvicorn.run(app, host=args.host, port=args.port)
42
+
43
+
44
+ if __name__ == "__main__":
45
+ main()