Skip to content

Commit

Permalink
Merge branch 'main' into feature/update_deps
Browse files Browse the repository at this point in the history
Conflicts:
	project.json
  • Loading branch information
sveneberth committed Jan 30, 2025
2 parents e4119c5 + bd1be79 commit a53fd77
Show file tree
Hide file tree
Showing 14 changed files with 113 additions and 586 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
*.pyc
*.log
*.bak
*.bat

.venv
.idea
Expand Down
7 changes: 2 additions & 5 deletions deploy/.gcloudignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# $ gcloud topic gcloudignore
#
.gcloudignore

# If you would like to upload your .git directory, .gitignore file or files
# from your .gitignore file, remove the corresponding line
# below:
Expand All @@ -15,12 +16,8 @@

# Python pycache:
__pycache__/

# Ignored by the build system
/setup.cfg

node_modules/
/viur/docs/
/viur/CHANGELOG.md
/viur/LICENSE
/viur/README.md
/viur/.readthedocs.yml
9 changes: 4 additions & 5 deletions deploy/html/example_list.html → deploy/html/empty_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ <h1 class="headline">View {{ moduleName() }}</h1>
{% for skel in skellist %}
<div>{{ skel["name"] }}</div>
{% if skel["image"] %}
<div>
<img src="{{ downloadUrlFor(skel["image"]["dest"], derived="thumbnail-w500.webp") }}">
</div>
{% endif %}
<div>
<img src="{{ downloadUrlFor(skel["image"]["dest"], derived="thumbnail-w500.webp") }}">
</div>
{% endif %}
{% endfor %}

{% endblock %}
61 changes: 45 additions & 16 deletions deploy/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class ProjectConfig(ConfigType):
# {"width": 1920},
# {"width": 1280},
# {"width": 900},
# {"width": 500}
# {"width": 500},
# ]
# }

Expand All @@ -71,8 +71,6 @@ class ProjectConfig(ConfigType):

conf.valid_application_ids = list(conf.project.appnames.keys())

# Client-ID for OAuth with google
# conf.user.google_client_id = ""

# ------------------------------------------------------------------------------
# Debugging & Performance
Expand All @@ -95,6 +93,23 @@ class ProjectConfig(ConfigType):
# render old-style tuple-list in SelectBone's values structure
conf.compatibility.remove("bone.select.structure.values.keytuple")

# ------------------------------------------------------------------------------
# User module
#

# Client-ID for OAuth with Google Account
# conf.user.google_client_id = ""
# conf.user.google_gsuite_domains = ["example.com"]

# User roles
#
# conf.user.roles = {
# "custom": "Custom setting",
# "admin": "Administrator",
# "backoffice": "Back office worker",
# "salesforce": "Sales force worker",
# }

# ------------------------------------------------------------------------------
# File module
#
Expand Down Expand Up @@ -137,11 +152,13 @@ class ProjectConfig(ConfigType):
# Email configuration
#

conf.email.sendinblue_api_key = "xkeysib-XXX" # better: use secret.get("sib-api-key")
conf.email.transport_class = email.EmailTransportSendInBlue
conf.email.send_from_local_development_server = True # enable sending emails from local development server
# conf.email.transport_class = email.EmailTransportMailjet(
# api_key=secret.get("mailjet-api-key"),
# secret_key=secret.get("mailjet-api-secret"),
# )
# conf.email.send_from_local_development_server = True # enable sending emails from local development server
# conf.email.sender_override = "mail@viur.dev"
# conf.email.recipient_override = ["mail@viur.dev"] # send all emails to this recipient
# conf.email.recipient_override = "mail@viur.dev" # send all emails to this recipient

# ------------------------------------------------------------------------------
# Content Security Policy (CSP)
Expand Down Expand Up @@ -206,23 +223,35 @@ class ProjectConfig(ConfigType):
# conf.request_preprocessor = maintenance_mode

# ------------------------------------------------------------------------------
# VueJS development
# CORS configuration for VueJS development
#

# if conf.instance.is_dev_server:
# def vuejs_cors_allow_all(path):
# current.request.get().response.headers["Access-Control-Allow-Origin"] = "http://localhost:8081"
# current.request.get().response.headers["Access-Control-Allow-Credentials"] = "true"
# return path
# import re
#
# conf.security.cors_max_age = datetime.timedelta(seconds=30)
# conf.security.cors_allow_credentials = True
# conf.security.cors_origins = "*"
# conf.security.cors_origins = [
# # "*",
# # "http://localhost:8080",
# # "http://localhost:9090",
# # Allows any localhost port:
# re.compile(r"^(http://localhost:(\d{4,5}))/?$", flags=re.IGNORECASE),
# ]
# # conf.security.cors_origins_use_wildcard = True
#
# conf.request_preprocessor = vuejs_cors_allow_all
# # Allows the header "X-Requested-With" and "X-ViUR-*"
# conf.security.cors_allow_headers = [
# "X-Requested-With",
# re.compile(r"^X-ViUR-.*$", flags=re.IGNORECASE),
# ]

# ------------------------------------------------------------------------------
# Server startup
#

import modules
import render
import modules # noqa
import render # noqa

# core.setDefaultLanguage("de")
app = setup(modules, render)
12 changes: 12 additions & 0 deletions deploy/modules/empty.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from viur.core.prototypes import List


class Empty(List):
listTemplate = "empty_list"

def listFilter(self, query):
return query # This content is public!


Empty.html = True # enable for HTML-rendering
Empty.json = True # enable for JSON-rendering
2 changes: 1 addition & 1 deletion deploy/modules/file.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from viur.core import i18n, db, current
from viur.core import i18n, current
from viur.core.modules.file import File


Expand Down
9 changes: 9 additions & 0 deletions deploy/skeletons/empty.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from viur.core.bones import *
from viur.core.skeleton import Skeleton


class EmptySkel(Skeleton):
name = StringBone(
descr="Name",
required=True,
)
20 changes: 9 additions & 11 deletions deploy/skeletons/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,45 +7,43 @@ class ExampleSkel(Skeleton):
# Defaults
name = StringBone(
descr="Name",
required=True
required=True,
)

sortindex = NumericBone(
descr="Sort index",
indexed=True,
required=True
sortindex = SortIndexBone(
required=True,
)

image = FileBone(
descr="Image",
derive=conf["derives"]
# derive=conf.project.standard_derives,
)

# SEO
seo_title = StringBone(
descr="SEO Title",
params={
"category": "SEO"
}
"category": "SEO",
},
)

seo_description = StringBone(
descr="SEO Description",
params={
"category": "SEO"
}
},
)

seo_keywords = StringBone(
descr="SEO Keywords",
params={
"category": "SEO"
}
},
)

seo_image = FileBone(
descr="SEO Preview Image",
params={
"category": "SEO"
}
},
)
25 changes: 0 additions & 25 deletions deploy/vi_plugins/__init__.py

This file was deleted.

3 changes: 0 additions & 3 deletions deploy/vi_plugins/files.json

This file was deleted.

5 changes: 0 additions & 5 deletions resources/allbones/README.md

This file was deleted.

Loading

0 comments on commit a53fd77

Please sign in to comment.