-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1705 from SURFscz/openconext-dev
Openconext dev
- Loading branch information
Showing
10 changed files
with
184 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,19 @@ | ||
# First build SRAM SBS image | ||
FROM python:3.11-slim-bookworm AS sram-sbs | ||
# Build SRAM SBS (apache) server image | ||
FROM ghcr.io/openconext/openconext-basecontainers/apache2:latest AS sram-sbs-server | ||
|
||
# Do an initial clean up and general upgrade of the distribution | ||
ENV DEBIAN_FRONTEND noninteractive | ||
RUN apt clean && apt autoclean && apt update | ||
RUN apt -y upgrade && apt -y dist-upgrade | ||
|
||
# Install the packages we need | ||
RUN apt install -y curl \ | ||
git \ | ||
build-essential \ | ||
pkgconf \ | ||
python3-dev \ | ||
default-libmysqlclient-dev \ | ||
libxmlsec1-dev | ||
|
||
# Clean up | ||
RUN apt autoremove -y && apt clean && apt autoclean && rm -rf /var/lib/apt/lists/* | ||
|
||
# Set the default workdir | ||
WORKDIR /opt | ||
|
||
# Install SBS | ||
COPY sbs.tar.xz /opt/sbs.tar.xz | ||
|
||
# Untar sbs | ||
RUN tar -Jxf sbs.tar.xz | ||
|
||
# Create venv dir | ||
#RUN virtualenv /opt/sbs | ||
|
||
#RUN . /opt/sbs/bin/activate && \ | ||
RUN pip install -r /opt/sbs/server/requirements/test.txt | ||
|
||
# Copy entrypoint | ||
COPY misc/entrypoint.sh /entrypoint.sh | ||
RUN chmod 755 /entrypoint.sh | ||
RUN rm -f /etc/apache2/sites-enabled/*.conf | ||
COPY etc/apache-dev.conf /etc/apache2/sites-enabled/apache.conf | ||
|
||
# Set the default workdir | ||
WORKDIR /opt/sbs | ||
|
||
EXPOSE 8080 | ||
WORKDIR /opt | ||
|
||
ENTRYPOINT ["/entrypoint.sh"] | ||
#CMD ["bash"] | ||
CMD ["/usr/local/bin/gunicorn --worker-class eventlet --workers 8 --bind 0.0.0.0:8080 server.__main__:app"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Build SRAM SBS (apache) server image | ||
FROM ghcr.io/openconext/openconext-basecontainers/apache2:latest AS sram-sbs-client | ||
|
||
# Do an initial clean up and general upgrade of the distribution | ||
ENV DEBIAN_FRONTEND noninteractive | ||
RUN apt clean && apt autoclean && apt update | ||
RUN apt -y upgrade && apt -y dist-upgrade | ||
|
||
# Install the packages we need | ||
RUN apt install -y xz-utils | ||
|
||
# Clean up | ||
RUN apt autoremove -y && apt clean && apt autoclean && rm -rf /var/lib/apt/lists/* | ||
|
||
RUN rm -f /etc/apache2/sites-enabled/*.conf | ||
COPY etc/apache.conf /etc/apache2/sites-enabled/apache.conf | ||
|
||
RUN a2enmod proxy_wstunnel | ||
|
||
# Set the default workdir | ||
WORKDIR /opt | ||
|
||
# Install SBS | ||
COPY sbs.tar.xz /opt/sbs.tar.xz | ||
|
||
# Untar sbs | ||
RUN tar -Jxf sbs.tar.xz | ||
|
||
#CMD ["bash"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,47 @@ | ||
# Build SRAM SBS (apache) server image | ||
FROM ghcr.io/openconext/openconext-basecontainers/apache2:latest AS sram-sbs-server | ||
RUN rm -f /etc/apache2/sites-enabled/*.conf | ||
RUN a2enmod proxy_wstunnel | ||
# First build SRAM SBS image | ||
FROM python:3.11-slim-bookworm AS sram-sbs-server | ||
|
||
# Do an initial clean up and general upgrade of the distribution | ||
ENV DEBIAN_FRONTEND noninteractive | ||
RUN apt clean && apt autoclean && apt update | ||
RUN apt -y upgrade && apt -y dist-upgrade | ||
|
||
# Install the packages we need | ||
RUN apt install -y curl \ | ||
git \ | ||
build-essential \ | ||
pkgconf \ | ||
python3-dev \ | ||
default-libmysqlclient-dev \ | ||
libxmlsec1-dev | ||
|
||
# Clean up | ||
RUN apt autoremove -y && apt clean && apt autoclean && rm -rf /var/lib/apt/lists/* | ||
|
||
# Set the default workdir | ||
WORKDIR /opt | ||
|
||
#CMD ["bash"] | ||
# Install SBS | ||
COPY sbs.tar.xz /opt/sbs.tar.xz | ||
|
||
# Untar sbs | ||
RUN tar -Jxf sbs.tar.xz | ||
|
||
# Create venv dir | ||
#RUN virtualenv /opt/sbs | ||
|
||
#RUN . /opt/sbs/bin/activate && \ | ||
RUN pip install -r /opt/sbs/server/requirements/test.txt | ||
|
||
# Copy entrypoint | ||
COPY misc/entrypoint.sh /entrypoint.sh | ||
RUN chmod 755 /entrypoint.sh | ||
|
||
# Set the default workdir | ||
WORKDIR /opt/sbs | ||
|
||
EXPOSE 8080 | ||
|
||
ENTRYPOINT ["/entrypoint.sh"] | ||
#CMD ["bash"] | ||
CMD ["/usr/local/bin/gunicorn --worker-class eventlet --workers 8 --bind 0.0.0.0:8080 server.__main__:app"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
Listen 8080 | ||
<VirtualHost *:8080> | ||
ServerName sbs | ||
DocumentRoot /var/www/html | ||
|
||
Header set Content-Security-Policy "default-src 'self'; base-uri 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; frame-src 'none'; form-action 'self' https://*.dev.openconext.local; frame-ancestors 'none'; block-all-mixed-content;" | ||
Header set Permissions-Policy "accelerometer=(), ambient-light-sensor=(), autoplay=(), battery=(), camera=(), cross-origin-isolated=(), display-capture=(), document-domain=(), encrypted-media=(), execution-while-not-rendered=(), execution-while-out-of-viewport=(), fullscreen=(), geolocation=(), gyroscope=(), keyboard-map=(), magnetometer=(), microphone=(), midi=(), navigation-override=(), payment=(), picture-in-picture=(), publickey-credentials-get=(), screen-wake-lock=(), sync-xhr=(), usb=(), web-share=(), xr-spatial-tracking=(), clipboard-read=(), clipboard-write=(self), gamepad=(), speaker-selection=()" | ||
|
||
#RewriteEngine On | ||
#RewriteCond %{REQUEST_URI} !^/(api|pam-weblogin|flasgger_static|swagger|health|config|info|socket.io) | ||
#RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f | ||
#RewriteRule ^/(.*)$ /index.html [L] | ||
|
||
ProxyRequests off | ||
ProxyPassMatch ^/(api|pam-weblogin|flasgger_static|swagger|health|config|info) http://sbs-server:8080/ | ||
ProxyPassReverse / http://sbs-server:8080/ | ||
ProxyPass /socket.io/ ws://sbs-server:8080/socket.io/ | ||
ProxyPassReverse /socket.io/ ws://sbs-server:8080/socket.io/ | ||
ProxyPass / http://sbs-client:8080/ | ||
ProxyPassReverse / http://sbs-client:8080/ | ||
|
||
<If "%{REQUEST_URI} =~ m#^/api/images/#"> | ||
Header set Cache-Control: "public, max-age=31536000, immutable" | ||
</If> | ||
<ElseIf "%{REQUEST_URI} =~ m#^/(api|pam-weblogin|flasgger_static|swagger|health|config|info)#"> | ||
Header set Cache-Control: "no-cache, private" | ||
</ElseIf> | ||
|
||
<Directory /var/www/html> | ||
Require all granted | ||
Options -Indexes | ||
</Directory> | ||
</VirtualHost> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,31 @@ | ||
# ServerName {{ hostnames.sbs }} | ||
#ErrorLog /proc/self/fd/2 | ||
#CustomLog /proc/self/fd/1 common | ||
DocumentRoot /var/www/html | ||
Listen 8080 | ||
<VirtualHost *:8080> | ||
ServerName sbs | ||
DocumentRoot /opt/sbs/client/build | ||
|
||
# Header set Content-Security-Policy "default-src 'self'; base-uri 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; frame-src 'none'; form-action 'self' https://*.{{ base_domain }}; frame-ancestors 'none'; block-all-mixed-content;" | ||
# Header set Permissions-Policy "accelerometer=(), ambient-light-sensor=(), autoplay=(), battery=(), camera=(), cross-origin-isolated=(), display-capture=(), document-domain=(), encrypted-media=(), execution-while-not-rendered=(), execution-while-out-of-viewport=(), fullscreen=(), geolocation=(), gyroscope=(), keyboard-map=(), magnetometer=(), microphone=(), midi=(), navigation-override=(), payment=(), picture-in-picture=(), publickey-credentials-get=(), screen-wake-lock=(), sync-xhr=(), usb=(), web-share=(), xr-spatial-tracking=(), clipboard-read=(), clipboard-write=(self), gamepad=(), speaker-selection=()" | ||
Header set Content-Security-Policy "default-src 'self'; base-uri 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; frame-src 'none'; form-action 'self' https://*.dev.openconext.local; frame-ancestors 'none'; block-all-mixed-content;" | ||
Header set Permissions-Policy "accelerometer=(), ambient-light-sensor=(), autoplay=(), battery=(), camera=(), cross-origin-isolated=(), display-capture=(), document-domain=(), encrypted-media=(), execution-while-not-rendered=(), execution-while-out-of-viewport=(), fullscreen=(), geolocation=(), gyroscope=(), keyboard-map=(), magnetometer=(), microphone=(), midi=(), navigation-override=(), payment=(), picture-in-picture=(), publickey-credentials-get=(), screen-wake-lock=(), sync-xhr=(), usb=(), web-share=(), xr-spatial-tracking=(), clipboard-read=(), clipboard-write=(self), gamepad=(), speaker-selection=()" | ||
|
||
RewriteEngine On | ||
RewriteCond %{REQUEST_URI} !^/(api|pam-weblogin|flasgger_static|swagger|health|config|info|socket.io) | ||
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f | ||
RewriteRule ^/(.*)$ /index.html [L] | ||
#RewriteEngine On | ||
#RewriteCond %{REQUEST_URI} !^/(api|pam-weblogin|flasgger_static|swagger|health|config|info|socket.io) | ||
#RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f | ||
#RewriteRule ^/(.*)$ /index.html [L] | ||
|
||
ProxyRequests off | ||
ProxyPass /socket.io/ ws://server:8080/socket.io/ | ||
ProxyPassReverse /socket.io/ ws://server:8080/socket.io/ | ||
ProxyPassMatch ^/(api|pam-weblogin|flasgger_static|swagger|health|config|info) http://server:8080/ | ||
ProxyPassReverse / http://server:8080/ | ||
ProxyRequests off | ||
ProxyPassMatch ^/(api|pam-weblogin|flasgger_static|swagger|health|config|info) http://sbs-server:8080/ | ||
ProxyPassReverse / http://sbs-server:8080/ | ||
ProxyPass /socket.io/ ws://sbs-server:8080/socket.io/ | ||
ProxyPassReverse /socket.io/ ws://sbs-server:8080/socket.io/ | ||
|
||
<Directory /var/www/html> | ||
Require all granted | ||
Options -Indexes | ||
</Directory> | ||
<If "%{REQUEST_URI} =~ m#^/api/images/#"> | ||
Header set Cache-Control: "public, max-age=31536000, immutable" | ||
</If> | ||
<ElseIf "%{REQUEST_URI} =~ m#^/(api|pam-weblogin|flasgger_static|swagger|health|config|info)#"> | ||
Header set Cache-Control: "no-cache, private" | ||
</ElseIf> | ||
|
||
<Directory /opt/sbs/client/build> | ||
Require all granted | ||
Options -Indexes | ||
</Directory> | ||
</VirtualHost> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,7 +35,7 @@ script_location = migrations | |
# are written from script.py.mako | ||
# output_encoding = utf-8 | ||
|
||
sqlalchemy.url = mysql+mysqldb://sbs:[email protected]/sbs | ||
sqlalchemy.url = mysql+mysqldb://sbs:secret@mariadb/sbs?charset=utf8mb4 | ||
|
||
|
||
# Logging configuration | ||
|
@@ -49,9 +49,8 @@ keys = console | |
keys = generic | ||
|
||
[logger_root] | ||
level = WARN | ||
level = NOTSET | ||
handlers = console | ||
qualname = | ||
|
||
[logger_sqlalchemy] | ||
level = WARN | ||
|
@@ -66,9 +65,9 @@ qualname = alembic | |
[handler_console] | ||
class = StreamHandler | ||
args = (sys.stderr,) | ||
level = NOTSET | ||
level = DEBUG | ||
formatter = generic | ||
|
||
[formatter_generic] | ||
format = %(levelname)-5.5s [%(name)s] %(message)s | ||
datefmt = %H:%M:%S | ||
datefmt = %H:%M:%S |