Skip to content

Commit 1c816be

Browse files
authored
NextcloudApp: polishing API, maintenance update
Maintenance update: applied changes from AppAPI 2.3.0 (renamed vars) fixed CI for Nextcloud Master with PGSQL(some server bug?) removed non needed stuff(optional API scopes) updated Security.md
1 parent 3fcf6b2 commit 1c816be

File tree

20 files changed

+72
-195
lines changed

20 files changed

+72
-195
lines changed

.github/SECURITY.md

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,13 @@ Only the latest non beta release version of `nc_py_api` are currently being supp
66

77
## Reporting a Vulnerability about nc_py_api
88

9-
Officially, Nextcloud is not responsible for this project; the project is developed in the community’s free time.
9+
Officially, Nextcloud is not responsible for this project; the project is developing by the community.
1010

11-
Please report security vulnerabilities to bigcat88@icloud.com with `nc-py-api` in the subject line.
12-
If there is no response within 24 hours, then create an Issue,
13-
without technical details, to report on the previously sent mail.
11+
Please use GitHub's Private Vulnerability Reporting feature.
1412

15-
## Reporting a Vulnerability about Nextcloud
13+
If there is no response within 48 hours, then create an Issue,
14+
without technical details, to report on the previously reported vulnerability.
1615

17-
Transparency and Security are vital.
18-
If you have discovered a security issue with Nextcloud,
19-
please read our responsible disclosure guidelines and contact us at [hackerone.com/nextcloud](https://hackerone.com/nextcloud).
20-
Your report should include:
16+
## Conclusion
2117

22-
- Product version
23-
- A vulnerability description
24-
- Reproduction steps
25-
26-
If in the scope of the project, a member of the security team confirms the vulnerability, determines its impact, and develops a fix.
27-
Otherwise, the team will contact the maintainer and make sure the issue gets fixed.
28-
The fix will be applied to the main branch, tested, and packaged in the next security release.
29-
The vulnerability will be publicly announced after the release.
30-
31-
Finally, your name will be added to the [hall of fame](https://hackerone.com/nextcloud/thanks)
32-
as a thank-you from the entire Nextcloud community.
33-
34-
Note our [threat model](https://nextcloud.com/security/threat-model) to know what is expected behavior.
35-
36-
Please visit https://nextcloud.com/security/ for further information about security.
18+
We welcome and appreciate contributions to the security and advancement of open-source projects.

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [0.12.0 - 2024-02-28]
6+
7+
Update with new features only for `NextcloudApp` class. #233
8+
9+
### Added
10+
11+
- `ex_app.get_computation_device` function for retrieving GPU type(only with AppAPI `2.4.0`+).
12+
- `ex_app.integration_fastapi.fetch_models_task` are now public function, added `progress_init_start_value` param.
13+
- Global authentication when used now sets `request.scope["username"]` for easy use.
14+
515
## [0.11.0 - 2024-02-17]
616

717
### Added

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
# General information about the project.
3636
project = "NcPyApi"
37-
copyright = str(now.year) + " Nextcloud GmbH" # noqa
37+
copyright = str(now.year) + f" {project} Authors" # noqa
3838

3939
# The version info for the project you're documenting, acts as replacement for
4040
# |version| and |release|, also used in various other places throughout the

docs/reference/ExApp.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ External Application
66
Constants
77
---------
88

9-
.. autoclass:: ApiScope
10-
:members:
11-
129
.. autoclass:: LogLvl
1310
:members:
1411

examples/as_app/skeleton/Makefile

Lines changed: 6 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ help:
99
@echo " "
1010
@echo " build-push build image and upload to ghcr.io"
1111
@echo " "
12-
@echo " deploy27 deploy Skeleton to registered 'docker_dev' for Nextcloud 27"
13-
@echo " deploy28 deploy Skeleton to registered 'docker_dev' for Nextcloud 28"
14-
@echo " deploy deploy Skeleton to registered 'docker_dev' for Nextcloud Last"
15-
@echo " "
1612
@echo " run27 install Skeleton for Nextcloud 27"
1713
@echo " run28 install Skeleton for Nextcloud 28"
1814
@echo " run install Skeleton for Nextcloud Last"
@@ -29,59 +25,41 @@ build-push:
2925
docker login ghcr.io
3026
docker buildx build --push --platform linux/arm64/v8,linux/amd64 --tag ghcr.io/cloud-py-api/skeleton:latest .
3127

32-
.PHONY: deploy27
33-
deploy27:
34-
docker exec master-stable27-1 sudo -u www-data php occ app_api:app:unregister skeleton --silent --force || true
35-
docker exec master-stable27-1 sudo -u www-data php occ app_api:app:deploy skeleton docker_dev \
36-
--info-xml https://raw.githubusercontent.com/cloud-py-api/nc_py_api/main/examples/as_app/skeleton/appinfo/info.xml
37-
38-
.PHONY: deploy28
39-
deploy28:
40-
docker exec master-stable28-1 sudo -u www-data php occ app_api:app:unregister skeleton --silent --force || true
41-
docker exec master-stable28-1 sudo -u www-data php occ app_api:app:deploy skeleton docker_dev \
42-
--info-xml https://raw.githubusercontent.com/cloud-py-api/nc_py_api/main/examples/as_app/skeleton/appinfo/info.xml
43-
44-
.PHONY: deploy
45-
deploy:
46-
docker exec master-nextcloud-1 sudo -u www-data php occ app_api:app:unregister skeleton --silent --force || true
47-
docker exec master-nextcloud-1 sudo -u www-data php occ app_api:app:deploy skeleton docker_dev \
48-
--info-xml https://raw.githubusercontent.com/cloud-py-api/nc_py_api/main/examples/as_app/skeleton/appinfo/info.xml
49-
5028
.PHONY: run27
5129
run27:
5230
docker exec master-stable27-1 sudo -u www-data php occ app_api:app:unregister skeleton --silent --force || true
53-
docker exec master-stable27-1 sudo -u www-data php occ app_api:app:register skeleton docker_dev --force-scopes \
31+
docker exec master-stable27-1 sudo -u www-data php occ app_api:app:register skeleton --force-scopes \
5432
--info-xml https://raw.githubusercontent.com/cloud-py-api/nc_py_api/main/examples/as_app/skeleton/appinfo/info.xml
5533

5634
.PHONY: run28
5735
run28:
5836
docker exec master-stable28-1 sudo -u www-data php occ app_api:app:unregister skeleton --silent --force || true
59-
docker exec master-stable28-1 sudo -u www-data php occ app_api:app:register skeleton docker_dev --force-scopes \
37+
docker exec master-stable28-1 sudo -u www-data php occ app_api:app:register skeleton --force-scopes \
6038
--info-xml https://raw.githubusercontent.com/cloud-py-api/nc_py_api/main/examples/as_app/skeleton/appinfo/info.xml
6139

6240
.PHONY: run
6341
run:
6442
docker exec master-nextcloud-1 sudo -u www-data php occ app_api:app:unregister skeleton --silent --force || true
65-
docker exec master-nextcloud-1 sudo -u www-data php occ app_api:app:register skeleton docker_dev --force-scopes \
43+
docker exec master-nextcloud-1 sudo -u www-data php occ app_api:app:register skeleton --force-scopes \
6644
--info-xml https://raw.githubusercontent.com/cloud-py-api/nc_py_api/main/examples/as_app/skeleton/appinfo/info.xml
6745

6846
.PHONY: register27
6947
register27:
7048
docker exec master-stable27-1 sudo -u www-data php occ app_api:app:unregister skeleton --silent --force || true
7149
docker exec master-stable27-1 sudo -u www-data php occ app_api:app:register skeleton manual_install --json-info \
72-
"{\"appid\":\"skeleton\",\"name\":\"App Skeleton\",\"daemon_config_name\":\"manual_install\",\"version\":\"1.0.0\",\"secret\":\"12345\",\"port\":9030,\"scopes\":[],\"system_app\":0}" \
50+
"{\"id\":\"skeleton\",\"name\":\"App Skeleton\",\"daemon_config_name\":\"manual_install\",\"version\":\"1.0.0\",\"secret\":\"12345\",\"port\":9030,\"scopes\":[],\"system\":0}" \
7351
--force-scopes --wait-finish
7452

7553
.PHONY: register28
7654
register28:
7755
docker exec master-stable28-1 sudo -u www-data php occ app_api:app:unregister skeleton --silent --force || true
7856
docker exec master-stable28-1 sudo -u www-data php occ app_api:app:register skeleton manual_install --json-info \
79-
"{\"appid\":\"skeleton\",\"name\":\"App Skeleton\",\"daemon_config_name\":\"manual_install\",\"version\":\"1.0.0\",\"secret\":\"12345\",\"port\":9030,\"scopes\":[],\"system_app\":0}" \
57+
"{\"id\":\"skeleton\",\"name\":\"App Skeleton\",\"daemon_config_name\":\"manual_install\",\"version\":\"1.0.0\",\"secret\":\"12345\",\"port\":9030,\"scopes\":[],\"system\":0}" \
8058
--force-scopes --wait-finish
8159

8260
.PHONY: register
8361
register:
8462
docker exec master-nextcloud-1 sudo -u www-data php occ app_api:app:unregister skeleton --silent --force || true
8563
docker exec master-nextcloud-1 sudo -u www-data php occ app_api:app:register skeleton manual_install --json-info \
86-
"{\"appid\":\"skeleton\",\"name\":\"App Skeleton\",\"daemon_config_name\":\"manual_install\",\"version\":\"1.0.0\",\"secret\":\"12345\",\"port\":9030,\"scopes\":[],\"system_app\":0}" \
64+
"{\"id\":\"skeleton\",\"name\":\"App Skeleton\",\"daemon_config_name\":\"manual_install\",\"version\":\"1.0.0\",\"secret\":\"12345\",\"port\":9030,\"scopes\":[],\"system\":0}" \
8765
--force-scopes --wait-finish
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
nc_py_api[app]>=0.5.0
1+
nc_py_api[app]>=0.10.0

examples/as_app/talk_bot/HOW_TO_INSTALL.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,7 @@ How To Install
33

44
1. [Install AppAPI](https://apps.nextcloud.com/apps/app_api)
55
2. Create a deployment daemon according to the [instructions](https://cloud-py-api.github.io/app_api/CreationOfDeployDaemon.html#create-deploy-daemon) of the AppPI
6-
3. php occ app_api:app:deploy talk_bot "daemon_deploy_name" \
6+
3. php occ app_api:app:register talk_bot --force-scopes \
77
--info-xml https://raw.githubusercontent.com/cloud-py-api/nc_py_api/main/examples/as_app/talk_bot/appinfo/info.xml
88

9-
to deploy a docker image with Bot to docker.
10-
11-
4. php occ app_api:app:register talk_bot "daemon_deploy_name" --force-scopes \
12-
--info-xml https://raw.githubusercontent.com/cloud-py-api/nc_py_api/main/examples/as_app/talk_bot/appinfo/info.xml
13-
14-
to call its **enable** handler and accept all required API scopes by default.
9+
to deploy and install this ExApp.

examples/as_app/talk_bot/Makefile

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ help:
99
@echo " "
1010
@echo " build-push build image and upload to ghcr.io"
1111
@echo " "
12-
@echo " deploy deploy example to registered 'docker_dev' for Nextcloud Last"
13-
@echo " deploy27 deploy example to registered 'docker_dev' for Nextcloud 27"
14-
@echo " "
1512
@echo " run install TalkBot for Nextcloud Last"
1613
@echo " run27 install TalkBot for Nextcloud 27"
1714
@echo " "
@@ -26,40 +23,28 @@ build-push:
2623
docker login ghcr.io
2724
docker buildx build --push --platform linux/arm64/v8,linux/amd64 --tag ghcr.io/cloud-py-api/talk_bot:latest .
2825

29-
.PHONY: deploy
30-
deploy:
31-
docker exec master-nextcloud-1 sudo -u www-data php occ app_api:app:unregister talk_bot --silent --force || true
32-
docker exec master-nextcloud-1 sudo -u www-data php occ app_api:app:deploy talk_bot docker_dev \
33-
--info-xml https://raw.githubusercontent.com/cloud-py-api/nc_py_api/main/examples/as_app/talk_bot/appinfo/info.xml
34-
35-
.PHONY: deploy27
36-
deploy27:
37-
docker exec master-stable27-1 sudo -u www-data php occ app_api:app:unregister talk_bot --silent --force || true
38-
docker exec master-stable27-1 sudo -u www-data php occ app_api:app:deploy talk_bot docker_dev \
39-
--info-xml https://raw.githubusercontent.com/cloud-py-api/nc_py_api/main/examples/as_app/talk_bot/appinfo/info.xml
40-
4126
.PHONY: run
4227
run:
4328
docker exec master-nextcloud-1 sudo -u www-data php occ app_api:app:unregister talk_bot --silent --force || true
44-
docker exec master-nextcloud-1 sudo -u www-data php occ app_api:app:register talk_bot docker_dev --force-scopes \
29+
docker exec master-nextcloud-1 sudo -u www-data php occ app_api:app:register talk_bot --force-scopes \
4530
--info-xml https://raw.githubusercontent.com/cloud-py-api/nc_py_api/main/examples/as_app/talk_bot/appinfo/info.xml
4631

4732
.PHONY: run27
4833
run27:
4934
docker exec master-stable27-1 sudo -u www-data php occ app_api:app:unregister talk_bot --silent --force || true
50-
docker exec master-stable27-1 sudo -u www-data php occ app_api:app:register talk_bot docker_dev --force-scopes \
35+
docker exec master-stable27-1 sudo -u www-data php occ app_api:app:register talk_bot --force-scopes \
5136
--info-xml https://raw.githubusercontent.com/cloud-py-api/nc_py_api/main/examples/as_app/talk_bot/appinfo/info.xml
5237

5338
.PHONY: register
5439
register:
5540
docker exec master-nextcloud-1 sudo -u www-data php occ app_api:app:unregister talk_bot --silent --force || true
5641
docker exec master-nextcloud-1 sudo -u www-data php occ app_api:app:register talk_bot manual_install --json-info \
57-
"{\"appid\":\"talk_bot\",\"name\":\"TalkBot\",\"daemon_config_name\":\"manual_install\",\"version\":\"1.0.0\",\"secret\":\"12345\",\"port\":9032,\"scopes\":[\"TALK\", \"TALK_BOT\"],\"system_app\":0}" \
42+
"{\"id\":\"talk_bot\",\"name\":\"TalkBot\",\"daemon_config_name\":\"manual_install\",\"version\":\"1.0.0\",\"secret\":\"12345\",\"port\":9032,\"scopes\":[\"TALK\", \"TALK_BOT\"],\"system\":0}" \
5843
--force-scopes --wait-finish
5944

6045
.PHONY: register27
6146
register27:
6247
docker exec master-stable27-1 sudo -u www-data php occ app_api:app:unregister talk_bot --force || true
6348
docker exec master-stable27-1 sudo -u www-data php occ app_api:app:register talk_bot manual_install --json-info \
64-
"{\"appid\":\"talk_bot\",\"name\":\"TalkBot\",\"daemon_config_name\":\"manual_install\",\"version\":\"1.0.0\",\"secret\":\"12345\",\"port\":9032,\"scopes\":[\"TALK\", \"TALK_BOT\"],\"system_app\":0}" \
49+
"{\"id\":\"talk_bot\",\"name\":\"TalkBot\",\"daemon_config_name\":\"manual_install\",\"version\":\"1.0.0\",\"secret\":\"12345\",\"port\":9032,\"scopes\":[\"TALK\", \"TALK_BOT\"],\"system\":0}" \
6550
--force-scopes --wait-finish

examples/as_app/talk_bot_ai/Makefile

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ help:
99
@echo " "
1010
@echo " build-push build image and upload to ghcr.io"
1111
@echo " "
12-
@echo " deploy deploy example to registered 'docker_dev' for Nextcloud Last"
13-
@echo " deploy27 deploy example to registered 'docker_dev' for Nextcloud 27"
14-
@echo " "
1512
@echo " run install TalkBotAI for Nextcloud Last"
1613
@echo " run27 install TalkBotAI for Nextcloud 27"
1714
@echo " "
@@ -26,40 +23,28 @@ build-push:
2623
docker login ghcr.io
2724
docker buildx build --push --platform linux/arm64/v8,linux/amd64 --tag ghcr.io/cloud-py-api/talk_bot_ai:latest .
2825

29-
.PHONY: deploy
30-
deploy:
31-
docker exec master-nextcloud-1 sudo -u www-data php occ app_api:app:unregister talk_bot_ai --silent --force || true
32-
docker exec master-nextcloud-1 sudo -u www-data php occ app_api:app:deploy talk_bot_ai docker_dev \
33-
--info-xml https://raw.githubusercontent.com/cloud-py-api/nc_py_api/main/examples/as_app/talk_bot_ai/appinfo/info.xml
34-
35-
.PHONY: deploy27
36-
deploy27:
37-
docker exec master-stable27-1 sudo -u www-data php occ app_api:app:unregister talk_bot_ai --silent --force || true
38-
docker exec master-stable27-1 sudo -u www-data php occ app_api:app:deploy talk_bot_ai docker_dev \
39-
--info-xml https://raw.githubusercontent.com/cloud-py-api/nc_py_api/main/examples/as_app/talk_bot_ai/appinfo/info.xml
40-
4126
.PHONY: run
4227
run:
4328
docker exec master-nextcloud-1 sudo -u www-data php occ app_api:app:unregister talk_bot_ai --silent --force || true
44-
docker exec master-nextcloud-1 sudo -u www-data php occ app_api:app:register talk_bot_ai docker_dev --force-scopes \
29+
docker exec master-nextcloud-1 sudo -u www-data php occ app_api:app:register talk_bot_ai --force-scopes \
4530
--info-xml https://raw.githubusercontent.com/cloud-py-api/nc_py_api/main/examples/as_app/talk_bot_ai/appinfo/info.xml
4631

4732
.PHONY: run27
4833
run27:
4934
docker exec master-stable27-1 sudo -u www-data php occ app_api:app:unregister talk_bot_ai --silent --force || true
50-
docker exec master-stable27-1 sudo -u www-data php occ app_api:app:register talk_bot_ai docker_dev --force-scopes \
35+
docker exec master-stable27-1 sudo -u www-data php occ app_api:app:register talk_bot_ai --force-scopes \
5136
--info-xml https://raw.githubusercontent.com/cloud-py-api/nc_py_api/main/examples/as_app/talk_bot_ai/appinfo/info.xml
5237

5338
.PHONY: register
5439
register:
5540
docker exec master-nextcloud-1 sudo -u www-data php occ app_api:app:unregister talk_bot_ai --silent --force || true
5641
docker exec master-nextcloud-1 sudo -u www-data php occ app_api:app:register talk_bot_ai manual_install --json-info \
57-
"{\"appid\":\"talk_bot_ai\",\"name\":\"TalkBotAI\",\"daemon_config_name\":\"manual_install\",\"version\":\"1.0.0\",\"secret\":\"12345\",\"port\":9034,\"scopes\":[\"TALK\", \"TALK_BOT\"],\"system_app\":0}" \
42+
"{\"id\":\"talk_bot_ai\",\"name\":\"TalkBotAI\",\"daemon_config_name\":\"manual_install\",\"version\":\"1.0.0\",\"secret\":\"12345\",\"port\":9034,\"scopes\":[\"TALK\", \"TALK_BOT\"],\"system\":0}" \
5843
--force-scopes --wait-finish
5944

6045
.PHONY: register27
6146
register27:
6247
docker exec master-stable27-1 sudo -u www-data php occ app_api:app:unregister talk_bot_ai --silent --force || true
6348
docker exec master-stable27-1 sudo -u www-data php occ app_api:app:register talk_bot_ai manual_install --json-info \
64-
"{\"appid\":\"talk_bot_ai\",\"name\":\"TalkBotAI\",\"daemon_config_name\":\"manual_install\",\"version\":\"1.0.0\",\"secret\":\"12345\",\"port\":9034,\"scopes\":[\"TALK\", \"TALK_BOT\"],\"system_app\":0}" \
49+
"{\"id\":\"talk_bot_ai\",\"name\":\"TalkBotAI\",\"daemon_config_name\":\"manual_install\",\"version\":\"1.0.0\",\"secret\":\"12345\",\"port\":9034,\"scopes\":[\"TALK\", \"TALK_BOT\"],\"system\":0}" \
6550
--force-scopes --wait-finish

0 commit comments

Comments
 (0)