+82
docs/knot-hosting.md
+82
docs/knot-hosting.md
···
106
106
107
107
You should now have a running knot server! You can finalize your registration by hitting the
108
108
`initialize` button on the [/knots](/knots) page.
109
+
110
+
### custom paths
111
+
112
+
(This section applies to manual setup only. Docker users should edit the mounts
113
+
in `docker-compose.yml` instead.)
114
+
115
+
Right now, the database and repositories of your knot lives in `/home/git`. You
116
+
can move these paths if you'd like to store them in another folder. Be careful
117
+
when adjusting these paths:
118
+
119
+
* Stop your knot when moving data (e.g. `systemctl stop knotserver`) to prevent
120
+
any possible side effects. Remember to restart it once you're done.
121
+
* Make backups before moving in case something goes wrong.
122
+
* Make sure the `git` user can read and write from the new paths.
123
+
124
+
#### database
125
+
126
+
As an example, let's say the current database is at `/home/git/knotserver.db`,
127
+
and we want to move it to `/home/git/database/knotserver.db`.
128
+
129
+
Copy the current database to the new location. Make sure to copy the `.db-shm`
130
+
and `.db-wal` files if they exist.
131
+
132
+
```
133
+
mkdir /home/git/database
134
+
cp /home/git/knotserver.db* /home/git/database
135
+
```
136
+
137
+
In the environment (e.g. `/home/git/.knot.env`), set `KNOT_SERVER_DB_PATH` to
138
+
the new file path (_not_ the directory):
139
+
140
+
```
141
+
KNOT_SERVER_DB_PATH=/home/git/database/knotserver.db
142
+
```
143
+
144
+
#### repositories
145
+
146
+
As an example, let's say the repositories are currently in `/home/git`, and we
147
+
want to move them into `/home/git/repositories`.
148
+
149
+
Create the new folder, then move the existing repositories (if there are any):
150
+
151
+
```
152
+
mkdir /home/git/repositories
153
+
# move all DIDs into the new folder; these will vary for you!
154
+
mv /home/git/did:plc:wshs7t2adsemcrrd4snkeqli /home/git/repositories
155
+
```
156
+
157
+
In the environment (e.g. `/home/git/.knot.env`), update `KNOT_REPO_SCAN_PATH`
158
+
to the new directory:
159
+
160
+
```
161
+
KNOT_REPO_SCAN_PATH=/home/git/repositories
162
+
```
163
+
164
+
In your SSH config (e.g. `/etc/ssh/sshd_config.d/authorized_keys_command.conf`),
165
+
update the `AuthorizedKeysCommand` line to use the new folder. For example:
166
+
167
+
```
168
+
Match User git
169
+
AuthorizedKeysCommand /usr/local/libexec/tangled-keyfetch -git-dir /home/git/repositories
170
+
AuthorizedKeysCommandUser nobody
171
+
```
172
+
173
+
Make sure to restart your SSH server!
174
+
175
+
#### git
176
+
177
+
The keyfetch executable takes multiple arguments to change certain paths. You
178
+
can view a full list by running `/usr/local/libexec/tangled-keyfetch -h`.
179
+
180
+
As an example, if you wanted to change the path to the repoguard executable,
181
+
you would edit your SSH config (e.g. `/etc/ssh/sshd_config.d/authorized_keys_command.conf`)
182
+
and update the `AuthorizedKeysCommand` line:
183
+
184
+
```
185
+
Match User git
186
+
AuthorizedKeysCommand /usr/local/libexec/tangled-keyfetch -repoguard-path /path/to/repoguard
187
+
AuthorizedKeysCommandUser nobody
188
+
```
189
+
190
+
Make sure to restart your SSH server!