Compare commits
20 Commits
78384a31fb
...
nc
| Author | SHA1 | Date | |
|---|---|---|---|
| 996e602774 | |||
| c116021b29 | |||
| d813c3c70e | |||
| 854b7a2338 | |||
| 901e5b29b6 | |||
| b6ccb0c859 | |||
| 42a12d7ced | |||
| a329511464 | |||
| fc927eef63 | |||
| 7ed3b07ab4 | |||
|
|
0f2ab58f00 | ||
| 950c9a6aea | |||
| 414c300b41 | |||
| a5ac19a2a4 | |||
| 78c0895418 | |||
| 8cbe7eecd3 | |||
| 9090da987f | |||
| 650e77210e | |||
| 16a45c495d | |||
| 08ae04a154 |
@@ -1,9 +1,9 @@
|
||||
# syntax=docker/dockerfile:1.4
|
||||
FROM python:3-slim-bookworm AS builder
|
||||
FROM python:3.12-slim-bookworm AS builder
|
||||
|
||||
# Second line optional/debug/qol
|
||||
RUN apt update && apt install -y \
|
||||
libmariadb-dev gcc \
|
||||
libmariadb-dev gcc python3-setuptools \
|
||||
mariadb-client
|
||||
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ from app.models import User
|
||||
|
||||
class LoginForm(FlaskForm):
|
||||
username = StringField('Username', validators=[DataRequired()])
|
||||
password = PasswordField('Pasword', validators=[DataRequired()])
|
||||
password = PasswordField('Password', validators=[DataRequired()])
|
||||
remember_me = BooleanField('Remember Me')
|
||||
submit = SubmitField('Sign In')
|
||||
|
||||
|
||||
1
backend/app/static/test.txt
Normal file
1
backend/app/static/test.txt
Normal file
@@ -0,0 +1 @@
|
||||
eee
|
||||
@@ -19,10 +19,12 @@
|
||||
<a {% block profilecurrent %}{% endblock %} href="{{ url_for('user', username=current_user.username) }}">profile</a>
|
||||
<a href="{{ url_for('logout') }}">logout</a>
|
||||
{% endif %}
|
||||
|
||||
<a href="https://gut.oily.dad/explore/repos">
|
||||
<img style="vertical-align: middle; horizontal-align: center; height: 22px" src="https://gut.oily.dad/assets/img/logo.svg" alt="Logo" aria-hidden="true">
|
||||
</a>
|
||||
</nav>
|
||||
|
||||
<h2>oily.dad</h2>
|
||||
<h5>oilydada7ckiseinkbeathsefwgkvjrce743xy7x7iiybkuxh4vheead.onion</h5>
|
||||
</header>
|
||||
<hr>
|
||||
{% with messages = get_flashed_messages() %}
|
||||
|
||||
58
compose.yaml
58
compose.yaml
@@ -31,7 +31,7 @@ services:
|
||||
#tty: true
|
||||
restart: always
|
||||
# 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
|
||||
environment:
|
||||
- MYSQL_USER=flasku
|
||||
@@ -75,10 +75,13 @@ services:
|
||||
- GITEA__mailer__PROTOCOL=smtp
|
||||
- GITEA__mailer__SMTP_ADDR=pmb
|
||||
- GITEA__mailer__SMTP_PORT=25
|
||||
- GITEA__service__REGISTER_EMAIL_CONFIRM=true
|
||||
- GITEA__service__REGISTER_EMAIL_CONFIRM=false
|
||||
- GITEA__service__REGISTER_MANUAL_CONFIRM=true
|
||||
- GITEA__service__ENABLE_NOTIFY_MAIL=true
|
||||
- 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"
|
||||
# To disable new users after setup:
|
||||
#- GITEA__service__DISABLE_REGISTRATION=false
|
||||
- GITEA__service__DISABLE_REGISTRATION=true
|
||||
networks:
|
||||
- backnet
|
||||
- frontnet
|
||||
@@ -96,9 +99,9 @@ services:
|
||||
proxy:
|
||||
build: proxy
|
||||
restart: always
|
||||
volumes:
|
||||
- /home/finn/d/cert/var/lib/letsencrypt:/var/lib/letsencrypt:ro
|
||||
- /home/finn/d/cert/etc/letsencrypt:/etc/letsencrypt:ro
|
||||
#volumes:
|
||||
# - /home/finn/d/cert/var/lib/letsencrypt:/var/lib/letsencrypt:ro
|
||||
# - /home/finn/d/cert/etc/letsencrypt:/etc/letsencrypt:ro
|
||||
ports:
|
||||
- "80:80"
|
||||
- "443:443"
|
||||
@@ -118,11 +121,11 @@ services:
|
||||
- frontnet
|
||||
|
||||
pmb:
|
||||
#build:
|
||||
# args:
|
||||
# GPG_PP: $BUILD_GPG_PP
|
||||
# context: pmb-pf
|
||||
# dockerfile: Dockerfile
|
||||
build:
|
||||
args:
|
||||
GPG_PP: $BUILD_GPG_PP
|
||||
context: pmb-pf
|
||||
dockerfile: Dockerfile
|
||||
image: site_pmb:latest
|
||||
expose:
|
||||
- "25"
|
||||
@@ -139,18 +142,47 @@ services:
|
||||
build:
|
||||
context: sshtun
|
||||
dockerfile: Dockerfile
|
||||
restart: always
|
||||
restart: on-failure
|
||||
environment:
|
||||
- USE_TUN=${USE_TUN}
|
||||
ports:
|
||||
- "22222:22"
|
||||
expose:
|
||||
- "11111"
|
||||
- "11112"
|
||||
networks:
|
||||
- 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:
|
||||
db-data:
|
||||
pmb-root:
|
||||
nextcloud-data:
|
||||
nextcloud-apps:
|
||||
nextcloud-config:
|
||||
|
||||
networks:
|
||||
backnet:
|
||||
|
||||
@@ -75,10 +75,13 @@ services:
|
||||
- GITEA__mailer__PROTOCOL=smtp
|
||||
- GITEA__mailer__SMTP_ADDR=pmb
|
||||
- GITEA__mailer__SMTP_PORT=25
|
||||
- GITEA__service__REGISTER_EMAIL_CONFIRM=true
|
||||
- GITEA__service__REGISTER_EMAIL_CONFIRM=false
|
||||
- GITEA__service__REGISTER_MANUAL_CONFIRM=true
|
||||
- GITEA__service__ENABLE_NOTIFY_MAIL=true
|
||||
- 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"
|
||||
# To disable new users after setup:
|
||||
#- GITEA__service__DISABLE_REGISTRATION=false
|
||||
- GITEA__service__DISABLE_REGISTRATION=true
|
||||
networks:
|
||||
- backnet
|
||||
- frontnet
|
||||
@@ -118,11 +121,11 @@ services:
|
||||
- frontnet
|
||||
|
||||
pmb:
|
||||
#build:
|
||||
# args:
|
||||
# GPG_PP: $BUILD_GPG_PP
|
||||
# context: pmb-pf
|
||||
# dockerfile: Dockerfile
|
||||
build:
|
||||
args:
|
||||
GPG_PP: $BUILD_GPG_PP
|
||||
context: pmb-pf
|
||||
dockerfile: Dockerfile
|
||||
image: site_pmb:latest
|
||||
expose:
|
||||
- "25"
|
||||
@@ -139,18 +142,47 @@ services:
|
||||
build:
|
||||
context: sshtun
|
||||
dockerfile: Dockerfile
|
||||
restart: always
|
||||
restart: on-failure
|
||||
environment:
|
||||
- USE_TUN=${USE_TUN}
|
||||
ports:
|
||||
- "22222:22"
|
||||
expose:
|
||||
- "11111"
|
||||
- "11112"
|
||||
networks:
|
||||
- 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:
|
||||
db-data:
|
||||
pmb-root:
|
||||
nextcloud-data:
|
||||
nextcloud-apps:
|
||||
nextcloud-config:
|
||||
|
||||
networks:
|
||||
backnet:
|
||||
|
||||
@@ -75,10 +75,13 @@ services:
|
||||
- GITEA__mailer__PROTOCOL=smtp
|
||||
- GITEA__mailer__SMTP_ADDR=pmb
|
||||
- GITEA__mailer__SMTP_PORT=25
|
||||
- GITEA__service__REGISTER_EMAIL_CONFIRM=true
|
||||
- GITEA__service__REGISTER_EMAIL_CONFIRM=false
|
||||
- GITEA__service__REGISTER_MANUAL_CONFIRM=true
|
||||
- GITEA__service__ENABLE_NOTIFY_MAIL=true
|
||||
- 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"
|
||||
# To disable new users after setup:
|
||||
#- GITEA__service__DISABLE_REGISTRATION=false
|
||||
- GITEA__service__DISABLE_REGISTRATION=true
|
||||
networks:
|
||||
- backnet
|
||||
- frontnet
|
||||
@@ -118,11 +121,11 @@ services:
|
||||
- frontnet
|
||||
|
||||
pmb:
|
||||
#build:
|
||||
# args:
|
||||
# GPG_PP: $BUILD_GPG_PP
|
||||
# context: pmb-pf
|
||||
# dockerfile: Dockerfile
|
||||
build:
|
||||
args:
|
||||
GPG_PP: $BUILD_GPG_PP
|
||||
context: pmb-pf
|
||||
dockerfile: Dockerfile
|
||||
image: site_pmb:latest
|
||||
expose:
|
||||
- "25"
|
||||
@@ -139,18 +142,47 @@ services:
|
||||
build:
|
||||
context: sshtun
|
||||
dockerfile: Dockerfile
|
||||
restart: always
|
||||
restart: on-failure
|
||||
environment:
|
||||
- USE_TUN=${USE_TUN}
|
||||
ports:
|
||||
- "22222:22"
|
||||
expose:
|
||||
- "11111"
|
||||
- "11112"
|
||||
networks:
|
||||
- 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:
|
||||
db-data:
|
||||
pmb-root:
|
||||
nextcloud-data:
|
||||
nextcloud-apps:
|
||||
nextcloud-config:
|
||||
|
||||
networks:
|
||||
backnet:
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
-- create databases
|
||||
CREATE DATABASE IF NOT EXISTS `gitea`;
|
||||
CREATE DATABASE IF NOT EXISTS `flask`;
|
||||
CREATE DATABASE IF NOT EXISTS `nextcloud`;
|
||||
|
||||
-- create root user and grant rights
|
||||
CREATE USER 'gitea'@'gitea.backnet' IDENTIFIED BY 'giteap';
|
||||
CREATE USER 'flasku'@'backend.backnet' IDENTIFIED BY 'flaskp';
|
||||
CREATE USER IF NOT EXISTS 'gitea'@'gitea.backnet' IDENTIFIED BY 'giteap';
|
||||
CREATE USER IF NOT EXISTS 'flasku'@'backend.backnet' IDENTIFIED BY 'flaskp';
|
||||
CREATE USER IF NOT EXISTS 'nextcloud'@'nextcloud.backnet' IDENTIFIED BY 'nextcloudp';
|
||||
--CREATE USER 'gitea'@'localhost' IDENTIFIED BY 'gitea';
|
||||
--GRANT ALL ON `gitea` TO 'gitea'@'localhost';
|
||||
GRANT ALL ON gitea.* TO 'gitea'@'gitea.backnet';
|
||||
GRANT ALL ON flask.* TO 'flasku'@'backend.backnet';
|
||||
GRANT ALL ON nextcloud.* TO 'nextcloud'@'nextcloud.backnet';
|
||||
|
||||
|
||||
7
dotenv
7
dotenv
@@ -13,6 +13,9 @@ BUILD_GPG_PP=
|
||||
# Tor:
|
||||
# true/false:
|
||||
USE_TOR=false
|
||||
# SSH Tun:
|
||||
# true/false:
|
||||
USE_TUN=false
|
||||
|
||||
# Backend:
|
||||
FLASK_SECRET_KEY="flaskkey"
|
||||
@@ -28,4 +31,8 @@ FLASK_ADMIN_EMAIL="git@aaa"
|
||||
FLASK_JWT_PHRASE="jwtphrase"
|
||||
FLASK_REAL_HOSTNAME="localhost"
|
||||
|
||||
# Nextcloud:
|
||||
DOTENV_MYSQL_NEXTCLOUD_PASSWORD="nextcloudp"
|
||||
DOTENV_NEXTCLOUD_ADMIN_PASSWORD="adminp"
|
||||
|
||||
|
||||
|
||||
@@ -7,6 +7,14 @@ server {
|
||||
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/;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
50
proxy/conf
50
proxy/conf
@@ -1,52 +1,20 @@
|
||||
#server {
|
||||
# listen 80;
|
||||
# server_name localhost;
|
||||
# location / {
|
||||
# proxy_pass http://backend:8000;
|
||||
# }
|
||||
|
||||
|
||||
# always redirect to https
|
||||
server {
|
||||
listen 80 default_server;
|
||||
server_name _;
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
|
||||
listen 80;
|
||||
server_name localhost;
|
||||
location / {
|
||||
proxy_pass http://backend:8000/;
|
||||
proxy_pass http://backend:8000;
|
||||
}
|
||||
location /gutty{
|
||||
proxy_pass http://gitea:3000;
|
||||
}
|
||||
|
||||
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 / {
|
||||
location /nextcloud{
|
||||
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/;
|
||||
}
|
||||
proxy_pass http://nextcloud/;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ server {
|
||||
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/;
|
||||
@@ -50,3 +51,22 @@ 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/;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,14 @@
|
||||
#!/bin/bash
|
||||
# Container goal:
|
||||
# autossh -N -R 11111:localhost:11434 -i sshtun/oilykey/<SOMEKEY> -p 22222 <SOMEURL>
|
||||
# forwards rem_c_port:(operator_pc:op_pc_port) ...some args... rem_host_p rem_host_url
|
||||
# Container goal: egress
|
||||
# first: physical_box$ autossh -N -R 11111:localhost:11434 -i sshtun/oilykey/<SOMEKEY> -p 22222 <rem_vps_url>
|
||||
# will forward rem_c_port:physical_box:physical_box_port ...some args... rem_vps_p rem_vps_url
|
||||
# then: frontnet_c$ curl sshtun.frontnet:11112 --> physical_box:11434
|
||||
|
||||
if $USE_TUN ; then
|
||||
echo "@@@@@@@@@@ SSH TUNNEL ENABLED BY ENV"
|
||||
nohup socat TCP-LISTEN:11112,fork TCP:localhost:11111 &
|
||||
/usr/sbin/sshd -D
|
||||
/usr/sbin/sshd -De
|
||||
else
|
||||
echo "@@@@@@@@@@ SSH TUNNEL DISABLED BY ENV"
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user