@effect-vfs/nfs 0.1.0
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.
- package/LICENSE +22 -0
- package/README.md +93 -0
- package/dist/NfsServer.d.ts +693 -0
- package/dist/NfsServer.d.ts.map +1 -0
- package/dist/NfsServer.js +439 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/internal/export.d.ts +77 -0
- package/dist/internal/export.d.ts.map +1 -0
- package/dist/internal/export.js +224 -0
- package/dist/internal/lockRanges.d.ts +16 -0
- package/dist/internal/lockRanges.d.ts.map +1 -0
- package/dist/internal/lockRanges.js +12 -0
- package/dist/internal/nfs4.d.ts +194 -0
- package/dist/internal/nfs4.d.ts.map +1 -0
- package/dist/internal/nfs4.js +3561 -0
- package/dist/internal/recordMarking.d.ts +29 -0
- package/dist/internal/recordMarking.d.ts.map +1 -0
- package/dist/internal/recordMarking.js +127 -0
- package/dist/internal/rpc.d.ts +73 -0
- package/dist/internal/rpc.d.ts.map +1 -0
- package/dist/internal/rpc.js +161 -0
- package/dist/internal/server.d.ts +17 -0
- package/dist/internal/server.d.ts.map +1 -0
- package/dist/internal/server.js +78 -0
- package/dist/internal/xdr.d.ts +51 -0
- package/dist/internal/xdr.d.ts.map +1 -0
- package/dist/internal/xdr.js +178 -0
- package/package.json +54 -0
|
@@ -0,0 +1,693 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Models and constructors for the experimental read-only NFSv4.1 server.
|
|
3
|
+
*
|
|
4
|
+
* The server exports one live `@effect-vfs/core` volume over NFSv4.1 so that
|
|
5
|
+
* ordinary NFS clients can mount a virtual filesystem. It implements the
|
|
6
|
+
* required read-only operation set and answers every other operation with
|
|
7
|
+
* `NFS4ERR_NOTSUPP`.
|
|
8
|
+
*
|
|
9
|
+
* @since 0.1.0
|
|
10
|
+
*/
|
|
11
|
+
import { VirtualFileSystem as Vfs } from "@effect-vfs/core";
|
|
12
|
+
import * as ByteSize from "effect/ByteSize";
|
|
13
|
+
import * as Context from "effect/Context";
|
|
14
|
+
import * as Crypto from "effect/Crypto";
|
|
15
|
+
import * as Effect from "effect/Effect";
|
|
16
|
+
import * as Layer from "effect/Layer";
|
|
17
|
+
import * as Schema from "effect/Schema";
|
|
18
|
+
import type * as Scope from "effect/Scope";
|
|
19
|
+
import * as SocketServer from "effect/unstable/socket/SocketServer";
|
|
20
|
+
/**
|
|
21
|
+
* Schema for a literal IPv4 or IPv6 loopback address.
|
|
22
|
+
*
|
|
23
|
+
* @category schemas
|
|
24
|
+
* @since 0.1.0
|
|
25
|
+
*/
|
|
26
|
+
export declare const LoopbackHost: Schema.Literals<readonly ["127.0.0.1", "::1"]>;
|
|
27
|
+
/**
|
|
28
|
+
* A literal IPv4 or IPv6 loopback address.
|
|
29
|
+
*
|
|
30
|
+
* @category models
|
|
31
|
+
* @since 0.1.0
|
|
32
|
+
*/
|
|
33
|
+
export type LoopbackHost = typeof LoopbackHost.Type;
|
|
34
|
+
/**
|
|
35
|
+
* Schema for a TCP port, including `0` for an ephemeral port.
|
|
36
|
+
*
|
|
37
|
+
* @category schemas
|
|
38
|
+
* @since 0.1.0
|
|
39
|
+
*/
|
|
40
|
+
export declare const Port: Schema.Finite;
|
|
41
|
+
/**
|
|
42
|
+
* A TCP port, including `0` for an ephemeral port.
|
|
43
|
+
*
|
|
44
|
+
* @category models
|
|
45
|
+
* @since 0.1.0
|
|
46
|
+
*/
|
|
47
|
+
export type Port = typeof Port.Type;
|
|
48
|
+
declare const NfsServerLimitsSchema: Schema.Struct<{
|
|
49
|
+
readonly maxConnections: Schema.Finite;
|
|
50
|
+
readonly maxFragmentBytes: Schema.ByteSize;
|
|
51
|
+
readonly maxRecordBytes: Schema.ByteSize;
|
|
52
|
+
readonly maxFragmentsPerRecord: Schema.Finite;
|
|
53
|
+
readonly maxOpaqueBytes: Schema.ByteSize;
|
|
54
|
+
readonly maxStringBytes: Schema.ByteSize;
|
|
55
|
+
readonly maxArrayElements: Schema.Finite;
|
|
56
|
+
readonly maxAuthBytes: Schema.ByteSize;
|
|
57
|
+
readonly maxMachineNameBytes: Schema.ByteSize;
|
|
58
|
+
readonly maxSupplementaryGroups: Schema.Finite;
|
|
59
|
+
readonly maxCompoundBytes: Schema.ByteSize;
|
|
60
|
+
readonly maxOperations: Schema.Finite;
|
|
61
|
+
readonly maxBitmapWords: Schema.Finite;
|
|
62
|
+
readonly maxClients: Schema.Finite;
|
|
63
|
+
readonly maxIdentities: Schema.Finite;
|
|
64
|
+
readonly maxPendingClientReplacements: Schema.Finite;
|
|
65
|
+
readonly maxSessions: Schema.Finite;
|
|
66
|
+
readonly maxSlotsPerSession: Schema.Finite;
|
|
67
|
+
readonly maxReplayBytes: Schema.ByteSize;
|
|
68
|
+
readonly maxOpens: Schema.Finite;
|
|
69
|
+
readonly maxLockOwners: Schema.Finite;
|
|
70
|
+
readonly maxLocks: Schema.Finite;
|
|
71
|
+
readonly maxOwnerBytes: Schema.ByteSize;
|
|
72
|
+
readonly maxReadBytes: Schema.ByteSize;
|
|
73
|
+
readonly maxWriteBytes: Schema.ByteSize;
|
|
74
|
+
readonly maxReaddirEntries: Schema.Finite;
|
|
75
|
+
readonly maxReaddirReplyBytes: Schema.ByteSize;
|
|
76
|
+
readonly maxNameBytes: Schema.ByteSize;
|
|
77
|
+
readonly maxFilehandles: Schema.Finite;
|
|
78
|
+
}>;
|
|
79
|
+
/**
|
|
80
|
+
* Every resource bound enforced by the preview server.
|
|
81
|
+
*
|
|
82
|
+
* @category models
|
|
83
|
+
* @since 0.1.0
|
|
84
|
+
*/
|
|
85
|
+
export type NfsServerLimits = typeof NfsServerLimitsSchema.Type;
|
|
86
|
+
/**
|
|
87
|
+
* Schema for every resource bound enforced by the preview server, with frozen presets.
|
|
88
|
+
*
|
|
89
|
+
* @category schemas
|
|
90
|
+
* @since 0.1.0
|
|
91
|
+
*/
|
|
92
|
+
export declare const NfsServerLimits: Schema.Struct<{
|
|
93
|
+
readonly maxConnections: Schema.Finite;
|
|
94
|
+
readonly maxFragmentBytes: Schema.ByteSize;
|
|
95
|
+
readonly maxRecordBytes: Schema.ByteSize;
|
|
96
|
+
readonly maxFragmentsPerRecord: Schema.Finite;
|
|
97
|
+
readonly maxOpaqueBytes: Schema.ByteSize;
|
|
98
|
+
readonly maxStringBytes: Schema.ByteSize;
|
|
99
|
+
readonly maxArrayElements: Schema.Finite;
|
|
100
|
+
readonly maxAuthBytes: Schema.ByteSize;
|
|
101
|
+
readonly maxMachineNameBytes: Schema.ByteSize;
|
|
102
|
+
readonly maxSupplementaryGroups: Schema.Finite;
|
|
103
|
+
readonly maxCompoundBytes: Schema.ByteSize;
|
|
104
|
+
readonly maxOperations: Schema.Finite;
|
|
105
|
+
readonly maxBitmapWords: Schema.Finite;
|
|
106
|
+
readonly maxClients: Schema.Finite;
|
|
107
|
+
readonly maxIdentities: Schema.Finite;
|
|
108
|
+
readonly maxPendingClientReplacements: Schema.Finite;
|
|
109
|
+
readonly maxSessions: Schema.Finite;
|
|
110
|
+
readonly maxSlotsPerSession: Schema.Finite;
|
|
111
|
+
readonly maxReplayBytes: Schema.ByteSize;
|
|
112
|
+
readonly maxOpens: Schema.Finite;
|
|
113
|
+
readonly maxLockOwners: Schema.Finite;
|
|
114
|
+
readonly maxLocks: Schema.Finite;
|
|
115
|
+
readonly maxOwnerBytes: Schema.ByteSize;
|
|
116
|
+
readonly maxReadBytes: Schema.ByteSize;
|
|
117
|
+
readonly maxWriteBytes: Schema.ByteSize;
|
|
118
|
+
readonly maxReaddirEntries: Schema.Finite;
|
|
119
|
+
readonly maxReaddirReplyBytes: Schema.ByteSize;
|
|
120
|
+
readonly maxNameBytes: Schema.ByteSize;
|
|
121
|
+
readonly maxFilehandles: Schema.Finite;
|
|
122
|
+
}> & {
|
|
123
|
+
constrained: {
|
|
124
|
+
readonly maxConnections: number;
|
|
125
|
+
readonly maxFragmentBytes: ByteSize.ByteSize;
|
|
126
|
+
readonly maxRecordBytes: ByteSize.ByteSize;
|
|
127
|
+
readonly maxFragmentsPerRecord: number;
|
|
128
|
+
readonly maxOpaqueBytes: ByteSize.ByteSize;
|
|
129
|
+
readonly maxStringBytes: ByteSize.ByteSize;
|
|
130
|
+
readonly maxArrayElements: number;
|
|
131
|
+
readonly maxAuthBytes: ByteSize.ByteSize;
|
|
132
|
+
readonly maxMachineNameBytes: ByteSize.ByteSize;
|
|
133
|
+
readonly maxSupplementaryGroups: number;
|
|
134
|
+
readonly maxCompoundBytes: ByteSize.ByteSize;
|
|
135
|
+
readonly maxOperations: number;
|
|
136
|
+
readonly maxBitmapWords: number;
|
|
137
|
+
readonly maxClients: number;
|
|
138
|
+
readonly maxIdentities: number;
|
|
139
|
+
readonly maxPendingClientReplacements: number;
|
|
140
|
+
readonly maxSessions: number;
|
|
141
|
+
readonly maxSlotsPerSession: number;
|
|
142
|
+
readonly maxReplayBytes: ByteSize.ByteSize;
|
|
143
|
+
readonly maxOpens: number;
|
|
144
|
+
readonly maxLockOwners: number;
|
|
145
|
+
readonly maxLocks: number;
|
|
146
|
+
readonly maxOwnerBytes: ByteSize.ByteSize;
|
|
147
|
+
readonly maxReadBytes: ByteSize.ByteSize;
|
|
148
|
+
readonly maxWriteBytes: ByteSize.ByteSize;
|
|
149
|
+
readonly maxReaddirEntries: number;
|
|
150
|
+
readonly maxReaddirReplyBytes: ByteSize.ByteSize;
|
|
151
|
+
readonly maxNameBytes: ByteSize.ByteSize;
|
|
152
|
+
readonly maxFilehandles: number;
|
|
153
|
+
};
|
|
154
|
+
default: {
|
|
155
|
+
readonly maxConnections: number;
|
|
156
|
+
readonly maxFragmentBytes: ByteSize.ByteSize;
|
|
157
|
+
readonly maxRecordBytes: ByteSize.ByteSize;
|
|
158
|
+
readonly maxFragmentsPerRecord: number;
|
|
159
|
+
readonly maxOpaqueBytes: ByteSize.ByteSize;
|
|
160
|
+
readonly maxStringBytes: ByteSize.ByteSize;
|
|
161
|
+
readonly maxArrayElements: number;
|
|
162
|
+
readonly maxAuthBytes: ByteSize.ByteSize;
|
|
163
|
+
readonly maxMachineNameBytes: ByteSize.ByteSize;
|
|
164
|
+
readonly maxSupplementaryGroups: number;
|
|
165
|
+
readonly maxCompoundBytes: ByteSize.ByteSize;
|
|
166
|
+
readonly maxOperations: number;
|
|
167
|
+
readonly maxBitmapWords: number;
|
|
168
|
+
readonly maxClients: number;
|
|
169
|
+
readonly maxIdentities: number;
|
|
170
|
+
readonly maxPendingClientReplacements: number;
|
|
171
|
+
readonly maxSessions: number;
|
|
172
|
+
readonly maxSlotsPerSession: number;
|
|
173
|
+
readonly maxReplayBytes: ByteSize.ByteSize;
|
|
174
|
+
readonly maxOpens: number;
|
|
175
|
+
readonly maxLockOwners: number;
|
|
176
|
+
readonly maxLocks: number;
|
|
177
|
+
readonly maxOwnerBytes: ByteSize.ByteSize;
|
|
178
|
+
readonly maxReadBytes: ByteSize.ByteSize;
|
|
179
|
+
readonly maxWriteBytes: ByteSize.ByteSize;
|
|
180
|
+
readonly maxReaddirEntries: number;
|
|
181
|
+
readonly maxReaddirReplyBytes: ByteSize.ByteSize;
|
|
182
|
+
readonly maxNameBytes: ByteSize.ByteSize;
|
|
183
|
+
readonly maxFilehandles: number;
|
|
184
|
+
};
|
|
185
|
+
};
|
|
186
|
+
/**
|
|
187
|
+
* Schema for selectively overriding the default NFS server resource policy.
|
|
188
|
+
*
|
|
189
|
+
* @category schemas
|
|
190
|
+
* @since 0.1.0
|
|
191
|
+
*/
|
|
192
|
+
export declare const NfsServerLimitOverrides: Schema.Struct<{
|
|
193
|
+
readonly maxConnections: Schema.optionalKey<Schema.Finite>;
|
|
194
|
+
readonly maxFragmentBytes: Schema.optionalKey<Schema.ByteSize>;
|
|
195
|
+
readonly maxRecordBytes: Schema.optionalKey<Schema.ByteSize>;
|
|
196
|
+
readonly maxFragmentsPerRecord: Schema.optionalKey<Schema.Finite>;
|
|
197
|
+
readonly maxOpaqueBytes: Schema.optionalKey<Schema.ByteSize>;
|
|
198
|
+
readonly maxStringBytes: Schema.optionalKey<Schema.ByteSize>;
|
|
199
|
+
readonly maxArrayElements: Schema.optionalKey<Schema.Finite>;
|
|
200
|
+
readonly maxAuthBytes: Schema.optionalKey<Schema.ByteSize>;
|
|
201
|
+
readonly maxMachineNameBytes: Schema.optionalKey<Schema.ByteSize>;
|
|
202
|
+
readonly maxSupplementaryGroups: Schema.optionalKey<Schema.Finite>;
|
|
203
|
+
readonly maxCompoundBytes: Schema.optionalKey<Schema.ByteSize>;
|
|
204
|
+
readonly maxOperations: Schema.optionalKey<Schema.Finite>;
|
|
205
|
+
readonly maxBitmapWords: Schema.optionalKey<Schema.Finite>;
|
|
206
|
+
readonly maxClients: Schema.optionalKey<Schema.Finite>;
|
|
207
|
+
readonly maxIdentities: Schema.optionalKey<Schema.Finite>;
|
|
208
|
+
readonly maxPendingClientReplacements: Schema.optionalKey<Schema.Finite>;
|
|
209
|
+
readonly maxSessions: Schema.optionalKey<Schema.Finite>;
|
|
210
|
+
readonly maxSlotsPerSession: Schema.optionalKey<Schema.Finite>;
|
|
211
|
+
readonly maxReplayBytes: Schema.optionalKey<Schema.ByteSize>;
|
|
212
|
+
readonly maxOpens: Schema.optionalKey<Schema.Finite>;
|
|
213
|
+
readonly maxLockOwners: Schema.optionalKey<Schema.Finite>;
|
|
214
|
+
readonly maxLocks: Schema.optionalKey<Schema.Finite>;
|
|
215
|
+
readonly maxOwnerBytes: Schema.optionalKey<Schema.ByteSize>;
|
|
216
|
+
readonly maxReadBytes: Schema.optionalKey<Schema.ByteSize>;
|
|
217
|
+
readonly maxWriteBytes: Schema.optionalKey<Schema.ByteSize>;
|
|
218
|
+
readonly maxReaddirEntries: Schema.optionalKey<Schema.Finite>;
|
|
219
|
+
readonly maxReaddirReplyBytes: Schema.optionalKey<Schema.ByteSize>;
|
|
220
|
+
readonly maxNameBytes: Schema.optionalKey<Schema.ByteSize>;
|
|
221
|
+
readonly maxFilehandles: Schema.optionalKey<Schema.Finite>;
|
|
222
|
+
}>;
|
|
223
|
+
/**
|
|
224
|
+
* A selective override of the default NFS server resource policy.
|
|
225
|
+
*
|
|
226
|
+
* @category models
|
|
227
|
+
* @since 0.1.0
|
|
228
|
+
*/
|
|
229
|
+
export type NfsServerLimitOverrides = typeof NfsServerLimitOverrides.Type;
|
|
230
|
+
/** Schema for configuration that can be validated without opening runtime capabilities. */
|
|
231
|
+
declare const NfsServerConfigSchema: Schema.Struct<{
|
|
232
|
+
readonly leaseDurationSeconds: Schema.Finite;
|
|
233
|
+
/** How long a backchannel callback waits for the client before the path is treated as down. */
|
|
234
|
+
readonly callbackTimeoutSeconds: Schema.Finite;
|
|
235
|
+
readonly limits: Schema.Struct<{
|
|
236
|
+
readonly maxConnections: Schema.Finite;
|
|
237
|
+
readonly maxFragmentBytes: Schema.ByteSize;
|
|
238
|
+
readonly maxRecordBytes: Schema.ByteSize;
|
|
239
|
+
readonly maxFragmentsPerRecord: Schema.Finite;
|
|
240
|
+
readonly maxOpaqueBytes: Schema.ByteSize;
|
|
241
|
+
readonly maxStringBytes: Schema.ByteSize;
|
|
242
|
+
readonly maxArrayElements: Schema.Finite;
|
|
243
|
+
readonly maxAuthBytes: Schema.ByteSize;
|
|
244
|
+
readonly maxMachineNameBytes: Schema.ByteSize;
|
|
245
|
+
readonly maxSupplementaryGroups: Schema.Finite;
|
|
246
|
+
readonly maxCompoundBytes: Schema.ByteSize;
|
|
247
|
+
readonly maxOperations: Schema.Finite;
|
|
248
|
+
readonly maxBitmapWords: Schema.Finite;
|
|
249
|
+
readonly maxClients: Schema.Finite;
|
|
250
|
+
readonly maxIdentities: Schema.Finite;
|
|
251
|
+
readonly maxPendingClientReplacements: Schema.Finite;
|
|
252
|
+
readonly maxSessions: Schema.Finite;
|
|
253
|
+
readonly maxSlotsPerSession: Schema.Finite;
|
|
254
|
+
readonly maxReplayBytes: Schema.ByteSize;
|
|
255
|
+
readonly maxOpens: Schema.Finite;
|
|
256
|
+
readonly maxLockOwners: Schema.Finite;
|
|
257
|
+
readonly maxLocks: Schema.Finite;
|
|
258
|
+
readonly maxOwnerBytes: Schema.ByteSize;
|
|
259
|
+
readonly maxReadBytes: Schema.ByteSize;
|
|
260
|
+
readonly maxWriteBytes: Schema.ByteSize;
|
|
261
|
+
readonly maxReaddirEntries: Schema.Finite;
|
|
262
|
+
readonly maxReaddirReplyBytes: Schema.ByteSize;
|
|
263
|
+
readonly maxNameBytes: Schema.ByteSize;
|
|
264
|
+
readonly maxFilehandles: Schema.Finite;
|
|
265
|
+
}> & {
|
|
266
|
+
constrained: {
|
|
267
|
+
readonly maxConnections: number;
|
|
268
|
+
readonly maxFragmentBytes: ByteSize.ByteSize;
|
|
269
|
+
readonly maxRecordBytes: ByteSize.ByteSize;
|
|
270
|
+
readonly maxFragmentsPerRecord: number;
|
|
271
|
+
readonly maxOpaqueBytes: ByteSize.ByteSize;
|
|
272
|
+
readonly maxStringBytes: ByteSize.ByteSize;
|
|
273
|
+
readonly maxArrayElements: number;
|
|
274
|
+
readonly maxAuthBytes: ByteSize.ByteSize;
|
|
275
|
+
readonly maxMachineNameBytes: ByteSize.ByteSize;
|
|
276
|
+
readonly maxSupplementaryGroups: number;
|
|
277
|
+
readonly maxCompoundBytes: ByteSize.ByteSize;
|
|
278
|
+
readonly maxOperations: number;
|
|
279
|
+
readonly maxBitmapWords: number;
|
|
280
|
+
readonly maxClients: number;
|
|
281
|
+
readonly maxIdentities: number;
|
|
282
|
+
readonly maxPendingClientReplacements: number;
|
|
283
|
+
readonly maxSessions: number;
|
|
284
|
+
readonly maxSlotsPerSession: number;
|
|
285
|
+
readonly maxReplayBytes: ByteSize.ByteSize;
|
|
286
|
+
readonly maxOpens: number;
|
|
287
|
+
readonly maxLockOwners: number;
|
|
288
|
+
readonly maxLocks: number;
|
|
289
|
+
readonly maxOwnerBytes: ByteSize.ByteSize;
|
|
290
|
+
readonly maxReadBytes: ByteSize.ByteSize;
|
|
291
|
+
readonly maxWriteBytes: ByteSize.ByteSize;
|
|
292
|
+
readonly maxReaddirEntries: number;
|
|
293
|
+
readonly maxReaddirReplyBytes: ByteSize.ByteSize;
|
|
294
|
+
readonly maxNameBytes: ByteSize.ByteSize;
|
|
295
|
+
readonly maxFilehandles: number;
|
|
296
|
+
};
|
|
297
|
+
default: {
|
|
298
|
+
readonly maxConnections: number;
|
|
299
|
+
readonly maxFragmentBytes: ByteSize.ByteSize;
|
|
300
|
+
readonly maxRecordBytes: ByteSize.ByteSize;
|
|
301
|
+
readonly maxFragmentsPerRecord: number;
|
|
302
|
+
readonly maxOpaqueBytes: ByteSize.ByteSize;
|
|
303
|
+
readonly maxStringBytes: ByteSize.ByteSize;
|
|
304
|
+
readonly maxArrayElements: number;
|
|
305
|
+
readonly maxAuthBytes: ByteSize.ByteSize;
|
|
306
|
+
readonly maxMachineNameBytes: ByteSize.ByteSize;
|
|
307
|
+
readonly maxSupplementaryGroups: number;
|
|
308
|
+
readonly maxCompoundBytes: ByteSize.ByteSize;
|
|
309
|
+
readonly maxOperations: number;
|
|
310
|
+
readonly maxBitmapWords: number;
|
|
311
|
+
readonly maxClients: number;
|
|
312
|
+
readonly maxIdentities: number;
|
|
313
|
+
readonly maxPendingClientReplacements: number;
|
|
314
|
+
readonly maxSessions: number;
|
|
315
|
+
readonly maxSlotsPerSession: number;
|
|
316
|
+
readonly maxReplayBytes: ByteSize.ByteSize;
|
|
317
|
+
readonly maxOpens: number;
|
|
318
|
+
readonly maxLockOwners: number;
|
|
319
|
+
readonly maxLocks: number;
|
|
320
|
+
readonly maxOwnerBytes: ByteSize.ByteSize;
|
|
321
|
+
readonly maxReadBytes: ByteSize.ByteSize;
|
|
322
|
+
readonly maxWriteBytes: ByteSize.ByteSize;
|
|
323
|
+
readonly maxReaddirEntries: number;
|
|
324
|
+
readonly maxReaddirReplyBytes: ByteSize.ByteSize;
|
|
325
|
+
readonly maxNameBytes: ByteSize.ByteSize;
|
|
326
|
+
readonly maxFilehandles: number;
|
|
327
|
+
};
|
|
328
|
+
};
|
|
329
|
+
}>;
|
|
330
|
+
/**
|
|
331
|
+
* Complete server configuration.
|
|
332
|
+
*
|
|
333
|
+
* @category models
|
|
334
|
+
* @since 0.1.0
|
|
335
|
+
*/
|
|
336
|
+
export type NfsServerConfig = typeof NfsServerConfigSchema.Type;
|
|
337
|
+
/**
|
|
338
|
+
* Complete server configuration schema with a frozen default policy.
|
|
339
|
+
*
|
|
340
|
+
* @category schemas
|
|
341
|
+
* @since 0.1.0
|
|
342
|
+
*/
|
|
343
|
+
export declare const NfsServerConfig: Schema.Struct<{
|
|
344
|
+
readonly leaseDurationSeconds: Schema.Finite;
|
|
345
|
+
/** How long a backchannel callback waits for the client before the path is treated as down. */
|
|
346
|
+
readonly callbackTimeoutSeconds: Schema.Finite;
|
|
347
|
+
readonly limits: Schema.Struct<{
|
|
348
|
+
readonly maxConnections: Schema.Finite;
|
|
349
|
+
readonly maxFragmentBytes: Schema.ByteSize;
|
|
350
|
+
readonly maxRecordBytes: Schema.ByteSize;
|
|
351
|
+
readonly maxFragmentsPerRecord: Schema.Finite;
|
|
352
|
+
readonly maxOpaqueBytes: Schema.ByteSize;
|
|
353
|
+
readonly maxStringBytes: Schema.ByteSize;
|
|
354
|
+
readonly maxArrayElements: Schema.Finite;
|
|
355
|
+
readonly maxAuthBytes: Schema.ByteSize;
|
|
356
|
+
readonly maxMachineNameBytes: Schema.ByteSize;
|
|
357
|
+
readonly maxSupplementaryGroups: Schema.Finite;
|
|
358
|
+
readonly maxCompoundBytes: Schema.ByteSize;
|
|
359
|
+
readonly maxOperations: Schema.Finite;
|
|
360
|
+
readonly maxBitmapWords: Schema.Finite;
|
|
361
|
+
readonly maxClients: Schema.Finite;
|
|
362
|
+
readonly maxIdentities: Schema.Finite;
|
|
363
|
+
readonly maxPendingClientReplacements: Schema.Finite;
|
|
364
|
+
readonly maxSessions: Schema.Finite;
|
|
365
|
+
readonly maxSlotsPerSession: Schema.Finite;
|
|
366
|
+
readonly maxReplayBytes: Schema.ByteSize;
|
|
367
|
+
readonly maxOpens: Schema.Finite;
|
|
368
|
+
readonly maxLockOwners: Schema.Finite;
|
|
369
|
+
readonly maxLocks: Schema.Finite;
|
|
370
|
+
readonly maxOwnerBytes: Schema.ByteSize;
|
|
371
|
+
readonly maxReadBytes: Schema.ByteSize;
|
|
372
|
+
readonly maxWriteBytes: Schema.ByteSize;
|
|
373
|
+
readonly maxReaddirEntries: Schema.Finite;
|
|
374
|
+
readonly maxReaddirReplyBytes: Schema.ByteSize;
|
|
375
|
+
readonly maxNameBytes: Schema.ByteSize;
|
|
376
|
+
readonly maxFilehandles: Schema.Finite;
|
|
377
|
+
}> & {
|
|
378
|
+
constrained: {
|
|
379
|
+
readonly maxConnections: number;
|
|
380
|
+
readonly maxFragmentBytes: ByteSize.ByteSize;
|
|
381
|
+
readonly maxRecordBytes: ByteSize.ByteSize;
|
|
382
|
+
readonly maxFragmentsPerRecord: number;
|
|
383
|
+
readonly maxOpaqueBytes: ByteSize.ByteSize;
|
|
384
|
+
readonly maxStringBytes: ByteSize.ByteSize;
|
|
385
|
+
readonly maxArrayElements: number;
|
|
386
|
+
readonly maxAuthBytes: ByteSize.ByteSize;
|
|
387
|
+
readonly maxMachineNameBytes: ByteSize.ByteSize;
|
|
388
|
+
readonly maxSupplementaryGroups: number;
|
|
389
|
+
readonly maxCompoundBytes: ByteSize.ByteSize;
|
|
390
|
+
readonly maxOperations: number;
|
|
391
|
+
readonly maxBitmapWords: number;
|
|
392
|
+
readonly maxClients: number;
|
|
393
|
+
readonly maxIdentities: number;
|
|
394
|
+
readonly maxPendingClientReplacements: number;
|
|
395
|
+
readonly maxSessions: number;
|
|
396
|
+
readonly maxSlotsPerSession: number;
|
|
397
|
+
readonly maxReplayBytes: ByteSize.ByteSize;
|
|
398
|
+
readonly maxOpens: number;
|
|
399
|
+
readonly maxLockOwners: number;
|
|
400
|
+
readonly maxLocks: number;
|
|
401
|
+
readonly maxOwnerBytes: ByteSize.ByteSize;
|
|
402
|
+
readonly maxReadBytes: ByteSize.ByteSize;
|
|
403
|
+
readonly maxWriteBytes: ByteSize.ByteSize;
|
|
404
|
+
readonly maxReaddirEntries: number;
|
|
405
|
+
readonly maxReaddirReplyBytes: ByteSize.ByteSize;
|
|
406
|
+
readonly maxNameBytes: ByteSize.ByteSize;
|
|
407
|
+
readonly maxFilehandles: number;
|
|
408
|
+
};
|
|
409
|
+
default: {
|
|
410
|
+
readonly maxConnections: number;
|
|
411
|
+
readonly maxFragmentBytes: ByteSize.ByteSize;
|
|
412
|
+
readonly maxRecordBytes: ByteSize.ByteSize;
|
|
413
|
+
readonly maxFragmentsPerRecord: number;
|
|
414
|
+
readonly maxOpaqueBytes: ByteSize.ByteSize;
|
|
415
|
+
readonly maxStringBytes: ByteSize.ByteSize;
|
|
416
|
+
readonly maxArrayElements: number;
|
|
417
|
+
readonly maxAuthBytes: ByteSize.ByteSize;
|
|
418
|
+
readonly maxMachineNameBytes: ByteSize.ByteSize;
|
|
419
|
+
readonly maxSupplementaryGroups: number;
|
|
420
|
+
readonly maxCompoundBytes: ByteSize.ByteSize;
|
|
421
|
+
readonly maxOperations: number;
|
|
422
|
+
readonly maxBitmapWords: number;
|
|
423
|
+
readonly maxClients: number;
|
|
424
|
+
readonly maxIdentities: number;
|
|
425
|
+
readonly maxPendingClientReplacements: number;
|
|
426
|
+
readonly maxSessions: number;
|
|
427
|
+
readonly maxSlotsPerSession: number;
|
|
428
|
+
readonly maxReplayBytes: ByteSize.ByteSize;
|
|
429
|
+
readonly maxOpens: number;
|
|
430
|
+
readonly maxLockOwners: number;
|
|
431
|
+
readonly maxLocks: number;
|
|
432
|
+
readonly maxOwnerBytes: ByteSize.ByteSize;
|
|
433
|
+
readonly maxReadBytes: ByteSize.ByteSize;
|
|
434
|
+
readonly maxWriteBytes: ByteSize.ByteSize;
|
|
435
|
+
readonly maxReaddirEntries: number;
|
|
436
|
+
readonly maxReaddirReplyBytes: ByteSize.ByteSize;
|
|
437
|
+
readonly maxNameBytes: ByteSize.ByteSize;
|
|
438
|
+
readonly maxFilehandles: number;
|
|
439
|
+
};
|
|
440
|
+
};
|
|
441
|
+
}> & {
|
|
442
|
+
default: {
|
|
443
|
+
readonly leaseDurationSeconds: number;
|
|
444
|
+
readonly callbackTimeoutSeconds: number;
|
|
445
|
+
readonly limits: {
|
|
446
|
+
readonly maxConnections: number;
|
|
447
|
+
readonly maxFragmentBytes: ByteSize.ByteSize;
|
|
448
|
+
readonly maxRecordBytes: ByteSize.ByteSize;
|
|
449
|
+
readonly maxFragmentsPerRecord: number;
|
|
450
|
+
readonly maxOpaqueBytes: ByteSize.ByteSize;
|
|
451
|
+
readonly maxStringBytes: ByteSize.ByteSize;
|
|
452
|
+
readonly maxArrayElements: number;
|
|
453
|
+
readonly maxAuthBytes: ByteSize.ByteSize;
|
|
454
|
+
readonly maxMachineNameBytes: ByteSize.ByteSize;
|
|
455
|
+
readonly maxSupplementaryGroups: number;
|
|
456
|
+
readonly maxCompoundBytes: ByteSize.ByteSize;
|
|
457
|
+
readonly maxOperations: number;
|
|
458
|
+
readonly maxBitmapWords: number;
|
|
459
|
+
readonly maxClients: number;
|
|
460
|
+
readonly maxIdentities: number;
|
|
461
|
+
readonly maxPendingClientReplacements: number;
|
|
462
|
+
readonly maxSessions: number;
|
|
463
|
+
readonly maxSlotsPerSession: number;
|
|
464
|
+
readonly maxReplayBytes: ByteSize.ByteSize;
|
|
465
|
+
readonly maxOpens: number;
|
|
466
|
+
readonly maxLockOwners: number;
|
|
467
|
+
readonly maxLocks: number;
|
|
468
|
+
readonly maxOwnerBytes: ByteSize.ByteSize;
|
|
469
|
+
readonly maxReadBytes: ByteSize.ByteSize;
|
|
470
|
+
readonly maxWriteBytes: ByteSize.ByteSize;
|
|
471
|
+
readonly maxReaddirEntries: number;
|
|
472
|
+
readonly maxReaddirReplyBytes: ByteSize.ByteSize;
|
|
473
|
+
readonly maxNameBytes: ByteSize.ByteSize;
|
|
474
|
+
readonly maxFilehandles: number;
|
|
475
|
+
};
|
|
476
|
+
};
|
|
477
|
+
};
|
|
478
|
+
/**
|
|
479
|
+
* Optional configuration accepted when constructing an NFS server.
|
|
480
|
+
*
|
|
481
|
+
* @category schemas
|
|
482
|
+
* @since 0.1.0
|
|
483
|
+
*/
|
|
484
|
+
export declare const NfsServerConfigOverrides: Schema.Struct<{
|
|
485
|
+
readonly leaseDurationSeconds: Schema.optionalKey<Schema.Finite>;
|
|
486
|
+
readonly callbackTimeoutSeconds: Schema.optionalKey<Schema.Finite>;
|
|
487
|
+
readonly limits: Schema.optionalKey<Schema.Struct<{
|
|
488
|
+
readonly maxConnections: Schema.optionalKey<Schema.Finite>;
|
|
489
|
+
readonly maxFragmentBytes: Schema.optionalKey<Schema.ByteSize>;
|
|
490
|
+
readonly maxRecordBytes: Schema.optionalKey<Schema.ByteSize>;
|
|
491
|
+
readonly maxFragmentsPerRecord: Schema.optionalKey<Schema.Finite>;
|
|
492
|
+
readonly maxOpaqueBytes: Schema.optionalKey<Schema.ByteSize>;
|
|
493
|
+
readonly maxStringBytes: Schema.optionalKey<Schema.ByteSize>;
|
|
494
|
+
readonly maxArrayElements: Schema.optionalKey<Schema.Finite>;
|
|
495
|
+
readonly maxAuthBytes: Schema.optionalKey<Schema.ByteSize>;
|
|
496
|
+
readonly maxMachineNameBytes: Schema.optionalKey<Schema.ByteSize>;
|
|
497
|
+
readonly maxSupplementaryGroups: Schema.optionalKey<Schema.Finite>;
|
|
498
|
+
readonly maxCompoundBytes: Schema.optionalKey<Schema.ByteSize>;
|
|
499
|
+
readonly maxOperations: Schema.optionalKey<Schema.Finite>;
|
|
500
|
+
readonly maxBitmapWords: Schema.optionalKey<Schema.Finite>;
|
|
501
|
+
readonly maxClients: Schema.optionalKey<Schema.Finite>;
|
|
502
|
+
readonly maxIdentities: Schema.optionalKey<Schema.Finite>;
|
|
503
|
+
readonly maxPendingClientReplacements: Schema.optionalKey<Schema.Finite>;
|
|
504
|
+
readonly maxSessions: Schema.optionalKey<Schema.Finite>;
|
|
505
|
+
readonly maxSlotsPerSession: Schema.optionalKey<Schema.Finite>;
|
|
506
|
+
readonly maxReplayBytes: Schema.optionalKey<Schema.ByteSize>;
|
|
507
|
+
readonly maxOpens: Schema.optionalKey<Schema.Finite>;
|
|
508
|
+
readonly maxLockOwners: Schema.optionalKey<Schema.Finite>;
|
|
509
|
+
readonly maxLocks: Schema.optionalKey<Schema.Finite>;
|
|
510
|
+
readonly maxOwnerBytes: Schema.optionalKey<Schema.ByteSize>;
|
|
511
|
+
readonly maxReadBytes: Schema.optionalKey<Schema.ByteSize>;
|
|
512
|
+
readonly maxWriteBytes: Schema.optionalKey<Schema.ByteSize>;
|
|
513
|
+
readonly maxReaddirEntries: Schema.optionalKey<Schema.Finite>;
|
|
514
|
+
readonly maxReaddirReplyBytes: Schema.optionalKey<Schema.ByteSize>;
|
|
515
|
+
readonly maxNameBytes: Schema.optionalKey<Schema.ByteSize>;
|
|
516
|
+
readonly maxFilehandles: Schema.optionalKey<Schema.Finite>;
|
|
517
|
+
}>>;
|
|
518
|
+
}>;
|
|
519
|
+
/**
|
|
520
|
+
* Optional configuration accepted when constructing an NFS server.
|
|
521
|
+
*
|
|
522
|
+
* @category models
|
|
523
|
+
* @since 0.1.0
|
|
524
|
+
*/
|
|
525
|
+
export type NfsServerConfigOverrides = typeof NfsServerConfigOverrides.Type;
|
|
526
|
+
/**
|
|
527
|
+
* Schema for a bound loopback TCP address.
|
|
528
|
+
*
|
|
529
|
+
* @category schemas
|
|
530
|
+
* @since 0.1.0
|
|
531
|
+
*/
|
|
532
|
+
export declare const NfsServerTcpAddress: Schema.Struct<{
|
|
533
|
+
readonly host: Schema.Literals<readonly ["127.0.0.1", "::1"]>;
|
|
534
|
+
readonly port: Schema.Finite;
|
|
535
|
+
}>;
|
|
536
|
+
/**
|
|
537
|
+
* A bound loopback TCP address.
|
|
538
|
+
*
|
|
539
|
+
* @category models
|
|
540
|
+
* @since 0.1.0
|
|
541
|
+
*/
|
|
542
|
+
export type NfsServerTcpAddress = typeof NfsServerTcpAddress.Type;
|
|
543
|
+
/**
|
|
544
|
+
* Schema for a TCP address that may be reachable beyond the local host.
|
|
545
|
+
*
|
|
546
|
+
* @category schemas
|
|
547
|
+
* @since 0.1.0
|
|
548
|
+
*/
|
|
549
|
+
export declare const NfsServerNetworkTcpAddress: Schema.Struct<{
|
|
550
|
+
readonly host: Schema.NonEmptyString;
|
|
551
|
+
readonly port: Schema.Finite;
|
|
552
|
+
}>;
|
|
553
|
+
/**
|
|
554
|
+
* A TCP address that may be reachable beyond the local host.
|
|
555
|
+
*
|
|
556
|
+
* @category models
|
|
557
|
+
* @since 0.1.0
|
|
558
|
+
*/
|
|
559
|
+
export type NfsServerNetworkTcpAddress = typeof NfsServerNetworkTcpAddress.Type;
|
|
560
|
+
/**
|
|
561
|
+
* Schema for a bound UNIX-domain socket path. A filesystem socket is reachable only from the
|
|
562
|
+
* same host, so it counts as a local address alongside loopback TCP.
|
|
563
|
+
*
|
|
564
|
+
* @category schemas
|
|
565
|
+
* @since 0.1.0
|
|
566
|
+
*/
|
|
567
|
+
export declare const NfsServerUnixAddress: Schema.Struct<{
|
|
568
|
+
readonly path: Schema.NonEmptyString;
|
|
569
|
+
}>;
|
|
570
|
+
/**
|
|
571
|
+
* A bound UNIX-domain socket path.
|
|
572
|
+
*
|
|
573
|
+
* @category models
|
|
574
|
+
* @since 0.1.0
|
|
575
|
+
*/
|
|
576
|
+
export type NfsServerUnixAddress = typeof NfsServerUnixAddress.Type;
|
|
577
|
+
/**
|
|
578
|
+
* Schema for the bound server address: TCP or a UNIX-domain socket path.
|
|
579
|
+
*
|
|
580
|
+
* @category schemas
|
|
581
|
+
* @since 0.1.0
|
|
582
|
+
*/
|
|
583
|
+
export declare const NfsServerAddress: Schema.Union<readonly [Schema.Struct<{
|
|
584
|
+
readonly host: Schema.NonEmptyString;
|
|
585
|
+
readonly port: Schema.Finite;
|
|
586
|
+
}>, Schema.Struct<{
|
|
587
|
+
readonly path: Schema.NonEmptyString;
|
|
588
|
+
}>]>;
|
|
589
|
+
/**
|
|
590
|
+
* The bound server address.
|
|
591
|
+
*
|
|
592
|
+
* @category models
|
|
593
|
+
* @since 0.1.0
|
|
594
|
+
*/
|
|
595
|
+
export type NfsServerAddress = typeof NfsServerAddress.Type;
|
|
596
|
+
/**
|
|
597
|
+
* Validated configuration paired with the live volume and caller capabilities.
|
|
598
|
+
*
|
|
599
|
+
* @category models
|
|
600
|
+
* @since 0.1.0
|
|
601
|
+
*/
|
|
602
|
+
export type NfsServerLocalOptions = NfsServerConfigOverrides & {
|
|
603
|
+
readonly volume: Vfs.Volume;
|
|
604
|
+
readonly caller: Vfs.Caller;
|
|
605
|
+
readonly policy?: never;
|
|
606
|
+
readonly peer?: never;
|
|
607
|
+
readonly allowNonLoopback?: never;
|
|
608
|
+
readonly acceptedFlavors?: never;
|
|
609
|
+
};
|
|
610
|
+
/** Peer details from the transport; UNIX sockets do not expose a client IP or port. */
|
|
611
|
+
export type NfsPeer = {
|
|
612
|
+
readonly transport: "tcp";
|
|
613
|
+
readonly address: string;
|
|
614
|
+
readonly port: number;
|
|
615
|
+
} | {
|
|
616
|
+
readonly transport: "unix";
|
|
617
|
+
readonly address: null;
|
|
618
|
+
readonly port: null;
|
|
619
|
+
readonly path: string;
|
|
620
|
+
};
|
|
621
|
+
/** RPC identity claims. They grant no authority until the application policy maps them. */
|
|
622
|
+
export type NfsCredential = {
|
|
623
|
+
readonly flavor: "none";
|
|
624
|
+
} | {
|
|
625
|
+
readonly flavor: "sys";
|
|
626
|
+
readonly uid: number;
|
|
627
|
+
readonly gid: number;
|
|
628
|
+
readonly groups: ReadonlyArray<number>;
|
|
629
|
+
readonly machineName: string;
|
|
630
|
+
};
|
|
631
|
+
/** A policy returns an identity for this volume or null to deny the request. */
|
|
632
|
+
export type NfsIdentityPolicy = (request: {
|
|
633
|
+
readonly credential: NfsCredential;
|
|
634
|
+
readonly peer: NfsPeer;
|
|
635
|
+
}) => NonNullable<Vfs.RootCallerOptions["identity"]> | null;
|
|
636
|
+
export type NfsServerNetworkedOptions = NfsServerConfigOverrides & {
|
|
637
|
+
readonly volume: Vfs.Volume;
|
|
638
|
+
readonly policy: NfsIdentityPolicy;
|
|
639
|
+
/** Evaluated in each accepted socket's context; null closes a connection without a trustworthy peer. */
|
|
640
|
+
readonly peer: Effect.Effect<NfsPeer | null>;
|
|
641
|
+
/** Required when the supplied socket server binds outside loopback. */
|
|
642
|
+
readonly allowNonLoopback?: true;
|
|
643
|
+
/** Flavors advertised by SECINFO; defaults to AUTH_SYS only. */
|
|
644
|
+
readonly acceptedFlavors?: ReadonlyArray<"sys" | "none">;
|
|
645
|
+
readonly caller?: never;
|
|
646
|
+
};
|
|
647
|
+
export type NfsServerOptions = NfsServerLocalOptions | NfsServerNetworkedOptions;
|
|
648
|
+
declare const ConfigurationError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
649
|
+
readonly _tag: "ConfigurationError";
|
|
650
|
+
} & Readonly<A>;
|
|
651
|
+
/**
|
|
652
|
+
* Raised when a server option fails validation before the server starts.
|
|
653
|
+
*
|
|
654
|
+
* The `option` field names the rejected configuration key.
|
|
655
|
+
*
|
|
656
|
+
* @category errors
|
|
657
|
+
* @since 0.1.0
|
|
658
|
+
*/
|
|
659
|
+
export declare class ConfigurationError extends ConfigurationError_base<{
|
|
660
|
+
readonly option: string;
|
|
661
|
+
readonly message: string;
|
|
662
|
+
}> {
|
|
663
|
+
}
|
|
664
|
+
declare const NfsServerError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
665
|
+
readonly _tag: "NfsServerError";
|
|
666
|
+
} & Readonly<A>;
|
|
667
|
+
/**
|
|
668
|
+
* Raised when the NFS server cannot start or cannot continue listening.
|
|
669
|
+
*
|
|
670
|
+
* @category errors
|
|
671
|
+
* @since 0.1.0
|
|
672
|
+
*/
|
|
673
|
+
export declare class NfsServerError extends NfsServerError_base<{
|
|
674
|
+
readonly cause: unknown;
|
|
675
|
+
}> {
|
|
676
|
+
get message(): string;
|
|
677
|
+
}
|
|
678
|
+
declare const make: (options: NfsServerOptions) => Effect.Effect<NfsServer["Service"], ConfigurationError | NfsServerError, Scope.Scope | SocketServer.SocketServer | Crypto.Crypto>;
|
|
679
|
+
declare const NfsServer_base: Context.ServiceClass<NfsServer, "@effect-vfs/nfs/NfsServer", {
|
|
680
|
+
readonly address: NfsServerAddress;
|
|
681
|
+
}>;
|
|
682
|
+
/**
|
|
683
|
+
* The running NFS server, exposing the address it bound to.
|
|
684
|
+
*
|
|
685
|
+
* @category services
|
|
686
|
+
* @since 0.1.0
|
|
687
|
+
*/
|
|
688
|
+
export declare class NfsServer extends NfsServer_base {
|
|
689
|
+
static readonly make: typeof make;
|
|
690
|
+
static readonly layer: (options: NfsServerOptions) => Layer.Layer<NfsServer, ConfigurationError | NfsServerError, SocketServer.SocketServer | Crypto.Crypto>;
|
|
691
|
+
}
|
|
692
|
+
export {};
|
|
693
|
+
//# sourceMappingURL=NfsServer.d.ts.map
|