Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ jobs:
fess-version:
- fess_version: "14.19.2"
opensearch_version: "2.19.1"
- fess_version: "15.4.0"
opensearch_version: "3.3.2"
- fess_version: "15.6.1"
opensearch_version: "3.6.0"

steps:
- uses: actions/checkout@v4
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ The easiest way to get started is using the pre-built Docker image:
docker run --rm \
-e FESS_ENDPOINT=https://your-fess-server \
-e FESS_ACCESS_TOKEN=your_access_token_here \
-e FESS_VERSION=15.4.0 \
-e FESS_VERSION=15.6.1 \
ghcr.io/codelibs/fessctl:0.1.0 --help
```

Expand All @@ -35,13 +35,13 @@ Run actual commands:
docker run --rm \
-e FESS_ENDPOINT=https://your-fess-server \
-e FESS_ACCESS_TOKEN=your_access_token_here \
-e FESS_VERSION=15.4.0 \
-e FESS_VERSION=15.6.1 \
ghcr.io/codelibs/fessctl:0.1.0 ping

docker run --rm \
-e FESS_ENDPOINT=https://your-fess-server \
-e FESS_ACCESS_TOKEN=your_access_token_here \
-e FESS_VERSION=15.4.0 \
-e FESS_VERSION=15.6.1 \
ghcr.io/codelibs/fessctl:0.1.0 user list
```

Expand All @@ -61,7 +61,7 @@ Then run with your custom image:
docker run --rm \
-e FESS_ENDPOINT=https://your-fess-server \
-e FESS_ACCESS_TOKEN=your_access_token_here \
-e FESS_VERSION=15.4.0 \
-e FESS_VERSION=15.6.1 \
fessctl:latest --help
```

Expand All @@ -86,7 +86,7 @@ uv pip install -e src
```bash
export FESS_ACCESS_TOKEN=your_access_token_here
export FESS_ENDPOINT=https://your-fess-server
export FESS_VERSION=15.4.0
export FESS_VERSION=15.6.1

fessctl --help
fessctl ping
Expand All @@ -100,7 +100,7 @@ All three methods require the following environment variables:

- `FESS_ENDPOINT`: The URL of your Fess server's API endpoint (default: `http://localhost:8080`)
- `FESS_ACCESS_TOKEN`: Bearer token for API authentication (required)
- `FESS_VERSION`: Target Fess version for API compatibility (default: `15.4.0`)
- `FESS_VERSION`: Target Fess version for API compatibility (default: `15.6.1`)

## License

Expand Down
2 changes: 1 addition & 1 deletion src/fessctl/config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ class Settings:
access_token: str | None = field(
default_factory=lambda: os.getenv("FESS_ACCESS_TOKEN", None))
fess_version: str = field(
default_factory=lambda: os.getenv("FESS_VERSION", "15.4.0"))
default_factory=lambda: os.getenv("FESS_VERSION", "15.6.1"))
10 changes: 5 additions & 5 deletions tests/commands/test_accesstoken.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def test_accesstoken_crud_flow(runner, fess_service):
# 2) Retrieve the created accesstoken
result = runner.invoke(
accesstoken_app,
["get", accesstoken_id, "--output", "json"]
["get", "--output", "json", "--", accesstoken_id]
)
assert result.exit_code == 0, f"Get failed: {result.stdout}"
get_resp = json.loads(result.stdout)
Expand All @@ -45,7 +45,7 @@ def test_accesstoken_crud_flow(runner, fess_service):
# 3) Update the accesstoken's permissions
result = runner.invoke(
accesstoken_app,
["update", accesstoken_id, "--permission", "admin", "--output", "json"]
["update", "--permission", "admin", "--output", "json", "--", accesstoken_id]
)
assert result.exit_code == 0, f"Update failed: {result.stdout}"
update_resp = json.loads(result.stdout)
Expand All @@ -54,7 +54,7 @@ def test_accesstoken_crud_flow(runner, fess_service):
# 4) Retrieve again and verify updated permissions
result = runner.invoke(
accesstoken_app,
["get", accesstoken_id, "--output", "json"]
["get", "--output", "json", "--", accesstoken_id]
)
assert result.exit_code == 0, f"Get after update failed: {result.stdout}"
get_after = json.loads(result.stdout)
Expand All @@ -76,7 +76,7 @@ def test_accesstoken_crud_flow(runner, fess_service):
# 6) Delete the accesstoken
result = runner.invoke(
accesstoken_app,
["delete", accesstoken_id, "--output", "json"]
["delete", "--output", "json", "--", accesstoken_id]
)
assert result.exit_code == 0, f"Delete failed: {result.stdout}"
del_resp = json.loads(result.stdout)
Expand All @@ -85,7 +85,7 @@ def test_accesstoken_crud_flow(runner, fess_service):
# 7) Verify that get now fails
result = runner.invoke(
accesstoken_app,
["get", accesstoken_id]
["get", "--", accesstoken_id]
)
assert result.exit_code != 0
assert "failed to retrieve accesstoken" in result.stdout.lower()
10 changes: 5 additions & 5 deletions tests/commands/test_badword.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def test_badword_crud_flow(runner, fess_service):
# 2) Retrieve the created badword
result = runner.invoke(
badword_app,
["get", badword_id, "--output", "json"]
["get", "--output", "json", "--", badword_id]
)
assert result.exit_code == 0, f"Get failed: {result.stdout}"
get_resp = json.loads(result.stdout)
Expand All @@ -46,7 +46,7 @@ def test_badword_crud_flow(runner, fess_service):
new_suggest_word = f"updated-{suggest_word}"
result = runner.invoke(
badword_app,
["update", badword_id, "--suggest-word", new_suggest_word, "--output", "json"]
["update", "--suggest-word", new_suggest_word, "--output", "json", "--", badword_id]
)
assert result.exit_code == 0, f"Update failed: {result.stdout}"
update_resp = json.loads(result.stdout)
Expand All @@ -55,7 +55,7 @@ def test_badword_crud_flow(runner, fess_service):
# 4) Retrieve again and verify updated suggest_word
result = runner.invoke(
badword_app,
["get", badword_id, "--output", "json"]
["get", "--output", "json", "--", badword_id]
)
assert result.exit_code == 0, f"Get after update failed: {result.stdout}"
get_after = json.loads(result.stdout)
Expand All @@ -77,7 +77,7 @@ def test_badword_crud_flow(runner, fess_service):
# 6) Delete the badword
result = runner.invoke(
badword_app,
["delete", badword_id, "--output", "json"]
["delete", "--output", "json", "--", badword_id]
)
assert result.exit_code == 0, f"Delete failed: {result.stdout}"
del_resp = json.loads(result.stdout)
Expand All @@ -86,7 +86,7 @@ def test_badword_crud_flow(runner, fess_service):
# 7) Verify that get now fails
result = runner.invoke(
badword_app,
["get", badword_id]
["get", "--", badword_id]
)
assert result.exit_code != 0
assert "failed to retrieve badword" in result.stdout.lower()
10 changes: 5 additions & 5 deletions tests/commands/test_boostdoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def test_boostdoc_crud_flow(runner, fess_service):
# 2) Retrieve the created boostdoc
result = runner.invoke(
boostdoc_app,
["get", boostdoc_id, "--output", "json"]
["get", "--output", "json", "--", boostdoc_id]
)
assert result.exit_code == 0, f"Get failed: {result.stdout}"
get_resp = json.loads(result.stdout)
Expand All @@ -48,7 +48,7 @@ def test_boostdoc_crud_flow(runner, fess_service):
new_boost_expr = "20.0"
result = runner.invoke(
boostdoc_app,
["update", boostdoc_id, "--boost-expr", new_boost_expr, "--output", "json"]
["update", "--boost-expr", new_boost_expr, "--output", "json", "--", boostdoc_id]
)
assert result.exit_code == 0, f"Update failed: {result.stdout}"
update_resp = json.loads(result.stdout)
Expand All @@ -57,7 +57,7 @@ def test_boostdoc_crud_flow(runner, fess_service):
# 4) Retrieve again and verify updated boost_expr
result = runner.invoke(
boostdoc_app,
["get", boostdoc_id, "--output", "json"]
["get", "--output", "json", "--", boostdoc_id]
)
assert result.exit_code == 0, f"Get after update failed: {result.stdout}"
get_after = json.loads(result.stdout)
Expand All @@ -79,7 +79,7 @@ def test_boostdoc_crud_flow(runner, fess_service):
# 6) Delete the boostdoc
result = runner.invoke(
boostdoc_app,
["delete", boostdoc_id, "--output", "json"]
["delete", "--output", "json", "--", boostdoc_id]
)
assert result.exit_code == 0, f"Delete failed: {result.stdout}"
del_resp = json.loads(result.stdout)
Expand All @@ -88,7 +88,7 @@ def test_boostdoc_crud_flow(runner, fess_service):
# 7) Verify that get now fails
result = runner.invoke(
boostdoc_app,
["get", boostdoc_id]
["get", "--", boostdoc_id]
)
assert result.exit_code != 0
assert "failed to retrieve boostdoc" in result.stdout.lower()
10 changes: 5 additions & 5 deletions tests/commands/test_dataconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def test_dataconfig_crud_flow(runner, fess_service):
# 2) Retrieve the created dataconfig
result = runner.invoke(
dataconfig_app,
["get", dataconfig_id, "--output", "json"]
["get", "--output", "json", "--", dataconfig_id]
)
assert result.exit_code == 0, f"Get failed: {result.stdout}"
get_resp = json.loads(result.stdout)
Expand All @@ -47,7 +47,7 @@ def test_dataconfig_crud_flow(runner, fess_service):
new_description = "test description"
result = runner.invoke(
dataconfig_app,
["update", dataconfig_id, "--description", new_description, "--output", "json"]
["update", "--description", new_description, "--output", "json", "--", dataconfig_id]
)
assert result.exit_code == 0, f"Update failed: {result.stdout}"
update_resp = json.loads(result.stdout)
Expand All @@ -56,7 +56,7 @@ def test_dataconfig_crud_flow(runner, fess_service):
# 4) Retrieve again and verify updated description
result = runner.invoke(
dataconfig_app,
["get", dataconfig_id, "--output", "json"]
["get", "--output", "json", "--", dataconfig_id]
)
assert result.exit_code == 0, f"Get after update failed: {result.stdout}"
get_after = json.loads(result.stdout)
Expand All @@ -78,7 +78,7 @@ def test_dataconfig_crud_flow(runner, fess_service):
# 6) Delete the dataconfig
result = runner.invoke(
dataconfig_app,
["delete", dataconfig_id, "--output", "json"]
["delete", "--output", "json", "--", dataconfig_id]
)
assert result.exit_code == 0, f"Delete failed: {result.stdout}"
del_resp = json.loads(result.stdout)
Expand All @@ -87,7 +87,7 @@ def test_dataconfig_crud_flow(runner, fess_service):
# 7) Verify that get now fails
result = runner.invoke(
dataconfig_app,
["get", dataconfig_id]
["get", "--", dataconfig_id]
)
assert result.exit_code != 0
assert "failed to retrieve dataconfig" in result.stdout.lower()
10 changes: 5 additions & 5 deletions tests/commands/test_duplicatehost.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def test_duplicatehost_crud_flow(runner, fess_service):
# 2) Retrieve the created duplicatehost
result = runner.invoke(
duplicatehost_app,
["get", duplicatehost_id, "--output", "json"]
["get", "--output", "json", "--", duplicatehost_id]
)
assert result.exit_code == 0, f"Get failed: {result.stdout}"
get_resp = json.loads(result.stdout)
Expand All @@ -48,7 +48,7 @@ def test_duplicatehost_crud_flow(runner, fess_service):
new_sort_order = "10"
result = runner.invoke(
duplicatehost_app,
["update", duplicatehost_id, "--sort-order", new_sort_order, "--output", "json"]
["update", "--sort-order", new_sort_order, "--output", "json", "--", duplicatehost_id]
)
assert result.exit_code == 0, f"Update failed: {result.stdout}"
update_resp = json.loads(result.stdout)
Expand All @@ -57,7 +57,7 @@ def test_duplicatehost_crud_flow(runner, fess_service):
# 4) Retrieve again and verify updated sort_order
result = runner.invoke(
duplicatehost_app,
["get", duplicatehost_id, "--output", "json"]
["get", "--output", "json", "--", duplicatehost_id]
)
assert result.exit_code == 0, f"Get after update failed: {result.stdout}"
get_after = json.loads(result.stdout)
Expand All @@ -79,7 +79,7 @@ def test_duplicatehost_crud_flow(runner, fess_service):
# 6) Delete the duplicatehost
result = runner.invoke(
duplicatehost_app,
["delete", duplicatehost_id, "--output", "json"]
["delete", "--output", "json", "--", duplicatehost_id]
)
assert result.exit_code == 0, f"Delete failed: {result.stdout}"
del_resp = json.loads(result.stdout)
Expand All @@ -88,7 +88,7 @@ def test_duplicatehost_crud_flow(runner, fess_service):
# 7) Verify that get now fails
result = runner.invoke(
duplicatehost_app,
["get", duplicatehost_id]
["get", "--", duplicatehost_id]
)
assert result.exit_code != 0
assert "failed to retrieve duplicatehost" in result.stdout.lower()
10 changes: 5 additions & 5 deletions tests/commands/test_elevateword.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def test_elevateword_crud_flow(runner, fess_service):
# 2) Retrieve the created elevateword
result = runner.invoke(
elevateword_app,
["get", elevateword_id, "--output", "json"]
["get", "--output", "json", "--", elevateword_id]
)
assert result.exit_code == 0, f"Get failed: {result.stdout}"
get_resp = json.loads(result.stdout)
Expand All @@ -48,7 +48,7 @@ def test_elevateword_crud_flow(runner, fess_service):
new_boost = "20.0"
result = runner.invoke(
elevateword_app,
["update", elevateword_id, "--boost", new_boost, "--output", "json"]
["update", "--boost", new_boost, "--output", "json", "--", elevateword_id]
)
assert result.exit_code == 0, f"Update failed: {result.stdout}"
update_resp = json.loads(result.stdout)
Expand All @@ -57,7 +57,7 @@ def test_elevateword_crud_flow(runner, fess_service):
# 4) Retrieve again and verify updated boost
result = runner.invoke(
elevateword_app,
["get", elevateword_id, "--output", "json"]
["get", "--output", "json", "--", elevateword_id]
)
assert result.exit_code == 0, f"Get after update failed: {result.stdout}"
get_after = json.loads(result.stdout)
Expand All @@ -79,7 +79,7 @@ def test_elevateword_crud_flow(runner, fess_service):
# 6) Delete the elevateword
result = runner.invoke(
elevateword_app,
["delete", elevateword_id, "--output", "json"]
["delete", "--output", "json", "--", elevateword_id]
)
assert result.exit_code == 0, f"Delete failed: {result.stdout}"
del_resp = json.loads(result.stdout)
Expand All @@ -88,7 +88,7 @@ def test_elevateword_crud_flow(runner, fess_service):
# 7) Verify that get now fails
result = runner.invoke(
elevateword_app,
["get", elevateword_id]
["get", "--", elevateword_id]
)
assert result.exit_code != 0
assert "failed to retrieve elevateword" in result.stdout.lower()
12 changes: 6 additions & 6 deletions tests/commands/test_fileauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def temp_fileconfig(runner):
assert result.exit_code == 0, f"Failed to create temp fileconfig: {result.stdout}"
fileconfig_id = json.loads(result.stdout)["response"]["id"]
yield fileconfig_id
runner.invoke(fileconfig_app, ["delete", fileconfig_id])
runner.invoke(fileconfig_app, ["delete", "--", fileconfig_id])


def test_fileauth_crud_flow(runner, fess_service, temp_fileconfig):
Expand All @@ -51,7 +51,7 @@ def test_fileauth_crud_flow(runner, fess_service, temp_fileconfig):
# 2) Retrieve the created fileauth
result = runner.invoke(
fileauth_app,
["get", fileauth_id, "--output", "json"]
["get", "--output", "json", "--", fileauth_id]
)
assert result.exit_code == 0, f"Get failed: {result.stdout}"
get_resp = json.loads(result.stdout)
Expand All @@ -64,7 +64,7 @@ def test_fileauth_crud_flow(runner, fess_service, temp_fileconfig):
new_password = "new_password"
result = runner.invoke(
fileauth_app,
["update", fileauth_id, "--password", new_password, "--output", "json"]
["update", "--password", new_password, "--output", "json", "--", fileauth_id]
)
assert result.exit_code == 0, f"Update failed: {result.stdout}"
update_resp = json.loads(result.stdout)
Expand All @@ -73,7 +73,7 @@ def test_fileauth_crud_flow(runner, fess_service, temp_fileconfig):
# 4) Retrieve again and verify updated password
result = runner.invoke(
fileauth_app,
["get", fileauth_id, "--output", "json"]
["get", "--output", "json", "--", fileauth_id]
)
assert result.exit_code == 0, f"Get after update failed: {result.stdout}"
get_after = json.loads(result.stdout)
Expand All @@ -95,7 +95,7 @@ def test_fileauth_crud_flow(runner, fess_service, temp_fileconfig):
# 6) Delete the fileauth
result = runner.invoke(
fileauth_app,
["delete", fileauth_id, "--output", "json"]
["delete", "--output", "json", "--", fileauth_id]
)
assert result.exit_code == 0, f"Delete failed: {result.stdout}"
del_resp = json.loads(result.stdout)
Expand All @@ -104,7 +104,7 @@ def test_fileauth_crud_flow(runner, fess_service, temp_fileconfig):
# 7) Verify that get now fails
result = runner.invoke(
fileauth_app,
["get", fileauth_id]
["get", "--", fileauth_id]
)
assert result.exit_code != 0
assert "failed to retrieve fileauth" in result.stdout.lower()
Loading
Loading