ajout de umap
This commit is contained in:
parent
574b0fb197
commit
69cbf81a7c
11 changed files with 211 additions and 0 deletions
0
ressources/umap/rootfs/DEBIAN/changelog
Normal file
0
ressources/umap/rootfs/DEBIAN/changelog
Normal file
4
ressources/umap/rootfs/DEBIAN/conffiles
Normal file
4
ressources/umap/rootfs/DEBIAN/conffiles
Normal file
|
@ -0,0 +1,4 @@
|
|||
/etc/nginx/sites-available/umap
|
||||
/etc/umap/umap.conf
|
||||
/etc/umap/uwsgi_params
|
||||
/etc/umap/uwsgi.ini
|
8
ressources/umap/rootfs/DEBIAN/control
Normal file
8
ressources/umap/rootfs/DEBIAN/control
Normal file
|
@ -0,0 +1,8 @@
|
|||
Package: umap
|
||||
Version: %VERSION%
|
||||
Section: contrib
|
||||
Priority: optional
|
||||
Architecture: all
|
||||
Depends: python3, python-is-python3, python3-venv, python3-psycopg2
|
||||
Maintainer: Thomas Legay <thomas@lgy.fr>
|
||||
Description: umap
|
7
ressources/umap/rootfs/DEBIAN/postinst
Executable file
7
ressources/umap/rootfs/DEBIAN/postinst
Executable file
|
@ -0,0 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
APP=umap
|
||||
id $APP &> /dev/null || useradd $APP -r -s /bin/false -md /var/lib/$APP/
|
||||
chown -R $APP:$APP /var/lib/$APP/
|
||||
|
||||
|
44
ressources/umap/rootfs/umap.conf
Normal file
44
ressources/umap/rootfs/umap.conf
Normal file
|
@ -0,0 +1,44 @@
|
|||
#import os
|
||||
#os.environ['HTTPS_PROXY'] = 'http://squid:3128'
|
||||
#os.environ['HTTP_PROXY'] = 'http://squid:3128'
|
||||
|
||||
DATABASES = {
|
||||
"default": {
|
||||
"ENGINE": "django.contrib.gis.db.backends.postgis",
|
||||
"NAME": "umap",
|
||||
"USER": "umap",
|
||||
"HOST": "postgresql",
|
||||
"PORT": 5432,
|
||||
"PASSWORD": "password",
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
SECRET_KEY="secret"
|
||||
SITE_URL = "https://umap.domaine.com/"
|
||||
ALLOWED_HOSTS = ["umap.domaine.com"]
|
||||
|
||||
#UMAP_ALLOW_ANONYMOUS=True
|
||||
DEBUG=True
|
||||
|
||||
SESSION_COOKIE_SECURE = True
|
||||
CSRF_COOKIE_SECURE = True
|
||||
CSRF_TRUSTED_ORIGINS=["https://umap.domaine.com/"]
|
||||
SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https")
|
||||
SECURE_SSL_REDIRECT = True
|
||||
|
||||
|
||||
AUTHENTICATION_BACKENDS = (
|
||||
'social_core.backends.keycloak.KeycloakOAuth2',
|
||||
"django.contrib.auth.backends.ModelBackend",
|
||||
)
|
||||
|
||||
#SOCIAL_AUTH_KEYCLOAK_KEY = ''
|
||||
#SOCIAL_AUTH_KEYCLOAK_SECRET = ''
|
||||
#SOCIAL_AUTH_KEYCLOAK_PUBLIC_KEY = ''
|
||||
#SOCIAL_AUTH_KEYCLOAK_ID_KEY = 'email'
|
||||
#SOCIAL_AUTH_KEYCLOAK_AUTHORIZATION_URL = 'https://keycloak/realms/keycloak/protocol/openid-connect/auth'
|
||||
#SOCIAL_AUTH_KEYCLOAK_ACCESS_TOKEN_URL = 'https://keycloak/realms/keycloak/protocol/openid-connect/token'
|
||||
#LOGOUT_REDIRECT_URL="https://keycloak/realms/keycloak/protocol/openid-connect/logout"
|
||||
#SOCIAL_AUTH_JSONFIELD_ENABLED=True
|
||||
EMAIL_HOST=""
|
23
ressources/umap/rootfs/umap.ngnix
Normal file
23
ressources/umap/rootfs/umap.ngnix
Normal file
|
@ -0,0 +1,23 @@
|
|||
upstream umap {
|
||||
server unix:///var/lib/umap/uwsgi.sock;
|
||||
}
|
||||
|
||||
server {
|
||||
# the port your site will be served on
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
# listen 443 ssl;
|
||||
# listen [::]:443 ssl;
|
||||
# the domain name it will serve for
|
||||
server_name umap.leolagrange-gestion.org;
|
||||
charset utf-8;
|
||||
|
||||
# max upload size
|
||||
client_max_body_size 5M; # adjust to taste
|
||||
|
||||
# Finally, send all non-media requests to the Django server.
|
||||
location / {
|
||||
uwsgi_pass umap;
|
||||
include /etc/umap/uwsgi_params;
|
||||
}
|
||||
}
|
18
ressources/umap/rootfs/umap.service
Normal file
18
ressources/umap/rootfs/umap.service
Normal file
|
@ -0,0 +1,18 @@
|
|||
[Unit]
|
||||
Description=umap
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
User=umap
|
||||
Group=umap
|
||||
#WorkingDirectory=/var/share/umap/
|
||||
ExecStartPre=/usr/bin/python3 -m venv /var/lib/umap/venv
|
||||
ExecStartPre=/var/lib/umap/venv/bin/pip install /usr/share/umap/.[docker]
|
||||
ExecStartPre=/var/lib/umap/venv/bin/python3 /usr/share/umap/manage.py migrate
|
||||
ExecStart=/var/lib/umap/venv/bin/uwsgi --ini /etc/umap/uwsgi.ini
|
||||
StandardOutput=inherit
|
||||
StandardError=inherit
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
24
ressources/umap/rootfs/uwsgi.ini
Normal file
24
ressources/umap/rootfs/uwsgi.ini
Normal file
|
@ -0,0 +1,24 @@
|
|||
[uwsgi]
|
||||
uid = umap
|
||||
gid = umap
|
||||
# Python related settings
|
||||
# the base directory (full path)
|
||||
chdir = /var/lib/umap/
|
||||
# umap's wsgi module
|
||||
module = umap.wsgi
|
||||
# the virtualenv (full path)
|
||||
home = /var/lib/umap/venv
|
||||
|
||||
# process-related settings
|
||||
# master
|
||||
master = true
|
||||
# maximum number of worker processes
|
||||
processes = 4
|
||||
# the socket (use the full path to be safe)
|
||||
socket = /var/lib/umap/uwsgi.sock
|
||||
# ... with appropriate permissions - may be needed
|
||||
chmod-socket = 666
|
||||
stats = /var/lib/umap/stats.sock
|
||||
# clear environment on exit
|
||||
vacuum = true
|
||||
plugins = python3
|
16
ressources/umap/rootfs/uwsgi_params
Normal file
16
ressources/umap/rootfs/uwsgi_params
Normal file
|
@ -0,0 +1,16 @@
|
|||
uwsgi_param QUERY_STRING $query_string;
|
||||
uwsgi_param REQUEST_METHOD $request_method;
|
||||
uwsgi_param CONTENT_TYPE $content_type;
|
||||
uwsgi_param CONTENT_LENGTH $content_length;
|
||||
|
||||
uwsgi_param REQUEST_URI $request_uri;
|
||||
uwsgi_param PATH_INFO $document_uri;
|
||||
uwsgi_param DOCUMENT_ROOT $document_root;
|
||||
uwsgi_param SERVER_PROTOCOL $server_protocol;
|
||||
uwsgi_param REQUEST_SCHEME $scheme;
|
||||
uwsgi_param HTTPS $https if_not_empty;
|
||||
|
||||
uwsgi_param REMOTE_ADDR $remote_addr;
|
||||
uwsgi_param REMOTE_PORT $remote_port;
|
||||
uwsgi_param SERVER_PORT $server_port;
|
||||
uwsgi_param SERVER_NAME $server_name;
|
Loading…
Add table
Add a link
Reference in a new issue