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

update from Gluejar #94

Open
wants to merge 991 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
991 commits
Select commit Hold shift + click to select a range
668732b
cleanup thumbnailing
eshellman Mar 1, 2022
d3a6bdc
Merge pull request #985 from Gluejar/maintenance2022
eshellman Mar 1, 2022
c7b6d2f
return pre-sized default images
eshellman Mar 2, 2022
209c81e
Merge branch 'master' into maintenance2022
eshellman Mar 2, 2022
b68a3e4
Merge pull request #986 from Gluejar/maintenance2022
eshellman Mar 2, 2022
d0cc809
add upv, usmcu
eshellman Mar 3, 2022
1587eae
Merge pull request #987 from Gluejar/maintenance2022
eshellman Mar 3, 2022
2bd95d1
fix diposit, add acikerisim
eshellman Mar 4, 2022
992e440
Merge pull request #988 from Gluejar/maintenance2022
eshellman Mar 4, 2022
6e3bc7c
remove meta elements from where they shouldn't be
eshellman Mar 4, 2022
83bad68
Merge pull request #989 from Gluejar/maintenance2022
eshellman Mar 4, 2022
5e25608
fix mdpi
eshellman Apr 5, 2022
6ff4ba8
Merge pull request #990 from Gluejar/maintenance2022
eshellman Apr 5, 2022
930cf99
python 3.7
eshellman May 3, 2022
468c98b
add a dependency for python 3.8
eshellman May 4, 2022
26ae047
Update requirements.txt
eshellman May 4, 2022
29bab56
Merge pull request #991 from Gluejar/maintenance2022
eshellman May 4, 2022
9f10fe3
add a max_execution_time
eshellman May 5, 2022
13cf7bf
Update requirements.txt
eshellman May 6, 2022
6b26744
Update README.md
eshellman May 6, 2022
068a84c
Merge pull request #992 from Gluejar/maintenance2022
eshellman May 6, 2022
bdb0396
revert celery upgrade
eshellman May 6, 2022
2968e0e
Merge pull request #993 from Gluejar/maintenance2022
eshellman May 6, 2022
ec12d56
fix fef-questionaire
eshellman May 10, 2022
db96891
Merge pull request #994 from Gluejar/maintenance2022
eshellman May 10, 2022
fe0e4e5
fix test file address
eshellman May 31, 2022
f23c244
update code for Springer
eshellman May 31, 2022
76991a4
quiet an BS4 complaint
eshellman May 31, 2022
17b9391
Merge pull request #995 from Gluejar/maintenance2022
eshellman May 31, 2022
31ea7b6
add 2 omp sites
eshellman Jun 3, 2022
1151ced
Merge pull request #996 from Gluejar/maintenance2022
eshellman Jun 3, 2022
e4a5145
switch to GA4
eshellman Jun 29, 2022
10d6bcb
Merge pull request #997 from Gluejar/maintenance2022
eshellman Jul 5, 2022
88669d7
end support for mobi
eshellman Jul 28, 2022
e30129d
Merge pull request #998 from Gluejar/maintenance2022
eshellman Jul 29, 2022
c06cae8
add liege and edp new harvesters, add more stores
eshellman Aug 9, 2022
2fbbbdf
Merge pull request #999 from Gluejar/maintenance2022
eshellman Aug 9, 2022
723c0a0
mitpress
eshellman Aug 15, 2022
72331ce
Merge pull request #1000 from Gluejar/maintenance2022
eshellman Aug 15, 2022
9a6ec91
improve UI for activating ebooks
eshellman Sep 2, 2022
0ffb8c6
Merge pull request #1001 from Gluejar/maintenance2022
eshellman Sep 2, 2022
3e1ed44
add author string cleanup
eshellman Sep 21, 2022
b23f8ce
Merge branch 'maintenance2022' of https://github.com/Gluejar/regluit …
eshellman Sep 21, 2022
0de0de6
Merge pull request #1002 from Gluejar/maintenance2022
eshellman Sep 21, 2022
5e2461d
una_editions
eshellman Nov 17, 2022
d63a8e8
Update prod.py
eshellman Nov 17, 2022
240a50d
more accurate error message
eshellman Nov 17, 2022
69ab4a7
cambridge.org
eshellman Nov 17, 2022
a3c09fe
iupree
eshellman Nov 18, 2022
47986eb
Merge pull request #1003 from Gluejar/maintenance2022
eshellman Nov 18, 2022
b8c645a
exon
eshellman Nov 18, 2022
93c8380
Merge pull request #1004 from Gluejar/maintenance2022
eshellman Nov 18, 2022
b0294e3
una-editions
eshellman Nov 19, 2022
a9dbabd
refactor BOOKSTORE_PROVIDERS int STOREPROVIDERS
eshellman Dec 29, 2022
8a02427
Merge pull request #1005 from Gluejar/maintenance2022
eshellman Dec 29, 2022
821dbb8
fix typo
eshellman Jan 4, 2023
73767e4
Update .gitignore
eshellman Jan 5, 2023
580ae2d
update to fontawesome v6
eshellman Jan 5, 2023
83614cc
clean yahoo and old fa
eshellman Jan 5, 2023
95a7d45
add mastodon
eshellman Jan 5, 2023
283ac25
fontawesome to forkawesome
eshellman Jan 5, 2023
e60abbc
remove links to twitter
eshellman Jan 5, 2023
ca924c9
css tweaks for mastodon
eshellman Jan 5, 2023
b9501c5
typos
eshellman Jan 5, 2023
b94bfee
remove twitter id from user profile
eshellman Jan 6, 2023
dc2a250
update css files
eshellman Jan 6, 2023
01d878b
Merge pull request #1006 from Gluejar/maintenance-2023
eshellman Jan 6, 2023
56b820a
add one more css
eshellman Jan 11, 2023
8d30e73
fix add_by_webpage
eshellman Jan 11, 2023
d77224c
Merge pull request #1007 from Gluejar/maintenance-2023
eshellman Jan 12, 2023
12411b1
add options to not verify TLS certs
eshellman Jan 25, 2023
3407b1b
add wbg-wissenverbindet, "fix" 2 cmp providers
eshellman Jan 25, 2023
4e18dc8
Merge pull request #1008 from Gluejar/maintenance-2023
eshellman Jan 25, 2023
1b33856
add to store providers
eshellman Jan 26, 2023
60fc937
add kb
eshellman Jan 26, 2023
6959d1c
Merge pull request #1009 from Gluejar/maintenance-2023
eshellman Jan 26, 2023
80088bf
improve springer description
eshellman Feb 26, 2023
ba7f234
auto-activate sitemap harvest
eshellman Feb 26, 2023
38792ca
Merge pull request #1010 from Gluejar/maintenance-2023
eshellman Feb 26, 2023
4eb0e0e
update to mark_safe, make ebookfile admin useful
eshellman Mar 23, 2023
288ad53
fix id lookup when edition is null
eshellman Mar 23, 2023
20ef32f
suppress identifier identifier
eshellman Mar 23, 2023
638bb51
include identifiers in work, edition api result
eshellman Mar 23, 2023
96727d8
update api help
eshellman Mar 23, 2023
4d443c3
Merge pull request #1011 from Gluejar/maintenance-2023
eshellman Mar 23, 2023
65ec3bf
address bad certs
eshellman Apr 1, 2023
165c31f
Merge pull request #1012 from Gluejar/maintenance-2023
eshellman Apr 1, 2023
7889254
fix title cleaner
eshellman Jul 31, 2023
425e958
Merge pull request #1013 from Gluejar/maintenance-2023
eshellman Jul 31, 2023
98f4089
Update harvest.py
eshellman Aug 3, 2023
125e107
Merge pull request #1014 from Gluejar/maintenance-2023
eshellman Aug 3, 2023
f16e55f
oapen fixes
eshellman Aug 4, 2023
8e1cd3e
Merge pull request #1015 from Gluejar/maintenance-2023
eshellman Aug 4, 2023
26edcae
switch default donation to general
eshellman Sep 13, 2023
be7bb61
autoactivate springer
eshellman Nov 27, 2023
86b48ca
Merge pull request #1016 from Gluejar/maintenance-2023
eshellman Nov 27, 2023
fe0a2b3
get journal.frontiersin.org to work
eshellman Dec 8, 2023
78b6377
fix brill.com
eshellman Dec 8, 2023
8dd4713
cathc an exception in libroschile
eshellman Dec 8, 2023
f2e4fe6
add urldefese to STOREPROVIDERS
eshellman Dec 8, 2023
0362a45
Merge pull request #1017 from Gluejar/maintenance-2023
eshellman Dec 9, 2023
a1385b3
fix error with bad google id
eshellman Dec 14, 2023
031e305
catch an integrity error
eshellman Dec 14, 2023
991357a
americana
eshellman Dec 15, 2023
cc87cea
Merge pull request #1018 from Gluejar/maintenance-2023
eshellman Dec 15, 2023
c303e26
OBP, cambridge, revert digitalis, add stores
eshellman Dec 19, 2023
711f60b
Merge pull request #1019 from Gluejar/maintenance-2023
eshellman Dec 19, 2023
2b8381a
Update harvest.py
eshellman Dec 19, 2023
9bea940
fix after test
eshellman Dec 19, 2023
b08b46f
Merge pull request #1020 from Gluejar/maintenance-2023
eshellman Dec 19, 2023
e5b78a9
tudelft, kit
eshellman Dec 20, 2023
26713f5
Merge pull request #1021 from Gluejar/maintenance-2023
eshellman Dec 20, 2023
b0c5dcb
funlam
eshellman Dec 20, 2023
500d8ee
add facility for manual harvest
eshellman Dec 21, 2023
3307fe9
iminho (improve cmp)
eshellman Dec 21, 2023
b229d3e
add mr to doi coaccess
eshellman Dec 21, 2023
5ca1c3c
sciendo
eshellman Dec 22, 2023
d3e33da
manu
eshellman Dec 22, 2023
2ac9640
reversion
eshellman Dec 22, 2023
b3abb69
store providers
eshellman Dec 22, 2023
516d2b1
budrich
eshellman Dec 22, 2023
7fdbe6e
remove old sciendo
eshellman Dec 22, 2023
43f3133
figshare
eshellman Dec 22, 2023
376141b
rti
eshellman Dec 22, 2023
b7aac27
edp
eshellman Dec 22, 2023
64752eb
gta
eshellman Dec 22, 2023
bc20dca
unap
eshellman Dec 22, 2023
c561d91
delint
eshellman Dec 22, 2023
15a6679
Merge pull request #1022 from Gluejar/maintenance-2023
eshellman Dec 22, 2023
b4c0212
requirements and source pipfile
eshellman Dec 28, 2023
48ba583
remove questionnaire, replace with redirector
eshellman Dec 28, 2023
1b3a580
Merge branch 'master' into 2023-final
eshellman Dec 28, 2023
11a1a01
remove travis speciific stuff
eshellman Dec 28, 2023
24578d9
Merge pull request #1023 from Gluejar/2023-final
eshellman Dec 28, 2023
b29cb42
fix rare scraper bug
eshellman Dec 31, 2023
bcf760a
add liege (pressbooks)
eshellman Dec 31, 2023
e42e845
new chrome UA
eshellman Dec 31, 2023
28e4060
Merge branch 'master' into maintenance-2023
eshellman Dec 31, 2023
c94e233
Merge pull request #1024 from Gluejar/maintenance-2023
eshellman Dec 31, 2023
023345f
update handling of DOAB coers
eshellman Jan 2, 2024
2fb5457
Merge pull request #1025 from Gluejar/maintenance-2023
eshellman Jan 2, 2024
2cd1e28
fix all the null doab covers!
eshellman Jan 2, 2024
7edddde
Merge pull request #1026 from Gluejar/maintenance-2024
eshellman Jan 2, 2024
7fca123
don't check truth of querysets
eshellman Jan 19, 2024
444e851
optimize getting first entry of a queryset
eshellman Jan 19, 2024
5889d09
fix tests with old data
eshellman Jan 19, 2024
9351f2b
more optimized queryset access
eshellman Jan 19, 2024
e661216
Merge pull request #1027 from Gluejar/maintenance-2024
eshellman Jan 19, 2024
9de45ca
add ubiquity hosts
eshellman Jan 29, 2024
c1e97e3
muse
eshellman Feb 6, 2024
027da7c
Merge pull request #1028 from Gluejar/maintenance-2024
eshellman Feb 6, 2024
408aabb
tecnum, update de gruyter
eshellman Feb 6, 2024
b31f660
Merge pull request #1029 from Gluejar/maintenance-2024
eshellman Feb 6, 2024
2624299
simplify springer
eshellman Feb 7, 2024
010fa25
scielo
eshellman Feb 7, 2024
c38ceb6
improve cmp
eshellman Feb 7, 2024
a94a12d
Merge pull request #1030 from Gluejar/maintenance-2024
eshellman Feb 7, 2024
dd512cf
more useragent params
eshellman Feb 7, 2024
2bdc75e
useragent
eshellman Feb 7, 2024
28051bd
Merge pull request #1031 from Gluejar/maintenance-2024
eshellman Feb 7, 2024
eded728
february cleanup
eshellman Mar 4, 2024
b67945f
add librarything key
eshellman Mar 4, 2024
0ecccd8
Merge pull request #1032 from Gluejar/maintenance-2024
eshellman Mar 4, 2024
3aef9ba
one more omp site
eshellman Mar 5, 2024
58fff58
Merge pull request #1033 from Gluejar/maintenance-2024
eshellman Mar 5, 2024
7bc916c
tolerate oapen encoded redirects
eshellman Mar 18, 2024
6cfe009
make contenttyper more tolerant
eshellman Mar 18, 2024
33de365
some servers don't like '<' in user agents
eshellman Mar 18, 2024
e28ecbd
Merge pull request #1034 from Gluejar/maintenance-2024
eshellman Mar 18, 2024
2f0ee16
seems we need to try before fixing
eshellman Mar 18, 2024
3da6944
Merge pull request #1035 from Gluejar/maintenance-2024
eshellman Mar 18, 2024
0cea530
can't fix it when unicode and latin 1 don't work
eshellman Mar 18, 2024
fe1171e
Merge pull request #1036 from Gluejar/maintenance-2024
eshellman Mar 18, 2024
cd35191
improve registration
eshellman Mar 20, 2024
70b1908
fix bug in old django-registration
eshellman Mar 21, 2024
3aa8b2c
encode the answers
eshellman Mar 21, 2024
7afff5f
test the encoder
eshellman Mar 21, 2024
f194722
Merge pull request #1037 from Gluejar/maintenance-2024
eshellman Mar 21, 2024
4fc2557
update stripelib, stripe.js
eshellman Mar 25, 2024
3e3b136
update pypdf and xhtml2pdf
eshellman Mar 25, 2024
d807948
Merge pull request #1038 from Gluejar/maintenance-2024
eshellman Mar 25, 2024
7b03009
marilia.unesp.br
eshellman May 4, 2024
37f1a26
new GA config
eshellman May 4, 2024
614c3b1
stop hitting openlibrary
eshellman May 4, 2024
b374dc3
Merge pull request #1039 from Gluejar/maintenance-2024
eshellman May 4, 2024
4607615
fix GA syntax
eshellman May 4, 2024
050121a
Merge pull request #1040 from Gluejar/maintenance-2024
eshellman May 4, 2024
2b931d1
one more
eshellman May 4, 2024
21304e7
Merge pull request #1041 from Gluejar/maintenance-2024
eshellman May 4, 2024
14e2c7c
add cmp providers
eshellman May 4, 2024
436c0fd
Merge pull request #1042 from Gluejar/maintenance-2024
eshellman May 4, 2024
1c02e42
fix
eshellman May 4, 2024
8a7823a
Merge pull request #1043 from Gluejar/maintenance-2024
eshellman May 4, 2024
46dd2fe
more cmp, dspace providers
eshellman May 5, 2024
bd45a1c
Merge pull request #1044 from Gluejar/maintenance-2024
eshellman May 5, 2024
454acbe
benjamins, kiel, UA
eshellman May 6, 2024
32f05db
Merge pull request #1045 from Gluejar/maintenance-2024
eshellman May 6, 2024
39087fb
loader commands
eshellman May 6, 2024
e3a3e2f
Merge pull request #1046 from Gluejar/maintenance-2024
eshellman May 6, 2024
d58c4a3
change name of manual harvest command
eshellman Aug 3, 2024
d0a5971
add MAX_FACETS parameter
eshellman Aug 3, 2024
839e2d9
Merge pull request #1047 from Gluejar/maintenance-2024
eshellman Aug 3, 2024
d629d42
remove debug print
eshellman Aug 3, 2024
80166bf
Merge pull request #1048 from Gluejar/maintenance-2024
eshellman Aug 3, 2024
67daecd
Strip down the main search - it was way too slow
eshellman Aug 17, 2024
1701c17
Merge pull request #1049 from Gluejar/maintenance-2024
eshellman Aug 17, 2024
528350c
test to see if download writes is a bottleneck
eshellman Aug 18, 2024
ef00900
Merge pull request #1050 from Gluejar/maintenance-2024
eshellman Aug 18, 2024
992d8ec
really log the downloads
eshellman Aug 19, 2024
718cd1f
Merge pull request #1051 from Gluejar/maintenance-2024
eshellman Aug 19, 2024
c8c7353
precompute the number of free books per subject
eshellman Aug 19, 2024
83b76af
Merge pull request #1052 from Gluejar/maintenance-2024
eshellman Aug 19, 2024
fac1a9d
don't update num_free for invisible subjects
eshellman Aug 20, 2024
2d2a094
dial back pillow
eshellman Aug 26, 2024
98fbf2b
Merge pull request #1053 from Gluejar/maintenance-2024
eshellman Aug 26, 2024
0e7ae37
improve thumbnail logging
eshellman Aug 27, 2024
2f00d53
Merge pull request #1054 from Gluejar/maintenance-2024
eshellman Aug 27, 2024
948f3c3
set THUMBNAIL_URL_TIMEOUT
eshellman Sep 1, 2024
f35ad7a
add better logging for thumbnail maker
eshellman Sep 1, 2024
1f21da4
Merge pull request #1055 from Gluejar/maintenance-2024
eshellman Sep 1, 2024
6c2719f
management command to update downloads
eshellman Sep 5, 2024
9dec0b7
add lodz, fix mdpi
eshellman Sep 5, 2024
c8b3379
Merge pull request #1056 from Gluejar/maintenance-2024
eshellman Sep 5, 2024
536f29d
oh, that log file
eshellman Sep 5, 2024
e52327c
Merge pull request #1057 from Gluejar/maintenance-2024
eshellman Sep 5, 2024
2c89538
add and sort store prooviders
eshellman Oct 1, 2024
6fd4605
add support for multiple downloads logs
eshellman Oct 1, 2024
f4006ce
fix waxmann
eshellman Oct 2, 2024
85fb4e1
improve calgary
eshellman Oct 2, 2024
c97c146
Merge pull request #1058 from Gluejar/maintenance-2024
eshellman Oct 2, 2024
b6cdfb1
PdfMerger is removed
eshellman Oct 3, 2024
31096f8
Merge pull request #1059 from Gluejar/maintenance-2024
eshellman Oct 3, 2024
fd2a26b
fix edp
eshellman Oct 21, 2024
5843d1c
more covers to fix
eshellman Oct 21, 2024
6fbb87b
Merge pull request #1060 from Gluejar/maintenance-2024
eshellman Oct 21, 2024
bd25522
add openlibrary switch
eshellman Oct 21, 2024
ce8d813
Merge pull request #1061 from Gluejar/maintenance-2024
eshellman Oct 21, 2024
73e02a3
check for empty images
eshellman Oct 22, 2024
88dee33
Merge pull request #1062 from Gluejar/maintenance-2024
eshellman Oct 22, 2024
63cb177
fix image checking
eshellman Oct 22, 2024
6d8878c
Merge pull request #1063 from Gluejar/maintenance-2024
eshellman Oct 22, 2024
e35e5b3
update bad doab list
eshellman Oct 22, 2024
69ee25f
Merge pull request #1064 from Gluejar/maintenance-2024
eshellman Oct 22, 2024
50ee282
simplify sitemaps
eshellman Oct 28, 2024
03e71be
remove expensive cover_image query
eshellman Oct 28, 2024
f802391
Merge pull request #1065 from Gluejar/maintenance-2024
eshellman Oct 28, 2024
37a5486
fix mit, add redliclibros, nai010 bookshop
eshellman Nov 22, 2024
7bd6fba
fix bookloader when a bookdata is empty
eshellman Nov 22, 2024
fc0d32e
add some indexes
eshellman Nov 22, 2024
e86b7d5
Merge pull request #1066 from Gluejar/maintenance-2024
eshellman Nov 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
11 changes: 7 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,17 @@ settings/keys/*
*.dot
reports
ENV
venv
.env
.DS_Store
build
deploy/last-update
logs/*
cache/*
celerybeat.pid
celerybeat-schedule
.gitignore~
static/scss/**/*.css.map
*.retry
assets/*
*.ipynb
dump.rdb
Pipfile.lock

*.css.map
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.9.11
25 changes: 0 additions & 25 deletions .travis.yml

This file was deleted.

43 changes: 43 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
celery = "==4.4.7"
django = "==1.11.29"
django-contrib-comments = "==2.0.0"
django-extensions = "==3.1.1"
django-registration = "==2.4.1"
social-auth-app-django = "==2.1.0"
django-tastypie = "==0.14.1"
django-el-pagination = "==3.2.4"
django-selectable = "==1.1.0"
django-notification = {editable = true, ref = "1ad2be4adf3551a3471d923380368341452e178a", git = "git+https://github.com/eshellman/django-notification.git"}
django-email-change = {editable = true, ref = "fb063296cbf4e4a6d8a93d34d98fe0c7739c2e0d", git = "git+https://github.com/eshellman/django-email-change.git"}
django-ckeditor = "==5.6.1"
django-storages = "==1.5.2"
sorl-thumbnail = "==12.6.3"
django-mptt = "==0.8.6"
pyepub = "==0.5.0"
django-sass-processor = "==0.8.2"
mysqlclient = "==1.4.6"
mailchimp3 = "==3.0.14"
boto3 = "==1.17.91"
pymarc = "==4.2.1"
beautifulsoup4 = "==4.11.1"
gitberg = "==0.8.7"
risparser = "==0.4.3"
pyoai = "==2.5.0"
django-jsonfield = "==1.0.0"
mechanize = "==0.4.5"
stripe = "==2.76.0"
selenium = "==3.141.0"
requests-mock = "==1.8.0"
redis = "==3.5.3"
xhtml2pdf = ">=0.2.15"
pillow = "==9.5.0"
pypdf = ">=5.0.0"

[requires]
python_version = "3.9"
166 changes: 33 additions & 133 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
regluit - "The Unglue.it web application and website"
=======

This repo - https://github.com/EbookFoundation/regluit will be the place for collaborative development for Unglue.it. Add issues and submit pull requests here. As of January 19, 2017, https://github.com/Gluejar/regluit is still being used for production builds.
Another repo - https://github.com/EbookFoundation/regluit will eventually be the place for collaborative development for Unglue.it. Add issues and submit pull requests there. As of September 1, 2019, https://github.com/Gluejar/regluit is still being used for production builds.

The first version of the unglue.it codebase was a services-oriented project named "unglu".
We decided that "unglu" was too complicated, so we started over and named the new project "regluit".
Expand All @@ -10,49 +10,24 @@ contains four main applications: `core`, `frontend`, `api` and `payment` that ca
and configured on as many ec2 instances that are needed to support traffic.
The partitioning between these modules is not as clean as would be ideal. `payment` is particularly messy because we had to retool it twice because we had to switch from Paypal to Amazon Payments to Stripe.

regluit was originally developed on Django 1.3 (python 2.7) and currently runs on Django 1.8.
regluit was originally developed on Django 1.3 (python 2.7) and currently runs on Django 1.11 Python 3.8).

Development (Vagrant + Virtualbox)
-------

The recommended method for local development is to create a virtual machine with [Vagrant](https://www.vagrantup.com/) and [Virtualbox](https://www.virtualbox.org/wiki/Downloads).
With this method, the only requirements on the host machine are `virtualbox` and `vagrant`.
Vagrant will use the `ansible-local` provisioner, therefore installing python and ansible on the host machine is not necessary.

__Instructions for Ubuntu 16:__
1. Install virtualbox: `sudo apt-get install virtualbox`
2. Install vagrant: `sudo apt-get install vagrant`
3. Clone the `EbookFoundation/regluit` repository.
4. Navigate to the base directory of the cloned repo (where `Vagrantfile` is located).
5. Run `vagrant up` to create the VM, install dependencies, and start necessary services.
* Note: This step may take up to 15 minutes to complete.
6. Once the VM has been created, run `vagrant ssh` to log in to the virtual machine you just created. If provisioning was successful, you should see a success message upon login.
* If virtualenv doesn't activate upon login, you can do it manually by running `cd /opt/regluit && source venv/bin/activate`
7. Within the VM, run `./manage.py runserver 0.0.0.0:8000` to start the Django development server.
8. On your host machine, open your web browser of choice and navigate to `http://127.0.0.1:8000`

__Instructions for other platforms (Windows/OSX):__
* Steps are essentially the same, except for the installation of Vagrant and Virtualbox. Refer to each package's documentation for specific installation instructions.

_NOTE:_ If running Windows on your host machine, ensure you are running `vagrant up` from an elevated command prompt, e.g. right click on Command Prompt -> Run As Administrator.


Development (Host Machine)
Develop
-------

Here are some instructions for setting up regluit for development on
an Ubuntu system. If you are on OS X see notes below
to install python-setuptools in step 1:
an Ubuntu system. If you are on OS X see notes below.

1. Ensure MySQL and Redis are installed & running on your system.

- Ensure MySQL 5.7 and Redis are installed & running on your system.
1. Create a MySQL database and user for unglueit.
1. `sudo apt-get upgrade gcc`
1. `sudo apt-get install python-setuptools git python-lxml build-essential libssl-dev libffi-dev python2.7-dev libxml2-dev libxslt-dev libmysqlclient-dev`
1. `sudo apt-get install python-setuptools git python-lxml build-essential libssl-dev libffi-dev python3.8-dev libxml2-dev libxslt-dev libmysqlclient-dev`
1. `sudo easy_install virtualenv virtualenvwrapper`
1. `git clone [email protected]:Gluejar/regluit.git`
1. `cd regluit`
1. `mkvirtualenv regluit`
1. `pip install -r requirements_versioned.pip`
1. `pip install -r requirements.txt`
1. `add2virtualenv ..`
1. `cp settings/dev.py settings/me.py`
1. `mkdir settings/keys/`
Expand All @@ -63,8 +38,9 @@ to install python-setuptools in step 1:
1. `deactivate ; workon regluit`
1. `django-admin.py migrate --noinput`
1. `django-admin.py loaddata core/fixtures/initial_data.json core/fixtures/bookloader.json` populate database with test data to run properly.
1. `django-admin.py celeryd --loglevel=INFO` start the celery daemon to perform asynchronous tasks like adding related editions, and display logging information in the foreground.
1. `django-admin.py celerybeat -l INFO` to start the celerybeat daemon to handle scheduled tasks.
1. `redis-server` to start the task broker
1. `celery -A regluit worker --loglevel=INFO ` start the celery daemon to perform asynchronous tasks like adding related editions, and display logging information in the foreground. Add ` --logfile=logs/celery.log` if you want the logs to go into a log file.
1. `celery -A regluit beat --loglevel=INFO` to start the celerybeat daemon to handle scheduled tasks.
1. `django-admin.py runserver 0.0.0.0:8000` (you can change the port number from the default value of 8000)
1. make sure a [redis server](https://redis.io/topics/quickstart) is running
1. Point your browser to http://localhost:8000/
Expand All @@ -77,121 +53,40 @@ CSS development
Production Deployment
---------------------

OBSOLETE
Below are the steps for getting regluit running on EC2 with Apache and mod_wsgi, and talking to an Amazon Relational Data Store instance.
Instructions for setting please are slightly different.

1. create an ubuntu ec2 instance (e.g, go http://alestic.com/ to find various ubuntu images)
1. `sudo aptitude update`
1. `sudo aptitude upgrade`
1. `sudo aptitude install git-core apache libapache2-mod-wsgi mysql-client python-virtualenv python-mysqldb redis-server python-lxml postfix python-dev libmysqlclient-dev`
1. `sudo mkdir /opt/regluit`
1. `sudo chown ubuntu:ubuntu /opt/regluit`
1. `cd /opt`
1. `git config --global user.name "Raymond Yee"`
1. `git config --global user.email "[email protected]"`
1. `ssh-keygen`
1. add `~/.ssh/id\_rsa.pub` as a deploy key on github https://github.com/Gluejar/regluit/admin/keys
1. `git clone [email protected]:Gluejar/regluit.git`
1. `cd /opt/regluit`
1. create an Amazon RDS instance
1. connect to it, e.g. `mysql -u root -h gluejardb.cboagmr25pjs.us-east-1.rds.amazonaws.com -p`
1. `CREATE DATABASE unglueit CHARSET utf8;`
1. `GRANT ALL ON unglueit.\* TO ‘unglueit’@’ip-10-244-250-168.ec2.internal’ IDENTIFIED BY 'unglueit' REQUIRE SSL;`
1. update settings/prod.py with database credentials
1. `virtualenv ENV`
1. `source ENV/bin/activate`
1. `pip install -r requirements_versioned.pip`
1. `echo "/opt/" > ENV/lib/python2.7/site-packages/regluit.pth`
1. `django-admin.py syncdb --migrate --settings regluit.settings.prod`
1. `sudo mkdir /var/www/static`
1. `sudo chown ubuntu:ubuntu /var/www/static`
1. `django-admin.py collectstatic --settings regluit.settings.prod`
1. `sudo ln -s /opt/regluit/deploy/regluit.conf /etc/apache2/sites-available/regluit`
1. `sudo a2ensite regluit`
1. `sudo a2enmod ssl rewrite`
1. `cd /home/ubuntu`
1. copy SSL server key to `/etc/ssl/private/server.key`
1. copy SSL certificate to `/etc/ssl/certs/server.crt`
1. `sudo /etc/init.d/apache2 restart`
1. `sudo adduser --no-create-home celery --disabled-password --disabled-login` (just enter return for all?)
1. `sudo cp deploy/celeryd /etc/init.d/celeryd`
1. `sudo chmod 755 /etc/init.d/celeryd`
1. `sudo cp deploy/celeryd.conf /etc/default/celeryd`
1. `sudo mkdir /var/log/celery`
1. `sudo mkdir /var/run/celery`
1. `sudo chown celery:celery /var/log/celery /var/run/celery`
1. `sudo /etc/init.d/celeryd start`
1. `sudo cp deploy/celerybeat /etc/init.d/celerybeat`
1. `sudo chmod 755 /etc/init.d/celerybeat`
1. `sudo cp deploy/celerybeat.conf /etc/default/celerybeat`
1. `sudo mkdir /var/log/celerybeat`
1. `sudo chown celery:celery /var/log/celerybeat`
1. `sudo /etc/init.d/celerybeat start`

## setup to enable ckeditor to work properly

1. `mkdir /var/www/static/media/`
1. `sudo chown ubuntu:www-data /var/www/static/media/`


Updating Production
--------------------

1. Study the latest changes in the master branch, especially keep in mind how
it has [changed from what's in production](https://github.com/Gluejar/regluit/compare/production...master).
1. Update the production branch accordingly. If everything in `master` is ready to be moved into `production`, you can just merge `master` into `production`. Otherwise, you can grab specific parts. (How to do so is something that should probably be described in greater detail.)
1. Login to unglue.it and run [`/opt/regluit/deploy/update-prod`](https://github.com/Gluejar/regluit/blob/master/deploy/update-prod)

See http://github.com/EbookFoundation/regluit-provisioning

OS X Developer Notes
-------------------

To run regluit on OS X you should have XCode installed

Install virtualenvwrapper according
to the process at http://blog.praveengollakota.com/47430655:
Install MySQL:
`brew install [email protected]`
`mysql_secure_installation`
`mysqld_safe --user=root -p`


1. `sudo easy\_install pip`
1. `sudo pip install virtualenv`
1. `pip install virtualenvwrapper`
We use pyenv and pipenv to set up an environment.

Edit or create .bashrc in ~ to enable virtualenvwrapper commands:
1. `mkdir ~/.virtualenvs`
1. Edit .bashrc to include the following lines:

export WORKON_HOME=$HOME/.virtualenvs
source your_path_to_virtualenvwrapper.sh_here

In the above web site, the path to virtualenvwrapper.sh was
/Library/Frameworks/Python.framework/Versions/2.7/bin/virtualenvwrapper.sh
In Snow Leopard, this may be /usr/local/bin/virtualenvwrapper.sh
1. `pipenv install -r requirements.txt`
1. Edit .zshrc to include the following lines:

Configure Terminal to automatically notice this at startup:
Terminal –> Preferences –> Settings –> Shell
Click "run command"; add `source ~/.bashrc`
`eval "$(pyenv init -)"`
`export PATH=$PATH:/Applications/Postgres.app/Contents/Versions/10/bin`
`export PATH=$PATH:/usr/local/opt/mysql-client/bin:$PATH`
`export ANSIBLE_VAULT_PASSWORD_FILE=PATH_TO_VAULT_PASSWORD`

If you get 'EnvironmentError: mysql_config not found'
edit the line ~/.virtualenvs/regluit/build/MySQL-python/setup_posix.py
1. mysql_config.path = "mysql_config"
to be (using a path that exists on your system)
1. mysql_config.path = "/usr/local/mysql-5.5.20-osx10.6-x86_64/bin/mysql_config"
If you get `EnvironmentError: mysql_config not found`
you might need to set a path to mysqlconfig

You may need to set utf8 in /etc/my.cnf
collation-server = utf8_unicode_ci

init-connect='SET NAMES utf8'
character-set-server = utf8

Selenium Install
---------------

Download the selenium server:
http://selenium.googlecode.com/files/selenium-server-standalone-2.5.0.jar

Start the selenium server:
'java -jar selenium-server-standalone-2.5.0.jar'

MARC Records
------------

Expand Down Expand Up @@ -232,7 +127,12 @@ MARC Records
* if you have records with both DIRECT and UNGLUE links, you'll need two MARCRecord instances
* if you have both kinds of link, put them in _separate_ records, as marc_format can only take one value

MySQL Migration
---------------

## 5.7 - 8.0 Notes

# vagrant / ansible
* Many migration blockers were removed by by dumping, then restoring the database.
* After that, RDS was able to migrate
* needed to create the unglueit user from the mysql client

[How to build machines using Vagrant/ansible](docs/vagrant_ansible.md)
56 changes: 0 additions & 56 deletions Vagrantfile

This file was deleted.

8 changes: 8 additions & 0 deletions __init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from __future__ import absolute_import, unicode_literals

# This will make sure the app is always imported when
# Django starts so that shared_task will use this app.
from .celery_module import app as celery_app

__all__ = ('celery_app',)

Loading