Compare commits

1 Commits
nc ... master

Author SHA1 Message Date
345d66b5c9 fix py3 back compat failure 2026-03-19 19:24:44 -07:00
9 changed files with 75 additions and 160 deletions

View File

@@ -3,7 +3,7 @@ FROM python:3.12-slim-bookworm AS builder
# Second line optional/debug/qol # Second line optional/debug/qol
RUN apt update && apt install -y \ RUN apt update && apt install -y \
libmariadb-dev gcc python3-setuptools \ libmariadb-dev gcc \
mariadb-client mariadb-client

View File

@@ -31,7 +31,7 @@ services:
#tty: true #tty: true
restart: always restart: always
# Comment following line to use flask (1worker, dev), uncomment to use uwsgi (wsgi) # Comment following line to use flask (1worker, dev), uncomment to use uwsgi (wsgi)
#command: ["uwsgi", "--http", "0.0.0.0:8000", "--master", "-p", "4", "-w", "microblog:app"] command: ["uwsgi", "--http", "0.0.0.0:8000", "--master", "-p", "4", "-w", "microblog:app"]
container_name: backend container_name: backend
environment: environment:
- MYSQL_USER=flasku - MYSQL_USER=flasku
@@ -99,9 +99,9 @@ services:
proxy: proxy:
build: proxy build: proxy
restart: always restart: always
#volumes: volumes:
# - /home/finn/d/cert/var/lib/letsencrypt:/var/lib/letsencrypt:ro - /home/finn/d/cert/var/lib/letsencrypt:/var/lib/letsencrypt:ro
# - /home/finn/d/cert/etc/letsencrypt:/etc/letsencrypt:ro - /home/finn/d/cert/etc/letsencrypt:/etc/letsencrypt:ro
ports: ports:
- "80:80" - "80:80"
- "443:443" - "443:443"
@@ -121,11 +121,11 @@ services:
- frontnet - frontnet
pmb: pmb:
build: #build:
args: # args:
GPG_PP: $BUILD_GPG_PP # GPG_PP: $BUILD_GPG_PP
context: pmb-pf # context: pmb-pf
dockerfile: Dockerfile # dockerfile: Dockerfile
image: site_pmb:latest image: site_pmb:latest
expose: expose:
- "25" - "25"
@@ -152,37 +152,9 @@ services:
networks: networks:
- frontnet - frontnet
nextcloud:
image: nextcloud:latest
restart: always
container_name: nextcloud
volumes:
- nextcloud-data:/var/www/html
- nextcloud-apps:/var/www/html/custom_apps
- nextcloud-config:/var/www/html/config
- nextcloud-data:/var/www/html/data
environment:
- NEXTCLOUD_TRUSTED_DOMAINS=nextcloud.oily.dad
- MYSQL_HOST=db
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
- MYSQL_PASSWORD=${DOTENV_MYSQL_NEXTCLOUD_PASSWORD}
- NEXTCLOUD_ADMIN_USER=admin
- NEXTCLOUD_ADMIN_PASSWORD=${DOTENV_NEXTCLOUD_ADMIN_PASSWORD}
- NEXTCLOUD_DATA_DIR=/var/www/html/data
networks:
- backnet
- frontnet
depends_on:
db:
condition: service_healthy
volumes: volumes:
db-data: db-data:
pmb-root: pmb-root:
nextcloud-data:
nextcloud-apps:
nextcloud-config:
networks: networks:
backnet: backnet:

View File

@@ -81,7 +81,7 @@ services:
- GITEA__server__LANDING_PAGE=explore - GITEA__server__LANDING_PAGE=explore
- GITEA__ui__REACTIONS="+1, -1, fu, heart, laugh, confused, hooray, eyes, gun, boom, poop, kiss, rocket, bomb, chart_with_downwards_trend, eggplant" - GITEA__ui__REACTIONS="+1, -1, fu, heart, laugh, confused, hooray, eyes, gun, boom, poop, kiss, rocket, bomb, chart_with_downwards_trend, eggplant"
# To disable new users after setup: # To disable new users after setup:
- GITEA__service__DISABLE_REGISTRATION=true - GITEA__service__DISABLE_REGISTRATION=false
networks: networks:
- backnet - backnet
- frontnet - frontnet
@@ -121,11 +121,11 @@ services:
- frontnet - frontnet
pmb: pmb:
build: #build:
args: # args:
GPG_PP: $BUILD_GPG_PP # GPG_PP: $BUILD_GPG_PP
context: pmb-pf # context: pmb-pf
dockerfile: Dockerfile # dockerfile: Dockerfile
image: site_pmb:latest image: site_pmb:latest
expose: expose:
- "25" - "25"
@@ -152,37 +152,9 @@ services:
networks: networks:
- frontnet - frontnet
nextcloud:
image: nextcloud:latest
restart: always
container_name: nextcloud
volumes:
- nextcloud-data:/var/www/html
- nextcloud-apps:/var/www/html/custom_apps
- nextcloud-config:/var/www/html/config
- nextcloud-data:/var/www/html/data
environment:
- NEXTCLOUD_TRUSTED_DOMAINS=nextcloud.oily.dad
- MYSQL_HOST=db
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
- MYSQL_PASSWORD=${DOTENV_MYSQL_NEXTCLOUD_PASSWORD}
- NEXTCLOUD_ADMIN_USER=admin
- NEXTCLOUD_ADMIN_PASSWORD=${DOTENV_NEXTCLOUD_ADMIN_PASSWORD}
- NEXTCLOUD_DATA_DIR=/var/www/html/data
networks:
- backnet
- frontnet
depends_on:
db:
condition: service_healthy
volumes: volumes:
db-data: db-data:
pmb-root: pmb-root:
nextcloud-data:
nextcloud-apps:
nextcloud-config:
networks: networks:
backnet: backnet:

View File

@@ -81,7 +81,7 @@ services:
- GITEA__server__LANDING_PAGE=explore - GITEA__server__LANDING_PAGE=explore
- GITEA__ui__REACTIONS="+1, -1, fu, heart, laugh, confused, hooray, eyes, gun, boom, poop, kiss, rocket, bomb, chart_with_downwards_trend, eggplant" - GITEA__ui__REACTIONS="+1, -1, fu, heart, laugh, confused, hooray, eyes, gun, boom, poop, kiss, rocket, bomb, chart_with_downwards_trend, eggplant"
# To disable new users after setup: # To disable new users after setup:
- GITEA__service__DISABLE_REGISTRATION=true - GITEA__service__DISABLE_REGISTRATION=false
networks: networks:
- backnet - backnet
- frontnet - frontnet
@@ -121,11 +121,11 @@ services:
- frontnet - frontnet
pmb: pmb:
build: #build:
args: # args:
GPG_PP: $BUILD_GPG_PP # GPG_PP: $BUILD_GPG_PP
context: pmb-pf # context: pmb-pf
dockerfile: Dockerfile # dockerfile: Dockerfile
image: site_pmb:latest image: site_pmb:latest
expose: expose:
- "25" - "25"
@@ -152,37 +152,9 @@ services:
networks: networks:
- frontnet - frontnet
nextcloud:
image: nextcloud:latest
restart: always
container_name: nextcloud
volumes:
- nextcloud-data:/var/www/html
- nextcloud-apps:/var/www/html/custom_apps
- nextcloud-config:/var/www/html/config
- nextcloud-data:/var/www/html/data
environment:
- NEXTCLOUD_TRUSTED_DOMAINS=nextcloud.oily.dad
- MYSQL_HOST=db
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
- MYSQL_PASSWORD=${DOTENV_MYSQL_NEXTCLOUD_PASSWORD}
- NEXTCLOUD_ADMIN_USER=admin
- NEXTCLOUD_ADMIN_PASSWORD=${DOTENV_NEXTCLOUD_ADMIN_PASSWORD}
- NEXTCLOUD_DATA_DIR=/var/www/html/data
networks:
- backnet
- frontnet
depends_on:
db:
condition: service_healthy
volumes: volumes:
db-data: db-data:
pmb-root: pmb-root:
nextcloud-data:
nextcloud-apps:
nextcloud-config:
networks: networks:
backnet: backnet:

View File

@@ -1,15 +1,12 @@
-- create databases -- create databases
CREATE DATABASE IF NOT EXISTS `gitea`; CREATE DATABASE IF NOT EXISTS `gitea`;
CREATE DATABASE IF NOT EXISTS `flask`; CREATE DATABASE IF NOT EXISTS `flask`;
CREATE DATABASE IF NOT EXISTS `nextcloud`;
-- create root user and grant rights -- create root user and grant rights
CREATE USER IF NOT EXISTS 'gitea'@'gitea.backnet' IDENTIFIED BY 'giteap'; CREATE USER 'gitea'@'gitea.backnet' IDENTIFIED BY 'giteap';
CREATE USER IF NOT EXISTS 'flasku'@'backend.backnet' IDENTIFIED BY 'flaskp'; CREATE USER 'flasku'@'backend.backnet' IDENTIFIED BY 'flaskp';
CREATE USER IF NOT EXISTS 'nextcloud'@'nextcloud.backnet' IDENTIFIED BY 'nextcloudp';
--CREATE USER 'gitea'@'localhost' IDENTIFIED BY 'gitea'; --CREATE USER 'gitea'@'localhost' IDENTIFIED BY 'gitea';
--GRANT ALL ON `gitea` TO 'gitea'@'localhost'; --GRANT ALL ON `gitea` TO 'gitea'@'localhost';
GRANT ALL ON gitea.* TO 'gitea'@'gitea.backnet'; GRANT ALL ON gitea.* TO 'gitea'@'gitea.backnet';
GRANT ALL ON flask.* TO 'flasku'@'backend.backnet'; GRANT ALL ON flask.* TO 'flasku'@'backend.backnet';
GRANT ALL ON nextcloud.* TO 'nextcloud'@'nextcloud.backnet';

4
dotenv
View File

@@ -31,8 +31,4 @@ FLASK_ADMIN_EMAIL="git@aaa"
FLASK_JWT_PHRASE="jwtphrase" FLASK_JWT_PHRASE="jwtphrase"
FLASK_REAL_HOSTNAME="localhost" FLASK_REAL_HOSTNAME="localhost"
# Nextcloud:
DOTENV_MYSQL_NEXTCLOUD_PASSWORD="nextcloudp"
DOTENV_NEXTCLOUD_ADMIN_PASSWORD="adminp"

View File

@@ -7,14 +7,6 @@ server {
location /gutty{ location /gutty{
proxy_pass http://gitea:3000; proxy_pass http://gitea:3000;
} }
location /nextcloud{
client_max_body_size 512M;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://nextcloud/;
}
} }

View File

@@ -1,20 +1,53 @@
#server {
# listen 80;
# server_name localhost;
# location / {
# proxy_pass http://backend:8000;
# }
# always redirect to https
server { server {
listen 80; listen 80 default_server;
server_name localhost; server_name _;
location / { return 301 https://$host$request_uri;
proxy_pass http://backend:8000;
}
location /gutty{
proxy_pass http://gitea:3000;
}
location /nextcloud{
client_max_body_size 512M;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://nextcloud/;
}
} }
server {
listen 443 ssl http2;
# use the certificates
ssl_certificate /etc/letsencrypt/live/oily.dad/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/oily.dad/privkey.pem;
server_name oily.dad www.oily.dad;
root /var/www/html;
index index.php index.html index.htm;
add_header Onion-Location http://oilydada7ckiseinkbeathsefwgkvjrce743xy7x7iiybkuxh4vheead.onion$request_uri;
location / {
proxy_pass http://backend:8000/;
}
}
server {
listen 443 ssl http2;
# use the certificates
ssl_certificate /etc/letsencrypt/live/oily.dad/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/oily.dad/privkey.pem;
server_name gut.oily.dad;
root /var/www/html;
index index.php index.html index.htm;
location / {
client_max_body_size 512M;
#proxy_pass http://localhost:3000;
proxy_set_header Connection $http_connection;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://gitea:3000/;
}
}

View File

@@ -51,22 +51,3 @@ server {
} }
} }
server {
listen 443 ssl http2;
# use the certificates
ssl_certificate /etc/letsencrypt/live/oily.dad/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/oily.dad/privkey.pem;
server_name nextcloud.oily.dad;
root /var/www/html;
index index.php index.html index.htm;
location / {
client_max_body_size 512M;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://nextcloud/;
}
}