diff --git a/README.md b/README.md
index 64b0ed8..5e3737f 100644
--- a/README.md
+++ b/README.md
@@ -15,7 +15,7 @@ echo '{"users": {"vimes": {"password":"sybil", "permissions":"op"}}}' > groups/n
./skald &
```
-Point your browser at , ignore
+Point your browser at , ignore
the unknown certificate warning, and log in with username *vimes* and
password *sybil*.
diff --git a/skald-api.md b/skald-api.md
index 5f32215..d5e2189 100644
--- a/skald-api.md
+++ b/skald-api.md
@@ -1,22 +1,22 @@
# Skald's administrative API
Skald provides an HTTP-based API that can be used to create groups and
-users. For example, in order to create a group, a client may do
+users. For example, in order to create a hall, a client may do
- PUT /skald-api/v0/.groups/groupname/
+ PUT /skald-api/v0/.halls/hallname/
Content-Type: application/json
If-None-Match: *
The `If-None-Match` header avoids overwriting an existing group.
-In order to edit a group definition, a client first does
+In order to edit a hall definition, a client first does
- GET /skald-api/v0/.groups/groupname/
+ GET /skald-api/v0/.halls/hallname/
-This yields the group definition and an entity tag (in the ETag header).
+This yields the hall definition and an entity tag (in the ETag header).
The client then modifies the group defintion, and does
- PUT /skald-api/v0/.groups/groupname/
+ PUT /skald-api/v0/.halls/hallname/
If-Match: "abcd"
where "abcd" is the entity tag returned by the GET request. If the group
@@ -41,23 +41,23 @@ allowed methods are HEAD and GET.
### List of groups
- /skald-api/v0/.groups/
+ /skald-api/v0/.halls/
Returns a list of groups, as a JSON array. The only allowed methods are
HEAD and GET.
### Group definition
- /skald-api/v0/.groups/groupname
+ /skald-api/v0/.halls/hallname
-Contains a "sanitised" group definition in JSON format, analogous to the
+Contains a "sanitised" hall definition in JSON format, analogous to the
on-disk format but without any user definitions or cryptographic keys.
Allowed methods are HEAD, GET, PUT and DELETE. The only accepted
content-type is `application/json`.
### Authentication keys
- /skald-api/v0/.groups/groupname/.keys
+ /skald-api/v0/.halls/hallname/.keys
Contains the keys used for validation of stateless tokens, encoded as
a JSON key set (RFC 7517). Allowed methods are PUT and DELETE. The only
@@ -65,16 +65,16 @@ accepted content-type is `application/jwk-set+json`.
### List of users
- /skald-api/v0/.groups/groupname/.users/
+ /skald-api/v0/.halls/hallname/.users/
Returns a list of users, as a JSON array. The only allowed methods are
HEAD and GET.
### User definitions
- /skald-api/v0/.groups/groupname/.users/username
- /skald-api/v0/.groups/groupname/.empty-user
- /skald-api/v0/.groups/groupname/.wildcard-user
+ /skald-api/v0/.halls/hallname/.users/username
+ /skald-api/v0/.halls/hallname/.empty-user
+ /skald-api/v0/.halls/hallname/.wildcard-user
Contains a "sanitised" user definition (without any passwords), a JSON
object with a single field `permissions`. The entries `.empty-user` and
@@ -84,9 +84,9 @@ only accepted content-type is `application/json`.
### Passwords
- /skald-api/v0/.groups/groupname/.users/username/.password
- /skald-api/v0/.groups/groupname/.empty-user/.password
- /skald-api/v0/.groups/groupname/.wildcard-user/.password
+ /skald-api/v0/.halls/hallname/.users/username/.password
+ /skald-api/v0/.halls/hallname/.empty-user/.password
+ /skald-api/v0/.halls/hallname/.wildcard-user/.password
Contains the password of a given user. The PUT method takes a full
password definition, identical to what can appear in the `"password"`
@@ -97,7 +97,7 @@ POST.
### Wildcard user
- /skald-api/v0/.groups/groupname/.wildcard-user
+ /skald-api/v0/.halls/hallname/.wildcard-user
Contains a dictionary defining the wildcard user, in the same format as
the dictionary defining an ordinary user. Allowed methods are HEAD, GET,
@@ -105,14 +105,14 @@ PUT and DELETE.
### Wildcard user password
- /skald-api/v0/.groups/groupname/.wildcard-user/.password
+ /skald-api/v0/.halls/hallname/.wildcard-user/.password
This is analogous to the password of an ordinary user. Allowed methods
are PUT, POST and DELETE.
### List of stateful tokens
- /skald-api/v0/.groups/groupname/.users/username/.tokens/
+ /skald-api/v0/.halls/hallname/.users/username/.tokens/
GET returns the list of stateful tokens, as a JSON array. POST creates
a new token, and returns its name in the `Location` header. Allowed
@@ -120,7 +120,7 @@ methods are HEAD, GET and POST.
### Stateful token
- /skald-api/v0/.groups/groupname/.users/username/.tokens/token
+ /skald-api/v0/.halls/hallname/.users/username/.tokens/token
The full contents of a single token, in JSON. The exact format may change
between versions, so a client should first GET a token, update one or more
diff --git a/skald-install.md b/skald-install.md
index 499365c..bec06cb 100644
--- a/skald-install.md
+++ b/skald-install.md
@@ -159,46 +159,46 @@ rsync config.json skald@skald.example.org:data/
Create a group:
```sh
-skaldctl create-group -group city-watch
+skaldctl create-hall -hall city-watch
```
If you didn't install a TLS certificate above, you will need to run
`skaldctl` with the flag `-insecure`:
```sh
-skaldctl -insecure create-group -group city-watch
+skaldctl -insecure create-hall -hall city-watch
```
Create an "op", a user with group moderation privileges:
```sh
-skaldctl create-user -group city-watch -user vimes -permissions op
+skaldctl create-user -hall city-watch -user vimes -permissions op
```
Set the new user's password:
```sh
-skaldctl set-password -group city-watch -user vimes
+skaldctl set-password -hall city-watch -user vimes
```
You should now be able to test your Skald installation by pointing a web
-browser at .
+browser at .
Create an ordinary user:
```sh
-skaldctl create-user -group city-watch -user fred
-skaldctl set-password -group city-watch -user fred
+skaldctl create-user -hall city-watch -user fred
+skaldctl set-password -hall city-watch -user fred
```
Check the results:
```sh
-skaldctl list-groups
-skaldctl list-users -l -group city-watch
+skaldctl list-halls
+skaldctl list-users -l -hall city-watch
```
-Type `skaldctl -help`, `skaldctl create-group -help`, etc. for more
+Type `skaldctl -help`, `skaldctl create-hall -help`, etc. for more
information.
## Advanced configuration
diff --git a/skald-protocol.md b/skald-protocol.md
index ce80346..5d141fb 100644
--- a/skald-protocol.md
+++ b/skald-protocol.md
@@ -30,7 +30,7 @@ server to client direction.
The client needs to know the location of the group, the (user-visible) URL
at which the group is found. This may be obtained either by explicit
-configuration by the user, or by parsing the `/public-groups.json` file
+configuration by the user, or by parsing the `/public-halls.json` file
which may contain an array of group statuses (see below).
A client then performs an HTTP GET request on the file `.status` at
@@ -558,7 +558,7 @@ a POST request to the authorisation server URL containing in its body
a JSON dictionary of the following form:
```javascript
{
- "location": "https://skald.example.org/group/groupname/",
+ "location": "https://skald.example.org/hall/hallname/",
"username": username,
"password": password
}
@@ -575,7 +575,7 @@ a signed JWT (a "JWS") the body of which has the following form:
```javascript
{
"sub": username,
- "aud": "https://skald.example.org/group/groupname/",
+ "aud": "https://skald.example.org/hall/hallname/",
"permissions": ["present"],
"iat": now,
"exp": now + 30s,
@@ -599,4 +599,4 @@ authentication portal performs authorisation, generates a token as above,
then redirects back to the group's URL with the token stores in a URL
query parameter named `token`:
- https://skald.example.org/group/groupname/?token=eyJhbG...
+ https://skald.example.org/hall/hallname/?token=eyJhbG...
diff --git a/skald.md b/skald.md
index 11d923f..2747ca7 100644
--- a/skald.md
+++ b/skald.md
@@ -23,7 +23,7 @@ your browser directly at the desired group URL.
### The group pages
A group named e.g. *city-watch* has an associated page
-`/group/city-watch/`. After login, it presents an interface consisting
+`/hall/city-watch/`. After login, it presents an interface consisting
of three panes:
- the left side pane contains the list of users who have joined the
@@ -71,7 +71,7 @@ a *user menu*, a menu that applies to that specific user.
The centre pane is a traditional chat interface, with an input form at the
bottom and the chat history above it. Chat history is never saved to
disk, and is erased after four hours (or whatever is specified in the
-`"max-history-age"` field of the group definition).
+`"max-history-age"` field of the hall definition).
Double-clicking on a message opens a contextual menu.
@@ -87,7 +87,7 @@ commands.
In order to generate an invitation link, choose the entry *Invite user* in
the group menu. This generates a link of the form
- https://skald.example.org:8443/group/city-watch/?token=XXX
+ https://skald.example.org:8443/hall/city-watch/?token=XXX
where the *XXX* part, known as the *token*, is a shared secret. Such
a link allows password-less login to the group, and may therefore be
@@ -160,7 +160,7 @@ fields are as follows:
only meaningful permission is `"admin"`;
- `writableGroups`: if true, then the API used by `skaldctl` can be used
- to modify group definitions; if unset or false, then only read-only
+ to modify hall definitions; if unset or false, then only read-only
access is allowed;
- `allowOrigin` is an array containing the list of HTTP origins that
@@ -187,21 +187,21 @@ also be edited manually (there is no need to restart the server).
#### Creating, modifying, and deleting groups
-A group is created using `skaldctl create-group`:
+A group is created using `skaldctl create-hall`:
```sh
-skaldctl create-group -group city-watch
+skaldctl create-hall -hall city-watch
```
There are a number of options to customise the behaviour of the group, see
-`skaldctl create-group -help` for a full list. For example, in order to
-create a group that allows unrestricted creation of tokens, say:
+`skaldctl create-hall -help` for a full list. For example, in order to
+create a hall that allows unrestricted creation of tokens, say:
```sh
-skaldctl create-group -group city-watch -unrestricted-tokens
+skaldctl create-hall -hall city-watch -unrestricted-tokens
```
-For more advanced configuration, `skaldctl create-group` can be invoked
+For more advanced configuration, `skaldctl create-hall` can be invoked
with the `-json` flag, in which case it takes a JSON template from standard
input. The syntax of a JSON template is just like that of a group
definition file (see below), except that it must not contain the fields
@@ -209,27 +209,27 @@ definition file (see below), except that it must not contain the fields
(see the section *Group description reference* below):
```sh
-echo '{"redirect": "https://skald.example.org:8443/group/city-watch/"}' | skaldctl create-group -group amcw -json
+echo '{"redirect": "https://skald.example.org:8443/hall/city-watch/"}' | skaldctl create-hall -hall amcw -json
```
-Groups are modified using `skaldctl update-group`:
+Groups are modified using `skaldctl update-hall`:
```sh
-skaldctl update-group -group city-watch -unrestricted-tokens=false
+skaldctl update-hall -hall city-watch -unrestricted-tokens=false
```
-If a JSON template is provided to `skaldctl update-group`, then it is
+If a JSON template is provided to `skaldctl update-hall`, then it is
merged with the existing group configuration. Entries may be deleted
by setting them to `null` in the template:
```sh
-echo '{"redirect": null}' | skaldctl update-group -group amcw
+echo '{"redirect": null}' | skaldctl update-hall -hall amcw
```
-A group is deleted using `skaldctl delete-group`:
+A group is deleted using `skaldctl delete-hall`:
```sh
-skaldctl delete-group -group amcw
+skaldctl delete-hall -hall amcw
```
#### Creating, modifying, and deleting users
@@ -237,7 +237,7 @@ skaldctl delete-group -group amcw
A user entry is created with the `skaldctl create-user` command:
```sh
-skaldctl create-user -group city-watch -user vimes -permissions op
+skaldctl create-user -hall city-watch -user vimes -permissions op
```
If the `-permissions` flag is not specified, it defaults to `present`,
@@ -253,7 +253,7 @@ In order to be useful, a user entry needs to be assigned a password. This
is done with the `skaldctl set-password` command:
```sh
-skaldctl set-password -group city-watch -user vimes
+skaldctl set-password -hall city-watch -user vimes
```
#### The fallback user
@@ -262,15 +262,15 @@ It is sometimes useful to allow multiple users to log in using the same
password. This can be achieved by defining the *wildcard* user:
```sh
-skaldctl create-user -group city-watch -wildcard
-skaldctl set-password -group city-watch -wildcard
+skaldctl create-user -hall city-watch -wildcard
+skaldctl set-password -hall city-watch -wildcard
```
For open groups, where any user can login with any password, the wildcard
user's password is set to the password of type `wildcard`:
```sh
-skaldctl set-password -group city-watch -wildcard -type wildcard
+skaldctl set-password -hall city-watch -wildcard -type wildcard
```
See the section *Client authorisation* below for more information about
@@ -291,7 +291,7 @@ Automatic subgroups are enabled by setting the `"auto-subgroups"`
field in the group description:
```sh
-skaldctl create-group unseen-university -auto-subgroups
+skaldctl create-hall unseen-university -auto-subgroups
```
Whenever a user attempts to access a subgroup of `unseen-university`, for
@@ -308,8 +308,8 @@ the `skaldctl` utility's `create-token`, `revoke-token`, `delete-token`
and `list-tokens` commands:
```sh
-skaldctl create-token -group city-watch
-skaldctl list-tokens -l -group city-watch
+skaldctl create-token -hall city-watch
+skaldctl list-tokens -l -hall city-watch
```
A token that is generated with the `-include-subgroups` flag applies to
@@ -317,25 +317,25 @@ the whole hierarchy rooted at the given group, including both ordinary
groups and automatically generated subgroups.
```sh
-skaldctl create-token -group city-watch -include-subgroups
+skaldctl create-token -hall city-watch -include-subgroups
```
Such a token can be attached to the root of the group hierarchy, and
therefore be valid for any group on the server:
```sh
-skaldctl create-token -group '' -include-subgroups
+skaldctl create-token -hall '' -include-subgroups
```
### Group description reference
-The definition for the group called *groupname* is in the file
-`groups/groupname.json`; it does not contain the group name, which makes
-it easy to copy or link group definitions. You may use subdirectories:
+The definition for the group called *hallname* is in the file
+`groups/hallname.json`; it does not contain the group name, which makes
+it easy to copy or link hall definitions. You may use subdirectories:
a file `groups/teaching/networking.json` defines a group called
*teaching/networking*.
-Every group definition file contains a single JSON dictionary. All fields
+Every hall definition file contains a single JSON dictionary. All fields
are optional. The following fields are allowed:
- `users`: a dictionary that maps user names to user descriptions (see
@@ -352,7 +352,7 @@ are optional. The following fields are allowed:
displayed at the top of the group page;
- `description`: a human-readable description of the group; this is
- displayed on the landing page for public groups;
+ displayed on the landing page for public halls;
- `contact`: a human-readable contact for this group, such as an e-mail
address, ignored by the server;
diff --git a/skaldctl/skaldctl.go b/skaldctl/skaldctl.go
index d786f5d..4a1e1dc 100644
--- a/skaldctl/skaldctl.go
+++ b/skaldctl/skaldctl.go
@@ -65,25 +65,25 @@ var commands = map[string]command{
command: deletePasswordCmd,
description: "delete a user's password",
},
- "list-groups": {
+ "list-halls": {
command: listGroupsCmd,
- description: "list groups",
+ description: "list halls",
},
- "show-group": {
+ "show-hall": {
command: showGroupCmd,
- description: "show group definition",
+ description: "show hall definition",
},
- "create-group": {
+ "create-hall": {
command: createGroupCmd,
- description: "create a group",
+ description: "create a hall",
},
- "update-group": {
+ "update-hall": {
command: updateGroupCmd,
- description: "change a group's definition",
+ description: "change a hall's definition",
},
- "delete-group": {
+ "delete-hall": {
command: deleteGroupCmd,
- description: "delete a group",
+ description: "delete a hall",
},
"list-users": {
command: listUsersCmd,
@@ -593,7 +593,7 @@ func deleteValue(url string) error {
}
func setPasswordCmd(cmdname string, args []string) {
- var groupname, username string
+ var hallname, username string
var wildcard bool
var password, algorithm string
var iterations, cost, length, saltlen int
@@ -603,7 +603,7 @@ func setPasswordCmd(cmdname string, args []string) {
"%v [option...] %v [option...]\n",
os.Args[0], cmdname,
)
- cmd.StringVar(&groupname, "group", "", "group `name`")
+ cmd.StringVar(&hallname, "hall", "", "hall `name`")
cmd.StringVar(&username, "user", "", "user `name`")
cmd.BoolVar(&wildcard, "wildcard", false, "set wildcard user's password")
cmd.StringVar(&password, "password", "", "new `password`")
@@ -622,9 +622,9 @@ func setPasswordCmd(cmdname string, args []string) {
os.Exit(1)
}
- if groupname == "" {
+ if hallname == "" {
fmt.Fprintf(cmd.Output(),
- "Option \"-group\" is required\n")
+ "Option \"-hall\" is required\n")
os.Exit(1)
}
@@ -655,12 +655,12 @@ func setPasswordCmd(cmdname string, args []string) {
var u string
if wildcard {
u, err = url.JoinPath(
- serverURL, "/skald-api/v0/.groups", groupname,
+ serverURL, "/skald-api/v0/.halls", hallname,
".wildcard-user/.password",
)
} else {
u, err = url.JoinPath(
- serverURL, "/skald-api/v0/.groups", groupname,
+ serverURL, "/skald-api/v0/.halls", hallname,
".users", username, ".password",
)
}
@@ -675,7 +675,7 @@ func setPasswordCmd(cmdname string, args []string) {
}
func deletePasswordCmd(cmdname string, args []string) {
- var groupname, username string
+ var hallname, username string
var wildcard bool
cmd := flag.NewFlagSet(cmdname, flag.ExitOnError)
@@ -683,7 +683,7 @@ func deletePasswordCmd(cmdname string, args []string) {
"%v [option...] %v [option...]\n",
os.Args[0], cmdname,
)
- cmd.StringVar(&groupname, "group", "", "group `name`")
+ cmd.StringVar(&hallname, "hall", "", "hall `name`")
cmd.StringVar(&username, "user", "", "user `name`")
cmd.BoolVar(&wildcard, "wildcard", false, "set wildcard user's password")
cmd.Parse(args)
@@ -693,9 +693,9 @@ func deletePasswordCmd(cmdname string, args []string) {
os.Exit(1)
}
- if groupname == "" {
+ if hallname == "" {
fmt.Fprintf(cmd.Output(),
- "Option \"-group\" is required\n")
+ "Option \"-hall\" is required\n")
os.Exit(1)
}
@@ -710,12 +710,12 @@ func deletePasswordCmd(cmdname string, args []string) {
var err error
if wildcard {
u, err = url.JoinPath(
- serverURL, "/skald-api/v0/.groups", groupname,
+ serverURL, "/skald-api/v0/.halls", hallname,
".wildcard-user/.password",
)
} else {
u, err = url.JoinPath(
- serverURL, "/skald-api/v0/.groups", groupname,
+ serverURL, "/skald-api/v0/.halls", hallname,
".users", username, ".password",
)
}
@@ -796,7 +796,7 @@ func stdinJSON(doit bool) (map[string]any, error) {
}
func createGroupCmd(cmdname string, args []string) {
- var groupname string
+ var hallname string
var unrestrictedTokens, autoSubgroups boolOption
var doJSON bool
cmd := flag.NewFlagSet(cmdname, flag.ExitOnError)
@@ -804,7 +804,7 @@ func createGroupCmd(cmdname string, args []string) {
"%v [option...] %v [option...]\n",
os.Args[0], cmdname,
)
- cmd.StringVar(&groupname, "group", "", "group `name`")
+ cmd.StringVar(&hallname, "hall", "", "hall `name`")
cmd.Var(&unrestrictedTokens, "unrestricted-tokens",
"allow ordinary users to create tokens",
)
@@ -821,14 +821,14 @@ func createGroupCmd(cmdname string, args []string) {
os.Exit(1)
}
- if groupname == "" {
+ if hallname == "" {
fmt.Fprintf(cmd.Output(),
- "Option \"-group\" is required\n")
+ "Option \"-hall\" is required\n")
os.Exit(1)
}
u, err := url.JoinPath(
- serverURL, "/skald-api/v0/.groups", groupname,
+ serverURL, "/skald-api/v0/.halls", hallname,
)
if err != nil {
log.Fatalf("Build URL: %v", err)
@@ -848,18 +848,18 @@ func createGroupCmd(cmdname string, args []string) {
err = putJSON(u, data, false)
if err != nil {
- log.Fatalf("Create group: %v", err)
+ log.Fatalf("Create hall: %v", err)
}
}
func deleteGroupCmd(cmdname string, args []string) {
- var groupname string
+ var hallname string
cmd := flag.NewFlagSet(cmdname, flag.ExitOnError)
setUsage(cmd, cmdname,
"%v [option...] %v [option...]\n",
os.Args[0], cmdname,
)
- cmd.StringVar(&groupname, "group", "", "group `name`")
+ cmd.StringVar(&hallname, "hall", "", "hall `name`")
cmd.Parse(args)
if cmd.NArg() != 0 {
@@ -867,14 +867,14 @@ func deleteGroupCmd(cmdname string, args []string) {
os.Exit(1)
}
- if groupname == "" {
+ if hallname == "" {
fmt.Fprintf(cmd.Output(),
- "Option \"-group\" is required\n")
+ "Option \"-hall\" is required\n")
os.Exit(1)
}
u, err := url.JoinPath(
- serverURL, "/skald-api/v0/.groups", groupname,
+ serverURL, "/skald-api/v0/.halls", hallname,
)
if err != nil {
log.Fatalf("Build URL: %v", err)
@@ -882,12 +882,12 @@ func deleteGroupCmd(cmdname string, args []string) {
err = deleteValue(u)
if err != nil {
- log.Fatalf("Delete group: %v", err)
+ log.Fatalf("Delete hall: %v", err)
}
}
func updateGroupCmd(cmdname string, args []string) {
- var groupname string
+ var hallname string
var unrestrictedTokens, autoSubgroups boolOption
var doJSON bool
cmd := flag.NewFlagSet(cmdname, flag.ExitOnError)
@@ -895,7 +895,7 @@ func updateGroupCmd(cmdname string, args []string) {
"%v [option...] %v [option...]\n",
os.Args[0], cmdname,
)
- cmd.StringVar(&groupname, "group", "", "group `name`")
+ cmd.StringVar(&hallname, "hall", "", "hall `name`")
cmd.Var(&unrestrictedTokens, "unrestricted-tokens",
"allow ordinary users to create tokens",
)
@@ -913,7 +913,7 @@ func updateGroupCmd(cmdname string, args []string) {
}
u, err := url.JoinPath(
- serverURL, "/skald-api/v0/.groups", groupname,
+ serverURL, "/skald-api/v0/.halls", hallname,
)
if err != nil {
log.Fatalf("Build URL: %v", err)
@@ -1007,25 +1007,25 @@ func match(patterns []string, value string) (bool, error) {
}
func listUsersCmd(cmdname string, args []string) {
- var groupname string
+ var hallname string
var long bool
cmd := flag.NewFlagSet(cmdname, flag.ExitOnError)
setUsage(cmd, cmdname,
"%v [option...] %v [option...] [pattern...]\n",
os.Args[0], cmdname,
)
- cmd.StringVar(&groupname, "group", "", "group `name`")
+ cmd.StringVar(&hallname, "hall", "", "hall `name`")
cmd.BoolVar(&long, "l", false, "display permissions")
cmd.Parse(args)
patterns := cmd.Args()
- if groupname == "" {
+ if hallname == "" {
fmt.Fprintf(cmd.Output(),
- "Option \"-group\" is required\n")
+ "Option \"-hall\" is required\n")
os.Exit(1)
}
- u, err := url.JoinPath(serverURL, "/skald-api/v0/.groups/", groupname,
+ u, err := url.JoinPath(serverURL, "/skald-api/v0/.halls/", hallname,
".users/")
if err != nil {
log.Fatalf("Build URL: %v", err)
@@ -1069,21 +1069,21 @@ func listUsersCmd(cmdname string, args []string) {
}
}
-func userURL(wildcard bool, groupname, username string) (string, error) {
+func userURL(wildcard bool, hallname, username string) (string, error) {
if wildcard {
return url.JoinPath(
- serverURL, "/skald-api/v0/.groups", groupname,
+ serverURL, "/skald-api/v0/.halls", hallname,
".wildcard-user",
)
}
return url.JoinPath(
- serverURL, "/skald-api/v0/.groups", groupname,
+ serverURL, "/skald-api/v0/.halls", hallname,
".users", username,
)
}
func createUserCmd(cmdname string, args []string) {
- var groupname, username string
+ var hallname, username string
var wildcard bool
var permissions stringOption
var doJSON bool
@@ -1092,7 +1092,7 @@ func createUserCmd(cmdname string, args []string) {
"%v [option...] %v [option...]\n",
os.Args[0], cmdname,
)
- cmd.StringVar(&groupname, "group", "", "group `name`")
+ cmd.StringVar(&hallname, "hall", "", "hall `name`")
cmd.StringVar(&username, "user", "", "user `name`")
cmd.BoolVar(&wildcard, "wildcard", false, "create the wildcard user")
cmd.Var(&permissions, "permissions",
@@ -1107,9 +1107,9 @@ func createUserCmd(cmdname string, args []string) {
os.Exit(1)
}
- if groupname == "" {
+ if hallname == "" {
fmt.Fprintf(cmd.Output(),
- "Option \"-group\" is required\n")
+ "Option \"-hall\" is required\n")
os.Exit(1)
}
@@ -1131,7 +1131,7 @@ func createUserCmd(cmdname string, args []string) {
}
}
- u, err := userURL(wildcard, groupname, username)
+ u, err := userURL(wildcard, hallname, username)
if err != nil {
log.Fatalf("Build URL: %v", err)
}
@@ -1155,7 +1155,7 @@ func createUserCmd(cmdname string, args []string) {
}
func updateUserCmd(cmdname string, args []string) {
- var groupname, username string
+ var hallname, username string
var wildcard bool
var permissions stringOption
var doJSON bool
@@ -1164,7 +1164,7 @@ func updateUserCmd(cmdname string, args []string) {
"%v [option...] %v [option...]\n",
os.Args[0], cmdname,
)
- cmd.StringVar(&groupname, "group", "", "group `name`")
+ cmd.StringVar(&hallname, "hall", "", "hall `name`")
cmd.StringVar(&username, "user", "", "user `name`")
cmd.BoolVar(&wildcard, "wildcard", false, "update the wildcard user")
cmd.Var(&permissions, "permissions", "permissions")
@@ -1175,7 +1175,7 @@ func updateUserCmd(cmdname string, args []string) {
os.Exit(1)
}
- u, err := userURL(wildcard, groupname, username)
+ u, err := userURL(wildcard, hallname, username)
if err != nil {
log.Fatalf("Build URL: %v", err)
}
@@ -1217,13 +1217,13 @@ func updateUserCmd(cmdname string, args []string) {
}
func deleteUserCmd(cmdname string, args []string) {
- var groupname, username string
+ var hallname, username string
var wildcard bool
cmd := flag.NewFlagSet(cmdname, flag.ExitOnError)
setUsage(cmd, cmdname, "%v [option...] %v [option...]\n",
os.Args[0], cmdname,
)
- cmd.StringVar(&groupname, "group", "", "group `name`")
+ cmd.StringVar(&hallname, "hall", "", "hall `name`")
cmd.StringVar(&username, "user", "", "user `name`")
cmd.BoolVar(&wildcard, "wildcard", false, "delete the wildcard user")
cmd.Parse(args)
@@ -1233,9 +1233,9 @@ func deleteUserCmd(cmdname string, args []string) {
os.Exit(1)
}
- if groupname == "" {
+ if hallname == "" {
fmt.Fprintf(cmd.Output(),
- "Option \"-group\" is required\n")
+ "Option \"-hall\" is required\n")
os.Exit(1)
}
@@ -1250,12 +1250,12 @@ func deleteUserCmd(cmdname string, args []string) {
var err error
if wildcard {
u, err = url.JoinPath(
- serverURL, "/skald-api/v0/.groups", groupname,
+ serverURL, "/skald-api/v0/.halls", hallname,
".wildcard-user",
)
} else {
u, err = url.JoinPath(
- serverURL, "/skald-api/v0/.groups", groupname,
+ serverURL, "/skald-api/v0/.halls", hallname,
".users", username,
)
}
@@ -1270,13 +1270,13 @@ func deleteUserCmd(cmdname string, args []string) {
}
func showGroupCmd(cmdname string, args []string) {
- var groupname string
+ var hallname string
cmd := flag.NewFlagSet(cmdname, flag.ExitOnError)
setUsage(cmd, cmdname,
"%v [option...] %v\n",
os.Args[0], cmdname,
)
- cmd.StringVar(&groupname, "group", "", "group `name`")
+ cmd.StringVar(&hallname, "hall", "", "hall `name`")
cmd.Parse(args)
if cmd.NArg() != 0 {
@@ -1284,11 +1284,11 @@ func showGroupCmd(cmdname string, args []string) {
os.Exit(1)
}
- if groupname == "" {
- log.Fatal("Option \"-group\" is required.")
+ if hallname == "" {
+ log.Fatal("Option \"-hall\" is required.")
}
- u, err := url.JoinPath(serverURL, "/skald-api/v0/.groups/", groupname)
+ u, err := url.JoinPath(serverURL, "/skald-api/v0/.halls/", hallname)
if err != nil {
log.Fatalf("Build URL: %v", err)
}
@@ -1296,7 +1296,7 @@ func showGroupCmd(cmdname string, args []string) {
var description map[string]any
_, err = getJSON(u, &description)
if err != nil {
- log.Fatalf("Get group description: %v", err)
+ log.Fatalf("Get hall description: %v", err)
}
encoder := json.NewEncoder(os.Stdout)
encoder.SetIndent("", " ")
@@ -1315,7 +1315,7 @@ func listGroupsCmd(cmdname string, args []string) {
cmd.Parse(args)
patterns := cmd.Args()
- u, err := url.JoinPath(serverURL, "/skald-api/v0/.groups/")
+ u, err := url.JoinPath(serverURL, "/skald-api/v0/.halls/")
if err != nil {
log.Fatalf("Build URL: %v", err)
}
@@ -1323,7 +1323,7 @@ func listGroupsCmd(cmdname string, args []string) {
var groups []string
_, err = getJSON(u, &groups)
if err != nil {
- log.Fatalf("Get groups: %v", err)
+ log.Fatalf("Get halls: %v", err)
}
sort.Slice(groups, func(i, j int) bool {
return groups[i] < groups[j]
@@ -1343,13 +1343,13 @@ func listGroupsCmd(cmdname string, args []string) {
}
func listTokensCmd(cmdname string, args []string) {
- var groupname stringOption
+ var hallname stringOption
var long bool
cmd := flag.NewFlagSet(cmdname, flag.ExitOnError)
setUsage(cmd, cmdname, "%v [option...] %v [option...]\n",
os.Args[0], cmdname,
)
- cmd.Var(&groupname, "group", "group `name`")
+ cmd.Var(&hallname, "hall", "hall `name`")
cmd.BoolVar(&long, "l", false, "display token fields")
cmd.Parse(args)
@@ -1358,14 +1358,14 @@ func listTokensCmd(cmdname string, args []string) {
os.Exit(1)
}
- if !groupname.set {
+ if !hallname.set {
fmt.Fprintf(cmd.Output(),
- "Option \"-group\" is required\n")
+ "Option \"-hall\" is required\n")
os.Exit(1)
}
u, err := url.JoinPath(
- serverURL, "/skald-api/v0/.groups/", groupname.value, ".tokens/",
+ serverURL, "/skald-api/v0/.halls/", hallname.value, ".tokens/",
)
if err != nil {
@@ -1430,14 +1430,14 @@ func listTokensCmd(cmdname string, args []string) {
}
func createTokenCmd(cmdname string, args []string) {
- var groupname stringOption
+ var hallname stringOption
var username, permissions string
var includeSubgroups boolOption
cmd := flag.NewFlagSet(cmdname, flag.ExitOnError)
setUsage(cmd, cmdname, "%v [option...] %v [option...]\n",
os.Args[0], cmdname,
)
- cmd.Var(&groupname, "group", "group `name`")
+ cmd.Var(&hallname, "hall", "hall `name`")
cmd.Var(&includeSubgroups, "include-subgroups", "include subgroups")
cmd.StringVar(&username, "user", "", "encode user `name` in token")
cmd.StringVar(&permissions, "permissions", "present", "permissions")
@@ -1448,9 +1448,9 @@ func createTokenCmd(cmdname string, args []string) {
os.Exit(1)
}
- if !groupname.set {
+ if !hallname.set {
fmt.Fprintf(cmd.Output(),
- "Option \"-group\" is required\n")
+ "Option \"-hall\" is required\n")
os.Exit(1)
}
@@ -1469,7 +1469,7 @@ func createTokenCmd(cmdname string, args []string) {
}
u, err := url.JoinPath(
- serverURL, "/skald-api/v0/.groups/", groupname.value, ".tokens/",
+ serverURL, "/skald-api/v0/.halls/", hallname.value, ".tokens/",
)
if err != nil {
log.Fatalf("Build URL: %v", err)
@@ -1483,13 +1483,13 @@ func createTokenCmd(cmdname string, args []string) {
}
func revokeTokenCmd(cmdname string, args []string) {
- var groupname stringOption
+ var hallname stringOption
var token string
cmd := flag.NewFlagSet(cmdname, flag.ExitOnError)
setUsage(cmd, cmdname, "%v [option...] %v [option...]\n",
os.Args[0], cmdname,
)
- cmd.Var(&groupname, "group", "group `name`")
+ cmd.Var(&hallname, "hall", "hall `name`")
cmd.StringVar(&token, "token", "", "`token` to delete")
cmd.Parse(args)
@@ -1498,14 +1498,14 @@ func revokeTokenCmd(cmdname string, args []string) {
os.Exit(1)
}
- if !groupname.set || token == "" {
+ if !hallname.set || token == "" {
fmt.Fprintf(cmd.Output(),
- "Options \"-group\" and \"-token\" are required\n")
+ "Options \"-hall\" and \"-token\" are required\n")
os.Exit(1)
}
u, err := url.JoinPath(
- serverURL, "/skald-api/v0/.groups/", groupname.value,
+ serverURL, "/skald-api/v0/.halls/", hallname.value,
".tokens", token,
)
if err != nil {
@@ -1522,13 +1522,13 @@ func revokeTokenCmd(cmdname string, args []string) {
}
func deleteTokenCmd(cmdname string, args []string) {
- var groupname stringOption
+ var hallname stringOption
var token string
cmd := flag.NewFlagSet(cmdname, flag.ExitOnError)
setUsage(cmd, cmdname, "%v [option...] %v [option...]\n",
os.Args[0], cmdname,
)
- cmd.Var(&groupname, "group", "group `name`")
+ cmd.Var(&hallname, "hall", "hall `name`")
cmd.StringVar(&token, "token", "", "`token` to delete")
cmd.Parse(args)
@@ -1537,14 +1537,14 @@ func deleteTokenCmd(cmdname string, args []string) {
os.Exit(1)
}
- if !groupname.set || token == "" {
+ if !hallname.set || token == "" {
fmt.Fprintf(cmd.Output(),
- "Options \"-group\" and \"-token\" are required\n")
+ "Options \"-hall\" and \"-token\" are required\n")
os.Exit(1)
}
u, err := url.JoinPath(
- serverURL, "/skald-api/v0/.groups/", groupname.value,
+ serverURL, "/skald-api/v0/.halls/", hallname.value,
".tokens", token,
)
if err != nil {
diff --git a/static/example/example.js b/static/example/example.js
index efe46d1..5205b2c 100644
--- a/static/example/example.js
+++ b/static/example/example.js
@@ -307,7 +307,7 @@ document.getElementById('start').onclick = async function(e) {
let button = /** @type{HTMLButtonElement} */(this);
button.hidden = true;
try {
- await start("/group/public/");
+ await start("/hall/public/");
} catch(e) {
displayError(e);
};
diff --git a/static/index.html b/static/index.html
index 6a051d9..dd43049 100644
--- a/static/index.html
+++ b/static/index.html
@@ -15,22 +15,22 @@
Skald
-
-
-
Public groups
+
+
Public halls
-
+
diff --git a/static/mainpage.css b/static/mainpage.css
index d94bc7b..94dfe31 100644
--- a/static/mainpage.css
+++ b/static/mainpage.css
@@ -26,7 +26,7 @@ body {
padding: 1.875rem;
}
-#public-groups-table tr a{
+#public-halls-table tr a{
margin-left: 0.9375rem;
font-weight: 700;
}
diff --git a/static/mainpage.js b/static/mainpage.js
index 8488377..428e38d 100644
--- a/static/mainpage.js
+++ b/static/mainpage.js
@@ -20,16 +20,16 @@
'use strict';
-document.getElementById('groupform').onsubmit = async function(e) {
+document.getElementById('hallform').onsubmit = async function(e) {
e.preventDefault();
clearError();
- let groupinput = document.getElementById('group')
+ let groupinput = document.getElementById('hall')
let button = document.getElementById('submitbutton');
let group = groupinput.value.trim();
if(group === '')
return;
- let url = '/group/' + group + '/';
+ let url = '/hall/' + group + '/';
let statusUrl = url + '.status.json';
try {
@@ -78,25 +78,25 @@ function clearError() {
}
}
-async function listPublicGroups() {
- let div = document.getElementById('public-groups');
- let table = document.getElementById('public-groups-table');
+async function listPublicHalls() {
+ let div = document.getElementById('public-halls');
+ let table = document.getElementById('public-halls-table');
let l;
try {
- let r = await fetch('/public-groups.json');
+ let r = await fetch('/public-halls.json');
if(!r.ok)
throw new Error(`${r.status} ${r.statusText}`);
l = await r.json();
} catch(e) {
- table.textContent = `Couldn't fetch groups: ${e}`;
+ table.textContent = `Couldn't fetch halls: ${e}`;
div.classList.remove('nogroups');
div.classList.add('groups');
return;
}
if (l.length === 0) {
- table.textContent = '(No groups found.)';
+ table.textContent = '(No halls found.)';
div.classList.remove('groups');
div.classList.add('nogroups');
return;
@@ -131,4 +131,4 @@ async function listPublicGroups() {
}
-listPublicGroups();
+listPublicHalls();
diff --git a/static/management.js b/static/management.js
index 8cd11d7..d753f25 100644
--- a/static/management.js
+++ b/static/management.js
@@ -159,7 +159,7 @@ async function updateObject(url, values, etag) {
* @returns {Promise>}
*/
async function listGroups() {
- return await listObjects('/skald-api/v0/.groups/');
+ return await listObjects('/skald-api/v0/.halls/');
}
/**
@@ -170,7 +170,7 @@ async function listGroups() {
* @returns {Promise