Skip to content

Commit 5e02d7e

Browse files
committed
Merge branch 'develop' into selection
2 parents 0f8cf9d + 43aeeec commit 5e02d7e

File tree

16 files changed

+261
-27
lines changed

16 files changed

+261
-27
lines changed

Dockerfile

+19-2
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ EXPOSE 8000 3000 6006
8787
ENTRYPOINT ["./dev-run.sh"]
8888

8989

90-
#=========== STAGE: PRODUCTION ===============================================#
90+
#=========== STAGE: COMMON ===================================================#
9191

92-
FROM base AS production
92+
from base as common
9393

9494
# Install prod requirements
9595
RUN pip install --no-cache-dir -r requirements-prod.txt
@@ -105,6 +105,23 @@ RUN rm -rf ./mathesar_ui
105105
RUN rm -rf ./mathesar/tests ./db/tests
106106
RUN rm -rf ./docs
107107

108+
109+
#=========== STAGE: DEMO =====================================================#
110+
111+
FROM common AS demo
112+
113+
# Install prod requirements
114+
RUN pip install --no-cache-dir -r requirements-demo.txt
115+
116+
EXPOSE 8000
117+
118+
ENTRYPOINT ["./run.sh"]
119+
120+
121+
#=========== STAGE: PRODUCTION ===============================================#
122+
123+
FROM common AS production
124+
108125
EXPOSE 8000
109126

110127
ENTRYPOINT ["./run.sh"]

config/settings/production.py

+8
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
# Override default settings
44
DEBUG = False
55
MATHESAR_MODE = 'PRODUCTION'
6+
7+
'''
8+
This tells Django to trust the X-Forwarded-Proto header that comes from our proxy,
9+
and any time its value is 'https', then the request is guaranteed to be secure
10+
(i.e., it originally came in via HTTPS).
11+
'''
12+
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
13+
614
# Use a local.py module for settings that shouldn't be version tracked
715
try:
816
from .local import * # noqa

demo/settings.py

+3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
"demo.middleware.LiveDemoModeMiddleware",
1111
]
1212

13+
14+
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
15+
1316
MATHESAR_MODE = 'PRODUCTION'
1417
MATHESAR_LIVE_DEMO = True
1518
MATHESAR_LIVE_DEMO_USERNAME = decouple_config('MATHESAR_LIVE_DEMO_USERNAME', default=None)

docker-compose.dev.yml

+2
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ services:
3838
context: .
3939
target: development
4040
dockerfile: Dockerfile
41+
args:
42+
PYTHON_VERSION: ${PYTHON_VERSION-3.9-bookworm}
4143
environment:
4244
- MODE=${MODE-DEVELOPMENT}
4345
- DEBUG=${DEBUG-True}

docs/docs/administration/debug.md

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Debug Mathesar
2+
3+
For now, we only support turning on Debugging by using our special docker image. More methods will follow in future releases.
4+
5+
## Use the debugging Mathesar docker image
6+
7+
There is a debugging-enabled Mathesar docker image available at `mathesar/mathesar-debug` that is the same as the `mathesar/mathesar-prod` image, except that it has more debugging output available in the console where it's run, and it also produces more verbose errors in the browser when something goes wrong.
8+
9+
You can use this image to figure out (or to help the Mathesar team figure out) what's wrong if your Mathesar installation isn't working as expected. The procedure is to
10+
11+
1. Run Mathesar with the `mathesar/mathesar-debug` image, and then
12+
1. Observe and report any additional output or clues to the Mathesar team.
13+
14+
### Docker Compose
15+
16+
Just replace the line
17+
18+
```
19+
image: mathesar/mathesar-prod:latest
20+
```
21+
22+
with
23+
24+
```
25+
image: mathesar/mathesar-debug:latest
26+
```
27+
28+
### Basic Mathesar docker image
29+
30+
If you are just trying the Mathesar Docker image directly as instructed in the [introduction](../index.md#try-locally), replace the command
31+
32+
```
33+
docker run -it --name mathesar -p 8000:8000 mathesar/mathesar-prod:latest
34+
```
35+
36+
with
37+
38+
```
39+
docker run -it --name mathesar -p 8000:8000 mathesar/mathesar-debug:latest
40+
```
41+
42+
### Other setups
43+
44+
The debugging docker image should work anywhere the production image works. This means you can just replace any pull or run of the image `mathesar/mathesar-prod:latest` with `mathesar/mathesar-debug:latest`.

docs/docs/administration/upgrade/0.1.4.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,11 @@ If you installed Mathesar [from scratch](../../installation/build-from-source/in
149149
!!! note
150150
Your installation directory may be different from above if you used a different directory when installing Mathesar.
151151
152-
1. Pull the latest version from the repository
152+
1. Pull version 0.1.4 from the repository
153153
154154
```
155155
git pull https://github.com/mathesar-foundation/mathesar.git
156+
git checkout 0.1.4
156157
```
157158
158159
1. Update Python dependencies

docs/docs/administration/upgrade/0.1.5.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ docker compose -f /etc/mathesar/docker-compose.yml up --pull always -d
1414

1515
### For installations done from scratch
1616

17-
If you installed from scratch, the upgrade instructions are the same as [for 0.1.4](../upgrade/0.1.4.md#scratch), but you can skip Step 5 – you do not need to change the environment variables.
17+
If you installed from scratch, the upgrade instructions are the same as [for 0.1.4](./0.1.4.md#scratch), except that you'll need to specify version 0.1.5 when pulling code from the repository in Step 2. You should also skip Step 5 – you do not need to change the environment variables.
+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# Upgrade Mathesar to 0.1.6
2+
3+
### For installations using Docker Compose
4+
5+
If you have a Docker compose installation (including one from the guided script), run the command below:
6+
7+
```
8+
docker compose -f /etc/mathesar/docker-compose.yml up --pull always -d
9+
```
10+
11+
!!! warning "Your installation directory may be different"
12+
You may need to change `/etc/mathesar/` in the command above if you chose to install Mathesar to a different directory.
13+
14+
15+
### For installations done from scratch
16+
17+
If you installed Mathesar [from scratch](../../installation/build-from-source/index.md), then use these steps to upgrade your installation to 0.1.6.
18+
19+
1. Go to your Mathesar installation directory
20+
21+
```
22+
cd xMATHESAR_INSTALLATION_DIRx
23+
```
24+
25+
!!! note
26+
Your installation directory may be different from above if you used a different directory when installing Mathesar.
27+
28+
1. Pull version 0.1.6 from the repository
29+
30+
```
31+
git pull https://github.com/mathesar-foundation/mathesar.git
32+
git checkout 0.1.6
33+
```
34+
35+
1. Update Python dependencies
36+
37+
```
38+
pip install -r requirements-prod.txt
39+
```
40+
41+
1. Activate our virtual environment
42+
43+
```
44+
source ./mathesar-venv/bin/activate
45+
```
46+
47+
1. You can skip the following if you're upgrading from versions 0.1.4 and above.
48+
- If you're upgrading from versions <= 0.1.3, update your environment variables according to the [the new configuration specification](../../configuration/env-variables.md#db).
49+
- In particular, you must put the connection info for the internal DB into new `POSTGRES_*` variables. The `DJANGO_DATABASE_URL` variable is no longer supported.
50+
51+
1. Add the environment variables to the shell before running Django commands
52+
53+
```
54+
export $(sudo cat .env)
55+
```
56+
57+
1. Run Django migrations
58+
59+
```
60+
python manage.py migrate
61+
```
62+
63+
1. Download and extract frontend assets
64+
65+
```
66+
wget https://github.com/mathesar-foundation/mathesar/releases/download/0.1.6/static_files.zip
67+
unzip static_files.zip && mv static_files mathesar/static/mathesar && rm static_files.zip
68+
```
69+
70+
1. Compile Mathesar translation files
71+
72+
```
73+
python manage.py compilemessages
74+
```
75+
76+
1. Update Mathesar functions on the database:
77+
78+
```
79+
python -m mathesar.install --skip-confirm | tee /tmp/install.py.log
80+
```
81+
82+
1. Restart the gunicorn server
83+
84+
```
85+
systemctl restart gunicorn
86+
```

docs/docs/installation/build-from-source/index.md

+8-14
Original file line numberDiff line numberDiff line change
@@ -23,33 +23,36 @@ You should have **root access** to the machine you're installing Mathesar on.
2323

2424
You'll need to install the following system packages before you install Mathesar:
2525

26-
- [Python](https://www.python.org/downloads/) 3.9, 3.10, 3.11 or 3.12
26+
- [Python](https://www.python.org/downloads/) 3.9, 3.10, or 3.11
2727

2828
!!! note "Python version"
29+
2930
Python _older_ than 3.9 will not run Mathesar.
3031

31-
Python _newer_ than 3.10 will run Mathesar, but will require some slightly modified installation steps which we have [not yet documented](https://github.com/centerofci/mathesar/issues/2872).
32+
Python 3.12 will run Mathesar, but you'll have to take extra steps to get some dependencies to build. Installing a package for your OS that provides the `libpq-fe.h` header file should be enough in most cases. On Debian 12, this header is provided by the `libpq-dev` package.
3233

3334
- [PostgreSQL](https://www.postgresql.org/download/linux/) 13 or newer (Verify by logging in, and running the query: `SELECT version();`)
3435

3536
- [Caddy](https://caddyserver.com/docs/install) (Verify with `caddy version`)
3637

3738
- [git](https://git-scm.com/downloads) (Verify with `git --version`)
3839

40+
- [GNU gettext](https://www.gnu.org/software/gettext/) (Verify with `gettext --version`)
3941

4042
### Domain (optional)
43+
4144
If you want Mathesar to be accessible over the internet, you'll probably want to set up a domain or sub-domain to use. **If you don't need a domain, you can skip this section.**
4245

4346
Before you start installation, **ensure that the DNS for your sub-domain or domain is pointing to the machine that you're installing Mathesar on**.
4447

4548
## Customizing this Guide
49+
4650
Type your domain name into the box below. Do not include a trailing slash.
4751

4852
<input data-input-for="DOMAIN_NAME" aria-label="Your Domain name "/>
4953

5054
Then press <kbd>Enter</kbd> to customize this guide with your domain name.
5155

52-
5356
## Installation Steps
5457

5558
### Set up the database
@@ -75,12 +78,6 @@ Then press <kbd>Enter</kbd> to customize this guide with your domain name.
7578
CREATE DATABASE mathesar_django OWNER mathesar;
7679
```
7780
78-
1. Now we let us create a database for storing your data.
79-
80-
```postgresql
81-
CREATE DATABASE your_db_name OWNER mathesar;
82-
```
83-
8481
1. Press <kbd>Ctrl</kbd>+<kbd>D</kbd> to exit the `psql` shell.
8582
8683
@@ -129,7 +126,7 @@ Then press <kbd>Enter</kbd> to customize this guide with your domain name.
129126
1. Clone the git repo into the installation directory.
130127
131128
```
132-
git clone https://github.com/centerofci/mathesar.git .
129+
git clone https://github.com/mathesar-foundation/mathesar.git .
133130
```
134131
135132
1. Checkout the tag of the latest stable release, `{{mathesar_version}}`.
@@ -141,9 +138,6 @@ Then press <kbd>Enter</kbd> to customize this guide with your domain name.
141138
!!! warning "Important"
142139
If you don't run the above command you'll end up installing the latest _development_ version of Mathesar, which will be less stable.
143140
144-
!!! tip
145-
You can install a specific Mathesar release by running commands like `git checkout 0.1.1` (to install version 0.1.1, for example). You can see all available versions by running `git tag`.
146-
147141
1. We need to create a python virtual environment for the Mathesar application.
148142
149143
```
@@ -216,7 +210,7 @@ Then press <kbd>Enter</kbd> to customize this guide with your domain name.
216210
217211
```
218212
wget https://github.com/mathesar-foundation/mathesar/releases/download/{{mathesar_version}}/static_files.zip
219-
unzip static_files.zip && mv static_files /mathesar/static/mathesar
213+
unzip static_files.zip && mv static_files mathesar/static/mathesar && rm static_files.zip
220214
```
221215
222216

docs/docs/releases/0.1.6.md

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Mathesar 0.1.6
2+
3+
## Summary
4+
5+
Mathesar 0.1.6 introduces Japanese localization of the UI and adds better support for working with long text in individual record pages. Improvements for administrators include compatibility with Python 3.10 and 3.11, support for databases running PostgreSQL 16, and the removal of `npm` and `nodejs` as dependencies when installing from scratch.
6+
7+
_This page provides a comprehensive list of all changes in the release._
8+
9+
## Upgrading to 0.1.6
10+
11+
See our guide on [upgrading Mathesar to 0.1.6](../administration/upgrade/0.1.6.md).
12+
13+
## Improvements
14+
15+
### You can now configure Mathesar's UI to display in Japanese
16+
17+
The language setting is stored per-user and can be modified when logging in or when editing a user. This changes the text displayed on buttons and other UI elements within Mathesar. It does not change the display of data within your database (e.g. table names, column names, and cell values). We are hoping to support more languages beyond English and Japanese eventually. Please reach out to us if your are interested in helping to add more translations!
18+
19+
![image](https://github.com/mathesar-foundation/mathesar/assets/52523023/f100423a-922c-4b6c-ad22-3c16cd06afde)
20+
21+
_[#3486](https://github.com/mathesar-foundation/mathesar/pull/3486 "Enable i18n")_, _[#3484](https://github.com/mathesar-foundation/mathesar/pull/3484 "Updates for file translations/en/LC_MESSAGES/django.po in ja")_, _[#3483](https://github.com/mathesar-foundation/mathesar/pull/3483 "Updates for file mathesar_ui/src/i18n/languages/en/dict.json in ja")_, _[#3472](https://github.com/mathesar-foundation/mathesar/pull/3472 "Separate pluralized string to fix Transifex sync")_, _[#3501](https://github.com/mathesar-foundation/mathesar/pull/3501 "Fix layout problem in Data Explorer actions pane")_
22+
23+
### Text fields now auto-expands on the record page to accommodate longer texts
24+
25+
**Before**
26+
27+
All text inputs on the record page had the same height, regardless of their content.
28+
29+
![image](https://github.com/mathesar-foundation/mathesar/assets/52523023/e6ded1de-7b81-49f9-9b2e-7a6311a22d4f)
30+
31+
**After**
32+
33+
All text inputs in record page dynamically adjust to accommodate the content seamlessly.
34+
35+
![image](https://github.com/mathesar-foundation/mathesar/assets/52523023/31e031cc-5c71-447f-9381-c4d6fae03b2d)
36+
37+
_[#3470](https://github.com/mathesar-foundation/mathesar/pull/3470 "Make textarea inputs auto-expand to accommodate longer text fields on the record page")_, _[#3488](https://github.com/mathesar-foundation/mathesar/pull/3488 "Fix regression with record selector not filtering")_, [#3495](https://github.com/mathesar-foundation/mathesar/pull/3495 "Prevent record selector inputs from growing taller")
38+
39+
### Mathesar is now compatible with Python versions: 3.10 and 3.11 along with 3.9
40+
41+
Mathesar now officially supports Python versions 3.10 and 3.11, in addition to the existing 3.9 compatibility. This will provide great flexibility while building Mathesar from source on an OS that natively ships with relatively newer versions of Python.
42+
43+
_[#3478](https://github.com/mathesar-foundation/mathesar/pull/3478 "Extend mathesar to support python 3.10 and above")_, _[#3499](https://github.com/mathesar-foundation/mathesar/pull/3499 "Fix CSRF failures when app is behind a reverse proxy")_, _[#3503](https://github.com/mathesar-foundation/mathesar/pull/3503 "Remove 3.12 support from docs")_, [#3504](https://github.com/mathesar-foundation/mathesar/pull/3504 "Parameterize dev service python version")
44+
45+
### Mathesar is now compatible with PostgreSQL 16
46+
47+
Mathesar now officially supports, and is tested against, Postgres versions 13, 14, 15 and 16.
48+
49+
_[#3480](https://github.com/mathesar-foundation/mathesar/pull/3480 "Add PG 16 to testing matrix")_
50+
51+
### NodeJS is no longer a requirement for building Mathesar from source
52+
53+
We removed NodeJS as a dependency in favour of providing users with pre-built static assest for building Mathesar from source.
54+
55+
_[#3489](https://github.com/mathesar-foundation/mathesar/pull/3489 "GH workflow to create draft release with built static files")_
56+
57+
## Bug fix
58+
59+
- Fixed connection creation failures due to schema name collisions while adding provided sample schema(s) in the database _[#3490](https://github.com/mathesar-foundation/mathesar/pull/3490 "Fix schema creation errors while adding a new connection")_
60+
61+
## Documentation
62+
63+
- Documented upgrade instructions for v0.1.6 _[#3507](https://github.com/mathesar-foundation/mathesar/pull/3507 "Adds upgrade documentation for 0.1.6, fixes existing issues with upgrade docs")_
64+
- 0.1.6 release notes _[#3506](https://github.com/mathesar-foundation/mathesar/pull/3506 "Release notes v0.1.6")_
65+
- Documented mathesar-debug image for Docker based installations _[#3513](https://github.com/mathesar-foundation/mathesar/pull/3513 "Add Debug image docs")_
66+
- Fixed upgrade instructions for v0.1.5 _[#3469](https://github.com/mathesar-foundation/mathesar/pull/3469 "Merge pull request #3468 from mathesar-foundation/upgrade_instruction_fix")_
67+
- Updated Mathesar's version number in docs _[#3476](https://github.com/mathesar-foundation/mathesar/pull/3476 "Merge pull request #3475 from mathesar-foundation/version_number_in_docs")_
68+
- Added MkDocs edit URI _[#3482](https://github.com/mathesar-foundation/mathesar/pull/3482 "Added MkDocs edit URI")_
69+
- Removed stale code coverage badge _[#3491](https://github.com/mathesar-foundation/mathesar/pull/3491 "Remove stale code coverage badge")_
70+
71+
## Maintenance
72+
73+
- Added a health check endpoint for Mathesar _[#3479](https://github.com/mathesar-foundation/mathesar/pull/3479 "Add health check endpoint to Mathesar")_
74+
- Bumped Django from 4.2.8 to 4.2.10 _[#3492](https://github.com/mathesar-foundation/mathesar/pull/3492 "Bump django from 4.2.8 to 4.2.10")_
75+
- Removed NodeJS from Docker production image _[#3474](https://github.com/mathesar-foundation/mathesar/pull/3474 "Add multiple stages to Dockerfile, remove NodeJS & unnecessary source files from production image")_
76+
- Post release cleanup _[#3463](https://github.com/mathesar-foundation/mathesar/pull/3463 "Merge pull request #3460 from mathesar-foundation/0.1.5")_

0 commit comments

Comments
 (0)