Skip to content

Commit 5a3f7b2

Browse files
authored
Merge pull request #1 from cloud-py-api/appapi-1.1.0
"/init" endpoint implementation
2 parents c241060 + 7c59915 commit 5a3f7b2

File tree

3 files changed

+20
-14
lines changed

3 files changed

+20
-14
lines changed

Makefile

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ help:
1616
@echo " run27 install UpScaler for Nextcloud 27"
1717
@echo " "
1818
@echo " For development of this example use PyCharm run configurations. Development is always set for last Nextcloud."
19-
@echo " First run 'upscaler_example' and then 'make manual_register', after that you can use/debug/develop it and easy test."
19+
@echo " First run 'upscaler_example' and then 'make register', after that you can use/debug/develop it and easy test."
2020
@echo " "
21-
@echo " manual_register28 perform registration of running 'upscaler_example' into 'manual_install' deploy daemon."
22-
@echo " manual_register27 perform registration of running 'upscaler_example' into 'manual_install' deploy daemon."
21+
@echo " register28 perform registration of running 'upscaler_example' into 'manual_install' deploy daemon."
22+
@echo " register27 perform registration of running 'upscaler_example' into 'manual_install' deploy daemon."
2323

2424
.PHONY: build-push
2525
build-push:
2626
docker login ghcr.io
27-
docker buildx build --push --platform linux/arm64/v8,linux/amd64 --tag ghcr.io/cloud-py-api/upscaler_example:1.0.0 --tag ghcr.io/cloud-py-api/upscaler_example:latest .
27+
docker buildx build --push --platform linux/arm64/v8,linux/amd64 --tag ghcr.io/cloud-py-api/upscaler_example:1.1.0 --tag ghcr.io/cloud-py-api/upscaler_example:latest .
2828

2929
.PHONY: deploy28
3030
deploy28:
@@ -36,7 +36,7 @@ deploy28:
3636
run28:
3737
docker exec master-nextcloud-1 sudo -u www-data php occ app_api:app:unregister upscaler_example --silent || true
3838
docker exec master-nextcloud-1 sudo -u www-data php occ app_api:app:register upscaler_example docker_dev \
39-
-e --force-scopes \
39+
--force-scopes \
4040
--info-xml https://raw.githubusercontent.com/cloud-py-api/upscaler_example/main/appinfo/info.xml
4141

4242
.PHONY: deploy27
@@ -49,19 +49,19 @@ deploy27:
4949
run27:
5050
docker exec master-stable27-1 sudo -u www-data php occ app_api:app:unregister upscaler_example --silent || true
5151
docker exec master-stable27-1 sudo -u www-data php occ app_api:app:register upscaler_example docker_dev \
52-
-e --force-scopes \
52+
--force-scopes \
5353
--info-xml https://raw.githubusercontent.com/cloud-py-api/upscaler_example/main/appinfo/info.xml
5454

55-
.PHONY: manual_register28
56-
manual_register28:
55+
.PHONY: register28
56+
register28:
5757
docker exec master-nextcloud-1 sudo -u www-data php occ app_api:app:unregister upscaler_example --silent || true
5858
docker exec master-nextcloud-1 sudo -u www-data php occ app_api:app:register upscaler_example manual_install --json-info \
5959
"{\"appid\":\"upscaler_example\",\"name\":\"upscaler_example\",\"daemon_config_name\":\"manual_install\",\"version\":\"1.0.0\",\"secret\":\"12345\",\"host\":\"host.docker.internal\",\"port\":10050,\"scopes\":{\"required\":[\"FILES\", \"NOTIFICATIONS\"],\"optional\":[]},\"protocol\":\"http\",\"system_app\":0}" \
60-
-e --force-scopes
60+
--force-scopes
6161

62-
.PHONY: manual_register27
63-
manual_register27:
62+
.PHONY: register27
63+
register27:
6464
docker exec master-stable27-1 sudo -u www-data php occ app_api:app:unregister upscaler_example --silent || true
6565
docker exec master-stable27-1 sudo -u www-data php occ app_api:app:register upscaler_example manual_install --json-info \
6666
"{\"appid\":\"upscaler_example\",\"name\":\"upscaler_example\",\"daemon_config_name\":\"manual_install\",\"version\":\"1.0.0\",\"secret\":\"12345\",\"host\":\"host.docker.internal\",\"port\":10050,\"scopes\":{\"required\":[\"FILES\", \"NOTIFICATIONS\"],\"optional\":[]},\"protocol\":\"http\",\"system_app\":0}" \
67-
-e --force-scopes
67+
--force-scopes

appinfo/info.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ It shouldn't be difficult to use an even more advanced model based on this examp
1313
1414
Refer to [How to install](https://github.com/cloud-py-api/upscaler_example/blob/main/HOW_TO_INSTALL.md) to try it.
1515
]]></description>
16-
<version>1.0.0</version>
16+
<version>1.1.0</version>
1717
<licence>agpl</licence>
1818
<author mail="[email protected]" homepage="https://github.com/andrey18106">Andrey Borysenko</author>
1919
<author mail="[email protected]" homepage="https://github.com/bigcat88">Alexander Piskun</author>
@@ -30,7 +30,7 @@ Refer to [How to install](https://github.com/cloud-py-api/upscaler_example/blob/
3030
<docker-install>
3131
<registry>ghcr.io</registry>
3232
<image>cloud-py-api/upscaler_example</image>
33-
<image-tag>1.0.0</image-tag>
33+
<image-tag>1.1.0</image-tag>
3434
</docker-install>
3535
<scopes>
3636
<required>

src/main.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,12 @@ def heartbeat_handler():
223223
return responses.JSONResponse(content={"status": "ok"}, status_code=200)
224224

225225

226+
@APP.post("/init")
227+
def init_callback():
228+
ocs_call(method="PUT", path=f"/index.php/apps/app_api/apps/status/{os.environ['APP_ID']}", json_data={"progress": 100})
229+
return responses.JSONResponse(content={}, status_code=200)
230+
231+
226232
if __name__ == "__main__":
227233
uvicorn.run(
228234
"main:APP", host=os.environ.get("APP_HOST", "127.0.0.1"), port=int(os.environ["APP_PORT"]), log_level="trace"

0 commit comments

Comments
 (0)