Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature button change #28

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions .github/changepassword.exp
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#!/usr/bin/expect -f
#
# This Expect script was generated by autoexpect on Tue Aug 24 19:02:13 2021
# Expect and autoexpect were both written by Don Libes, NIST.
#
# Note that autoexpect does not guarantee a working script. It
# necessarily has to guess about certain things. Two reasons a script
# might fail are:
#
# 1) timing - A surprising number of programs (rn, ksh, zsh, telnet,
# etc.) and devices discard or ignore keystrokes that arrive "too
# quickly" after prompts. If you find your new script hanging up at
# one spot, try adding a short sleep just before the previous send.
# Setting "force_conservative" to 1 (see below) makes Expect do this
# automatically - pausing briefly before sending each character. This
# pacifies every program I know of. The -c flag makes the script do
# this in the first place. The -C flag allows you to define a
# character to toggle this mode off and on.

set force_conservative 0 ;# set to 1 to force conservative mode even if
;# script wasn't run conservatively originally
if {$force_conservative} {
set send_slow {1 .1}
proc send {ignore arg} {
sleep .1
exp_send -s -- $arg
}
}

#
# 2) differing output - Some programs produce different output each time
# they run. The "date" command is an obvious example. Another is
# ftp, if it produces throughput statistics at the end of a file
# transfer. If this causes a problem, delete these patterns or replace
# them with wildcards. An alternative is to use the -p flag (for
# "prompt") which makes Expect only look for the last line of output
# (i.e., the prompt). The -P flag allows you to define a character to
# toggle this mode off and on.
#
# Read the man page for more info.
#
# -Don


set timeout -1
spawn /opt/mayan-edms/bin/mayan-edms.py changepassword admin
match_max 100000
expect -exact "Changing password for user 'admin'\r
Password: "
send -- "cmu-313-mayan\r"
expect -exact "\r
Password (again): "
send -- "cmu-313-mayan\r"
expect eof

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@ docs/_templates/layout.html
docs/_templates/footer.html
gitlab-ci-volume/
.DS_Store
data/
5 changes: 4 additions & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
exiftool \
expect \
fonts-arphic-uming \
fonts-arphic-ukai \
fonts-unfonts-core \
Expand All @@ -49,6 +50,7 @@ apt-get update \
libmagic1 \
libmariadb3 \
libpq5 \
procps \
poppler-utils \
python3-distutils \
sane-utils \
Expand Down Expand Up @@ -124,6 +126,7 @@ apt-get install -y --no-install-recommends \
python3-dev \
python3-venv \
zlib1g-dev \
procps \
&& mkdir -p "${PROJECT_INSTALL_DIR}" \
&& chown -R mayan:mayan "${PROJECT_INSTALL_DIR}" \
&& chown -R mayan:mayan /src
Expand Down Expand Up @@ -156,7 +159,7 @@ RUN set -a \
&& pip install --no-cache-dir dist/mayan_edms-*.whl \
# Install the static content.
&& mayan-edms.py installdependencies \
&& MAYAN_STATIC_ROOT=${PROJECT_INSTALL_DIR}static mayan-edms.py preparestatic --link --noinput
&& MAYAN_STATIC_ROOT=${PROJECT_INSTALL_DIR}static mayan-edms.py preparestatic --noinput

COPY --chown=mayan:mayan requirements/testing-base.txt "${PROJECT_INSTALL_DIR}"

Expand Down
16 changes: 7 additions & 9 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ x-mayan-container:
# Enable to use RabbitMQ
# MAYAN_CELERY_BROKER_URL: amqp://${MAYAN_RABBITMQ_USER:-mayan}:${MAYAN_RABBITMQ_PASSWORD:-mayanrabbitpass}@rabbitmq:5672/${MAYAN_RABBITMQ_VHOST:-mayan}
# To use RabbitMQ as broker, disable Redis as broker
PYTHONDONTWRITEBYTECODE: 1
MAYAN_CELERY_BROKER_URL: redis://:${MAYAN_REDIS_PASSWORD:-mayanredispassword}@redis:6379/0
MAYAN_CELERY_RESULT_BACKEND: redis://:${MAYAN_REDIS_PASSWORD:-mayanredispassword}@redis:6379/1
MAYAN_DATABASES: "{'default':{'ENGINE':'django.db.backends.postgresql','NAME':'${MAYAN_DATABASE_NAME:-mayan}','PASSWORD':'${MAYAN_DATABASE_PASSWORD:-mayandbpass}','USER':'${MAYAN_DATABASE_USER:-mayan}','HOST':'${MAYAN_DATABASE_HOST:-postgresql}'}}"
Expand All @@ -20,12 +21,14 @@ x-mayan-container:
MAYAN_LOCK_MANAGER_BACKEND_ARGUMENTS: "{'redis_url':'redis://:${MAYAN_REDIS_PASSWORD:-mayanredispassword}@redis:6379/2'}"
# Replace with the line below when using RabbitMQ
# MAYAN_DOCKER_WAIT: "${MAYAN_DATABASE_HOST:-postgresql}:5432 redis:6379 rabbitmq:5672"
image: ${MAYAN_DOCKER_IMAGE_NAME:-mayanedms/mayanedms}:${MAYAN_DOCKER_IMAGE_TAG:-s4.0}
image: ${MAYAN_DOCKER_IMAGE_NAME:-mayanedms/mayanedms}:${MAYAN_DOCKER_IMAGE_TAG:-4.0.7}
networks:
- bridge
restart: unless-stopped
volumes:
- ${MAYAN_APP_VOLUME:-app}:/var/lib/mayan
- ${PWD}/data/app:/var/lib/mayan
- ${PWD}/mayan/apps/appearance/static/appearance/css:/opt/mayan-edms/static/appearance/css
- ${PWD}/mayan:/opt/mayan-edms/lib/python3.7/site-packages/mayan
# Optional volumes to access external data like staging or watch folders
# - /opt/staging_files:/staging_files
# - /opt/watch_folder:/watch_folder
Expand All @@ -37,11 +40,6 @@ networks:
services:
app:
<<: *mayan-container
labels:
- "traefik.enable=true"
- "traefik.http.routers.app.rule=Host(`www.example.com`)" # Replace this with your published URL
- "traefik.http.routers.mayan.rule=Host(`mayan.app`)"
- "traefik.http.routers.mayan.entrypoints=web"
ports:
- "80:8000"

Expand Down Expand Up @@ -72,7 +70,7 @@ services:
# - "5432:5432"
restart: unless-stopped
volumes:
- ${MAYAN_POSTGRES_VOLUME:-postgres}:/var/lib/postgresql/data
- ${PWD}/data/postgres:/var/lib/postgresql/data

redis:
command:
Expand All @@ -98,7 +96,7 @@ services:
- bridge
restart: unless-stopped
volumes:
- ${MAYAN_REDIS_VOLUME:-redis}:/data
- ${PWD}/data/redis:/data

# Celery flower a monitor for Celery
celery_flower:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

{% load common_tags %}

<button aria-expanded="false" aria-haspopup="true" class="{{ action_dropdown_classes|default:"btn btn-default btn-danger"}} btn-sm dropdown-toggle" data-toggle="dropdown" type="button">
<button style = "background-color:#1B1A1A;" aria-expanded="false" aria-haspopup="true" class="{{ action_dropdown_classes|default:"btn btn-default btn-danger"}} btn-sm dropdown-toggle" data-toggle="dropdown" type="button">
{% if action_dropdown_label %}
{{ action_dropdown_label }}
{% else %}
{% trans 'Actions' %}
{% trans 'Actions' %}git checkout -b new-feature
{% endif %}
<span class="caret"></span>
<span class="sr-only">{% trans 'Toggle Dropdown' %}</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ export MAYAN_BIN=/opt/mayan-edms/bin/mayan-edms.py
export MAYAN_INSTALL_DIR=/opt/mayan-edms
export MAYAN_PYTHON_BIN_DIR=/opt/mayan-edms/bin/
export MAYAN_MEDIA_ROOT=/var/lib/mayan
export MAYAN_SETTINGS_MODULE=${MAYAN_SETTINGS_MODULE:-mayan.settings.production}
export MAYAN_SETTINGS_MODULE=${MAYAN_SETTINGS_MODULE:-mayan.settings.development}

export PYTHONDONTWRITEBYTECODE=1

# Set DJANGO_SETTINGS_MODULE to MAYAN_SETTINGS_MODULE to avoid two
# different environments for the setting file.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[program:mayan-edms-gunicorn]
autorestart = false
autostart = true
command = /bin/bash -c "${MAYAN_GUNICORN_BIN} --workers ${MAYAN_GUNICORN_WORKERS} ${MAYAN_GUNICORN_TEMPORARY_DIRECTORY} mayan.wsgi --max-requests ${MAYAN_GUNICORN_MAX_REQUESTS} --max-requests-jitter ${MAYAN_GUNICORN_JITTER} --worker-class ${MAYAN_GUNICORN_WORKER_CLASS} --bind 0.0.0.0:8000 --env DJANGO_SETTINGS_MODULE=${MAYAN_SETTINGS_MODULE} --timeout ${MAYAN_GUNICORN_TIMEOUT} --limit-request-line ${MAYAN_GUNICORN_LIMIT_REQUEST_LINE}"
command = /bin/bash -c "${MAYAN_GUNICORN_BIN} --workers ${MAYAN_GUNICORN_WORKERS} ${MAYAN_GUNICORN_TEMPORARY_DIRECTORY} mayan.wsgi --max-requests ${MAYAN_GUNICORN_MAX_REQUESTS} --max-requests-jitter ${MAYAN_GUNICORN_JITTER} --worker-class ${MAYAN_GUNICORN_WORKER_CLASS} --bind 0.0.0.0:8000 --env DJANGO_SETTINGS_MODULE=${MAYAN_SETTINGS_MODULE} --timeout ${MAYAN_GUNICORN_TIMEOUT} --limit-request-line ${MAYAN_GUNICORN_LIMIT_REQUEST_LINE} --reload"
redirect_stderr = true
stderr_logfile = /dev/fd/2
stderr_logfile_maxbytes = 0
Expand Down
5 changes: 3 additions & 2 deletions mayan/apps/platform/templates/platform/supervisord.tmpl
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
[supervisord]
environment=
PYTHONPATH="{{ MEDIA_ROOT }}{{ USER_SETTINGS_FOLDER }}",
DJANGO_SETTINGS_MODULE=mayan.settings.production,
DJANGO_SETTINGS_MODULE=mayan.settings.development,
MAYAN_ALLOWED_HOSTS='["*"]',
MAYAN_MEDIA_ROOT="{{ MEDIA_ROOT }}"
PYTHONDONTWRITEBYTECODE=1

[program:mayan-edms-gunicorn]
autorestart = true
autostart = true
command = {{ INSTALLATION_PATH }}bin/gunicorn --workers {{ GUNICORN_WORKERS }} mayan.wsgi --max-requests {{ GUNICORN_MAX_REQUESTS }} --max-requests-jitter {{ GUNICORN_JITTER }} --worker-class {{ GUNICORN_WORKER_CLASS }} --bind 0.0.0.0:8000 --timeout {{ GUNICORN_TIMEOUT }} --limit-request-line {{ GUNICORN_LIMIT_REQUEST_LINE }}
command = {{ INSTALLATION_PATH }}bin/gunicorn --workers {{ GUNICORN_WORKERS }} mayan.wsgi --max-requests {{ GUNICORN_MAX_REQUESTS }} --max-requests-jitter {{ GUNICORN_JITTER }} --worker-class {{ GUNICORN_WORKER_CLASS }} --bind 0.0.0.0:8000 --timeout {{ GUNICORN_TIMEOUT }} --limit-request-line {{ GUNICORN_LIMIT_REQUEST_LINE }} --reload
user = mayan
{% for worker in workers %}
[program:mayan-edms-{{ worker.name }}]
Expand Down
2 changes: 1 addition & 1 deletion mayan/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@
'mayan.apps.views.finders.MayanAppDirectoriesFinder'
)

STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
STATICFILES_STORAGE = 'whitenoise.storage.StaticFilesStorage'

TEST_RUNNER = 'mayan.apps.testing.runner.MayanTestRunner'

Expand Down
2 changes: 1 addition & 1 deletion mayan/settings/testing/development.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .base import * # NOQA

DEBUG = False
DEBUG = True
SIGNATURES_GPG_PATH = '/usr/bin/gpg1'