Useful for setting up a repository of technical reports for a research group.
Credits to: https://github.com/VieVie31/podofo
Must be available on the dev/prod box.
- Python 3
- Pip
- SQLite 3
- Docker
- docker-compose
In Ubuntu 20.04: sudo apt install python3-pip sqlite3
(Download the release from the Releases section: https://github.com/srg-ics-uplb/srg-tr-searcher/releases)
tar xzvf srg-tr-searcher.tar.gz
cd srg-tr-searcher
pip install -r requirements.txt
export PATH=$PATH:$HOME/.local/bin
mkdir app/static/pdf
./reset.sh
Create a client_secret.json
with the following variables needed for
Google authentication
{
"web":
{
"client_id": "xxx",
"project_id":"xxx",
"auth_uri":"xxx",
"token_uri":"xxx",
"auth_provider_x509_cert_url":"xxx",
"client_secret":"xxx",
"redirect_uris":["http://localhost:5000/callback"]
}
}
Docker is the best way to deploy the app. This assumes that the remote docker host is configured for passwordless access.
- Set a strong username and password in
app/creds.py
- Disable upload by setting
app.config['ALLOW_UPLOAD'] = False
inapp/__init__.py
DOCKER_HOST="ssh://remote.docker.host" docker-compose down
DOCKER_HOST="ssh://remote.docker.host" docker-compose build
DOCKER_HOST="ssh://remote.docker.host" docker-compose up -d
- Get a shell:
DOCKER_HOST="ssh://remote.docker.host" docker-compose exec flask bash
- Download access log:
DOCKER_HOST="ssh://remote.docker.host" docker cp srg-tr-searcher:/usr/src/access.log access_for_stats.log
- Get some stats:
./stats.sh
Do the install for the new version. If there are no changes in the db schema,
copy the previous version's app/sql/users.db
, app/sql/pdf.db
, and app/static/pdf
to the new version
Contributions can be done using pull requests to the dev branch. The pull request has to be reviewed and tested first. Each pull request should address a maximum of 5 issues/features.
git fetch pull/PRNUMBER/head:BRANCHNAME
git checkout BRANCHNAME
Test the BRANCHNAME. Accept the pull request if everything is ok.