1- ---
2- hide :
3- - toc
4- ---
5-
61# Administration
72
8- asciinema server provides admin panel on port 4002, separate from the main,
9- user-facing web interface.
3+ asciinema server includes an admin panel - a web interface for managing the
4+ users, recordings, and streams on your instance. From it you can search and
5+ inspect content, change visibility, feature or archive recordings, merge or
6+ delete accounts, grant admin access, and monitor the running system.
7+
8+ ## Accessing the admin panel
9+
10+ There are two ways to reach the admin panel.
1011
11- To be able to access the admin panel when deploying the container make sure
12- this port is exposed.
12+ ### Dedicated admin port
13+
14+ By default the admin panel is served on its own port, ** 4002** , separate from
15+ the main, user-facing site. When deploying with Docker, expose this port to
16+ reach it:
1317
1418``` yaml title="docker-compose.yml"
1519services :
@@ -20,6 +24,106 @@ services:
2024
2125!!! danger
2226
23- At the moment the admin endpoint doesn't perform any form of
24- authentication/authorization so do not expose this port directly to the
25- internet when running a public asciinema server instance.
27+ The dedicated admin endpoint performs **no authentication** - anyone who can
28+ reach port 4002 has full admin access. Never expose it directly to the
29+ internet. Keep it bound to localhost (the default) and reach it through an
30+ SSH tunnel or VPN, or place it behind a reverse proxy that restricts access
31+ by IP address and/or requires authentication.
32+
33+ The admin endpoint's network binding and the URLs it generates can be adjusted
34+ with ` ADMIN_PORT`, `ADMIN_BIND_ALL`, and the `ADMIN_URL_*` variables - see
35+ [Configuration](configuration.md#admin-panel).
36+
37+ # ## On the main web interface
38+
39+ Alternatively, set `ADMIN_PANEL_ON_MAIN_ENDPOINT=1` to also serve the panel at
40+ `/admin` on the main, user-facing site. In this mode access is **login-gated** :
41+ visitors who aren't logged in are redirected to the login page, and logged-in
42+ users without the admin flag get a 404 response, so the panel's existence isn't
43+ revealed to regular users. With this enabled you don't need to expose port 4002.
44+
45+ # # Granting admin access
46+
47+ A user is an admin when their account has the admin flag set.
48+
49+ # ## The first account becomes an admin
50+
51+ On a brand-new instance the **first registered account is automatically made an
52+ admin**, so you can bootstrap a fresh server simply by signing up. All
53+ subsequent accounts are regular users.
54+
55+ # ## Toggling the admin flag
56+
57+ Admins can grant or revoke the flag on any account from that user's edit page in
58+ the panel (the **admin** checkbox). As a safeguard, you can't remove the admin
59+ flag from your own account this way.
60+
61+ On an existing instance that has no admin yet, use the [dedicated admin
62+ port](#dedicated-admin-port) - which doesn't require logging in - to open a
63+ user's edit page and grant them the flag.
64+
65+ # # What you can do
66+
67+ # ## Dashboard
68+
69+ The landing page shows totals (users, recordings, streams, live streams) and
70+ recent activity - the latest signups, uploads, and stream sessions.
71+
72+ # ## Users
73+
74+ Search and browse accounts; view a user's recordings, streams, and authorized
75+ CLIs; edit their details; generate a one-time login link; toggle the admin and
76+ streaming flags; merge one account into another; and delete accounts.
77+
78+ # ## Recordings
79+
80+ Search and browse recordings; view and edit a recording; change its visibility
81+ (public / unlisted / private); feature or unfeature it; archive or unarchive it;
82+ and delete it.
83+
84+ # ## Streams
85+
86+ Search and browse live streams; view and edit a stream; change its visibility;
87+ forcibly disconnect an active stream; and delete it.
88+
89+ # ## System dashboards
90+
91+ Under **System** there's a live system dashboard (runtime metrics, processes,
92+ memory), powered by Phoenix LiveDashboard, and an Oban dashboard for inspecting
93+ the background job queues.
94+
95+ # # Searching
96+
97+ Each list - Users, Recordings, and Streams - has a search box that accepts a
98+ compact `field:value` syntax. Bare words (without a `field:`) match identity
99+ (users) or title (recordings and streams), and multiple terms are combined with
100+ AND. Beyond text you can filter by things like owner, visibility, dates, counts,
101+ size, and duration - with comparisons (`>`, `>=`, `<`, `<=`) and ranges
102+ (`a..b`). A few examples :
103+
104+ - ` admin:no registered:yes created:30d` - regular accounts created in the last 30 days
105+ - ` visibility:public featured:no views:>1000` - popular public recordings that aren't featured
106+ - ` live:yes peak-viewers:>50` - busy live streams
107+
108+ For the full, always-current list of fields and value formats, click the **Query
109+ syntax help** button next to the search box - it opens a cheat sheet for the list
110+ you're viewing.
111+
112+ # ## Saved queries
113+
114+ Once you've composed a search you can save it under a name to reuse later. Saved
115+ queries are scoped to their list (Users, Recordings, or Streams) and are shared
116+ by all admins. When the current search matches a saved one, the search box lets
117+ you rename or delete it.
118+
119+ # # Security
120+
121+ The two access modes have very different trust models :
122+
123+ - The **dedicated admin port (4002)** is unauthenticated and relies entirely on
124+ the network being restricted - treat anything that can reach it as fully
125+ trusted, and keep it on localhost or behind an IP-restricted reverse proxy or
126+ VPN.
127+ - The **main-endpoint mode** (`ADMIN_PANEL_ON_MAIN_ENDPOINT=1`) is login-gated
128+ and serves only admins; non-admins get a 404 and anonymous visitors are sent
129+ to the login page.
0 commit comments