1
0
forked from finn/site

20 Commits

Author SHA1 Message Date
996e602774 restore nc stuff 2026-03-19 16:13:21 -07:00
c116021b29 checkpoint build fixes for pmb and be 2026-03-19 16:03:12 -07:00
d813c3c70e update proxy 2026-03-19 15:02:05 -07:00
854b7a2338 update db helper 2026-03-19 14:52:24 -07:00
901e5b29b6 add nc to network 2026-03-19 14:46:30 -07:00
b6ccb0c859 stop gitea regs 2026-03-19 21:18:01 +00:00
42a12d7ced also update example compose files 2026-01-04 08:03:22 +00:00
a329511464 set up admin-allowed registration 2026-01-04 08:01:10 +00:00
fc927eef63 add long staged emoji changes 2025-08-30 08:38:45 +00:00
7ed3b07ab4 Merge pull request 'Fixed typo.' (#7) from oily.mom/site:typo-fix into master
Reviewed-on: finn/site#7
Massive.
2025-08-30 04:46:38 +00:00
JustinOros
0f2ab58f00 Fixed typo. 2025-08-25 09:32:28 -07:00
950c9a6aea gitea ui tweaks 2025-01-02 02:22:57 +00:00
414c300b41 recenter gitea link 2024-09-05 20:24:47 -07:00
a5ac19a2a4 Merge pull request 'remove hard tabs oops' (#5) from tab_to_softtab into master
Reviewed-on: finn/site#5
2024-09-02 22:48:05 +00:00
78c0895418 disable gitea reg if link on tld 2024-09-02 07:47:47 +00:00
8cbe7eecd3 remove tabs from html 2024-09-02 07:22:23 +00:00
9090da987f gitea link in header 2024-09-02 00:04:58 -07:00
650e77210e move onion address to nginx header 2024-08-20 19:40:33 +00:00
16a45c495d restart always incomp with env switch 2024-08-10 06:30:54 -07:00
08ae04a154 ssh tunnel env switch and logging 2024-08-10 06:12:26 -07:00
26 changed files with 449 additions and 338 deletions

View File

@@ -1,9 +1,9 @@
# syntax=docker/dockerfile:1.4 # 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 # Second line optional/debug/qol
RUN apt update && apt install -y \ RUN apt update && apt install -y \
libmariadb-dev gcc \ libmariadb-dev gcc python3-setuptools \
mariadb-client mariadb-client

View File

@@ -7,7 +7,7 @@ from app.models import User
class LoginForm(FlaskForm): class LoginForm(FlaskForm):
username = StringField('Username', validators=[DataRequired()]) username = StringField('Username', validators=[DataRequired()])
password = PasswordField('Pasword', validators=[DataRequired()]) password = PasswordField('Password', validators=[DataRequired()])
remember_me = BooleanField('Remember Me') remember_me = BooleanField('Remember Me')
submit = SubmitField('Sign In') submit = SubmitField('Sign In')

View File

@@ -0,0 +1 @@
eee

View File

@@ -2,7 +2,7 @@
{% block content %} {% block content %}
<h2>File Not Found</h1> <h2>File Not Found</h1>
<p><a href="{{ url_for('index') }}">Back</a></p> <p><a href="{{ url_for('index') }}">Back</a></p>
{% endblock %} {% endblock %}

View File

@@ -2,8 +2,8 @@
{% block content %} {% block content %}
<h2>An unexpected error has occurred.</h1> <h2>An unexpected error has occurred.</h1>
<p>Administrator has been notified.</p> <p>Administrator has been notified.</p>
<p><a href="{{ url_for('index') }}">Back</a></p> <p><a href="{{ url_for('index') }}">Back</a></p>
{% endblock %} {% endblock %}

View File

@@ -1,11 +1,11 @@
<tr style="vertical-align: top;"> <tr style="vertical-align: top;">
<td style="vertical-align: middle; width: 60px;"> <td style="vertical-align: middle; width: 60px;">
<img style="vertical-align: middle; width: 40px;" src="data:image/png;base64,{{ post.author.gen_avatar(write_png=False) }}"> <img style="vertical-align: middle; width: 40px;" src="data:image/png;base64,{{ post.author.gen_avatar(write_png=False) }}">
</td> </td>
<td style="word-break: break-word;"> <td style="word-break: break-word;">
<a href="{{ url_for('user', username=post.author.username) }}"> <a href="{{ url_for('user', username=post.author.username) }}">
{{ post.author.username }} {{ post.author.username }}
</a> says:<br> </a> says:<br>
{{ post.body }} {{ post.body }}
</td> </td>
</tr> </tr>

View File

@@ -1,14 +1,14 @@
<div> <div>
{% if prev_url %} {% if prev_url %}
<a class="button" href="{{ prev_url }}">Newer</a> <a class="button" href="{{ prev_url }}">Newer</a>
{% else %} {% else %}
<a class="button" aria-disabled=true>Newer</a> <a class="button" aria-disabled=true>Newer</a>
{% endif %} {% endif %}
{% if next_url %} {% if next_url %}
<a class="button" href="{{ next_url }}">Older</a> <a class="button" href="{{ next_url }}">Older</a>
{% else %} {% else %}
<a class="button" aria-disabled=true>Older</a> <a class="button" aria-disabled=true>Older</a>
{% endif %} {% endif %}
</div> </div>

View File

@@ -1,42 +1,44 @@
<!doctype html> <!doctype html>
<html> <html>
<head> <head>
<link rel="stylesheet" href="{{ url_for('static', filename='simple.css') }}"> <link rel="stylesheet" href="{{ url_for('static', filename='simple.css') }}">
{% if title %} {% if title %}
<title>{{ title }}</title> <title>{{ title }}</title>
{% else %} {% else %}
<title>oily page</title> <title>oily page</title>
{% endif %} {% endif %}
</head> </head>
<body> <body>
<header> <header>
<nav> <nav>
<a {% block indexcurrent %}{% endblock %} href="{{ url_for('index') }}">home</a> <a {% block indexcurrent %}{% endblock %} href="{{ url_for('index') }}">home</a>
<a {% block explorecurrent %}{% endblock %} href="{{ url_for('explore') }}">explore</a> <a {% block explorecurrent %}{% endblock %} href="{{ url_for('explore') }}">explore</a>
{% if current_user.is_anonymous %} {% if current_user.is_anonymous %}
<a {% block logincurrent %}{% endblock %} href="{{ url_for('login') }}">login</a> <a {% block logincurrent %}{% endblock %} href="{{ url_for('login') }}">login</a>
{% else %} {% else %}
<a {% block profilecurrent %}{% endblock %} href="{{ url_for('user', username=current_user.username) }}">profile</a> <a {% block profilecurrent %}{% endblock %} href="{{ url_for('user', username=current_user.username) }}">profile</a>
<a href="{{ url_for('logout') }}">logout</a> <a href="{{ url_for('logout') }}">logout</a>
{% endif %} {% 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>
</nav> <h2>oily.dad</h2>
<h2>oily.dad</h2> </header>
<h5>oilydada7ckiseinkbeathsefwgkvjrce743xy7x7iiybkuxh4vheead.onion</h5> <hr>
</header> {% with messages = get_flashed_messages() %}
<hr> {% if messages %}
{% with messages = get_flashed_messages() %} <ul>
{% if messages %} {% for message in messages %}
<ul> <p class="notice">{{ message }}</p>
{% for message in messages %} {% endfor %}
<p class="notice">{{ message }}</p> </ul>
{% endfor %} {% endif %}
</ul> {% endwith %}
{% endif %}
{% endwith %}
{% block content %}{% endblock %} {% block content %}{% endblock %}
</body> </body>
</html> </html>

View File

@@ -1,24 +1,24 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block content %} {% block content %}
<h2>Edit Profile</h1> <h2>Edit Profile</h1>
<form action="" method="post"> <form action="" method="post">
{{ form.hidden_tag() }} {{ form.hidden_tag() }}
<p> <p>
{{ form.username.label }} {{ form.username.label }}
{{ form.username(size=32) }} {{ form.username(size=32) }}
{% for error in form.username.errors %} {% for error in form.username.errors %}
<span style="color: red;">[{{ error }}]</span> <span style="color: red;">[{{ error }}]</span>
{% endfor %} {% endfor %}
</p> </p>
<p> <p>
{{ form.about_me.label }} {{ form.about_me.label }}
{{ form.about_me(cols=50, rows=4) }} {{ form.about_me(cols=50, rows=4) }}
{% for error in form.about_me.errors %} {% for error in form.about_me.errors %}
<span style="color: red;">[{{ error }}]</span> <span style="color: red;">[{{ error }}]</span>
{% endfor %} {% endfor %}
</p> </p>
<p>{{ form.submit }}</p> <p>{{ form.submit }}</p>
</form> </form>
{% endblock %} {% endblock %}

View File

@@ -1,10 +1,10 @@
<!doctype html> <!doctype html>
<html> <html>
<body> <body>
<p>User {{ user.username }} requested password reset.</p> <p>User {{ user.username }} requested password reset.</p>
<p>Reset link:</p> <p>Reset link:</p>
<p><a href="{{ hostname }}{{ url_for('reset_password', token=token) }}">click here</a> <p><a href="{{ hostname }}{{ url_for('reset_password', token=token) }}">click here</a>
<p>If you did not request this, ignore this message.</p> <p>If you did not request this, ignore this message.</p>
</body> </body>
</html> </html>

View File

@@ -3,26 +3,26 @@
{% block explorecurrent %}class="current"{% endblock %} {% block explorecurrent %}class="current"{% endblock %}
{% block content %} {% block content %}
{% if form %} {% if form %}
<form action="" method="post"> <form action="" method="post">
{{ form.hidden_tag() }} {{ form.hidden_tag() }}
<p> <p>
{{ form.post.label }} {{ form.post.label }}
{{ form.post(cols=32, rows=4) }} {{ form.post(cols=32, rows=4) }}
{% for error in form.post.errors %} {% for error in form.post.errors %}
<span style="color: red;">[{{ error }}]</span> <span style="color: red;">[{{ error }}]</span>
{% endfor %} {% endfor %}
</p> </p>
<p>{{ form.submit() }}</p> <p>{{ form.submit() }}</p>
</form> </form>
{% endif %} {% endif %}
<table> <table>
{% for post in posts %} {% for post in posts %}
{% include '_post.html' %} {% include '_post.html' %}
{% endfor %} {% endfor %}
</table> </table>
{% include '_postnav.html' %} {% include '_postnav.html' %}
{% endblock %} {% endblock %}

View File

@@ -3,26 +3,26 @@
{% block indexcurrent %}class="current"{% endblock %} {% block indexcurrent %}class="current"{% endblock %}
{% block content %} {% block content %}
{% if form %} {% if form %}
<form action="" method="post"> <form action="" method="post">
{{ form.hidden_tag() }} {{ form.hidden_tag() }}
<p> <p>
{{ form.post.label }} {{ form.post.label }}
{{ form.post(cols=32, rows=4) }} {{ form.post(cols=32, rows=4) }}
{% for error in form.post.errors %} {% for error in form.post.errors %}
<span style="color: red;">[{{ error }}]</span> <span style="color: red;">[{{ error }}]</span>
{% endfor %} {% endfor %}
</p> </p>
<p>{{ form.submit() }}</p> <p>{{ form.submit() }}</p>
</form> </form>
{% endif %} {% endif %}
<table> <table>
{% for post in posts %} {% for post in posts %}
{% include '_post.html' %} {% include '_post.html' %}
{% endfor %} {% endfor %}
</table> </table>
{% include '_postnav.html' %} {% include '_postnav.html' %}
{% endblock %} {% endblock %}

View File

@@ -3,31 +3,31 @@
{% block logincurrent %}class="current"{% endblock %} {% block logincurrent %}class="current"{% endblock %}
{% block content %} {% block content %}
<h2>Sign In</h1> <h2>Sign In</h1>
<form action="" method="post" novalidate> <form action="" method="post" novalidate>
{{ form.hidden_tag() }} {{ form.hidden_tag() }}
<p> <p>
{{ form.username.label }}<br> {{ form.username.label }}<br>
{{ form.username(size=32) }}<br> {{ form.username(size=32) }}<br>
{% for error in form.username.errors %} {% for error in form.username.errors %}
<span style="color: red;">[{{ error }}]</span> <span style="color: red;">[{{ error }}]</span>
{% endfor %} {% endfor %}
</p> </p>
<p> <p>
{{ form.password.label }}<br> {{ form.password.label }}<br>
{{ form.password(size=32) }}<br> {{ form.password(size=32) }}<br>
{% for error in form.password.errors %} {% for error in form.password.errors %}
<span style="color: red;">[{{ error }}]</span> <span style="color: red;">[{{ error }}]</span>
{% endfor %} {% endfor %}
</p> </p>
<p>{{ form.remember_me() }} {{ form.remember_me.label }}</p> <p>{{ form.remember_me() }} {{ form.remember_me.label }}</p>
<p> <p>
{{ form.submit }} {{ form.submit }}
<a class="button" href="{{ url_for('register') }}">Register</a> <a class="button" href="{{ url_for('register') }}">Register</a>
</p> </p>
</form> </form>
<p><a href="{{ url_for('reset_password_request') }}">Reset Password</a></p> <p><a href="{{ url_for('reset_password_request') }}">Reset Password</a></p>
{% endblock %} {% endblock %}

View File

@@ -2,39 +2,39 @@
{% block content %} {% block content %}
<h2>Register</h1> <h2>Register</h1>
<form action="" method="post"> <form action="" method="post">
{{ form.hidden_tag() }} {{ form.hidden_tag() }}
<p> <p>
{{ form.username.label }}<br> {{ form.username.label }}<br>
{{ form.username(size=32) }}<br> {{ form.username(size=32) }}<br>
{% for error in form.username.errors %} {% for error in form.username.errors %}
<span style="color: red;">[{{ error }}]</span> <span style="color: red;">[{{ error }}]</span>
{% endfor %} {% endfor %}
</p> </p>
<p> <p>
{{ form.email.label }}<br> {{ form.email.label }}<br>
{{ form.email(size=64) }}<br> {{ form.email(size=64) }}<br>
{% for error in form.email.errors %} {% for error in form.email.errors %}
<span style="color: red;">[{{ error }}]</span> <span style="color: red;">[{{ error }}]</span>
{% endfor %} {% endfor %}
</p> </p>
<p> <p>
{{ form.password.label }}<br> {{ form.password.label }}<br>
{{ form.password(size=64) }}<br> {{ form.password(size=64) }}<br>
{% for error in form.password.errors %} {% for error in form.password.errors %}
<span style="color: red;">[{{ error }}]</span> <span style="color: red;">[{{ error }}]</span>
{% endfor %} {% endfor %}
</p> </p>
<p> <p>
{{ form.password2.label }}<br> {{ form.password2.label }}<br>
{{ form.password2(size=64) }}<br> {{ form.password2(size=64) }}<br>
{% for error in form.password2.errors %} {% for error in form.password2.errors %}
<span style="color: red;">[{{ error }}]</span> <span style="color: red;">[{{ error }}]</span>
{% endfor %} {% endfor %}
</p> </p>
<p>{{ form.submit }}</p> <p>{{ form.submit }}</p>
</form> </form>
{% endblock %} {% endblock %}

View File

@@ -2,25 +2,25 @@
{% block content %} {% block content %}
<h2>Reset Your Password</h1> <h2>Reset Your Password</h1>
<form action="" method="post"> <form action="" method="post">
{{ form.hidden_tag() }} {{ form.hidden_tag() }}
<p> <p>
{{ form.password.label }} {{ form.password.label }}
{{ form.password(size=32) }} {{ form.password(size=32) }}
{% for error in form.password.errors %} {% for error in form.password.errors %}
<span style="color: red;">[{{ error }}]</span> <span style="color: red;">[{{ error }}]</span>
{% endfor %} {% endfor %}
</p> </p>
<p> <p>
{{ form.password2.label }} {{ form.password2.label }}
{{ form.password2(size=32) }} {{ form.password2(size=32) }}
{% for error in form.password2.errors %} {% for error in form.password2.errors %}
<span style="color: red;">[{{ error }}]</span> <span style="color: red;">[{{ error }}]</span>
{% endfor %} {% endfor %}
</p> </p>
<p>{{ form.submit() }}</p> <p>{{ form.submit() }}</p>
</form> </form>
{% endblock %} {% endblock %}

View File

@@ -1,17 +1,17 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block content %} {% block content %}
<h2>Reset Password</h1> <h2>Reset Password</h1>
<form action="" method="post"> <form action="" method="post">
{{ form.hidden_tag() }} {{ form.hidden_tag() }}
<p> <p>
{{ form.email.label }}<br> {{ form.email.label }}<br>
{{ form.email(size=64) }}<br> {{ form.email(size=64) }}<br>
{% for error in form.email.errors %} {% for error in form.email.errors %}
<span style="color: red;">[{{ error }}]</span> <span style="color: red;">[{{ error }}]</span>
{% endfor %} {% endfor %}
</p> </p>
<p>{{ form.submit() }}</p> <p>{{ form.submit() }}</p>
</form> </form>
{% endblock %} {% endblock %}

View File

@@ -3,40 +3,40 @@
{% block profilecurrent %}class="current"{% endblock %} {% block profilecurrent %}class="current"{% endblock %}
{% block content %} {% block content %}
<article> <article>
<h2> <h2>
<img style="vertical-align: middle; width: 60px;" src="data:image/png;base64,{{ user.gen_avatar(write_png=False) }}"> <img style="vertical-align: middle; width: 60px;" src="data:image/png;base64,{{ user.gen_avatar(write_png=False) }}">
User: {{ user.username }} User: {{ user.username }}
</h2> </h2>
{% if user.about_me %}<p>{{ user.about_me }}</p>{% endif %} {% if user.about_me %}<p>{{ user.about_me }}</p>{% endif %}
{% if user.last_seen %}<p>Last activity: {{ user.last_seen }}</p>{% endif %} {% if user.last_seen %}<p>Last activity: {{ user.last_seen }}</p>{% endif %}
{% if user == current_user %} {% if user == current_user %}
<p><a class="button" href="{{ url_for('edit_profile') }}">Edit Profile</a></p> <p><a class="button" href="{{ url_for('edit_profile') }}">Edit Profile</a></p>
{% elif not current_user.is_following(user) %} {% elif not current_user.is_following(user) %}
<p> <p>
<form action="{{ url_for('follow', username=user.username) }}" method="post"> <form action="{{ url_for('follow', username=user.username) }}" method="post">
{{ form.hidden_tag() }} {{ form.hidden_tag() }}
{{ form.submit(value='Follow') }} {{ form.submit(value='Follow') }}
</form> </form>
</p> </p>
{% else %} {% else %}
<p> <p>
<form action="{{ url_for('unfollow', username=user.username) }}" method="post"> <form action="{{ url_for('unfollow', username=user.username) }}" method="post">
{{ form.hidden_tag() }} {{ form.hidden_tag() }}
{{ form.submit(value='Unfollow') }} {{ form.submit(value='Unfollow') }}
</form> </form>
</p> </p>
{% endif %} {% endif %}
</article> </article>
<hr> <hr>
<table> <table>
{% for post in posts %} {% for post in posts %}
{% include '_post.html' %} {% include '_post.html' %}
{% endfor %} {% endfor %}
</table> </table>
{% include '_postnav.html' %} {% include '_postnav.html' %}
{% endblock %} {% endblock %}

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
@@ -75,10 +75,13 @@ services:
- GITEA__mailer__PROTOCOL=smtp - GITEA__mailer__PROTOCOL=smtp
- GITEA__mailer__SMTP_ADDR=pmb - GITEA__mailer__SMTP_ADDR=pmb
- GITEA__mailer__SMTP_PORT=25 - 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__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: # To disable new users after setup:
#- GITEA__service__DISABLE_REGISTRATION=false - GITEA__service__DISABLE_REGISTRATION=true
networks: networks:
- backnet - backnet
- frontnet - frontnet
@@ -96,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"
@@ -118,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"
@@ -139,18 +142,47 @@ services:
build: build:
context: sshtun context: sshtun
dockerfile: Dockerfile dockerfile: Dockerfile
restart: always restart: on-failure
environment:
- USE_TUN=${USE_TUN}
ports: ports:
- "22222:22" - "22222:22"
expose: expose:
- "11111"
- "11112" - "11112"
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

@@ -75,10 +75,13 @@ services:
- GITEA__mailer__PROTOCOL=smtp - GITEA__mailer__PROTOCOL=smtp
- GITEA__mailer__SMTP_ADDR=pmb - GITEA__mailer__SMTP_ADDR=pmb
- GITEA__mailer__SMTP_PORT=25 - 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__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: # To disable new users after setup:
#- GITEA__service__DISABLE_REGISTRATION=false - GITEA__service__DISABLE_REGISTRATION=true
networks: networks:
- backnet - backnet
- frontnet - frontnet
@@ -118,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"
@@ -139,18 +142,47 @@ services:
build: build:
context: sshtun context: sshtun
dockerfile: Dockerfile dockerfile: Dockerfile
restart: always restart: on-failure
environment:
- USE_TUN=${USE_TUN}
ports: ports:
- "22222:22" - "22222:22"
expose: expose:
- "11111"
- "11112" - "11112"
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

@@ -75,10 +75,13 @@ services:
- GITEA__mailer__PROTOCOL=smtp - GITEA__mailer__PROTOCOL=smtp
- GITEA__mailer__SMTP_ADDR=pmb - GITEA__mailer__SMTP_ADDR=pmb
- GITEA__mailer__SMTP_PORT=25 - 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__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: # To disable new users after setup:
#- GITEA__service__DISABLE_REGISTRATION=false - GITEA__service__DISABLE_REGISTRATION=true
networks: networks:
- backnet - backnet
- frontnet - frontnet
@@ -118,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"
@@ -139,18 +142,47 @@ services:
build: build:
context: sshtun context: sshtun
dockerfile: Dockerfile dockerfile: Dockerfile
restart: always restart: on-failure
environment:
- USE_TUN=${USE_TUN}
ports: ports:
- "22222:22" - "22222:22"
expose: expose:
- "11111"
- "11112" - "11112"
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,12 +1,15 @@
-- 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 'gitea'@'gitea.backnet' IDENTIFIED BY 'giteap'; CREATE USER IF NOT EXISTS 'gitea'@'gitea.backnet' IDENTIFIED BY 'giteap';
CREATE USER 'flasku'@'backend.backnet' IDENTIFIED BY 'flaskp'; 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'; --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';

7
dotenv
View File

@@ -13,6 +13,9 @@ BUILD_GPG_PP=
# Tor: # Tor:
# true/false: # true/false:
USE_TOR=false USE_TOR=false
# SSH Tun:
# true/false:
USE_TUN=false
# Backend: # Backend:
FLASK_SECRET_KEY="flaskkey" FLASK_SECRET_KEY="flaskkey"
@@ -28,4 +31,8 @@ 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,6 +7,14 @@ 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,52 +1,20 @@
#server {
# listen 80;
# server_name localhost;
# location / {
# proxy_pass http://backend:8000;
# }
# always redirect to https
server { server {
listen 80 default_server; listen 80;
server_name _; server_name localhost;
return 301 https://$host$request_uri; location / {
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;
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

@@ -22,6 +22,7 @@ server {
root /var/www/html; root /var/www/html;
index index.php index.html index.htm; index index.php index.html index.htm;
add_header Onion-Location http://oilydada7ckiseinkbeathsefwgkvjrce743xy7x7iiybkuxh4vheead.onion$request_uri;
location / { location / {
proxy_pass http://backend:8000/; 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/;
}
}

View File

@@ -1,8 +1,14 @@
#!/bin/bash #!/bin/bash
# Container goal: # Container goal: egress
# autossh -N -R 11111:localhost:11434 -i sshtun/oilykey/<SOMEKEY> -p 22222 <SOMEURL> # first: physical_box$ autossh -N -R 11111:localhost:11434 -i sshtun/oilykey/<SOMEKEY> -p 22222 <rem_vps_url>
# forwards rem_c_port:(operator_pc:op_pc_port) ...some args... rem_host_p rem_host_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
nohup socat TCP-LISTEN:11112,fork TCP:localhost:11111 & if $USE_TUN ; then
/usr/sbin/sshd -D echo "@@@@@@@@@@ SSH TUNNEL ENABLED BY ENV"
nohup socat TCP-LISTEN:11112,fork TCP:localhost:11111 &
/usr/sbin/sshd -De
else
echo "@@@@@@@@@@ SSH TUNNEL DISABLED BY ENV"
fi