mirror of
https://expo.survex.com/repositories/expoweb/.git/
synced 2026-01-20 21:02:46 +00:00
password stuff re engineered - online edit of handbook/troggle/troglaptop.html - on dev machine 'SnowWhite'
This commit is contained in:
@@ -237,32 +237,42 @@ The version number is the version of Django you have installed. Double check tha
|
||||
You will get an error: No module named 'localsettings'. Fixing this is described below, but for now try:
|
||||
|
||||
<pre><code>python manage.py check -v 3 --traceback</code></pre><p>The most important is the <var>python manage.py check</var>. If this works, then you have installed the software correctly.
|
||||
|
||||
<h4>troggle local settings and passwords</h4>
|
||||
<p>
|
||||
The next task is to edit the SETTINGS files to match your machine and folder structure. So find the appropriate copy of the localsettings in /_deploy/ and copy it into the main troggle folder:
|
||||
<pre><code>cp _deploy/wsl/localsettingsWSL.py localsettings.py</code></pre>
|
||||
The next task is to edit the SETTINGS files to match your machine and folder structure. So find the most appropriate copy of the localsettings in /_deploy/ and copy it into the main troggle folder:
|
||||
<pre><code>cp _deploy/okchai/localsettings-okchai.py localsettings.py</code></pre>
|
||||
The git repo copies have got munged passwords.
|
||||
localsettings.py is not stored in git, but the copy on the server does have the correct passwords.
|
||||
So use sFTP to download localsettings.py from expo.survex.com to get these.
|
||||
localsettings.py no longer has active passwords in it, but we have not tidied everything up yet.
|
||||
|
||||
<p>
|
||||
We have at one time made localsettings in /_deploy/ appropriate for
|
||||
<ul>
|
||||
<li>debian (server install, not development)
|
||||
<li>Ubuntu
|
||||
<li>Ubuntu under WSL (Windows System for Linux)
|
||||
<li>debian-server (server install, not development), current?
|
||||
<li>debian-laptops
|
||||
<li>ubuntu
|
||||
<li>ubuntu-dev under WSL (Windows System for Linux)
|
||||
<li>docker container
|
||||
<li>potatohut (local network only)
|
||||
<li>xubuntu
|
||||
<li>wsl
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
WARNING: only the WSL (12/2024) and debian (12/2023) variants are in any way current . All the others are so old that
|
||||
they will need serious work to be useable. Copy what you need from WSL and debian variants of
|
||||
localsettings.py
|
||||
WARNING: All those above are out of date. We have moved to a per-machine set of settings as this is more manageable in practice:
|
||||
|
||||
<p style="color:red">[ALL THIS ABOUT PASSWORDS IS OUT OF DATE, come back tomorrow: 28th June 2025.
|
||||
]
|
||||
<p>Now edit localsettings.py and insert useful values for EXPOUSERPASS [e.g. cavey:beery], EXPOADMINUSERPASS [e.g. beery:cavey], SECRET_KEY. SECRET_KEY can be anything, it just has to be unique to each installation and invisible to anyone not a developer.
|
||||
<ul>
|
||||
<li>SnowWhite (uses WSL: ubuntu 24.04.2 on Win10), local expofiles and photos, current
|
||||
<li>okchai (xubuntu 24.04.2) local expofiles and photos, current
|
||||
<li>pulsifer (xubuntu, in 2025)
|
||||
<li>barbie (xubuntu? in 2025)
|
||||
<li>crowley (debian? in 2025)
|
||||
<li>aziraphale (debian? in 2026 if resurrected)
|
||||
<li>expo (new name for debian-server)
|
||||
</ul>
|
||||
|
||||
Pick one which is closest to your needs and copy it
|
||||
<pre><code>cp _deploy/okchai/localsettings-okchai.py localsettings.py</code></pre>
|
||||
|
||||
<p>Set <a href="https://docs.djangoproject.com/en/4.0/topics/email/#s-configuring-email-for-development">EMAIL_HOST and EMAIL_HOST_PASSWORD</a> to an email account you control that can send email. Then troggle can email you when some things go wrong. This may mean having to set EMAIL_PORT and MAIL_USE_TLS too (this is not used in troggle currently). Set EXPOUSER_EMAIL and EXPOADMINUSER_EMAIL to your own email address while you are doing software development. All these will be different when troggle is deployed on the public server.
|
||||
|
||||
<p>
|
||||
Now you need to edit the following settings in your localsettings.py file to match your
|
||||
@@ -270,7 +280,8 @@ development machine, e.g. if you have /expofiles/ mounted on another disc:
|
||||
|
||||
|
||||
<pre><code>FILES = Path('/mnt/f/expofiles/')
|
||||
EXPOFILES = Path('/mnt/f/expofiles/')</code></pre>
|
||||
EXPOFILES = Path('/mnt/f/expofiles/')
|
||||
PHOTOS = Path('/mnt/z/expophotos/')</code></pre>
|
||||
<p>
|
||||
All the other settings (drawings, expoweb etc.) will work fine if they are parallel directories
|
||||
to the directory you installed troggle into. The troggle code can find out itself where it
|
||||
@@ -279,9 +290,37 @@ is living.
|
||||
If you do not have a local copy of /expofiles/ (40 GB), you can use the expo server copy if
|
||||
you set:
|
||||
<pre><code>EXPOFILESREMOTE = TRUE</code></pre>
|
||||
and then the FILES and EXPOFILES setings will be ignored. (Except for the upload forms which will 'upload' files
|
||||
<a href="#EXPOFILESREMOTE">to your local disc</a>. )
|
||||
and then the FILES and EXPOFILES setings will be ignored. (Except for the upload forms which will 'upload' files <a href="#EXPOFILESREMOTE">to your local disc</a>. )
|
||||
|
||||
<h4>Passwords</h4>
|
||||
|
||||
<p>The passwords are in a file <var>troggle/secret-credentials.py</var> which is listed in .gitignore and so it not under version control. Use sFTP to download credentials.py from expo.survex.com to get these. A sanitised version of this is:
|
||||
<pre><code>
|
||||
'''
|
||||
Do not load this into git !
|
||||
it should always be listed in .gitignore
|
||||
'''
|
||||
SECRET_KEY = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
|
||||
# used for Django session cookies, generated 16/1/2024
|
||||
LONGTERM_SECRET_KEY = 'yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy'
|
||||
# used for encrypting stored personal data, generated 16/1/2024
|
||||
EXPOUSERPASS = "nnn:gggggg" # expo
|
||||
EXPOADMINUSERPASS = "gggggggggg" # expoadmin
|
||||
EMAIL_HOST_PASSWORD = "smtp-zzzzzzzzzzz"
|
||||
MARIADB_SERVER_PASSWORD = 'uuuuuuuuuuuuuuu'</code></pre>
|
||||
<p>
|
||||
The "SECRET_KEY" doesn't matter, it could be anything, and we could regenerate a random one whenever we reset the database. It is only used by Django internal functions such as session cookies.
|
||||
<p>
|
||||
The "LONGTERM_SECRET_KEY" encrypts the email addresses of registered users in a file. This is only used for user registration and for logging on as an individual instead of just as "expo".
|
||||
|
||||
|
||||
|
||||
<p>Set <a href="https://docs.djangoproject.com/en/4.0/topics/email/#s-configuring-email-for-development">EMAIL_HOST and EMAIL_HOST_PASSWORD</a> to an email account you control that can send email. Then troggle can email you when some things go wrong. This may mean having to set EMAIL_PORT and MAIL_USE_TLS too (this is not used in troggle currently). Set EXPOUSER_EMAIL and EXPOADMINUSER_EMAIL to your own email address while you are doing software development. All these will be different when troggle is deployed on the public server.
|
||||
<p>If you got hold of <var>secret_credentials.py</var> from the server, you will need to edit the EMAIL passwords in <var>secret_credentials.py</var> to match the email address you will put into localsettings.py for your own machine.
|
||||
|
||||
<p>Only the server runs MARIADB, you don't need it for local development.
|
||||
|
||||
<h4>Both django & troggle health checks</h4>
|
||||
<p>
|
||||
Now try this again:
|
||||
<pre><code>python manage.py</code></pre>
|
||||
|
||||
Reference in New Issue
Block a user