Skip to content

Commit 3783547

Browse files
committed
WIP: draft
0 parents  commit 3783547

29 files changed

+18838
-0
lines changed

.editorconfig

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# https://editorconfig.org
2+
3+
root = true
4+
5+
[*]
6+
charset = utf-8
7+
end_of_line = lf
8+
indent_size = 4
9+
indent_style = tab
10+
insert_final_newline = true
11+
trim_trailing_whitespace = true
12+
13+
[*.py]
14+
indent_style = space
15+
16+
[*.yml]
17+
indent_size = 2
18+
indent_style = space
19+
20+
[*.md]
21+
trim_trailing_whitespace = false
22+
23+
[*.svg]
24+
insert_final_newline = false
25+
26+
[package*.json]
27+
indent_size = 2
28+
indent_style = space
29+
30+
[tests/psalm-baseline.xml]
31+
indent_size = 2
32+
indent_style = space

.eslintrc.js

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
module.exports = {
2+
globals: {
3+
appVersion: true
4+
},
5+
parserOptions: {
6+
requireConfigFile: false
7+
},
8+
extends: [
9+
'@nextcloud'
10+
],
11+
rules: {
12+
'jsdoc/require-jsdoc': 'off',
13+
'jsdoc/tag-lines': 'off',
14+
'vue/first-attribute-linebreak': 'off',
15+
'import/extensions': 'off'
16+
}
17+
}

.gitattributes

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Declare files that always have LF line endings on checkout
2+
* text eol=lf
3+
4+
# Denote all files that are truly binary and should not be modified
5+
js/* binary
6+
screenshots/* binary
7+
locales/* binary
8+
translationfiles/* binary
9+
*.png binary
10+
*.hif binary
11+
12+
# Files to exclude from GitHub Languages statistics
13+
l10n/* linguist-vendored=true

.gitignore

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
.DS_Store
2+
node_modules/
3+
npm-debug.log*
4+
yarn-debug.log*
5+
yarn-error.log*
6+
7+
# Editor directories and files
8+
.idea
9+
.vscode
10+
*.suo
11+
*.ntvs*
12+
*.njsproj
13+
*.sln
14+
15+
.marginalia
16+
17+
/js/
18+
build/
19+
coverage/
20+
vendor
21+
.php-cs-fixer.cache
22+
.phpunit.result.cache
23+
24+
__pycache__
25+
local
26+
.run/
27+
.venv
28+
venv

.l10nignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
js/
2+
vendor/
3+
.venv/
4+
venv/

.nextcloudignore

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
.git
2+
.github
3+
.tx
4+
.vscode
5+
/build
6+
/node_modules
7+
/screenshots
8+
/src
9+
tests
10+
/vendor
11+
/.codecov.yml
12+
/.eslintrc.js
13+
/.gitattributes
14+
/.gitignore
15+
/.l10nignore
16+
/.nextcloudignore
17+
.php-cs-fixer.*
18+
/.pre-commit-config.yaml
19+
/babel.config.js
20+
/CODE_OF_CONDUCT.md
21+
/composer.json
22+
/composer.lock
23+
/jest.config.js
24+
/Makefile
25+
/package-lock.json
26+
/package.json
27+
/postcss.config.js
28+
/psalm.xml
29+
/pyproject.toml
30+
/stylelint.config.js
31+
/webpack.config.js

Dockerfile

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM python:3.11-slim-bookworm
2+
3+
COPY requirements.txt /
4+
5+
ADD cs[s] /app/css
6+
ADD im[g] /app/img
7+
ADD j[s] /app/js
8+
ADD l10[n] /app/l10n
9+
ADD li[b] /app/lib
10+
11+
RUN \
12+
python3 -m pip install -r requirements.txt && rm -rf ~/.cache && rm requirements.txt
13+
14+
WORKDIR /app/lib
15+
ENTRYPOINT ["python3", "main.py"]

Makefile

+85
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
.DEFAULT_GOAL := help
2+
3+
.PHONY: help
4+
help:
5+
@echo "Welcome to Vix. Please use \`make <target>\` where <target> is one of"
6+
@echo " "
7+
@echo " Next commands are only for dev environment with nextcloud-docker-dev!"
8+
@echo " They should run from the host you are developing on(with activated venv) and not in the container with Nextcloud!"
9+
@echo " "
10+
@echo " build-push build image and upload to ghcr.io"
11+
@echo " "
12+
@echo " run28 install Visionatrix for Nextcloud 28"
13+
@echo " run29 install Visionatrix for Nextcloud 29"
14+
@echo " run install Visionatrix for Nextcloud Last"
15+
@echo " "
16+
@echo " For development of this example use PyCharm run configurations. Development is always set for last Nextcloud."
17+
@echo " First run 'UiExample' and then 'make registerXX', after that you can use/debug/develop it and easy test."
18+
@echo " "
19+
@echo " register28 perform registration of running Visionatrix into the 'manual_install' deploy daemon."
20+
@echo " register29 perform registration of running Visionatrix into the 'manual_install' deploy daemon."
21+
@echo " register perform registration of running Visionatrix into the 'manual_install' deploy daemon."
22+
@echo " "
23+
@echo " L10N (for manual translation):"
24+
@echo " translation_templates extract translation strings from sources"
25+
@echo " convert_translations_nc convert translations to Nextcloud format files (json, js)"
26+
@echo " convert_to_locale copy translations to the common locale/<lang>/LC_MESSAGES/<appid>.(po|mo)"
27+
28+
.PHONY: build-push
29+
build-push:
30+
docker login ghcr.io
31+
docker buildx build --push --platform linux/arm64/v8,linux/amd64 --tag ghcr.io/cloud-py-api/vix:latest .
32+
33+
.PHONY: run28
34+
run28:
35+
docker exec master-stable28-1 sudo -u www-data php occ app_api:app:unregister vix --silent --force || true
36+
docker exec master-stable28-1 sudo -u www-data php occ app_api:app:register vix --force-scopes \
37+
--info-xml https://raw.githubusercontent.com/cloud-py-api/vix/main/appinfo/info.xml
38+
39+
.PHONY: run29
40+
run29:
41+
docker exec master-stable29-1 sudo -u www-data php occ app_api:app:unregister vix --silent --force || true
42+
docker exec master-stable29-1 sudo -u www-data php occ app_api:app:register vix --force-scopes \
43+
--info-xml https://raw.githubusercontent.com/cloud-py-api/vix/main/appinfo/info.xml
44+
45+
.PHONY: run
46+
run:
47+
docker exec master-nextcloud-1 sudo -u www-data php occ app_api:app:unregister vix --silent --force || true
48+
docker exec master-nextcloud-1 sudo -u www-data php occ app_api:app:register vix --force-scopes \
49+
--info-xml https://raw.githubusercontent.com/cloud-py-api/vix/main/appinfo/info.xml
50+
51+
.PHONY: register28
52+
register28:
53+
docker exec master-stable28-1 sudo -u www-data php occ app_api:app:unregister vix --silent --force || true
54+
docker exec master-stable28-1 rm -rf /tmp/vix_l10n && docker cp l10n master-stable28-1:/tmp/vix_l10n
55+
docker exec master-stable28-1 sudo -u www-data php occ app_api:app:register vix manual_install --json-info \
56+
"{\"id\":\"vix\",\"name\":\"Visionatrix\",\"daemon_config_name\":\"manual_install\",\"version\":\"1.0.0\",\"secret\":\"12345\",\"port\":9045,\"scopes\":[\"OCC_COMMAND\", \"NOTIFICATIONS\"],\"system_app\":0, \"translations_folder\":\"\/tmp\/vix_l10n\"}" \
57+
--force-scopes --wait-finish
58+
59+
.PHONY: register29
60+
register29:
61+
docker exec master-stable29-1 sudo -u www-data php occ app_api:app:unregister vix --silent --force || true
62+
docker exec master-stable29-1 rm -rf /tmp/vix_l10n && docker cp l10n master-stable29-1:/tmp/vix_l10n
63+
docker exec master-stable29-1 sudo -u www-data php occ app_api:app:register vix manual_install --json-info \
64+
"{\"id\":\"vix\",\"name\":\"Visionatrix\",\"daemon_config_name\":\"manual_install\",\"version\":\"1.0.0\",\"secret\":\"12345\",\"port\":9045,\"scopes\":[\"OCC_COMMAND\", \"NOTIFICATIONS\"],\"system_app\":0, \"translations_folder\":\"\/tmp\/vix_l10n\"}" \
65+
--force-scopes --wait-finish
66+
67+
.PHONY: register
68+
register:
69+
docker exec master-nextcloud-1 sudo -u www-data php occ app_api:app:unregister vix --silent --force || true
70+
docker exec master-nextcloud-1 rm -rf /tmp/vix_l10n && docker cp l10n master-nextcloud-1:/tmp/vix_l10n
71+
docker exec master-nextcloud-1 sudo -u www-data php occ app_api:app:register vix manual_install --json-info \
72+
"{\"id\":\"vix\",\"name\":\"Visionatrix\",\"daemon_config_name\":\"manual_install\",\"version\":\"1.0.0\",\"secret\":\"12345\",\"port\":9045,\"scopes\":[\"OCC_COMMAND\", \"NOTIFICATIONS\"],\"system_app\":0, \"translations_folder\":\"\/tmp\/vix_l10n\"}" \
73+
--force-scopes --wait-finish
74+
75+
.PHONY: translation_templates
76+
translation_templates:
77+
./translationtool.phar create-pot-files
78+
79+
.PHONY: convert_translations_nc
80+
convert_translations_nc:
81+
./translationtool.phar convert-po-files
82+
83+
.PHONY: convert_to_locale
84+
convert_to_locale:
85+
./scripts/convert_to_locale.sh

appinfo/info.xml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?xml version="1.0"?>
2+
<info>
3+
<id>vix</id>
4+
<name>Visionatrix</name>
5+
<summary>Visionatrix service in your Nextcloud</summary>
6+
<description>
7+
<![CDATA[AI Media processing using ComfyUI]]>
8+
</description>
9+
<version>1.0.0</version>
10+
<licence>MIT</licence>
11+
<author mail="[email protected]" homepage="https://github.com/andrey18106">Andrey Borysenko</author>
12+
<author mail="[email protected]" homepage="https://github.com/bigcat88">Alexander Piskun</author>
13+
<namespace>Vix</namespace>
14+
<category>tools</category>
15+
<website>https://github.com/cloud-py-api/vix</website>
16+
<bugs>https://github.com/cloud-py-api/vix/issues</bugs>
17+
<repository type="git">https://github.com/cloud-py-api/vix</repository>
18+
<dependencies>
19+
<nextcloud min-version="28" max-version="30"/>
20+
</dependencies>
21+
<external-app>
22+
<docker-install>
23+
<registry>ghcr.io</registry>
24+
<image>cloud-py-api/vix</image>
25+
<image-tag>1.0.0</image-tag>
26+
</docker-install>
27+
<scopes>
28+
<value>OCC_COMMAND</value>
29+
<value>NOTIFICATIONS</value>
30+
</scopes>
31+
<system>false</system>
32+
</external-app>
33+
</info>

babel.config.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
const babelConfig = require('@nextcloud/babel-config')
2+
3+
module.exports = babelConfig

img/app-dark.svg

+1
Loading

img/app.svg

+1
Loading

krankerl.toml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[package]
2+
before_cmds = [
3+
"npm install --deps",
4+
"npm run build",
5+
]

l10n/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)