Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
a819205
Gruntfile: Switch to python3.11
lentinj Jan 19, 2024
691d874
package.json: Support Node 18.x
lentinj Jan 19, 2024
433e2ba
Gruntfile: web2py_configure for web2py housekeeping
lentinj Jan 19, 2024
88a38e2
Gruntfile: venv for web2py #676
lentinj Jan 19, 2024
48a5ac5
controllers/API: Remove search_log
lentinj Jan 19, 2024
aa80e2d
models/db: is_testing iff running under rocket
lentinj Jan 19, 2024
5b8cb59
models/db: Database session-handling #82
lentinj Jan 19, 2024
2628e9d
install: Install scripts for nginx/supervisord
lentinj Jan 19, 2024
48308d2
Gruntfile: Alter web2py.py to use venv #676
lentinj Jan 20, 2024
f30b310
README.markdown: Rework installation instructions
lentinj Feb 5, 2024
a91ef03
Gruntfile: Use python3.10, not python3.11 #672 #699
lentinj Feb 5, 2024
ce41a32
README: Don't mention temporary branch
lentinj Feb 5, 2024
2895b39
install-nginx: /var/db/acme/live/ isn't created OOTB
lentinj Feb 5, 2024
950524a
install-nginx: BSD doesn't know about ln -r
lentinj Feb 5, 2024
bcd59ea
install-nginx: Use NGINX_PATH when generating include config
lentinj Feb 5, 2024
814e103
install-nginx: Remove v6 listeners
lentinj Feb 5, 2024
f9d59eb
install-supervisord: BSD-compatible stat syntax
lentinj Feb 5, 2024
5edd180
install-supervisord: Correct supervisord conf location on BSD
lentinj Feb 5, 2024
3b5e810
install-supervisord: Put script in debug mode
lentinj Feb 5, 2024
785c236
README.markdown: Separate "production installation" section
lentinj Feb 5, 2024
5adc769
README: Remove mention of README_SERVER #703
lentinj Feb 5, 2024
c0f28d3
README: Mysql-under windows notes #703
lentinj Feb 5, 2024
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
45 changes: 34 additions & 11 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ const path = require('path');

partial_install_site = "http://www.onezoom.org";
partial_local_install_site = "http://127.0.0.1:8000"; // if you are running a local installation
preferred_python3 = "python3.7"; // in case you have multiple python3 versions installed
preferred_python3 = "python3.10"; // in case you have multiple python3 versions installed
web2py_py = path.join(path.dirname(path.dirname(process.cwd())), 'web2py.py');
venv_python = path.join(path.dirname(path.dirname(process.cwd())), 'bin/python');

/** Generate a function to execute a web2py script, handing over all arguments */
function exec_web2py_script(script_name, init_args) {
return function () {
return [
preferred_python3,
venv_python,
web2py_py,
'-S OZtree/default',
'-M',
Expand All @@ -29,16 +30,36 @@ module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
exec: {
web2py_configure: {
cwd: "../../",
command: [
'git submodule update --init --recursive',
'ln -sf applications/OZtree/_COPY_CONTENTS_TO_WEB2PY_DIR/routes.py routes.py',
'ln -sf handlers/wsgihandler.py handler.py',
'( [ -d applications/welcome ] && rm -r -- "applications/welcome" || true )',
'( [ -d applications/examples ] && rm -r -- "applications/examples" || true )',
'( [ -f applications/OZtree/private/appconfig.ini ] || { cp applications/OZtree/private/appconfig.ini.example applications/OZtree/private/appconfig.ini ; echo "****** edit private/appconfig.ini"; exit 1; } )',
preferred_python3 + ' -m venv .',
'./bin/pip install -r applications/OZtree/requirements.txt',
// Make web2py.py use the venv
'mv web2py.py web2py.py.o',
'echo "#!' + venv_python + '" > web2py.py',
'tail -n +2 web2py.py.o >> web2py.py',
].join(" && "),
},
web2py_start_dev: {
cwd: "../../",
command: [
'( [ -f oz.crt ] || openssl req -newkey rsa:2048 -x509 -days 365 -nodes -keyout oz.key -subj "/CN=dev.onezoom/" -out oz.crt; )',
venv_python + ' web2py.py -c oz.crt -k oz.key -p 8000 -a pass',
].join(" && "),
},
compile_python: {
// compile python to make it faster on the server and hence reduce server load.
// should probably be run using the same python version as used to run web2py
cwd: "../../",
command:
preferred_python3 + ' -c "import gluon.compileapp; gluon.compileapp.compile_application(\''
+ process.cwd()
+ '\', skip_failed_views=True)"'
+ ' || ' + // If python 3.7 isn't available, use the system-defined python3 instead
'python3 -c "import gluon.compileapp; gluon.compileapp.compile_application(\''
venv_python + ' -c "import gluon.compileapp; gluon.compileapp.compile_application(\''
+ process.cwd()
+ '\', skip_failed_views=True)"'
},
Expand All @@ -59,7 +80,7 @@ module.exports = function (grunt) {
}
},
make_release_info: {
command: 'git describe --tags > RELEASE_INFO && python3 OZprivate/ServerScripts/Utilities/get_release_name.py RELEASE_INFO >> RELEASE_INFO'
command: 'git describe --tags > RELEASE_INFO && ' + venv_python + ' OZprivate/ServerScripts/Utilities/get_release_name.py RELEASE_INFO >> RELEASE_INFO'
},
test_server: {
command: function () {
Expand Down Expand Up @@ -95,7 +116,7 @@ module.exports = function (grunt) {
// Any .html file in /static is fair game. See documentation in
// https://github.com/OneZoom/OZtree#onezoom-setup
command:
"python3 OZprivate/ServerScripts/Utilities/partial_install.py" +
venv_python + " OZprivate/ServerScripts/Utilities/partial_install.py" +
" --search " + partial_local_install_site + // replace local urls, for partial local install
" --replace " + partial_install_site +
" static/*.html"
Expand Down Expand Up @@ -220,6 +241,8 @@ module.exports = function (grunt) {
grunt.registerTask("compile-js_dev", ["exec:compile_js_dev"]);
grunt.registerTask("partial-install", ["compile-js", "css", "copy:dev", "curl-dir:get_minlife", "exec:convert_links_to_local"]);
grunt.registerTask("partial-local-install", ["compile-js", "css", "copy:dev", "curl-dir:get_local_minlife", "exec:convert_links_to_local"]);
grunt.registerTask("prod", ["clean", "compile-python", "compile-js", "css", "compress", "copy:prod", "make_release_info", "docs"]);
grunt.registerTask("dev", ["clean", "compile-js_dev", "css", "compress", "copy:dev", "make_release_info", "docs"]);
grunt.registerTask("web2py", ["exec:web2py_configure"]);
grunt.registerTask("prod", ["clean", "web2py", "compile-python", "compile-js", "css", "compress", "copy:prod", "make_release_info", "docs"]);
grunt.registerTask("dev", ["clean", "web2py", "compile-js_dev", "css", "compress", "copy:dev", "make_release_info", "docs"]);
grunt.registerTask("start-dev", ['exec:web2py_start_dev']);
};
4 changes: 0 additions & 4 deletions OZprivate/ServerScripts/SQL/create_db_indexes.sql
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ call MakeFullUnicode('images_by_ott', 'rights');
call MakeFullUnicode('images_by_ott', 'licence');
call MakeFullUnicode('images_by_name', 'rights');
call MakeFullUnicode('images_by_name', 'licence');
call MakeFullUnicode('search_log', 'search_string');

# note make sure that the name column in vernacular_by_name and the name column in ordered_leaves and ordered_nodes are of the same character set otherwise search can get incredibly slow even with indexes.

Expand Down Expand Up @@ -213,9 +212,6 @@ CREATE FULLTEXT INDEX ft_user_sponsor_info_index ON reservations (user_more_info
DROP INDEX ipni_index ON PoWO;
CREATE INDEX ipni_index ON PoWO (ipni_int) USING HASH;

DROP INDEX string_index ON search_log;
CREATE INDEX string_index ON search_log (search_string) USING HASH;

DROP INDEX identifier_index ON partners;
CREATE INDEX identifier_index ON partners (partner_identifier) USING HASH;

Expand Down
2 changes: 1 addition & 1 deletion OZprivate/ServerScripts/Utilities/OneOff/make_usernames.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
Run from the OZtree directory as
python3 ../../web2py.py -S OZtree -M -R applications/OZtree/OZprivate/ServerScripts/Utilities/OneOff/make_usernames.py
./web2py-run OZprivate/ServerScripts/Utilities/OneOff/make_usernames.py

After 2 passes, will allocate usernames of remaining unallocated reservations using a
species name plus year.
Expand Down
Loading