-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
47 changed files
with
1,346 additions
and
627 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -136,3 +136,4 @@ lms/lmsweb/config.py | |
db.sqlite | ||
vim.session | ||
devops/rabbitmq.cookie | ||
our.db |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,34 @@ | ||
FROM python:3-buster | ||
FROM python:3.12 | ||
|
||
RUN apt update \ | ||
&& apt install -y --no-install-recommends docker.io vim unixodbc-dev \ | ||
&& apt clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
RUN apt-get update && apt-get install -y \ | ||
ca-certificates \ | ||
curl \ | ||
wget \ | ||
unzip \ | ||
&& install -m 0755 -d /etc/apt/keyrings \ | ||
&& curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc \ | ||
&& chmod a+r /etc/apt/keyrings/docker.asc \ | ||
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null \ | ||
&& apt-get update \ | ||
&& apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
COPY requirements.txt /tmp/requirements.txt | ||
RUN pip3 install -r /tmp/requirements.txt | ||
RUN pip3 install --no-cache-dir -r /tmp/requirements.txt | ||
|
||
# Install vnu (html/css validator) | ||
RUN wget https://github.com/validator/validator/releases/download/20.6.30/vnu.linux.zip && \ | ||
unzip vnu.linux.zip -d /opt/vnu/ && \ | ||
chmod +x /opt/vnu/vnu-runtime-image/bin/vnu | ||
ENV PATH=/opt/vnu/vnu-runtime-image/bin:$PATH | ||
RUN wget https://github.com/validator/validator/releases/download/20.6.30/vnu.linux.zip -O /tmp/vnu.linux.zip \ | ||
&& unzip /tmp/vnu.linux.zip -d /opt/vnu/ \ | ||
&& chmod +x /opt/vnu/vnu-runtime-image/bin/vnu \ | ||
&& rm /tmp/vnu.linux.zip | ||
|
||
RUN adduser --disabled-password --gecos '' app-user | ||
ENV PATH=/opt/vnu/vnu-runtime-image/bin:$PATH | ||
|
||
RUN mkdir -p /app_dir/lms | ||
RUN chown -R app-user:app-user /app_dir | ||
RUN adduser --disabled-password --gecos '' app-user \ | ||
&& mkdir -p /app_dir/lms \ | ||
&& chown -R app-user:app-user /app_dir | ||
|
||
# Note: we don't copy the code to container because we mount the code in different ways | ||
# on each setup | ||
WORKDIR /app_dir/lms | ||
ENV LOGURU_LEVEL INFO | ||
ENV PYTHONPATH /app_dir/:$PYTHONPATH | ||
ENV LOGURU_LEVEL=INFO | ||
ENV PYTHONPATH=/app_dir/:$PYTHONPATH | ||
# Note: Code is mounted at runtime, hence not copied. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
debugpy==1.4.3 | ||
ipdb==0.13.9 | ||
pytest-cov==2.12.1 | ||
pytest-env==0.6.2 | ||
debugpy==1.8.1 | ||
ipdb==0.13.13 | ||
pytest-cov==4.1.0 | ||
pytest-env==1.1.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -322,6 +322,22 @@ def _assessment_migration() -> bool: | |
return True | ||
|
||
|
||
def _linter_email_migration(): | ||
old_mail_address = '[email protected]' | ||
new_mail_address = '[email protected]' | ||
|
||
find_user = models.User.select().where | ||
mail_field = models.User.mail_address | ||
|
||
if find_user(mail_field == old_mail_address).exists(): | ||
user = find_user(mail_field == old_mail_address).get() | ||
user.mail_address = new_mail_address | ||
user.save() | ||
log.info(f'Changed {old_mail_address} to {new_mail_address} in User') | ||
else: | ||
log.info(f'{new_mail_address} already exists in User') | ||
|
||
|
||
def is_tables_exists(tables: Union[Model, Iterable[Model]]) -> bool: | ||
if not isinstance(tables, (tuple, list)): | ||
tables = (tables,) | ||
|
@@ -351,6 +367,7 @@ def main(): | |
_uuid_migration() | ||
|
||
_add_user_course_constaint() | ||
_linter_email_migration() | ||
|
||
models.create_basic_roles() | ||
if models.User.select().count() == 0: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
atomicwrites==1.4.0 | ||
attrs==19.3.0 | ||
importlib-metadata==1.6.0 | ||
more-itertools==8.2.0 | ||
packaging==20.3 | ||
pluggy==0.13.1 | ||
py==1.10.0 | ||
pyparsing==2.4.7 | ||
pytest==5.0.1 | ||
six==1.14.0 | ||
wcwidth==0.1.9 | ||
zipp==3.1.0 | ||
atomicwrites==1.4.1 | ||
attrs==23.2.0 | ||
importlib-metadata==7.0.1 | ||
more-itertools==10.2.0 | ||
packaging==23.2 | ||
pluggy==1.4.0 | ||
pyparsing==3.1.1 | ||
pytest==8.0.1 | ||
six==1.16.0 | ||
wcwidth==0.2.13 | ||
zipp==3.17.0 |
Oops, something went wrong.