Compare commits
No commits in common. "master" and "v1.0.0" have entirely different histories.
1
.gitignore
vendored
1
.gitignore
vendored
@ -3,4 +3,3 @@ __pycache__/
|
|||||||
config.py
|
config.py
|
||||||
*.pyc
|
*.pyc
|
||||||
.idea/
|
.idea/
|
||||||
*.env
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
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,5 +1,3 @@
|
|||||||
# MOVED PERMANENTLY TO GITHUB
|
|
||||||
https://github.com/michigg/codimd_note_overview
|
|
||||||
# CodiMD note overview
|
# CodiMD note overview
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,15 +1,16 @@
|
|||||||
version: "3"
|
version: "3"
|
||||||
|
|
||||||
|
networks:
|
||||||
|
db_net:
|
||||||
|
external: true
|
||||||
|
|
||||||
services:
|
services:
|
||||||
codimd_note_overview:
|
codimd_note_overview:
|
||||||
build:
|
build: .
|
||||||
context: .
|
|
||||||
dockerfile: Dockerfile.dev
|
|
||||||
image: docker.wiai.de/fswiai/codimd_notes_overview:0.1
|
image: docker.wiai.de/fswiai/codimd_notes_overview:0.1
|
||||||
ports:
|
ports:
|
||||||
- 8080:5000
|
- 8080:5000
|
||||||
|
networks:
|
||||||
|
- db_net
|
||||||
env_file:
|
env_file:
|
||||||
- ./docker.env
|
- /home/michigg/Nextcloud/Documents/OFU_Fachschaft/Server/hackmd_overview_addon/hackmd/docker.env
|
||||||
volumes:
|
|
||||||
- ./src:/app
|
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +0,0 @@
|
|||||||
DB_HOST=<hostname>
|
|
||||||
POSTGRES_DB=<db name>
|
|
||||||
POSTGRES_USER=<user name>
|
|
||||||
POSTGRES_PASSWORD=<user password>
|
|
||||||
|
|
||||||
# Padlist
|
|
||||||
TESTING=<True|False>
|
|
||||||
@ -1,19 +0,0 @@
|
|||||||
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)
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 8.5 KiB |
@ -20,10 +20,6 @@
|
|||||||
<a class="navbar-brand" href="#">
|
<a class="navbar-brand" href="#">
|
||||||
<h1>CodiMD notes</h1>
|
<h1>CodiMD notes</h1>
|
||||||
</a>
|
</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>
|
</nav>
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
@ -45,7 +41,7 @@
|
|||||||
<td scope="row"><a href="{{host}}/{{note['shortid']}}" target="_blank">{{note['shortid']}}</a></td>
|
<td scope="row"><a href="{{host}}/{{note['shortid']}}" target="_blank">{{note['shortid']}}</a></td>
|
||||||
<td>{{note['title']}}</td>
|
<td>{{note['title']}}</td>
|
||||||
<td>{{note['alias']}}</td>
|
<td>{{note['alias']}}</td>
|
||||||
<td><span class="note-date">{% if note['lastchangeAt'] %}{{note['lastchangeAt'].strftime('%Y-%m-%d %H:%M')}}{% endif %}</span>
|
<td><span class="note-date">{% if note['lastchangeAt'] %}{{note['lastchangeAt'].strftime('%d.%m.%Y %H:%M')}}{% endif %}</span>
|
||||||
</td>
|
</td>
|
||||||
<td>{{note['permission']}}</td>
|
<td>{{note['permission']}}</td>
|
||||||
<td>{%if note['content']%}💬{%else%}❌{%endif%}</td>
|
<td>{%if note['content']%}💬{%else%}❌{%endif%}</td>
|
||||||
|
|||||||
Reference in New Issue
Block a user