Compare commits
2 Commits
master
...
minetestch
Author | SHA1 | Date |
---|---|---|
Rampoina | ebdaa9d84d | |
Armen | e4dcb89d2e |
|
@ -27,7 +27,6 @@ from sqlalchemy import or_, and_
|
|||
from app.logic.game_support import GameSupportResolver
|
||||
from app.models import PackageRelease, db, Package, PackageState, PackageScreenshot, MetaPackage, User, \
|
||||
NotificationType, PackageUpdateConfig, License, UserRank, PackageType, PackageGameSupport
|
||||
from app.tasks.emails import send_pending_digests
|
||||
from app.tasks.forumtasks import importTopicList, checkAllForumAccounts
|
||||
from app.tasks.importtasks import importRepoScreenshot, checkZipRelease, check_for_updates
|
||||
from app.utils import addNotification, get_system_user
|
||||
|
@ -331,8 +330,3 @@ def detect_game_support():
|
|||
resolver = GameSupportResolver()
|
||||
resolver.update_all()
|
||||
db.session.commit()
|
||||
|
||||
|
||||
@action("Send pending notif digests")
|
||||
def do_send_pending_digests():
|
||||
send_pending_digests.delay()
|
||||
|
|
|
@ -78,8 +78,6 @@ def postReleaseCheckUpdate(self, release: PackageRelease, path):
|
|||
tree = build_tree(path, expected_type=ContentType[release.package.type.name],
|
||||
author=release.package.author.username, name=release.package.name)
|
||||
|
||||
if tree.name is not None and release.package.name != tree.name and tree.type == ContentType.MOD:
|
||||
raise MinetestCheckError(f"Expected {tree.relative} to have technical name {release.package.name}, instead has name {tree.name}")
|
||||
|
||||
cache = {}
|
||||
def getMetaPackages(names):
|
||||
|
@ -103,11 +101,6 @@ def postReleaseCheckUpdate(self, release: PackageRelease, path):
|
|||
depends.discard(mod)
|
||||
optional_depends.discard(mod)
|
||||
|
||||
# Raise error on unresolved game dependencies
|
||||
if package.type == PackageType.GAME and len(depends) > 0:
|
||||
deps = ", ".join(depends)
|
||||
raise MinetestCheckError("Game has unresolved hard dependencies: " + deps)
|
||||
|
||||
# Add dependencies
|
||||
for meta in getMetaPackages(depends):
|
||||
db.session.add(Dependency(package, meta=meta, optional=False))
|
||||
|
|
|
@ -22,18 +22,6 @@ class ContentType(Enum):
|
|||
"""
|
||||
assert other
|
||||
|
||||
if self == ContentType.MOD:
|
||||
if not other.isModLike():
|
||||
raise MinetestCheckError("Expected a mod or modpack, found " + other.value)
|
||||
|
||||
elif self == ContentType.TXP:
|
||||
if other != ContentType.UNKNOWN and other != ContentType.TXP:
|
||||
raise MinetestCheckError("expected a " + self.value + ", found a " + other.value)
|
||||
|
||||
elif other != self:
|
||||
raise MinetestCheckError("Expected a " + self.value + ", found a " + other.value)
|
||||
|
||||
|
||||
from .tree import PackageTreeNode, get_base_dir
|
||||
|
||||
def build_tree(path, expected_type=None, author=None, repo=None, name=None):
|
||||
|
|
|
@ -53,13 +53,7 @@ class PackageTreeNode:
|
|||
self.read_meta()
|
||||
|
||||
if self.type == ContentType.GAME:
|
||||
if not os.path.isdir(baseDir + "/mods"):
|
||||
raise MinetestCheckError("Game at {} does not have a mods/ folder".format(self.relative))
|
||||
self.add_children_from_mod_dir("mods")
|
||||
elif self.type == ContentType.MOD:
|
||||
if self.name and not basenamePattern.match(self.name):
|
||||
raise MinetestCheckError("Invalid base name for mod {} at {}, names must only contain a-z0-9_." \
|
||||
.format(self.name, self.relative))
|
||||
elif self.type == ContentType.MODPACK:
|
||||
self.add_children_from_mod_dir(None)
|
||||
|
||||
|
@ -94,14 +88,7 @@ class PackageTreeNode:
|
|||
conf = parse_conf(myfile.read())
|
||||
for key, value in conf.items():
|
||||
result[key] = value
|
||||
except SyntaxError as e:
|
||||
raise MinetestCheckError("Error while reading {}: {}".format(meta_file_rel , e.msg))
|
||||
except IOError:
|
||||
pass
|
||||
|
||||
if "release" in result:
|
||||
raise MinetestCheckError("{} should not contain 'release' key, as this is for use by ContentDB only.".format(meta_file_rel))
|
||||
|
||||
except IOError: pass
|
||||
|
||||
# description.txt
|
||||
if not "description" in result:
|
||||
|
@ -139,16 +126,7 @@ class PackageTreeNode:
|
|||
result["optional_depends"] = []
|
||||
|
||||
|
||||
def checkDependencies(deps):
|
||||
for dep in deps:
|
||||
if not basenamePattern.match(dep):
|
||||
if " " in dep:
|
||||
raise MinetestCheckError("Invalid dependency name '{}' for mod at {}, did you forget a comma?" \
|
||||
.format(dep, self.relative))
|
||||
else:
|
||||
raise MinetestCheckError(
|
||||
"Invalid dependency name '{}' for mod at {}, names must only contain a-z0-9_." \
|
||||
.format(dep, self.relative))
|
||||
def checkDependencies(deps): pass
|
||||
|
||||
# Check dependencies
|
||||
checkDependencies(result["depends"])
|
||||
|
@ -187,12 +165,6 @@ class PackageTreeNode:
|
|||
path = os.path.join(dir, entry)
|
||||
if not entry.startswith('.') and os.path.isdir(path):
|
||||
child = PackageTreeNode(path, relative + entry + "/", name=entry)
|
||||
if not child.type.isModLike():
|
||||
raise MinetestCheckError("Expecting mod or modpack, found {} at {} inside {}" \
|
||||
.format(child.type.value, child.relative, self.type.value))
|
||||
|
||||
if child.name is None:
|
||||
raise MinetestCheckError("Missing base name for mod at {}".format(self.relative))
|
||||
|
||||
self.children.append(child)
|
||||
|
||||
|
|
|
@ -17,23 +17,20 @@
|
|||
</ul>
|
||||
{% endfor %}
|
||||
|
||||
{% set other_notifications = notifications | selectattr("package", "none") %}
|
||||
|
||||
{% if other_notifications %}
|
||||
{% for group in notifications | selectattr("package", "none") %}
|
||||
<h2>
|
||||
{{ _("Other Notifications") }}
|
||||
</h2>
|
||||
|
||||
<ul>
|
||||
{% for notification in other_notifications %}
|
||||
{% for notification in group %}
|
||||
<li>
|
||||
<a href="{{ notification.url | abs_url }}">{{ notification.title }}</a> -
|
||||
{{ _("from %(username)s.", username=notification.causer.username) }}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
||||
{% endfor %}
|
||||
<p style="margin-top: 3em;">
|
||||
<a class="btn" href="{{ abs_url_for('notifications.list_all') }}">
|
||||
{{ _("View Notifications") }}
|
||||
|
|
|
@ -0,0 +1,68 @@
|
|||
version: '3'
|
||||
|
||||
|
||||
services:
|
||||
db:
|
||||
image: "postgres:14.1"
|
||||
volumes:
|
||||
- "./data/db:/var/lib/postgresql/data"
|
||||
environment: &env
|
||||
- POSTGRES_USER=contentdb
|
||||
- POSTGRES_PASSWORD=password
|
||||
- POSTGRES_DB=contentdb
|
||||
- FLASK_DEBUG=1
|
||||
- FLASK_CONFIG=../config.cfg
|
||||
adminer:
|
||||
image: adminer
|
||||
restart: always
|
||||
environment:
|
||||
- ADMINER_DEFAULT_SERVER=db
|
||||
- ADMINER_DESIGN=pepa-linha
|
||||
ports:
|
||||
- 8081:8080
|
||||
|
||||
redis:
|
||||
image: 'redis:6.2-alpine'
|
||||
command: redis-server
|
||||
volumes:
|
||||
- './data/redis:/data'
|
||||
|
||||
app:
|
||||
build: .
|
||||
container_name: contentdb_app_1
|
||||
command: ./utils/entrypoint.sh
|
||||
environment: *env
|
||||
ports:
|
||||
- 5123:5123
|
||||
volumes:
|
||||
- "./data/uploads:/var/cdb/uploads"
|
||||
- "./app:/source/app"
|
||||
- "./migrations:/source/migrations"
|
||||
depends_on:
|
||||
- db
|
||||
- redis
|
||||
|
||||
worker:
|
||||
build: .
|
||||
command: celery -A app.tasks.celery worker --concurrency 1
|
||||
environment: *env
|
||||
volumes:
|
||||
- "./data/uploads:/var/cdb/uploads"
|
||||
- "./app:/home/cdb/app"
|
||||
depends_on:
|
||||
- redis
|
||||
|
||||
beat:
|
||||
build: .
|
||||
command: celery -A app.tasks.celery beat
|
||||
environment: *env
|
||||
depends_on:
|
||||
- redis
|
||||
|
||||
exporter:
|
||||
image: ovalmoney/celery-exporter
|
||||
environment: *env
|
||||
ports:
|
||||
- 5125:9540
|
||||
depends_on:
|
||||
- redis
|
|
@ -1,11 +1,17 @@
|
|||
version: '3'
|
||||
|
||||
|
||||
services:
|
||||
db:
|
||||
image: "postgres:14.1"
|
||||
volumes:
|
||||
- "./data/db:/var/lib/postgresql/data"
|
||||
env_file:
|
||||
- config.env
|
||||
environment: &env
|
||||
- POSTGRES_USER=contentdb
|
||||
- POSTGRES_PASSWORD=password
|
||||
- POSTGRES_DB=contentdb
|
||||
- FLASK_DEBUG=0
|
||||
- FLASK_CONFIG=../config.cfg
|
||||
|
||||
redis:
|
||||
image: 'redis:6.2-alpine'
|
||||
|
@ -15,9 +21,9 @@ services:
|
|||
|
||||
app:
|
||||
build: .
|
||||
container_name: contentdb_app_1
|
||||
command: ./utils/entrypoint.sh
|
||||
env_file:
|
||||
- config.env
|
||||
environment: *env
|
||||
ports:
|
||||
- 5123:5123
|
||||
volumes:
|
||||
|
@ -31,10 +37,7 @@ services:
|
|||
worker:
|
||||
build: .
|
||||
command: celery -A app.tasks.celery worker --concurrency 1
|
||||
env_file:
|
||||
- config.env
|
||||
environment:
|
||||
- FLASK_CONFIG=../config.cfg
|
||||
environment: *env
|
||||
volumes:
|
||||
- "./data/uploads:/var/cdb/uploads"
|
||||
- "./app:/home/cdb/app"
|
||||
|
@ -44,17 +47,13 @@ services:
|
|||
beat:
|
||||
build: .
|
||||
command: celery -A app.tasks.celery beat
|
||||
env_file:
|
||||
- config.env
|
||||
environment:
|
||||
- FLASK_CONFIG=../config.cfg
|
||||
environment: *env
|
||||
depends_on:
|
||||
- redis
|
||||
|
||||
exporter:
|
||||
image: ovalmoney/celery-exporter
|
||||
env_file:
|
||||
- config.env
|
||||
environment: *env
|
||||
ports:
|
||||
- 5125:9540
|
||||
depends_on:
|
||||
|
|
Loading…
Reference in New Issue