diff options
Diffstat (limited to '_deploy')
24 files changed, 760 insertions, 0 deletions
diff --git a/_deploy/debian/serversetup b/_deploy/debian/serversetup new file mode 100644 index 0000000..644baea --- /dev/null +++ b/_deploy/debian/serversetup @@ -0,0 +1,90 @@ +Instructions for setting up new expo debian server/VM +For Debian Stretch, June 2019. + +[Note added March 2021: +See also http://expo.survex.com/handbook/troggle/serverconfig.html +and troggle/README.txt +] + +adduser expo +apt install openssh-server mosh tmux mc zile emacs-nox mc most ncdu +apt install python-django apache2 mysql-server survex make rsync +apt install libjs-openlayers make +apt install git mercurial mercurial-server? + +for boe: +apt install libcgi-session-perl libcrypt-passwdmd5-perl libfile-slurp-perl libgit-wrapper-perl libhtml-template-perl libhtml-template-pro-perl libmime-lite-perl libtext-password-pronounceable-perl libtime-parsedate-perl libuuid-tiny-perl libcrypt-cracklib-perl + +obsolete-packages: + bins (move to jigl?) (for photos) + python-django 1.7 +backports: survex therion +not-packaged: caveview + +make these dirs available at top documentroot: +cuccfiles +expofiles +loser (link to repo) +tunneldata (link to repo) +troggle (link to repo) +expoweb (link to repo) +boc/boe + + +config +containing: + +setup apache configs for cucc and expo +#disable default website +a2dissite 000-default +a2ensite cucc +a2ensite expo +a2enmod cgid + + +Boe config: +Alias /boe /home/expo/boe/boc/boc.pl +<Directory /home/expo/boe/boc> + AddHandler cgi-script .pl + SetHandler cgi-script + Options +ExecCGI + Require all granted +</Directory> +And remember to set both program and data dir to be +www-data:www-data +(optionally make file group read/write by treasurer account) +create empty repo by clicking create in boe interface +then set names in 'settings' + +Set up mysql (as root) +mysql -p +CREATE DATABASE troggle; +GRANT ALL PRIVILEGES ON troggle.* TO 'expo'@'localhost' IDENTIFIED BY 'somepassword'; + +install django: +sudo apt install python-django python-django-registration python-django-imagekit python-django-tinymce fonts-freefont-ttf libapache2-mod-wsgi + +python-django-imagekit comes from https://salsa.debian.org/python-team/modules/python-django-imagekit +python-django-tinymce comes from https://salsa.debian.org/python-team/modules/python-django-tinymce +(both modified for stretch/python2). packages under /home/wookey/packages/ + +need fonts-freefont-ttf (to have truetype freesans available for troggle via PIL) +need libapache2-mod-wsgi for apache wsgi support. + +On stretch the django 1.10 is no use so get rid of that: +apt remove python3-django python-django python-django-common python-django-doc + +Then replace with django 1.7 (Needs to be built for stretch) +apt install python-django python-django-common python-django-doc +apt install python-django-registration python-django-imagekit python-django-tinymce + +then hold them to stop them being upgraded by unattended upgrades: +echo "python-django hold" | sudo dpkg --set-selections +echo "python-django-common hold" | sudo dpkg --set-selections +echo "python-django-doc hold" | sudo dpkg --set-selections + +#troggle has to have a writable logfile otherwise the website explodes +# 500 error on the server, and apache error log has non-rentrant errors +create /var/log/troggle/troggle.log +chown www-data:adm /var/log/troggle/troggle.log +chmod 660 /var/log/troggle/troggle.log diff --git a/_deploy/debian/sitecustomize.py b/_deploy/debian/sitecustomize.py new file mode 100644 index 0000000..89c6712 --- /dev/null +++ b/_deploy/debian/sitecustomize.py @@ -0,0 +1,7 @@ +# install the apport exception handler if available +try: + import apport_python_hook +except ImportError: + pass +else: + apport_python_hook.install() diff --git a/_deploy/debian/this-is-the-live-expo.survex.com-system.txt b/_deploy/debian/this-is-the-live-expo.survex.com-system.txt new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/_deploy/debian/this-is-the-live-expo.survex.com-system.txt diff --git a/_deploy/debian/wookey-exposerver-recipe.txt b/_deploy/debian/wookey-exposerver-recipe.txt new file mode 100644 index 0000000..ab2fa60 --- /dev/null +++ b/_deploy/debian/wookey-exposerver-recipe.txt @@ -0,0 +1,95 @@ +adduser expo +apt install openssh-server mosh tmux mc zile emacs-nox mc most ncdu +apt install python-django apache2 mysql-server survex make rsync +apt install libjs-openlayers make +apt install git mercurial mercurial-server? + +for boe: +apt install libcgi-session-perl libcrypt-passwdmd5-perl libfile-slurp-perl libgit-wrapper-perl libhtml-template-perl libhtml-template-pro-perl libmime-lite-perl libtext-password-pronounceable-perl libtime-parsedate-perl libuuid-tiny-perl libcrypt-cracklib-perl + +apt install ufraw for PEF image decoding. +sudo apt install python-django python-django-registration e fonts-freefont-ttf libapache2-mod-wsgi python3-gdbm +# sudo apt install python-django-imagekit python-django-tinymc + +obsolete-packages: bins (move to jigl?) + older python-django? +backports: survex therion +not-packaged: caveview + + +make these dirs available at top documentroot: +cuccfiles +expofiles +loser +tunneldata +troggle +expoweb +boc/boe + +config +containing: + +setup apache configs for cucc and expo +#disable default website +a2dissite 000-default +a2ensite cucc +a2ensite expo +a2enmod cgid + + +Boe config: +Alias /boe /home/expo/boe/boc/boc.pl +<Directory /home/expo/boe/boc> + AddHandler cgi-script .pl + SetHandler cgi-script + Options +ExecCGI + Require all granted +</Directory> +And remember to set both program and data dir to be +www-data:www-data +(optionally make file group read/write by treasurer account) +create empty repo by clicking create in boe interface +then set names in 'settings' + +Set up mysql (as root) +mysql -p +CREATE DATABASE troggle; +GRANT ALL PRIVILEGES ON troggle.* TO 'expo'@'localhost' IDENTIFIED BY 'somepassword'; + +install django: +sudo apt install python-django python-django-registration python-django-imagekit python-django-tinymce fonts-freefont-ttf libapache2-mod-wsgi + +python-django-imagekit comes from https://salsa.debian.org/python-team/modules/python-django-imagekit +python-django-tinymce comes from https://salsa.debian.org/python-team/modules/python-django-tinymce + +need fonts-freefont-ttf (to have truetype freesans available for troggle via PIL) +need libapache2-mod-wsgi for apache wsgi support. + +On stretch the django 1.10 is no use so get rid of that: +apt remove python3-django python-django python-django-common python-django-doc + +Then replace with django 1.7 (Needs to be built for stretch) +apt install python-django python-django-common python-django-doc +apt install python-django-registration python-django-imagekit python-django-tinymce + +then hold them to stop them being upgraded by unattended upgrades: +echo "python-django hold" | sudo dpkg --set-selections +echo "python-django-common hold" | sudo dpkg --set-selections +echo "python-django-doc hold" | sudo dpkg --set-selections + +Optimizing server +I've tweaked the apache and mysql settings to make them a bit more suitable for a small machine. Seems to have shaved 200MB or so off the idling footprint. +https://www.narga.net/optimizing-apachephpmysql-low-memory-server/ + +(just discovered 'ab' for running apache performance tests - handy). + +Do the edit to site-packages/django/db/backends/base.py +to comment out the requirement for mysqlclient >1.3.13 +as we run perfectly happily with Django 2.2.19 & mysqlite 1.3.10 +: + +version = Database.version_info +#test nobbled by Wookey 2021-04-08 as 1.3.13 is not available on stable +#if version < (1, 3, 13): +# raise ImproperlyConfigured('mysqlclient 1.3.13 or newer is required; you have %s.' % Database.__version__) + diff --git a/_deploy/docker/Dockerfile b/_deploy/docker/Dockerfile new file mode 100644 index 0000000..5f45b8e --- /dev/null +++ b/_deploy/docker/Dockerfile @@ -0,0 +1,28 @@ +FROM python:2.7-stretch + +#COPY backports.list /etc/apt/sources.list.d/ + +RUN apt-get -y update && apt-get install -y mercurial fonts-freefont-ttf locales survex + +#RUN apt-get -y -t -backports install survex + +# Set the locale +RUN locale-gen en_GB.UTF-8 +ENV LANG en_GB.UTF-8 +ENV LANGUAGE en_GB:en +ENV LC_ALL en_GB.UTF-8 + +WORKDIR /opt/expo/troggle +COPY requirements.txt . + +RUN pip install --upgrade pip + +RUN pip install -r requirements.txt + +EXPOSE 8000 + +WORKDIR /expo/troggle + +#CMD ["python","manage.py","migrate"] + +ENTRYPOINT ["python","manage.py","runserver","0.0.0.0:8000"] diff --git a/_deploy/docker/Dockerfile-django-1.4.22-wheezy b/_deploy/docker/Dockerfile-django-1.4.22-wheezy new file mode 100644 index 0000000..f6d5554 --- /dev/null +++ b/_deploy/docker/Dockerfile-django-1.4.22-wheezy @@ -0,0 +1,18 @@ +FROM python:2.7-wheezy + +RUN apt-get -y update && apt-get install -y mercurial fonts-freefont-ttf survex locales + +# Set the locale +RUN locale-gen en_GB.UTF-8 +ENV LANG en_GB.UTF-8 +ENV LANGUAGE en_GB:en +ENV LC_ALL en_GB.UTF-8 + +WORKDIR /opt/expo/troggle +COPY requirements.txt . + +RUN pip install -r requirements.txt + +EXPOSE 8000 + +#CMD ["python","manage.py","runserver","0.0.0.0:8000"]
\ No newline at end of file diff --git a/_deploy/docker/Dockerfile-django-1.5.12-jessie b/_deploy/docker/Dockerfile-django-1.5.12-jessie new file mode 100644 index 0000000..2cf1a51 --- /dev/null +++ b/_deploy/docker/Dockerfile-django-1.5.12-jessie @@ -0,0 +1,26 @@ +FROM python:2.7-jessie + +COPY backports.list /etc/apt/sources.list.d/ + +RUN apt-get -y update && apt-get install -y mercurial fonts-freefont-ttf locales + +RUN apt-get -y -t jessie-backports install survex + +# Set the locale +RUN locale-gen en_GB.UTF-8 +ENV LANG en_GB.UTF-8 +ENV LANGUAGE en_GB:en +ENV LC_ALL en_GB.UTF-8 + +WORKDIR /opt/expo/troggle +COPY requirements.txt . + +RUN pip install --upgrade pip + +RUN pip install -r requirements.txt + +EXPOSE 8000 + +WORKDIR /expo/troggle + +#CMD ["python","manage.py","runserver","0.0.0.0:8000"]
\ No newline at end of file diff --git a/_deploy/docker/README.md b/_deploy/docker/README.md new file mode 100644 index 0000000..25ce966 --- /dev/null +++ b/_deploy/docker/README.md @@ -0,0 +1,84 @@ +# Running troggle on Docker + +These notes written by Sam Wenham in Feb., 2019. +These all pre-date the move to python3, later versions of Django (1.11.+) and debian. + +## Install +First you need to install + - [docker-ce](https://docs.docker.com/install/) + - [docker-compose](https://docs.docker.com/compose/install/) + +If you don't want to type sudo for every docker command (you don't) you need to add your user to the docker group. + +To do this + +- Create the docker group. + ```bash + $ sudo groupadd docker + ``` + +- Add your user to the docker group. + ```bash + $ sudo usermod -aG docker $USER + ``` +## Setup + +Checkout all 4 of the expo repos into one folder ([see here for repo cloning instructions](http://expo.survex.com/handbook/manual.html#quickstart)) eg. +``` +$ ~/expo/loser + /troggle + /expoweb + /tunnel +``` +In the troggle dir copy localsettingsdocker.py to localsettings.py + +In the folder you checked out all the repos into (expo in this example) create a folder called `expofiles` and in that a folder called `surveyscans` eg + +```bash +cd ~/expo +mkdir -p expofiles/surveyscans +``` + +## Starting the containers + +To start the containers run +```bash +$ docker-compose up +``` +You will now have a working troggle but with no data. To import the data you need to access the container run +```bash +$ docker exec -it docker_troggle_1 /bin/bash +``` +This will give you a shell inside the troggle container + +(You may get a warning like `bash: warning: setlocale: LC_ALL: cannot change locale (en_GB.UTF-8)` this can be ignored) + +To import the data into troggle now run +```bash +$ python databaseReset.py reset +``` +and wait .... this takes a while. +The MySQL database is stored in a docker volume so once run through once the database will remain full of expo data even if you restart the containers. + +## Using your new dev setup +Even whilst the import is running you can browse to [http://localhost:8000] + +Any chnages made to files in your checkouts will be automatically loaded in the container and served. Somtimes changes to the python files will require the system to reload so refresh a couple of times before declaring you have broken something. + +If you edit files from within the container they will have their ownership changed to root and may become un editable to your user (you will have to become root to fix this) so don't do this! + +## Stopping the containers +To stop the running containers press Ctrl-c + +## Killing it all +If you get it in some state you want to start again run +```bash +$ docker-compose down +``` +to destroy the containers +and +```bash +$ docker volume ls +$ docker volume rm docker_expo-mysqldb +``` + to remove the database volume
\ No newline at end of file diff --git a/_deploy/docker/backports.list b/_deploy/docker/backports.list new file mode 100644 index 0000000..c29532b --- /dev/null +++ b/_deploy/docker/backports.list @@ -0,0 +1 @@ +deb http://ftp.debian.org/debian jessie-backports main
\ No newline at end of file diff --git a/_deploy/docker/compose/mysql.env b/_deploy/docker/compose/mysql.env new file mode 100644 index 0000000..9cebaa7 --- /dev/null +++ b/_deploy/docker/compose/mysql.env @@ -0,0 +1,5 @@ +MYSQL_ROOT_PASSWORD=expo123 +MYSQL_DATABASE=troggle +MYSQL_USER=troggleuser +MYSQL_PASSWORD=expo123 + diff --git a/_deploy/docker/docker-cmd b/_deploy/docker/docker-cmd new file mode 100644 index 0000000..2898a60 --- /dev/null +++ b/_deploy/docker/docker-cmd @@ -0,0 +1,7 @@ +cd docker + +docker run -it --name expo-mysql -e MYSQL_ROOT_PASSWORD=expo123 mariadb + +docker build -t expo/troggle:django-1.5.12 . + +docker run -it --rm --link expo-mysql:mysql -v /home/sam/expo:/expo expo/troggle:django-1.5.12 /bin/bash
\ No newline at end of file diff --git a/_deploy/docker/docker-compose.yml b/_deploy/docker/docker-compose.yml new file mode 100644 index 0000000..a4ab80c --- /dev/null +++ b/_deploy/docker/docker-compose.yml @@ -0,0 +1,21 @@ +version: '3' +services: + troggle: + restart: always + build: . + ports: + - "8000:8000" + volumes: + - ../..:/expo + links: + - expo-mysql + expo-mysql: + restart: always + image: "mariadb" + env_file: + - compose/mysql.env + volumes: + - expo-mysqldb:/var/lib/mysql + +volumes: + expo-mysqldb: diff --git a/_deploy/docker/mysql.env b/_deploy/docker/mysql.env new file mode 100644 index 0000000..9cebaa7 --- /dev/null +++ b/_deploy/docker/mysql.env @@ -0,0 +1,5 @@ +MYSQL_ROOT_PASSWORD=expo123 +MYSQL_DATABASE=troggle +MYSQL_USER=troggleuser +MYSQL_PASSWORD=expo123 + diff --git a/_deploy/docker/requirements.txt b/_deploy/docker/requirements.txt new file mode 100644 index 0000000..7a197bd --- /dev/null +++ b/_deploy/docker/requirements.txt @@ -0,0 +1,9 @@ +Django==1.7.11 +django-registration==2.1.2 +mysql +#imagekit +django-imagekit +Image +django-tinymce==2.7.0 +smartencoding +unidecode diff --git a/_deploy/docker/requirements.txt.dj-1.4.22 b/_deploy/docker/requirements.txt.dj-1.4.22 new file mode 100644 index 0000000..dac7b30 --- /dev/null +++ b/_deploy/docker/requirements.txt.dj-1.4.22 @@ -0,0 +1,7 @@ +Django==1.4.22 +django-registration==0.8 +mysql +imagekit +Image +django-tinymce==1.5.3 +smartencoding diff --git a/_deploy/docker/requirements.txt.dj-1.5.12 b/_deploy/docker/requirements.txt.dj-1.5.12 new file mode 100644 index 0000000..9f9b5ae --- /dev/null +++ b/_deploy/docker/requirements.txt.dj-1.5.12 @@ -0,0 +1,7 @@ +Django==1.5.12 +django-registration==1.0 +mysql +imagekit +Image +django-tinymce==1.5.3 +smartencoding diff --git a/_deploy/docker/requirements.txt.dj-1.6.11 b/_deploy/docker/requirements.txt.dj-1.6.11 new file mode 100644 index 0000000..b26bc10 --- /dev/null +++ b/_deploy/docker/requirements.txt.dj-1.6.11 @@ -0,0 +1,7 @@ +Django==1.6.11 +django-registration==1.0 +mysql +imagekit +Image +django-tinymce==1.5.3 +smartencoding diff --git a/_deploy/docker/requirements.txt.dj-1.7.11 b/_deploy/docker/requirements.txt.dj-1.7.11 new file mode 100644 index 0000000..7a197bd --- /dev/null +++ b/_deploy/docker/requirements.txt.dj-1.7.11 @@ -0,0 +1,9 @@ +Django==1.7.11 +django-registration==2.1.2 +mysql +#imagekit +django-imagekit +Image +django-tinymce==2.7.0 +smartencoding +unidecode diff --git a/_deploy/docker/requirements.txt.dj-1.8.19 b/_deploy/docker/requirements.txt.dj-1.8.19 new file mode 100644 index 0000000..6942998 --- /dev/null +++ b/_deploy/docker/requirements.txt.dj-1.8.19 @@ -0,0 +1,7 @@ +Django==1.8.19 +django-registration==2.1.2 +mysql +django-imagekit +Image +django-tinymce==2.7.0 +smartencoding diff --git a/_deploy/old/localsettingsdocker.py b/_deploy/old/localsettingsdocker.py new file mode 100644 index 0000000..76cca3d --- /dev/null +++ b/_deploy/old/localsettingsdocker.py @@ -0,0 +1,65 @@ +import sys +# This is the local settings for use with the docker compose dev setup. It is imported automatically + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.mysql', # 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. + 'NAME' : 'troggle', # Or path to database file if using sqlite3. + 'USER' : 'troggleuser', # Not used with sqlite3. + 'PASSWORD' : 'expo123', # Not used with sqlite3. + 'HOST' : 'expo-mysql', # Set to empty string for localhost. Not used with sqlite3. + 'PORT' : '', # Set to empty string for default. Not used with sqlite3. + } +} + +EXPOUSER = 'expo' +EXPOUSERPASS = "nnn:gggggg" +EXPOUSER_EMAIL = 'wookey@wookware.org' + +REPOS_ROOT_PATH = '/expo/' +sys.path.append(REPOS_ROOT_PATH) +sys.path.append(REPOS_ROOT_PATH + 'troggle') + +PUBLIC_SITE = False + +SURVEX_DATA = REPOS_ROOT_PATH + 'loser/' +DRAWINGS_DATA = REPOS_ROOT_PATH + 'drawings/' + +CAVERN = 'cavern' +THREEDTOPOS = '3dtopos' +EXPOWEB = REPOS_ROOT_PATH + 'expoweb/' +SURVEYS = REPOS_ROOT_PATH +SURVEY_SCANS = REPOS_ROOT_PATH + 'expofiles/' +FILES = REPOS_ROOT_PATH + 'expofiles' + +CACHEDIR = REPOS_ROOT_PATH + 'expowebcache/' +THREEDCACHEDIR = CACHEDIR + '3d/' +THUMBNAILCACHE = CACHEDIR + 'thumbs' + +PYTHON_PATH = REPOS_ROOT_PATH + 'troggle/' + +URL_ROOT = 'http://127.0.0.1:8000/' +DIR_ROOT = ''#this should end in / if a value is given +EXPOWEB_URL = '/' +SURVEYS_URL = '/survey_scans/' + +MEDIA_URL = URL_ROOT + DIR_ROOT + 'site_media/' +MEDIA_ROOT = REPOS_ROOT_PATH + '/troggle/media/' +MEDIA_ADMIN_DIR = '/usr/lib/python2.7/site-packages/django/contrib/admin/media/' + +STATIC_URL = "/static/" +STATIC_ROOT = "/expo/static" + +JSLIB_URL = URL_ROOT + 'javascript/' + +TINY_MCE_MEDIA_ROOT = STATIC_ROOT + '/tiny_mce/' +TINY_MCE_MEDIA_URL = STATIC_ROOT + '/tiny_mce/' + +TEMPLATE_DIRS = ( + PYTHON_PATH + "templates", + # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". + # Always use forward slashes, even on Windows. + # Don't forget to use absolute paths, not relative paths. +) + +LOGFILE = PYTHON_PATH + 'troggle_log.txt' diff --git a/_deploy/old/localsettingspotatohut.py b/_deploy/old/localsettingspotatohut.py new file mode 100644 index 0000000..2e5c08b --- /dev/null +++ b/_deploy/old/localsettingspotatohut.py @@ -0,0 +1,78 @@ +import sys + +# This is an example file. Copy it to localsettings.py, set the +# password and _don't_ check that file back to the repo as it exposes +# your/our password to the world! + +# This will ALL NEED TO BE CHANGED to match localsettingsWSL / python3 / Django v1.18.29 + + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. + 'NAME': 'troggle', # Or path to database file if using sqlite3. + 'USER': 'expo', # Not used with sqlite3. + 'PASSWORD': 'notarealpassword', # Not used with sqlite3. + 'HOST': '', # Set to empty string for localhost. Not used with sqlite3. + 'PORT': '', # Set to empty string for default. Not used with sqlite3. + } +} + +REPOS_ROOT_PATH = '/home/expo/' +sys.path.append(REPOS_ROOT_PATH) +sys.path.append(REPOS_ROOT_PATH + 'troggle') + +PUBLIC_SITE = True +FIX_PERMISSIONS = ["sudo", "/usr/local/bin/fix_permissions"] + +SURVEX_DATA = REPOS_ROOT_PATH + 'loser/' +DRAWINGS_DATA = REPOS_ROOT_PATH + 'drawings/' +THREEDCACHEDIR = REPOS_ROOT_PATH + 'expowebcache/3d/' + +CAVERN = 'cavern' +THREEDTOPOS = '3dtopos' +EXPOWEB = REPOS_ROOT_PATH + 'expoweb/' +SURVEYS = REPOS_ROOT_PATH +SURVEY_SCANS = REPOS_ROOT_PATH + 'expoimages/' +FILES = REPOS_ROOT_PATH + 'expoimages' + + +PYTHON_PATH = '/home/expo/troggle/' + +URL_ROOT = "http://expo/" +DIR_ROOT = ''#this should end in / if a value is given +EXPOWEB_URL = 'http://expo/' +SURVEYS_URL = 'http://expo/survey_scans/' +MEDIA_URL = '/' + DIR_ROOT + 'site_media/' + +STATIC_URL = URL_ROOT +STATIC_ROOT = DIR_ROOT + +MEDIA_ROOT = REPOS_ROOT_PATH + '/troggle/media/' +MEDIA_ADMIN_DIR = '/usr/lib/python2.7/site-packages/django/contrib/admin/media/' + +JSLIB_PATH = '/usr/share/javascript/' + +TINY_MCE_MEDIA_ROOT = '/usr/share/tinymce/www/' +TINY_MCE_MEDIA_URL = URL_ROOT + DIR_ROOT + 'tinymce_media/' + +TEMPLATE_DIRS = ( + PYTHON_PATH + "templates", + # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". + # Always use forward slashes, even on Windows. + # Don't forget to use absolute paths, not relative paths. +) + +LOGFILE = '/home/expo/troggle/troggle_log.txt' + +FEINCMS_ADMIN_MEDIA='/site_media/feincms/' + +EMAIL_HOST = "smtp.gmail.com" + +EMAIL_HOST_USER = "cuccexpo@gmail.com" + +EMAIL_HOST_PASSWORD = "insert-real-email-password-here" + +EMAIL_PORT=587 + +EMAIL_USE_TLS = True diff --git a/_deploy/old/localsettingsserver.py b/_deploy/old/localsettingsserver.py new file mode 100644 index 0000000..79cd6ef --- /dev/null +++ b/_deploy/old/localsettingsserver.py @@ -0,0 +1,115 @@ +import sys +import os +import urllib.parse +"""Settings for a troggle installation which may vary among different +installations: for development or deployment, in a docker image or +python virtual environment (venv), on ubuntu, debian or in Windows +System for Linux (WSL), on the main server or in the potato hut, +using SQLite or mariaDB. + +It sets the directory locations for the major parts of the system so +that e.g. expofiles can be on a different filesystem. + +This file is included at the end of the main troggle/settings.py file so that +it overwrites defaults in that file. +""" + +print(" * importing troggle/localsettings.py") + +# DO NOT check this file into the git repo - it contains real passwords. + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.mysql', # 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. + 'NAME' : 'troggle', # Or path to database file if using sqlite3. + 'USER' : 'expo', # Not used with sqlite3. + 'PASSWORD' : 'not a real password', # Not used with sqlite3. + 'HOST' : '', # Set to empty string for localhost. Not used with sqlite3. + 'PORT' : '', # Set to empty string for default. Not used with sqlite3. + } +} + + +EXPOUSER = 'expo' +EXPOUSERPASS = "nnn:gggggg" +EXPOUSER_EMAIL = 'wookey@wookware.org' + +REPOS_ROOT_PATH = '/home/expo/' +sys.path.append(REPOS_ROOT_PATH) +sys.path.append(REPOS_ROOT_PATH + 'troggle') +# Define the path to the django app (troggle in this case) +PYTHON_PATH = REPOS_ROOT_PATH + 'troggle/' + +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [ + PYTHON_PATH + "templates" + ], + 'OPTIONS': { + 'debug': 'DEBUG', + 'context_processors': [ + 'django.contrib.auth.context_processors.auth', + 'core.context.troggle_context', + 'django.template.context_processors.debug', + 'django.template.context_processors.i18n', + 'django.template.context_processors.media', + 'django.template.context_processors.static', + 'django.template.context_processors.tz', + 'django.contrib.messages.context_processors.messages', + ], + 'loaders': [ + 'django.template.loaders.filesystem.Loader', + 'django.template.loaders.app_directories.Loader', + # insert your TEMPLATE_LOADERS here + ] + }, + }, +] + +PUBLIC_SITE = True + +# This should be False for normal running +DEBUG = True + +SURVEX_DATA = REPOS_ROOT_PATH + 'loser/' +DRAWINGS_DATA = REPOS_ROOT_PATH + 'drawings/' + +CAVERN = 'cavern' +THREEDTOPOS = 'survexport' +EXPOWEB = REPOS_ROOT_PATH + 'expoweb/' +SURVEYS = REPOS_ROOT_PATH +SURVEY_SCANS = REPOS_ROOT_PATH + 'expofiles/surveyscans/' +FILES = REPOS_ROOT_PATH + 'expofiles' +CAVEDESCRIPTIONS = os.path.join(EXPOWEB, "cave_data") +ENTRANCEDESCRIPTIONS = os.path.join(EXPOWEB, "entrance_data") + +CACHEDIR = REPOS_ROOT_PATH + 'expowebcache/' +THREEDCACHEDIR = CACHEDIR + '3d/' +THUMBNAILCACHE = CACHEDIR + 'thumbs' + +PYTHON_PATH = REPOS_ROOT_PATH + 'troggle/' + +URL_ROOT = 'http://expo.survex.com/' +DIR_ROOT = ''#this should end in / if a value is given +EXPOWEB_URL = '/' +SURVEYS_URL = '/survey_scans/' +EXPOFILES = urllib.parse.urljoin(REPOS_ROOT_PATH, 'expofiles/') +PHOTOS_URL = urllib.parse.urljoin(URL_ROOT, '/photos/') + +# MEDIA_URL is used by urls.py in a regex. See urls.py & core/views/surveys.py +MEDIA_URL = '/site_media/' + +MEDIA_ROOT = REPOS_ROOT_PATH + '/troggle/media/' + +STATIC_URL = urllib.parse.urljoin(URL_ROOT , '/static/') # used by Django admin pages. Do not delete. +JSLIB_URL = urllib.parse.urljoin(URL_ROOT , '/javascript/') # always fails, try to revive it ? + +#TINY_MCE_MEDIA_ROOT = STATIC_ROOT + '/tiny_mce/' # not needed while TinyMCE not installed +#TINY_MCE_MEDIA_URL = STATIC_URL + '/tiny_mce/' # not needed while TinyMCE not installed + +LOGFILE = '/var/log/troggle/troggle.log' +IMPORTLOGFILE = '/var/log/troggle/import.log' + +# add in 290, 291, 358 when they don't make it crash horribly +NOTABLECAVESHREFS = [ "264", "258", "204", "76", "107"] diff --git a/_deploy/old/localsettingsubuntu.py b/_deploy/old/localsettingsubuntu.py new file mode 100644 index 0000000..74ebd3c --- /dev/null +++ b/_deploy/old/localsettingsubuntu.py @@ -0,0 +1,69 @@ +import sys +# link localsettings to this file for use on expo computer in austria + +# This will ALL NEED TO BE CHANGED to match localsettingsWSL / python3 / Django v1.18.29 + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.mysql', # 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. + 'NAME' : 'troggle', # Or path to database file if using sqlite3. + 'USER' : 'expo', # Not used with sqlite3. + 'PASSWORD' : 'sekrit', # Not used with sqlite3. + 'HOST' : '', # Set to empty string for localhost. Not used with sqlite3. + 'PORT' : '', # Set to empty string for default. Not used with sqlite3. + } +} + +EXPOUSER = 'expo' +EXPOUSERPASS = "nnn:gggggg" +EXPOUSER_EMAIL = 'wookey@wookware.org' + +REPOS_ROOT_PATH = '/home/expo/expofiles/' + +sys.path.append(REPOS_ROOT_PATH) +sys.path.append(REPOS_ROOT_PATH + 'troggle') + +PUBLIC_SITE = False + +SURVEX_DATA = REPOS_ROOT_PATH + 'loser/' +DRAWINGS_DATA = REPOS_ROOT_PATH + 'drawings/' +THREEDCACHEDIR = REPOS_ROOT_PATH + 'expowebcache/3d/' + +CAVERN = 'cavern' +THREEDTOPOS = '3dtopos' +EXPOWEB = REPOS_ROOT_PATH + 'expoweb/' +SURVEYS = REPOS_ROOT_PATH +SURVEY_SCANS = REPOS_ROOT_PATH + 'expofiles/' +FILES = REPOS_ROOT_PATH + 'expofiles' + +EXPOWEB_URL = '/' +SURVEYS_URL = '/survey_scans/' + +PYTHON_PATH = REPOS_ROOT_PATH + 'troggle/' + +#URL_ROOT = 'http://127.0.0.1:8000' +URL_ROOT = "http://expoweb/" +DIR_ROOT = ''#this should end in / if a value is given + + + +MEDIA_URL = URL_ROOT + DIR_ROOT + '/site_media/' +MEDIA_ROOT = REPOS_ROOT_PATH + '/troggle/media/' +MEDIA_ADMIN_DIR = '/usr/lib/python2.4/site-packages/django/contrib/admin/media/' + +STATIC_URL = URL_ROOT +STATIC_ROOT = DIR_ROOT + +JSLIB_URL = URL_ROOT + 'javascript/' + +TINY_MCE_MEDIA_ROOT = '/usr/share/tinymce/www/' +TINY_MCE_MEDIA_URL = URL_ROOT + DIR_ROOT + '/tinymce_media/' + +TEMPLATE_DIRS = ( + PYTHON_PATH + "templates", + # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". + # Always use forward slashes, even on Windows. + # Don't forget to use absolute paths, not relative paths. +) + +LOGFILE = PYTHON_PATH + 'troggle_log.txt' diff --git a/_deploy/wsl/check-for-later-copy-of-localsettings.WSL.txt b/_deploy/wsl/check-for-later-copy-of-localsettings.WSL.txt new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/_deploy/wsl/check-for-later-copy-of-localsettings.WSL.txt |