Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d00645853b | |||
| eb43108aa6 | |||
| 40ff55c97d | |||
| f24feb8f4d | |||
|
|
b3272693d1 | ||
|
|
9681b3d92e | ||
|
|
99be38db25 | ||
|
|
9bceb0d4dd | ||
|
|
a5d0c977bf | ||
|
|
1097526f09 | ||
| 1f0294f4ac | |||
| f7ddd93179 |
1
.gitignore
vendored
1
.gitignore
vendored
@ -3,3 +3,4 @@ __pycache__/
|
||||
config.py
|
||||
*.pyc
|
||||
.idea/
|
||||
*.env
|
||||
14
Dockerfile.dev
Normal file
14
Dockerfile.dev
Normal file
@ -0,0 +1,14 @@
|
||||
FROM alpine:3.8
|
||||
|
||||
ADD ["./requirements.txt", "/requirements.txt"]
|
||||
RUN apk add --update --no-cache python3 postgresql-dev py3-psycopg2 && \
|
||||
pip3 install -r /requirements.txt && \
|
||||
rm /requirements.txt && \
|
||||
adduser -D app
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
CMD ["python3", "-u", "/app/main.py"]
|
||||
|
||||
EXPOSE 5000
|
||||
USER app
|
||||
@ -1,3 +1,5 @@
|
||||
# MOVED PERMANENTLY TO GITHUB
|
||||
https://github.com/michigg/codimd_note_overview
|
||||
# CodiMD note overview
|
||||
|
||||
|
||||
|
||||
@ -1,16 +1,15 @@
|
||||
version: "3"
|
||||
|
||||
networks:
|
||||
db_net:
|
||||
external: true
|
||||
|
||||
services:
|
||||
codimd_note_overview:
|
||||
build: .
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile.dev
|
||||
image: docker.wiai.de/fswiai/codimd_notes_overview:0.1
|
||||
ports:
|
||||
- 8080:5000
|
||||
networks:
|
||||
- db_net
|
||||
env_file:
|
||||
- /home/michigg/Nextcloud/Documents/OFU_Fachschaft/Server/hackmd_overview_addon/hackmd/docker.env
|
||||
- ./docker.env
|
||||
volumes:
|
||||
- ./src:/app
|
||||
|
||||
|
||||
7
docker_example.env
Normal file
7
docker_example.env
Normal file
@ -0,0 +1,7 @@
|
||||
DB_HOST=<hostname>
|
||||
POSTGRES_DB=<db name>
|
||||
POSTGRES_USER=<user name>
|
||||
POSTGRES_PASSWORD=<user password>
|
||||
|
||||
# Padlist
|
||||
TESTING=<True|False>
|
||||
19
src/delete_unused_notes.py
Normal file
19
src/delete_unused_notes.py
Normal file
@ -0,0 +1,19 @@
|
||||
import os
|
||||
import psycopg2
|
||||
|
||||
DB_HOST = os.environ.get('DB_HOST')
|
||||
DB_NAME = os.environ.get('POSTGRES_DB')
|
||||
DB_USER = os.environ.get('POSTGRES_USER')
|
||||
DB_PASSWORD = os.environ.get('POSTGRES_PASSWORD')
|
||||
|
||||
deletion_statement = 'DELETE FROM "Notes" WHERE "content" = \'\';'
|
||||
|
||||
try:
|
||||
conn = psycopg2.connect(host=DB_HOST, database=DB_NAME, user=DB_USER, password=DB_PASSWORD)
|
||||
cur = conn.cursor()
|
||||
cur.execute(deletion_statement)
|
||||
conn.commit()
|
||||
cur.close()
|
||||
conn.close()
|
||||
except Exception as e:
|
||||
print(e)
|
||||
BIN
src/static/images/gitea-192.png
Normal file
BIN
src/static/images/gitea-192.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.5 KiB |
@ -20,6 +20,10 @@
|
||||
<a class="navbar-brand" href="#">
|
||||
<h1>CodiMD notes</h1>
|
||||
</a>
|
||||
<div navbar-nav flex-row ml-md-auto d-none d-md-flex>
|
||||
<a class="nav-item nav-link" href="https://git.wiai.de/mgoetz/codimd_note_overview" target="_blank">Fork me <img
|
||||
src="{{ url_for('static', filename='images/gitea-192.png') }}" width="35px" heigt="35px"></a>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<div class="container">
|
||||
@ -41,7 +45,7 @@
|
||||
<td scope="row"><a href="{{host}}/{{note['shortid']}}" target="_blank">{{note['shortid']}}</a></td>
|
||||
<td>{{note['title']}}</td>
|
||||
<td>{{note['alias']}}</td>
|
||||
<td><span class="note-date">{% if note['lastchangeAt'] %}{{note['lastchangeAt'].strftime('%d.%m.%Y %H:%M')}}{% endif %}</span>
|
||||
<td><span class="note-date">{% if note['lastchangeAt'] %}{{note['lastchangeAt'].strftime('%Y-%m-%d %H:%M')}}{% endif %}</span>
|
||||
</td>
|
||||
<td>{{note['permission']}}</td>
|
||||
<td>{%if note['content']%}💬{%else%}❌{%endif%}</td>
|
||||
|
||||
Reference in New Issue
Block a user