Skip to content

Commit 9adf959

Browse files
Merge pull request #12 from devcordde/chore/cleanup-repo
Chore/cleanup repo
2 parents 1a6c71a + 58cbc0d commit 9adf959

40 files changed

Lines changed: 189 additions & 141 deletions

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ README.md
1111
.gitattributes
1212
.gitignore
1313
debug.sh
14+
public/impressum.html

.envrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
use nix

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.env
2-
.env.dev
2+
dev.env
33
discordguild.php
44
f.php
55
test.php
@@ -23,3 +23,5 @@ buildpush.sh
2323
html/install-php-extensions
2424
composer.lock
2525
info.php
26+
*.env
27+
!example.*.env

README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,23 @@
11
# DevCord Devmarkt
22

33
## setup dev environment
4-
- copy .env.dev.example to .env.dev
4+
- copy example.dev.env to dev.env
55
- enter all properties
66
- add the bot to your server
77
- run `docker compose -f compose.debug.yaml up`
8+
9+
## Impressum
10+
To provide an impressum, you can either:
11+
12+
1. **Use the default template**: Fill in the following environment variables in your `.env` file:
13+
- `IMPRESSUM_NAME`
14+
- `IMPRESSUM_STREET`
15+
- `IMPRESSUM_CITY`
16+
- `IMPRESSUM_EMAIL`
17+
18+
2. **Mount a custom file**: Create an `impressum.html` file in the `public` directory or mount it via docker-compose:
19+
```yaml
20+
volumes:
21+
- ./impressum.html:/var/www/public/impressum.html
22+
```
23+
If `public/impressum.html` exists (either in the image or mounted), it will be used instead of the template.

compose.debug.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
services:
22
mysql:
33
container_name: mysql_dev
4-
image: mysql
5-
command: --default-authentication-plugin=mysql_native_password
4+
image: mysql:9.7
65
environment:
76
MYSQL_ROOT_PASSWORD: test
87
MYSQL_DATABASE: test
@@ -15,11 +14,14 @@ services:
1514
- "8080:80"
1615
volumes:
1716
- ./:/var/www/
17+
# - ./impressum.html:/var/www/public/impressum.html
18+
depends_on:
19+
- mysql
1820
environment:
1921
MYSQL_HOST: mysql_dev
2022
MYSQL_DATABASE: test
2123
MYSQL_USER: root
2224
MYSQL_PASSWORD: test
2325
BOT_REDIRECT_URI: http://localhost:8080/login.php?
2426
BOT_BASE_URI: http://localhost:8080
25-
env_file: .env.dev
27+
env_file: dev.env

compose.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ services:
66
dockerfile: Dockerfile
77
volumes:
88
- ./:/var/www/
9+
# - ./impressum.html:/var/www/public/impressum.html
910
ports:
1011
- "8080:80"
1112
env_file: .env

debug.Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,6 @@ RUN chown -R www-data:www-data /var/www
3939
COPY docker/start-apache /usr/local/bin
4040

4141
ENV APP_PATH=/var/www
42+
COPY docker/000-default.conf /etc/apache2/sites-available/000-default.conf
4243

4344
CMD ["start-apache"]

docker/000-default.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<VirtualHost *:80>
22
ServerAdmin webmaster@localhost
3-
DocumentRoot /var/www
3+
DocumentRoot /var/www/public
44

5-
<Directory /var/www>
5+
<Directory /var/www/public>
66
Options Indexes FollowSymLinks
77
AllowOverride All
88
Require all granted

docker/start-apache

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
11
#!/usr/bin/env bash
2+
3+
# Generate impressum from template if it doesn't exist
4+
if [ ! -f /var/www/public/impressum.html ]; then
5+
echo "Generating /var/www/public/impressum.html from template..."
6+
cp /var/www/docker/templates/impressum.html.template /var/www/public/impressum.html
7+
sed -i "s/IMPRESSUM_NAME/${IMPRESSUM_NAME:-}/g" /var/www/public/impressum.html
8+
sed -i "s/IMPRESSUM_STREET/${IMPRESSUM_STREET:-}/g" /var/www/public/impressum.html
9+
sed -i "s/IMPRESSUM_CITY/${IMPRESSUM_CITY:-}/g" /var/www/public/impressum.html
10+
sed -i "s/IMPRESSUM_EMAIL/${IMPRESSUM_EMAIL:-}/g" /var/www/public/impressum.html
11+
fi
12+
213
sed -i "s/Listen 80/Listen ${PORT:-80}/g" /etc/apache2/ports.conf
314
sed -i "s/:80/:${PORT:-80}/g" /etc/apache2/sites-enabled/*
415
apache2-foreground
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<html>
44
<head>
5-
<title>Datenschutzerkl&auml;rung - DevCord</title>
5+
<title>Impressum - DevCord</title>
66
<link rel="shortcut icon" type="image/x-icon" href="assets/img/favicon.png" />
77
<link rel="stylesheet" href="assets/css/style.css" />
88
</head>
@@ -13,9 +13,9 @@ <h1>Impressum</h1>
1313

1414
<h2>Angaben gem&auml;&szlig; &sect; 5 TMG</h2>
1515
<p>
16-
Max Schlosser<br />
17-
Gro&szlig;br&ouml;sern 4<br />
18-
02627 Radibor
16+
IMPRESSUM_NAME<br />
17+
IMPRESSUM_STREET<br />
18+
IMPRESSUM_CITY
1919
</p>
2020

2121
<p>
@@ -24,7 +24,7 @@ <h2>Angaben gem&auml;&szlig; &sect; 5 TMG</h2>
2424
</p>
2525

2626
<h2>Kontakt</h2>
27-
<p>E-Mail: kontakt@max-schlosser.de</p>
27+
<p>E-Mail: IMPRESSUM_EMAIL</p>
2828

2929
<p>
3030
Wir sind nicht bereit oder verpflichtet, an Streitbeilegungsverfahren vor einer

0 commit comments

Comments
 (0)