Skip to content

Commit

Permalink
Merge branch 'b_1_5_2' into 2284-bugfix
Browse files Browse the repository at this point in the history
Signed-off-by: Mauro MSL <[email protected]>
  • Loading branch information
mauromsl authored Mar 12, 2024
2 parents 21c5c14 + 5400054 commit 157fe9e
Show file tree
Hide file tree
Showing 1,436 changed files with 125,753 additions and 53,263 deletions.
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ about: Create a report to help us improve
title: ''
labels: bug
assignees: ''

---

**Describe the bug**
Expand Down
14 changes: 14 additions & 0 deletions .github/ISSUE_TEMPLATE/documentation_update.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: Documentation update
about: Suggest an update to Janeway Documentation
title: ''
labels: documentation
assignees: ''

---

**Describe the area of the documentation you would like updated/added.**
A clear and concise description of what the problem is. Ex. xyz is missing from the documentation

**Additional context**
Add any other context or screenshots about the request here.
40 changes: 27 additions & 13 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,13 @@ src/core/settings.py
/src/files/import_cache
/src/files/data_backup
/src/files/xsl
/src/files/preprints
/src/files/repos
/src/media/django-summernote
/src/media/*
/src/collected-static

/src/files/robots/**
/src/files/sitemaps/**
mydatabase
node_modules/
src/plugins/*
Expand All @@ -86,22 +89,15 @@ src/media/profile_images/*
*.swp
.vim/

# gulp
/src/static/OLH/*

src/urls\.txt

src/files/styling/
src/static/OLH
src/utils/management/commands/import_news\.py
src/core/settings/
src/utils/management/commands/redirects\.py
.vscode/**
src/static/mater
ial/
src/texture/**
/src/static/material/**
/src/static/admin/hypothesis/**

*.ipynb

Expand All @@ -112,8 +108,8 @@ janeway\.sublime-workspace
terminal\.glue

src/core/management/commands

src/core/management/__init__\.py
src/utils/management/commands/test_command.py

src/auth\.json

Expand All @@ -123,11 +119,29 @@ src/.DS_Store
.DS_Store

src/static/superhero/

src/themes/clean

src/themes/superhero

# Lando
dockerfiles/lando_local.env
local.env
.lando.local.yml
dockerfiles/lando_local.env

src/utils/management/commands/test_command.py

# Emacs backup files
*~

# docker env
\.env

# Themes and subthemes
/src/themes/*
!/src/themes/clean/
!/src/themes/material/
!/src/themes/OLH/

# Static files
/src/static/*
!/src/static/common/
!/src/static/admin/
/src/static/admin/hypothesis/**
17 changes: 15 additions & 2 deletions .lando.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ env_file:

services:
appserver:
type: python:3.5.9
type: python:3.6
command: python /app/src/manage.py runserver 0.0.0.0:8000 -v 3
build_as_root:
- grep '^deb ' /etc/apt/sources.list | perl -pe 's/deb /deb-src /' >> /etc/apt/sources.list
Expand Down Expand Up @@ -36,9 +36,22 @@ tooling:
python:
service: appserver
cmd: python
dir: /app/src
pip:
service: appserver
description: run pip commands to manage Python package installation in this environment
cmd: pip
dir: /app/src
manage:
service: appserver
cmd: cd /app/src && python manage.py
cmd: python manage.py
dir: /app/src
restart-runserver:
service: appserver
description: Quickly restarts the Django runserver process, follows logs, and enables interactive debugging
cmd: killall python || python /app/src/manage.py runserver 0.0.0.0:8000 -v 3
dir: /app/src
user: root
psql:
service: db
cmd: psql -U postgres
Expand Down
11 changes: 10 additions & 1 deletion .update.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
#!/usr/bin/env bash
set -euo pipefail

# This command will run an update on Janeway.

pip3 install -r requirements.txt
python3 src/manage.py backup
python3 src/manage.py migrate
python3 src/manage.py build_assets
python3 src/manage.py collectstatic --no-input
DJANGO_SETTINGS_MODULE=1 python3 src/manage.py compilemessages
python3 src/manage.py load_default_settings
python3 src/manage.py update_repository_settings
python3 src/manage.py install_plugins
python3 src/manage.py update_translation_fields
python3 src/manage.py clear_cache
python3 src/manage.py install_cron
python3 src/manage.py populate_history cms.Page comms.NewsItem repository.Repository

echo "REMINDER: don't forget to restart your webserver!"
exit 0
40 changes: 39 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ endif
# Exposed ports
JANEWAY_PORT ?= 8000
PGADMIN_PORT ?= 8001
SNAKEVIZ_PORT ?= 8002

unexport NO_DEPS
DB_NAME ?= janeway
Expand Down Expand Up @@ -45,6 +46,15 @@ ifdef VERBOSE
_VERBOSE=--verbose
endif

# Email
ifdef DEBUG_SMTP
JANEWAY_EMAIL_BACKEND=django.core.mail.backends.smtp.EmailBackend
JANEWAY_EMAIL_HOST=janeway-debug-smtp
JANEWAY_EMAIL_PORT=1025
JANEWAY_EMAIL_USE_TLS=
endif
LOCALES_DIR = ./src/core/locales

export DB_VENDOR
export DB_HOST
export DB_PORT
Expand All @@ -53,10 +63,17 @@ export DB_USER
export DB_PASSWORD
export JANEWAY_PORT
export PGADMIN_PORT

export JANEWAY_EMAIL_BACKEND
export JANEWAY_EMAIL_HOST
export JANEWAY_EMAIL_PORT
export JANEWAY_EMAIL_USE_TLS

SUFFIX ?= $(shell date +%s)
SUFFIX := ${SUFFIX}
DATE := `date +"%y-%m-%d"`

.PHONY: janeway
all: help
run: janeway
help: ## Show this help.
Expand Down Expand Up @@ -96,5 +113,26 @@ uninstall: ## Removes all janeway related docker containers, docker images and d
@echo " Janeway has been uninstalled"
check: ## Runs janeway's test suit
bash -c "DB_VENDOR=sqlite make command CMD=test"
migrate: ## Runs Django's migrate command
bash -c "make command CMD=migrate"
makemigrations: ## Runs Django's makemigrations command
bash -c "make command CMD=makemigrations"
makemessages:
#$(foreach file, $(wildcard $(LOCALES_DIR)/*), make command CMD="makemessages --locale=$(file) --ignore=src/plugins/*";)
#@for f in $(shell ls ${LOCALES_DIR}); make command CMD='makemessages --locale=$${f} --ignore=src/plugins/*';)
bash -c "make command CMD='makemessages \
--locale=de \
--locale=cy \
--locale=fr \
--locale=it \
--locale=nl \
--locale=en-us \
--ignore=src/plugins/* \
'"

build_assets: ## Runs Janeway's build_assets command
bash -c "make command CMD=build_assets"
basebuild: ## Builds the base docker image
bash -c "docker build --no-cache -t janeway:`git rev-parse --abbrev-ref HEAD` ."
bash -c "docker build --no-cache -t birkbeckctp/janeway-base:latest -f dockerfiles/Dockerfile.base ."
snakeviz:
docker-compose run --publish $(SNAKEVIZ_PORT):$(SNAKEVIZ_PORT) $(NO_DEPS) --rm --entrypoint=snakeviz janeway-web $(FILE) --server -H 0.0.0.0 -p $(SNAKEVIZ_PORT)
38 changes: 28 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
![Janeway Logo](http://www.openlibhums.org/hosted_files/Janeway-Logo-05.png "Janeway")

Janeway is a journal platform designed for publishing scholarly research material. It is developed and maintained by the Centre for Technology and Publishing at Birkbeck, University of London.
Janeway is a web-based platform for publishing journals, preprints, conference proceedings, and books. It is developed and maintained by a team of developers at the Open Library of Humanities, part of Birkbeck, University of London.

# Technology
Janeway is written in Python (3.5+) and utilises the Django framework (1.11 LTS).
Janeway is written in Python (3.6+) and utilises the Django framework (3.2).


# Installation instructions
Developer installation [instructions are available in our documentation site](https://janeway.readthedocs.io/en/feature-documentation/installation.html#installation-guide).
Developer installation [instructions are available in our documentation site](https://janeway.readthedocs.io/en/latest/installation.html#installation-guide).

A guide for installing on the live environment with [apache and mod_wsgi](https://github.com/BirkbeckCTP/janeway/wiki/Janeway%2C-Apache-and-WSGI) is also available.

Expand All @@ -33,6 +33,21 @@ Uninstalling Janeway is as simple as running ``make uninstall`` which will delet

4. We will never accept commits of, or ourselves write, paywall features into Janeway.

# Current development

What are we working on right now? For a high-level view, check out our [public roadmap](https://github.com/orgs/BirkbeckCTP/projects/21).

You can get more detail by viewing our [project boards here on GitHub](https://github.com/orgs/BirkbeckCTP/projects). Open a project to see which issues it includes and what their status is. The status should be one of these:

- To Do -- we plan to do this and include it in this release
- In Progress -- someone is working on it at this very moment!
- PR Submitted -- this means one developer has come up with a solution and is waiting for feedback from others
- Done -- this means at least one other developer has approved the solution and it has been merged into the main codebase in preparation for the release

We aim to build releases in 8-week sprints, though some development cycles have taken quite a bit longer.

[More on how we develop Janeway](https://github.com/orgs/BirkbeckCTP/projects/21/views/1?pane=issue&itemId=18253226).

# Licensing
Janeway is available under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE (Version 3, 19 November 2007).

Expand All @@ -46,15 +61,18 @@ In order to more easily associate changes to their respective github issues, ple
# Contacts
If you wish to get in touch about Janeway, contact information is provided below.

Project Lead - Martin Paul Eve, martin.eve@bbk.ac.uk
Andy Byers, Senior Publishing Technologies Developer - a.byers@bbk.ac.uk

Lead Developer - Andy Byers, [email protected]
# Major Releases
Major releases are listed below. Between v1.3 & v1.4 there were a large number of minor releases. You can find more information on the [releases](https://github.com/BirkbeckCTP/janeway/releases) page.

# Releases
- v1.0 Kathryn released 10/08/17
- v1.1 Chakotay released 01/09/17
- v1.2 Tuvok released 06/11/17
- v1.3 Doctor released 10/08/18
| Version | Released | Code Name |
|---------|------------|-----------|
| v1.0 | 10/07/2017 | Kathryn |
| v1.1 | 01/09/2017 | Chakotay |
| v1.2 | 06/11/2017 | Tuvok |
| v1.3 | 10/08/2018 | Doctor |
| v1.4 | 25/10/2021 | Kes |

# Geolocation
Janeway includes GeoLite2 data created by MaxMind, available from [https://www.maxmind.com](https://www.maxmind.com)
3 changes: 3 additions & 0 deletions db/postgres-data/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*
*/
!.gitignore
4 changes: 4 additions & 0 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@ coverage
ipdb
python-wordpress-xmlrpc
Sphinx==1.8.2
marshmallow
freezegun
snakeviz
django-browser-reload
12 changes: 12 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ services:
image: dadarek/wait-for-dependencies
depends_on:
- "janeway-${DB_VENDOR}"
- janeway-debug-smtp
command: "janeway-${DB_VENDOR}:${DB_PORT}"

janeway-web:
Expand All @@ -82,8 +83,15 @@ services:
- PYTHONDONTWRITEBYTECODE=yes
- JANEWAY_SETTINGS_MODULE=core.dev_settings
- NOSE_INCLUDE_EXE=1
- JANEWAY_EMAIL_BACKEND
- JANEWAY_EMAIL_HOST
- JANEWAY_EMAIL_PORT
- JANEWAY_EMAIL_USE_TLS

depends_on:
- "start_dependencies"
cap_add:
- SYS_PTRACE

janeway-sqlite:
build:
Expand All @@ -92,3 +100,7 @@ services:
command: /bin/bash
volumes:
- ./db/janeway.sqlite:/var/lib/janeway.sqlite
janeway-debug-smtp:
# Use same python as janeway-web to reduce the number of images
image: python:3.8
entrypoint: python -u -m smtpd -c DebuggingServer -n 0.0.0.0:1025
1 change: 1 addition & 0 deletions dockerfiles/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ ADD . /vol/janeway
WORKDIR /vol/janeway
RUN apt-get update
RUN apt-get install -y pylint
RUN apt-get install -y gettext
RUN pip3 install -r requirements.txt --src /tmp/src
RUN pip3 install -r dev-requirements.txt --src /tmp/src
RUN if [ -n "$(ls -A ./lib)" ]; then pip3 install -e lib/*; fi
Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/Dockerfile.base
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.5
FROM python:3.10
ADD ./dockerfiles/janeway.sqlite3 /db/janeway.sqlite3
RUN curl https://raw.githubusercontent.com/BirkbeckCTP/janeway/master/requirements.txt > /tmp/requirements.txt
RUN pip3 install -r /tmp/requirements.txt
Expand Down
8 changes: 6 additions & 2 deletions docs/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
FROM python:3.8

ADD . /docs
RUN apt-get update && apt-get install -y -q python-sphinx texlive texlive-latex-extra pandoc build-essential
RUN mkdir /docs

ADD ./Makefile /docs/Makefile
ADD ./requirements.txt /docs/requirements.txt

RUN apt-get update && apt-get install -y -q sphinx-doc sphinx-common texlive texlive-latex-extra pandoc build-essential
RUN pip install -r /docs/requirements.txt

WORKDIR /docs
Expand Down
6 changes: 3 additions & 3 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ help:
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
rebuild:
@docker build . -t sphinx
docker-build:
@docker build . -t birkbeckctp/sphinx-rtd
docker:
@docker run --rm -ti -v ${PWD}:/docs sphinx
@docker run --rm -ti -v ${PWD}:/docs birkbeckctp/sphinx-rtd
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Python Sphinx project for building the Janeway documentation

## How to build the documentation

### Installing the depenencies
### Installing the dependencies
After installing the dependencies for Janeway, install the requirements described under `requirements.txt`
`pip install -r requirements.txt`

Expand Down
2 changes: 2 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
recommonmark
Sphinx==1.8.2
sphinx-rtd-theme
jinja2==2.11.3
markupsafe==2.0.1
Loading

0 comments on commit 157fe9e

Please sign in to comment.