You've already forked snikket-web-portal
Compare commits
15 Commits
feature/pi
...
feature/fl
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d5a46b69a6 | ||
|
|
aed9ad1cde | ||
|
|
b545c137b1 | ||
|
|
47642dc384 | ||
|
|
5d7183a0b8 | ||
|
|
c1cf6ab1e5 | ||
|
|
aee53a2e1a | ||
|
|
3a81a0140b | ||
|
|
5b4d4ddd36 | ||
|
|
28ff19c19c | ||
|
|
8e3837f704 | ||
|
|
98e7de3166 | ||
|
|
61c71b2145 | ||
|
|
6b35e9a259 | ||
|
|
58c2112fec |
2
.github/workflows/main.yaml
vendored
2
.github/workflows/main.yaml
vendored
@@ -45,7 +45,7 @@ jobs:
|
||||
- name: Install
|
||||
run: |
|
||||
set -euo pipefail
|
||||
pip install flake8
|
||||
pip install flake8 flake8-print
|
||||
- name: Linting
|
||||
run: |
|
||||
python -m flake8 snikket_web
|
||||
|
||||
55
Dockerfile
55
Dockerfile
@@ -1,7 +1,13 @@
|
||||
FROM debian:buster-slim
|
||||
FROM debian:bullseye-slim AS build
|
||||
|
||||
ARG BUILD_SERIES=dev
|
||||
ARG BUILD_ID=0
|
||||
RUN set -eu; \
|
||||
export DEBIAN_FRONTEND=noninteractive ; \
|
||||
apt-get update ; \
|
||||
apt-get install -y --no-install-recommends \
|
||||
python3 python3-pip python3-setuptools python3-wheel \
|
||||
libpython3-dev \
|
||||
make build-essential \
|
||||
netcat;
|
||||
|
||||
COPY requirements.txt /opt/snikket-web-portal/requirements.txt
|
||||
COPY build-requirements.txt /opt/snikket-web-portal/build-requirements.txt
|
||||
@@ -11,32 +17,41 @@ COPY babel.cfg /opt/snikket-web-portal/babel.cfg
|
||||
|
||||
WORKDIR /opt/snikket-web-portal
|
||||
|
||||
RUN set -eu; \
|
||||
export DEBIAN_FRONTEND=noninteractive ; \
|
||||
apt-get update ; \
|
||||
apt-get install -y --no-install-recommends \
|
||||
python3 python3-pip python3-setuptools python3-wheel \
|
||||
libpython3-dev \
|
||||
make build-essential \
|
||||
netcat \
|
||||
; \
|
||||
pip3 install -r requirements.txt; \
|
||||
RUN pip3 install -r requirements.txt; \
|
||||
pip3 install -r build-requirements.txt; \
|
||||
make; \
|
||||
pip3 uninstall -yr build-requirements.txt; \
|
||||
apt-get remove -y build-essential make libpython3-dev; \
|
||||
apt-get autoremove -y; \
|
||||
pip3 install hypercorn; \
|
||||
rm -rf /root/.cache; \
|
||||
apt-get clean ; rm -rf /var/lib/apt/lists
|
||||
make;
|
||||
|
||||
|
||||
FROM debian:bullseye-slim
|
||||
|
||||
ARG BUILD_SERIES=dev
|
||||
ARG BUILD_ID=0
|
||||
|
||||
COPY docker/env.py /etc/snikket-web-portal/env.py
|
||||
|
||||
ENV SNIKKET_WEB_PYENV=/etc/snikket-web-portal/env.py
|
||||
|
||||
ENV SNIKKET_WEB_PROSODY_ENDPOINT=http://127.0.0.1:5280/
|
||||
|
||||
HEALTHCHECK CMD nc -zv ${SNIKKET_TWEAK_PORTAL_INTERNAL_HTTP_INTERFACE:-127.0.0.1} ${SNIKKET_TWEAK_PORTAL_INTERNAL_HTTP_PORT:-5765}
|
||||
|
||||
RUN set -eu; \
|
||||
export DEBIAN_FRONTEND=noninteractive ; \
|
||||
apt-get update ; \
|
||||
apt-get install -y --no-install-recommends \
|
||||
python3 python3-pip python3-setuptools python3-wheel; \
|
||||
apt-get clean ; rm -rf /var/lib/apt/lists; \
|
||||
pip3 install hypercorn; \
|
||||
rm -rf /root/.cache;
|
||||
|
||||
WORKDIR /opt/snikket-web-portal
|
||||
|
||||
COPY requirements.txt /opt/snikket-web-portal/requirements.txt
|
||||
RUN pip3 install -r requirements.txt; rm -rf /root/.cache;
|
||||
|
||||
COPY --from=build /opt/snikket-web-portal/snikket_web/ /opt/snikket-web-portal/snikket_web
|
||||
COPY babel.cfg /opt/snikket-web-portal/babel.cfg
|
||||
|
||||
RUN echo "$BUILD_SERIES $BUILD_ID" > /opt/snikket-web-portal/.app_version
|
||||
|
||||
ADD docker/entrypoint.sh /entrypoint.sh
|
||||
|
||||
@@ -63,9 +63,6 @@ async def users() -> str:
|
||||
)
|
||||
|
||||
|
||||
_LIMITED_ROLE_NAME = _("Limited")
|
||||
|
||||
|
||||
class EditUserForm(BaseForm):
|
||||
localpart = wtforms.StringField(
|
||||
_l("Login name"),
|
||||
@@ -78,9 +75,7 @@ class EditUserForm(BaseForm):
|
||||
role = wtforms.RadioField(
|
||||
_l("Access Level"),
|
||||
choices=[
|
||||
# NOTE: enable this only after something has been done which
|
||||
# actually enforces the described restrictions :).
|
||||
# ("prosody:restricted", _LIMITED_ROLE_NAME),
|
||||
("prosody:restricted", _("Limited")),
|
||||
("prosody:normal", _l("Normal user")),
|
||||
("prosody:admin", _l("Administrator")),
|
||||
],
|
||||
@@ -547,8 +542,6 @@ async def edit_circle(id_: str) -> typing.Union[str, quart.Response]:
|
||||
)
|
||||
|
||||
return redirect(url_for(".edit_circle", id_=id_))
|
||||
else:
|
||||
print(form.errors)
|
||||
|
||||
return await render_template(
|
||||
"admin_edit_circle.html",
|
||||
|
||||
Binary file not shown.
@@ -6,18 +6,18 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PROJECT VERSION\n"
|
||||
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
|
||||
"Report-Msgid-Bugs-To: translations@snikket.org\n"
|
||||
"POT-Creation-Date: 2021-06-18 16:05+0200\n"
|
||||
"PO-Revision-Date: 2021-06-21 23:01+0000\n"
|
||||
"PO-Revision-Date: 2021-12-12 07:00+0000\n"
|
||||
"Last-Translator: uira <inboxriau@andriana.id>\n"
|
||||
"Language-Team: Indonesian <https://i18n.sotecware.net/projects/snikket/"
|
||||
"Language-Team: Indonesian <http://i18n.sotecware.net/projects/snikket/"
|
||||
"web-portal/id/>\n"
|
||||
"Language: id\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=1; plural=0;\n"
|
||||
"X-Generator: Weblate 4.5.1\n"
|
||||
"X-Generator: Weblate 4.8.1\n"
|
||||
"Generated-By: Babel 2.9.0\n"
|
||||
|
||||
#: snikket_web/admin.py:66
|
||||
@@ -980,7 +980,7 @@ msgstr "Perangkat terhubung"
|
||||
|
||||
#: snikket_web/templates/admin_system.html:82
|
||||
msgid "Broadcast message"
|
||||
msgstr "Siarkan pesan"
|
||||
msgstr "Sebarkan pesan"
|
||||
|
||||
#: snikket_web/templates/admin_system.html:84
|
||||
msgid ""
|
||||
|
||||
@@ -138,7 +138,6 @@ async def profile() -> typing.Union[str, quart.Response]:
|
||||
mimetype = file_info.mimetype
|
||||
data = file_info.stream.read()
|
||||
if len(data) > max_avatar_size:
|
||||
print(len(data), max_avatar_size)
|
||||
form.avatar.errors.append(EAVATARTOOBIG)
|
||||
ok = False
|
||||
elif len(data) > 0:
|
||||
|
||||
@@ -207,7 +207,7 @@ def make_avatar_metadata_set_request(
|
||||
item,
|
||||
"metadata", xmlns=NS_USER_AVATAR_METADATA)
|
||||
|
||||
attr: typing.MutableMapping[str, str] = {
|
||||
attr: typing.Dict[str, str] = {
|
||||
"id": id_,
|
||||
"bytes": str(size),
|
||||
"type": mimetype,
|
||||
@@ -217,7 +217,12 @@ def make_avatar_metadata_set_request(
|
||||
if height is not None:
|
||||
attr["height"] = str(height)
|
||||
|
||||
ET.SubElement(metadata_wrap, "info", xmlns=NS_USER_AVATAR_METADATA, **attr)
|
||||
ET.SubElement(
|
||||
metadata_wrap,
|
||||
"info",
|
||||
xmlns=NS_USER_AVATAR_METADATA,
|
||||
**attr, # type: ignore
|
||||
)
|
||||
return req
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user