Skip to content

Commit 8a3b8b7

Browse files
authored
Merge pull request #413 from rusq/i404
Update documentation to describe machine ID override
2 parents a87a008 + c6c65b5 commit 8a3b8b7

File tree

4 files changed

+85
-0
lines changed

4 files changed

+85
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Transferring Credentials to Another Computer
2+
3+
__Difficulty__: Advanced.
4+
5+
At times you may need to transfer the credentials to another computer or
6+
system, such as CI/CD. As the credentials are encrypted with the machine-specific
7+
key (machine ID), the credentials will not work straight away.
8+
9+
Slackdump supports Machine ID override, which allows you to define the machine ID
10+
for a chosen workspace. Using the same Machine ID on your local and remote systems
11+
will allow you to use the same credentials on both.
12+
13+
__IMPORTANT__: Never share your custom machine ID with anyone. The machine ID
14+
is a secret key to your login information.
15+
16+
To transfer the credentials to another system, follow these steps:
17+
18+
1. Reauthenticate in the workspace you want to transfer by specifying the
19+
machine ID override with `-machine-id` flag. For example:
20+
21+
```bash
22+
slackdump workspace new -machine-id="my-machine-id" your_workspace
23+
```
24+
25+
This will create a new workspace file with the machine ID override.
26+
27+
2. Run the `slackdump workspace list` command to get the workspace file name,
28+
for example: `your_workspace.bin`
29+
30+
3. Find out the slackdump cache directory location on your system by running:
31+
32+
```bash
33+
slackdump tools info
34+
```
35+
36+
Slackdump cache location will be in "workspace" section, "path" field. If
37+
you have `jq` installed, you can run:
38+
39+
```bash
40+
slackdump tools info | jq -r '.workspace.path'
41+
```
42+
43+
5. Install slackdump on the remote system.
44+
45+
6. Repeat the step 3 on the remote system to find out the cache directory.
46+
47+
7. Create it if it doesn't exist
48+
49+
8. Copy the workspace file and `workspace.txt` file from the cache directory to
50+
the remote system.
51+
52+
9. Verify that the workspace is available and credentials are working by running:
53+
54+
```bash
55+
slackdump workspace list -a -machine-id="my-machine-id"
56+
```
57+
58+
on the remote system.
59+
You should see OK in the last "error" column. If you see "failed to load
60+
stored credentials", it means that the credentials are not working.
61+
62+
10. You can now use the credentials on the remote system.
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package man
2+
3+
import (
4+
_ "embed"
5+
6+
"github.com/rusq/slackdump/v3/cmd/slackdump/internal/golang/base"
7+
)
8+
9+
//go:embed assets/transfer.md
10+
var transferMd string
11+
12+
var Transfer = &base.Command{
13+
UsageLine: "transfer",
14+
Short: "transfering credentials to another system",
15+
Long: transferMd,
16+
}

cmd/slackdump/main.go

+1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ func init() {
6060
man.Login,
6161
man.Chunk,
6262
man.Migration,
63+
man.Transfer,
6364
}
6465
}
6566

slackdump.1

+6
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,12 @@ Enables or disables JSON log format. The default is disabled.
155155
.It Fl token Ar token
156156
Specifies the token to use for the authentication. This flag is only used
157157
with the manual authentication methods.
158+
.It Fl machine-id Ar value
159+
Allows to override the machine ID. To read how to use it to transfer the credentials
160+
between machine, run:
161+
.Bd -literal -offset indent
162+
slackdump help transfer
163+
.Ed
158164
.It Fl member-only
159165
Specify this flag to export only conversations (channels) that the current user
160166
is part of. Works only if the list of channels/threads is not explicitly

0 commit comments

Comments
 (0)