efs-cli 1.1.2__tar.gz → 1.2.1__tar.gz
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.
- {efs_cli-1.1.2/src/efs_cli.egg-info → efs_cli-1.2.1}/PKG-INFO +84 -5
- efs_cli-1.2.1/README.md +160 -0
- {efs_cli-1.1.2 → efs_cli-1.2.1}/pyproject.toml +2 -2
- efs_cli-1.2.1/src/efs_cli/__init__.py +2 -0
- {efs_cli-1.1.2 → efs_cli-1.2.1}/src/efs_cli/cli.py +72 -5
- {efs_cli-1.1.2 → efs_cli-1.2.1/src/efs_cli.egg-info}/PKG-INFO +84 -5
- efs_cli-1.2.1/src/efs_cli.egg-info/requires.txt +2 -0
- efs_cli-1.1.2/README.md +0 -81
- efs_cli-1.1.2/src/efs_cli/__init__.py +0 -2
- efs_cli-1.1.2/src/efs_cli.egg-info/requires.txt +0 -2
- {efs_cli-1.1.2 → efs_cli-1.2.1}/LICENSE +0 -0
- {efs_cli-1.1.2 → efs_cli-1.2.1}/setup.cfg +0 -0
- {efs_cli-1.1.2 → efs_cli-1.2.1}/src/efs_cli.egg-info/SOURCES.txt +0 -0
- {efs_cli-1.1.2 → efs_cli-1.2.1}/src/efs_cli.egg-info/dependency_links.txt +0 -0
- {efs_cli-1.1.2 → efs_cli-1.2.1}/src/efs_cli.egg-info/entry_points.txt +0 -0
- {efs_cli-1.1.2 → efs_cli-1.2.1}/src/efs_cli.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: efs-cli
|
|
3
|
-
Version: 1.1
|
|
3
|
+
Version: 1.2.1
|
|
4
4
|
Summary: EepyFileServer API CLI written in Python
|
|
5
5
|
Author: maxie
|
|
6
6
|
License-Expression: MIT
|
|
@@ -17,7 +17,7 @@ Requires-Python: >=3.10
|
|
|
17
17
|
Description-Content-Type: text/markdown
|
|
18
18
|
License-File: LICENSE
|
|
19
19
|
Requires-Dist: requests>=2.30
|
|
20
|
-
Requires-Dist: efs-wrapper>=1.0
|
|
20
|
+
Requires-Dist: efs-wrapper>=1.1.0
|
|
21
21
|
Dynamic: license-file
|
|
22
22
|
|
|
23
23
|
# efs-cli (formerly eepyfileserver-cli)
|
|
@@ -27,7 +27,7 @@ command line interface for eepyfileserver written in python
|
|
|
27
27
|
## prerequisites
|
|
28
28
|
|
|
29
29
|
- python 3.10 (3.12+ recommended)
|
|
30
|
-
- [`eepyfileserver`](https://codeberg.org/maxeepy/eepyfileserver) 1.1.0-alpha or later
|
|
30
|
+
- [`eepyfileserver`](https://codeberg.org/maxeepy/eepyfileserver) 1.1.0-alpha (or later for some features, such as users)
|
|
31
31
|
|
|
32
32
|
## install
|
|
33
33
|
|
|
@@ -40,7 +40,7 @@ command line interface for eepyfileserver written in python
|
|
|
40
40
|
```bash
|
|
41
41
|
#login fully (lets you upload and download files)
|
|
42
42
|
#password is saved in PLAIN TEXT
|
|
43
|
-
efs-cli auth "https://example.com" "password123"
|
|
43
|
+
efs-cli auth "https://example.com" "password123" --custom-api-path (optional) "/meow/v123"
|
|
44
44
|
|
|
45
45
|
#login only using the url (lets you download PUBLIC files)
|
|
46
46
|
efs-cli auth "https://example.com"
|
|
@@ -48,6 +48,25 @@ efs-cli auth "https://example.com"
|
|
|
48
48
|
efs-cli login ...
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
+
### see and edit your configs
|
|
52
|
+
|
|
53
|
+
cli config
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
efs-cli config
|
|
57
|
+
efs-cli config --reset # resets your entire config
|
|
58
|
+
|
|
59
|
+
efs-cli conf
|
|
60
|
+
efs-cli cli-config
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
efs config
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
efs-cli efs-config
|
|
67
|
+
efs-cli efs-conf
|
|
68
|
+
```
|
|
69
|
+
|
|
51
70
|
### view version
|
|
52
71
|
|
|
53
72
|
```bash
|
|
@@ -70,10 +89,30 @@ efs-cli ls
|
|
|
70
89
|
efs-cli files
|
|
71
90
|
```
|
|
72
91
|
|
|
92
|
+
### view file/directory metadata
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
efs-cli metadata <path> --public (optional) # uses public url
|
|
96
|
+
efs-cli meta ...
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### edit a file
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
efs-cli edit <file_path>
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### get a url for a file
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
efs-cli url-for <file_path> --public (optional) --check-if-exists (optional) # --public uses public url, --check-if-exists checks if the file exists on efs
|
|
109
|
+
efs-cli url ...
|
|
110
|
+
```
|
|
111
|
+
|
|
73
112
|
### download a file
|
|
74
113
|
|
|
75
114
|
```bash
|
|
76
|
-
efs-cli download /example.txt /home/maxeepy/Downloads/example.txt
|
|
115
|
+
efs-cli download /example.txt /home/maxeepy/Downloads/example.txt --public (optional) # uses public url
|
|
77
116
|
efs-cli get ...
|
|
78
117
|
efs-cli d ...
|
|
79
118
|
```
|
|
@@ -87,6 +126,13 @@ efs-cli up ...
|
|
|
87
126
|
efs-cli put ...
|
|
88
127
|
```
|
|
89
128
|
|
|
129
|
+
### overwrite a file
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
efs-cli overwrite /home/maxeepy/Downloads/example.txt /example.txt
|
|
133
|
+
efs-cli over ...
|
|
134
|
+
```
|
|
135
|
+
|
|
90
136
|
### delete a file
|
|
91
137
|
|
|
92
138
|
```bash
|
|
@@ -99,5 +145,38 @@ efs-cli rm ...
|
|
|
99
145
|
|
|
100
146
|
```bash
|
|
101
147
|
efs-cli read /example.txt
|
|
148
|
+
efs-cli read /example.txt --no-less # doesn't use less
|
|
102
149
|
efs-cli cat ...
|
|
103
150
|
```
|
|
151
|
+
|
|
152
|
+
### list users
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
efs-cli users
|
|
156
|
+
efs-cli listusers
|
|
157
|
+
efs-cli lsu
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### add a user
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
efs-cli adduser dir123 "rw" # or "ro"
|
|
164
|
+
efs-cli auser ...
|
|
165
|
+
efs-cli au ...
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### change a user
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
efs-cli changeuser efskey_123 dir123 "rw" # or "ro"
|
|
172
|
+
efs-cli chuser ...
|
|
173
|
+
efs-cli chu ...
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### remove a user
|
|
177
|
+
|
|
178
|
+
```bash
|
|
179
|
+
efs-cli removeuser efskey_123 --remove-dir (optional) # removes the user directory if set
|
|
180
|
+
efs-cli rmuser ...
|
|
181
|
+
efs-cli ru ...
|
|
182
|
+
```
|
efs_cli-1.2.1/README.md
ADDED
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
# efs-cli (formerly eepyfileserver-cli)
|
|
2
|
+
|
|
3
|
+
command line interface for eepyfileserver written in python
|
|
4
|
+
|
|
5
|
+
## prerequisites
|
|
6
|
+
|
|
7
|
+
- python 3.10 (3.12+ recommended)
|
|
8
|
+
- [`eepyfileserver`](https://codeberg.org/maxeepy/eepyfileserver) 1.1.0-alpha (or later for some features, such as users)
|
|
9
|
+
|
|
10
|
+
## install
|
|
11
|
+
|
|
12
|
+
`pip install efs-cli`
|
|
13
|
+
|
|
14
|
+
## usage
|
|
15
|
+
|
|
16
|
+
### log in to an instance
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
#login fully (lets you upload and download files)
|
|
20
|
+
#password is saved in PLAIN TEXT
|
|
21
|
+
efs-cli auth "https://example.com" "password123" --custom-api-path (optional) "/meow/v123"
|
|
22
|
+
|
|
23
|
+
#login only using the url (lets you download PUBLIC files)
|
|
24
|
+
efs-cli auth "https://example.com"
|
|
25
|
+
|
|
26
|
+
efs-cli login ...
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### see and edit your configs
|
|
30
|
+
|
|
31
|
+
cli config
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
efs-cli config
|
|
35
|
+
efs-cli config --reset # resets your entire config
|
|
36
|
+
|
|
37
|
+
efs-cli conf
|
|
38
|
+
efs-cli cli-config
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
efs config
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
efs-cli efs-config
|
|
45
|
+
efs-cli efs-conf
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### view version
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
efs-cli version
|
|
52
|
+
efs-cli ver
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### view instance information
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
efs-cli instance
|
|
59
|
+
efs-cli info
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### list files
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
efs-cli list
|
|
66
|
+
efs-cli ls
|
|
67
|
+
efs-cli files
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### view file/directory metadata
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
efs-cli metadata <path> --public (optional) # uses public url
|
|
74
|
+
efs-cli meta ...
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### edit a file
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
efs-cli edit <file_path>
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### get a url for a file
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
efs-cli url-for <file_path> --public (optional) --check-if-exists (optional) # --public uses public url, --check-if-exists checks if the file exists on efs
|
|
87
|
+
efs-cli url ...
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### download a file
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
efs-cli download /example.txt /home/maxeepy/Downloads/example.txt --public (optional) # uses public url
|
|
94
|
+
efs-cli get ...
|
|
95
|
+
efs-cli d ...
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### upload a file
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
efs-cli upload /home/maxeepy/Downloads/example.txt /example.txt
|
|
102
|
+
efs-cli post ...
|
|
103
|
+
efs-cli up ...
|
|
104
|
+
efs-cli put ...
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### overwrite a file
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
efs-cli overwrite /home/maxeepy/Downloads/example.txt /example.txt
|
|
111
|
+
efs-cli over ...
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### delete a file
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
efs-cli delete /example.txt
|
|
118
|
+
efs-cli remove ...
|
|
119
|
+
efs-cli rm ...
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### read a file
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
efs-cli read /example.txt
|
|
126
|
+
efs-cli read /example.txt --no-less # doesn't use less
|
|
127
|
+
efs-cli cat ...
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### list users
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
efs-cli users
|
|
134
|
+
efs-cli listusers
|
|
135
|
+
efs-cli lsu
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### add a user
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
efs-cli adduser dir123 "rw" # or "ro"
|
|
142
|
+
efs-cli auser ...
|
|
143
|
+
efs-cli au ...
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### change a user
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
efs-cli changeuser efskey_123 dir123 "rw" # or "ro"
|
|
150
|
+
efs-cli chuser ...
|
|
151
|
+
efs-cli chu ...
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### remove a user
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
efs-cli removeuser efskey_123 --remove-dir (optional) # removes the user directory if set
|
|
158
|
+
efs-cli rmuser ...
|
|
159
|
+
efs-cli ru ...
|
|
160
|
+
```
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
[build-system]
|
|
2
|
-
requires = ["setuptools >= 77.0.3", "requests >= 2.30", "efs-wrapper >= 1.0
|
|
2
|
+
requires = ["setuptools >= 77.0.3", "requests >= 2.30", "efs-wrapper >= 1.1.0"]
|
|
3
3
|
build-backend = "setuptools.build_meta"
|
|
4
4
|
|
|
5
5
|
[project]
|
|
@@ -12,7 +12,7 @@ readme = "README.md"
|
|
|
12
12
|
requires-python = ">=3.10"
|
|
13
13
|
dependencies = [
|
|
14
14
|
"requests >= 2.30",
|
|
15
|
-
"efs-wrapper >= 1.0
|
|
15
|
+
"efs-wrapper >= 1.1.0"
|
|
16
16
|
]
|
|
17
17
|
classifiers = [
|
|
18
18
|
"Programming Language :: Python :: 3",
|
|
@@ -16,6 +16,9 @@ def exception_handler(func):
|
|
|
16
16
|
def wrapper(*args, **kwargs):
|
|
17
17
|
try:
|
|
18
18
|
func(*args, **kwargs)
|
|
19
|
+
except KeyError:
|
|
20
|
+
print("Error: no such file or directory")
|
|
21
|
+
sys.exit(1)
|
|
19
22
|
except Exception as exc:
|
|
20
23
|
if len(exc.args) == 2:
|
|
21
24
|
if isinstance(exc.args[1], int):
|
|
@@ -32,8 +35,17 @@ def get_conf():
|
|
|
32
35
|
with open(CONFIG_PATH, "r") as file:
|
|
33
36
|
conf = json.load(file)
|
|
34
37
|
|
|
38
|
+
if conf:
|
|
39
|
+
editor = conf.get("editor", "nano")
|
|
40
|
+
if "sudo" in editor or "rm" in editor or "rm -rf" in editor:
|
|
41
|
+
print("there cannot be 'sudo', 'rm' or 'rm -rf' in the editor command")
|
|
42
|
+
sys.exit(1)
|
|
43
|
+
|
|
35
44
|
return conf
|
|
36
45
|
|
|
46
|
+
def format_tree(root, files, dirs,):
|
|
47
|
+
...
|
|
48
|
+
|
|
37
49
|
def init_api():
|
|
38
50
|
conf = get_conf()
|
|
39
51
|
|
|
@@ -70,7 +82,7 @@ def efs_config(verbose, **__):
|
|
|
70
82
|
api = init_api()
|
|
71
83
|
editor = conf.get("editor", "nano")
|
|
72
84
|
if not hasattr(api, "get_config"):
|
|
73
|
-
print("Login using 'efs-cli auth <base url> <
|
|
85
|
+
print("Login using 'efs-cli auth <base url> <root_password>' to get and change the config")
|
|
74
86
|
sys.exit(1)
|
|
75
87
|
data = api.get_config()
|
|
76
88
|
with NamedTemporaryFile(suffix = ".json", mode="w+") as tmp:
|
|
@@ -229,15 +241,51 @@ def metadata(path, public, **__):
|
|
|
229
241
|
api = api.public
|
|
230
242
|
if path.startswith("/public"):
|
|
231
243
|
path = path.removeprefix("/public")
|
|
232
|
-
if api.is_file(path):
|
|
244
|
+
if api.is_file(path, check_if_exists = True):
|
|
233
245
|
print(api.get_file(path).metadata.to_dict())
|
|
234
|
-
|
|
235
|
-
if api.is_directory(path):
|
|
246
|
+
sys.exit(0)
|
|
247
|
+
if api.is_directory(path, check_if_exists = True):
|
|
236
248
|
print(api.get_tree(path))
|
|
237
|
-
|
|
249
|
+
sys.exit(0)
|
|
238
250
|
print(f"{path} does not exist or is not a file or a directory")
|
|
239
251
|
sys.exit(1)
|
|
240
252
|
|
|
253
|
+
def list_users(**__):
|
|
254
|
+
api = init_api()
|
|
255
|
+
if not hasattr(api, "get_users"):
|
|
256
|
+
print("Login using efs-cli auth <base url> <password> to list users")
|
|
257
|
+
sys.exit(1)
|
|
258
|
+
for password, values in api.get_users().items():
|
|
259
|
+
dir, perms = values["directory"], values["permissions"]
|
|
260
|
+
print(f"[{dir}] {password}:")
|
|
261
|
+
print(f" Directory: {dir}")
|
|
262
|
+
print(f" Permissions: {perms}")
|
|
263
|
+
|
|
264
|
+
def add_user(directory, permissions, **__):
|
|
265
|
+
api = init_api()
|
|
266
|
+
if not hasattr(api, "add_user"):
|
|
267
|
+
print("Login using efs-cli auth <base url> <root_password> to add users")
|
|
268
|
+
sys.exit(1)
|
|
269
|
+
out = api.add_user(directory, permissions)
|
|
270
|
+
print(f"Added user with directory of '{directory}' and permissions '{permissions}'")
|
|
271
|
+
print(f"User password: {out['password']}")
|
|
272
|
+
|
|
273
|
+
def change_user(password, directory, permissions, **__):
|
|
274
|
+
api = init_api()
|
|
275
|
+
if not hasattr(api, "change_user"):
|
|
276
|
+
print("Login using efs-cli auth <base url> <root_password> to change users")
|
|
277
|
+
sys.exit(1)
|
|
278
|
+
api.change_user(password, directory, permissions)
|
|
279
|
+
print("Changed user directory or/and permissions")
|
|
280
|
+
|
|
281
|
+
def remove_user(password, remove_dir, **__):
|
|
282
|
+
api = init_api()
|
|
283
|
+
if not hasattr(api, "remove_user"):
|
|
284
|
+
print("Login using efs-cli auth <base url> <root_password> to remove users")
|
|
285
|
+
sys.exit(1)
|
|
286
|
+
api.remove_user(password, remove_dir)
|
|
287
|
+
print("User deleted")
|
|
288
|
+
|
|
241
289
|
def main():
|
|
242
290
|
parser = ArgumentParser("efs-cli", description="eepyfileserver cli tool for downloading and uploading files")
|
|
243
291
|
subparser = parser.add_subparsers()
|
|
@@ -306,6 +354,25 @@ def main():
|
|
|
306
354
|
edit_parser.add_argument("file_path", help="the efs file path to edit")
|
|
307
355
|
edit_parser.set_defaults(func=edit)
|
|
308
356
|
|
|
357
|
+
list_users_parser = subparser.add_parser("users", help="view current users on your eepyfileserver instance", aliases=["listusers", "lsu"])
|
|
358
|
+
list_users_parser.set_defaults(func=list_users)
|
|
359
|
+
|
|
360
|
+
add_user_parser = subparser.add_parser("adduser", help="add a user to your eepyfileserver instance", aliases=["auser", "au"])
|
|
361
|
+
add_user_parser.add_argument("directory", help="the name of their directory on eepyfileserver")
|
|
362
|
+
add_user_parser.add_argument("permissions", help="permissions they will have on their directory" , choices=["rw", "ro"])
|
|
363
|
+
add_user_parser.set_defaults(func=add_user)
|
|
364
|
+
|
|
365
|
+
change_user_parser = subparser.add_parser("changeuser", help="change a user directory or permissions on your eepyfileserver instance", aliases=["chuser", "chu"])
|
|
366
|
+
change_user_parser.add_argument("password", help="a password of a user on eepyfileserver")
|
|
367
|
+
change_user_parser.add_argument("directory", help="the name of their directory on eepyfileserver")
|
|
368
|
+
change_user_parser.add_argument("permissions", help="permissions they will have on their directory" , choices=["rw", "ro"])
|
|
369
|
+
change_user_parser.set_defaults(func=change_user)
|
|
370
|
+
|
|
371
|
+
remove_user_parser = subparser.add_parser("removeuser", help="remove a user from your eepyfileserver instance", aliases=["ru", "rmuser"])
|
|
372
|
+
remove_user_parser.add_argument("password", help="a password of a user on eepyfileserver")
|
|
373
|
+
remove_user_parser.add_argument("-r", "--remove-dir", action="store_true", help="deletes the user directory entirely if set")
|
|
374
|
+
remove_user_parser.set_defaults(func=remove_user)
|
|
375
|
+
|
|
309
376
|
args = parser.parse_args()
|
|
310
377
|
if args == Namespace():
|
|
311
378
|
args = parser.parse_args(["-h"])
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: efs-cli
|
|
3
|
-
Version: 1.1
|
|
3
|
+
Version: 1.2.1
|
|
4
4
|
Summary: EepyFileServer API CLI written in Python
|
|
5
5
|
Author: maxie
|
|
6
6
|
License-Expression: MIT
|
|
@@ -17,7 +17,7 @@ Requires-Python: >=3.10
|
|
|
17
17
|
Description-Content-Type: text/markdown
|
|
18
18
|
License-File: LICENSE
|
|
19
19
|
Requires-Dist: requests>=2.30
|
|
20
|
-
Requires-Dist: efs-wrapper>=1.0
|
|
20
|
+
Requires-Dist: efs-wrapper>=1.1.0
|
|
21
21
|
Dynamic: license-file
|
|
22
22
|
|
|
23
23
|
# efs-cli (formerly eepyfileserver-cli)
|
|
@@ -27,7 +27,7 @@ command line interface for eepyfileserver written in python
|
|
|
27
27
|
## prerequisites
|
|
28
28
|
|
|
29
29
|
- python 3.10 (3.12+ recommended)
|
|
30
|
-
- [`eepyfileserver`](https://codeberg.org/maxeepy/eepyfileserver) 1.1.0-alpha or later
|
|
30
|
+
- [`eepyfileserver`](https://codeberg.org/maxeepy/eepyfileserver) 1.1.0-alpha (or later for some features, such as users)
|
|
31
31
|
|
|
32
32
|
## install
|
|
33
33
|
|
|
@@ -40,7 +40,7 @@ command line interface for eepyfileserver written in python
|
|
|
40
40
|
```bash
|
|
41
41
|
#login fully (lets you upload and download files)
|
|
42
42
|
#password is saved in PLAIN TEXT
|
|
43
|
-
efs-cli auth "https://example.com" "password123"
|
|
43
|
+
efs-cli auth "https://example.com" "password123" --custom-api-path (optional) "/meow/v123"
|
|
44
44
|
|
|
45
45
|
#login only using the url (lets you download PUBLIC files)
|
|
46
46
|
efs-cli auth "https://example.com"
|
|
@@ -48,6 +48,25 @@ efs-cli auth "https://example.com"
|
|
|
48
48
|
efs-cli login ...
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
+
### see and edit your configs
|
|
52
|
+
|
|
53
|
+
cli config
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
efs-cli config
|
|
57
|
+
efs-cli config --reset # resets your entire config
|
|
58
|
+
|
|
59
|
+
efs-cli conf
|
|
60
|
+
efs-cli cli-config
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
efs config
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
efs-cli efs-config
|
|
67
|
+
efs-cli efs-conf
|
|
68
|
+
```
|
|
69
|
+
|
|
51
70
|
### view version
|
|
52
71
|
|
|
53
72
|
```bash
|
|
@@ -70,10 +89,30 @@ efs-cli ls
|
|
|
70
89
|
efs-cli files
|
|
71
90
|
```
|
|
72
91
|
|
|
92
|
+
### view file/directory metadata
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
efs-cli metadata <path> --public (optional) # uses public url
|
|
96
|
+
efs-cli meta ...
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### edit a file
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
efs-cli edit <file_path>
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### get a url for a file
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
efs-cli url-for <file_path> --public (optional) --check-if-exists (optional) # --public uses public url, --check-if-exists checks if the file exists on efs
|
|
109
|
+
efs-cli url ...
|
|
110
|
+
```
|
|
111
|
+
|
|
73
112
|
### download a file
|
|
74
113
|
|
|
75
114
|
```bash
|
|
76
|
-
efs-cli download /example.txt /home/maxeepy/Downloads/example.txt
|
|
115
|
+
efs-cli download /example.txt /home/maxeepy/Downloads/example.txt --public (optional) # uses public url
|
|
77
116
|
efs-cli get ...
|
|
78
117
|
efs-cli d ...
|
|
79
118
|
```
|
|
@@ -87,6 +126,13 @@ efs-cli up ...
|
|
|
87
126
|
efs-cli put ...
|
|
88
127
|
```
|
|
89
128
|
|
|
129
|
+
### overwrite a file
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
efs-cli overwrite /home/maxeepy/Downloads/example.txt /example.txt
|
|
133
|
+
efs-cli over ...
|
|
134
|
+
```
|
|
135
|
+
|
|
90
136
|
### delete a file
|
|
91
137
|
|
|
92
138
|
```bash
|
|
@@ -99,5 +145,38 @@ efs-cli rm ...
|
|
|
99
145
|
|
|
100
146
|
```bash
|
|
101
147
|
efs-cli read /example.txt
|
|
148
|
+
efs-cli read /example.txt --no-less # doesn't use less
|
|
102
149
|
efs-cli cat ...
|
|
103
150
|
```
|
|
151
|
+
|
|
152
|
+
### list users
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
efs-cli users
|
|
156
|
+
efs-cli listusers
|
|
157
|
+
efs-cli lsu
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### add a user
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
efs-cli adduser dir123 "rw" # or "ro"
|
|
164
|
+
efs-cli auser ...
|
|
165
|
+
efs-cli au ...
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### change a user
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
efs-cli changeuser efskey_123 dir123 "rw" # or "ro"
|
|
172
|
+
efs-cli chuser ...
|
|
173
|
+
efs-cli chu ...
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### remove a user
|
|
177
|
+
|
|
178
|
+
```bash
|
|
179
|
+
efs-cli removeuser efskey_123 --remove-dir (optional) # removes the user directory if set
|
|
180
|
+
efs-cli rmuser ...
|
|
181
|
+
efs-cli ru ...
|
|
182
|
+
```
|
efs_cli-1.1.2/README.md
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
# efs-cli (formerly eepyfileserver-cli)
|
|
2
|
-
|
|
3
|
-
command line interface for eepyfileserver written in python
|
|
4
|
-
|
|
5
|
-
## prerequisites
|
|
6
|
-
|
|
7
|
-
- python 3.10 (3.12+ recommended)
|
|
8
|
-
- [`eepyfileserver`](https://codeberg.org/maxeepy/eepyfileserver) 1.1.0-alpha or later
|
|
9
|
-
|
|
10
|
-
## install
|
|
11
|
-
|
|
12
|
-
`pip install efs-cli`
|
|
13
|
-
|
|
14
|
-
## usage
|
|
15
|
-
|
|
16
|
-
### log in to an instance
|
|
17
|
-
|
|
18
|
-
```bash
|
|
19
|
-
#login fully (lets you upload and download files)
|
|
20
|
-
#password is saved in PLAIN TEXT
|
|
21
|
-
efs-cli auth "https://example.com" "password123"
|
|
22
|
-
|
|
23
|
-
#login only using the url (lets you download PUBLIC files)
|
|
24
|
-
efs-cli auth "https://example.com"
|
|
25
|
-
|
|
26
|
-
efs-cli login ...
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
### view version
|
|
30
|
-
|
|
31
|
-
```bash
|
|
32
|
-
efs-cli version
|
|
33
|
-
efs-cli ver
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
### view instance information
|
|
37
|
-
|
|
38
|
-
```bash
|
|
39
|
-
efs-cli instance
|
|
40
|
-
efs-cli info
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
### list files
|
|
44
|
-
|
|
45
|
-
```bash
|
|
46
|
-
efs-cli list
|
|
47
|
-
efs-cli ls
|
|
48
|
-
efs-cli files
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
### download a file
|
|
52
|
-
|
|
53
|
-
```bash
|
|
54
|
-
efs-cli download /example.txt /home/maxeepy/Downloads/example.txt
|
|
55
|
-
efs-cli get ...
|
|
56
|
-
efs-cli d ...
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
### upload a file
|
|
60
|
-
|
|
61
|
-
```bash
|
|
62
|
-
efs-cli upload /home/maxeepy/Downloads/example.txt /example.txt
|
|
63
|
-
efs-cli post ...
|
|
64
|
-
efs-cli up ...
|
|
65
|
-
efs-cli put ...
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
### delete a file
|
|
69
|
-
|
|
70
|
-
```bash
|
|
71
|
-
efs-cli delete /example.txt
|
|
72
|
-
efs-cli remove ...
|
|
73
|
-
efs-cli rm ...
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
### read a file
|
|
77
|
-
|
|
78
|
-
```bash
|
|
79
|
-
efs-cli read /example.txt
|
|
80
|
-
efs-cli cat ...
|
|
81
|
-
```
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|