Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
schilder2000
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
schilder
schilder2000
Commits
fed9239a
Commit
fed9239a
authored
9 months ago
by
Thomas Schneider
Browse files
Options
Downloads
Patches
Plain Diff
README: Production setup instructions
… and some fixes in the examples.
parent
6d24064b
No related branches found
No related tags found
No related merge requests found
Pipeline
#7004
passed
7 months ago
Stage: build
Stage: test
Stage: deploy
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.rst
+48
-2
48 additions, 2 deletions
README.rst
examples/config/config.py
+1
-1
1 addition, 1 deletion
examples/config/config.py
examples/data/templates/_layout.html.j2
+1
-1
1 addition, 1 deletion
examples/data/templates/_layout.html.j2
with
50 additions
and
4 deletions
README.rst
+
48
−
2
View file @
fed9239a
...
...
@@ -61,7 +61,7 @@ configuration:
.. code:: shell-session
% cp -r examples instance
% $EDITOR instance/config.py
% $EDITOR instance/config
/config
.py
Do replace ``SECRET_KEY`` with a unique, random value; and customise
``SQLALCHEMY_DATABASE_URI`` according to your environment. See `SQLAlchemy
...
...
@@ -90,7 +90,50 @@ every time, you can use a ``.env`` file:
Production setup
----------------
Don’t. This is not ready yet.
It is recommended to use our pre-built `Python package`_ (wheel) or `container
image`_. Building the package yourself is left as an exercise to the reader
(hint: it is a standard Python package, you need Node.js, pass
``--config-setting without-npm`` to ``pyproject-build`` if you do not want it to
build the frontend for you, but then you need to run ``npm run build``
beforehand).
The container image ships with all supported features. For the Python package,
some features require optional dependencies: ``auth-ldap``, ``auth-saml``,
``auth-oauth``, ``all-auth``, ``db-postgres``, ``db-mysql``, ``all-db``,
``all``. For example, to install the package with support for SAML login and
Postgres database:
.. code:: shell-session
% pip install "schilder2000[auth-saml,db-postgres]" --index-url https://git.fsmpi.rwth-aachen.de/api/v4/projects/305/packages/pypi/simple
Configuration and runtime data is stored in the instance directory. For
container installs, mount a volume to ``/usr/local/var/schilder2000-instance/``.
For package installs, this is ``{{ python prefix }}/var/schilder2000-instance``;
if in doubt, try to run ``flask -A schilder2000``, the error should tell you
where it expects the instance directory. Example config and data is located in
the ``examples`` directory. The templates there get their footer text and logo
from the application config and should also be useful as an example to write
your own templates.
The main application config is located in ``config/config.py``. Customise it as
needed, the example config should provide enough comments.
An example config for Gunicorn_ is provided in ``gunicorn.conf.py``. If you
want to use another WSGI server, configure it to use
``schilder2000:create_app()`` as application object. Note that this is a
factory function that returns the application callable, you have to call it!
Unless you use SQLite, create the database in your database server. In all
cases, run the migrations:
.. code:: shell-session
% flask -A schilder2000 alembic upgrade head
If you want to use your webserver to directly serve static files, route
``/static`` to ``{{ python packages directory }}/schilder2000/static`` and
``/instance/static`` to ``{{ instance path }}/data/static``.
.. _schildergenerator: https://git.fsmpi.rwth-aachen.de/schilder/schildergenerator
...
...
@@ -99,3 +142,6 @@ Don’t. This is not ready yet.
.. _PDM-Backend: https://backend.pdm-project.org/
.. _pip: https://pip.pypa.io/
.. _`SQLAlchemy documentation`: https://docs.sqlalchemy.org/en/20/core/engines.html#database-urls
.. _`Python package`: https://git.fsmpi.rwth-aachen.de/schilder/schilder2000/-/packages
.. _`container image`: https://git.fsmpi.rwth-aachen.de/schilder/schilder2000/container_registry/33
.. _Gunicorn: https://gunicorn.org/
This diff is collapsed.
Click to expand it.
examples/config/config.py
+
1
−
1
View file @
fed9239a
...
...
@@ -7,7 +7,7 @@ from pathlib import Path
SQLALCHEMY_DATABASE_URI
=
"
postgresql+psycopg:///schilder2000
"
# SQLALCHEMY_DATABASE_URI = "sqlite:///schilder2000.db" # Relative to instance directory
# SQLALCHEMY_DATABASE_URI = "sqlite:///
data/
schilder2000.db" # Relative to instance directory
# SQLALCHEMY_DATABASE_URI = "mysql:///schilder2000"
# To generate a secret key:
...
...
This diff is collapsed.
Click to expand it.
examples/data/templates/_layout.html.j2
+
1
−
1
View file @
fed9239a
...
...
@@ -20,7 +20,7 @@
</div>
<div
id=
"logo"
>
<img
src=
"{{ url_for('instance.static', filename=
'geier.png'
) }}"
/>
<img
src=
"{{ url_for('instance.static', filename=
config['SCHILD_LOGO']
) }}"
/>
</div>
</footer>
</body>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment