Compare commits
24 Commits
watermarks
...
master
Author | SHA1 | Date |
---|---|---|
![]() |
fc4b025d54 | 4 years ago |
|
cf0ed05816 | 4 years ago |
|
8c8378b4c3 | 4 years ago |
![]() |
a43ff51958 | 4 years ago |
![]() |
bb0c41974c | 4 years ago |
![]() |
601eaea199 | 4 years ago |
![]() |
d0af1b8a3e | 4 years ago |
![]() |
d6e8a838dd | 4 years ago |
![]() |
25594ca739 | 4 years ago |
![]() |
7ccaee4d8c | 4 years ago |
|
f8df5ee5e7 | 4 years ago |
![]() |
b5088929dd | 4 years ago |
![]() |
9c810fbab5 | 4 years ago |
![]() |
741bd399ed | 4 years ago |
![]() |
bc10d5c77e | 4 years ago |
|
33cba5d96b | 4 years ago |
|
2792cc707f | 4 years ago |
![]() |
f62eb4a659 | 4 years ago |
![]() |
7f664c44ae | 4 years ago |
![]() |
0bd376f11d | 4 years ago |
![]() |
91508a6d73 | 4 years ago |
![]() |
d23e4857af | 4 years ago |
![]() |
e5c984cbe3 | 4 years ago |
![]() |
2524c07dd0 | 4 years ago |
@ -1,3 +1,17 @@
|
|||||||
env/
|
env/
|
||||||
venv/
|
venv/
|
||||||
venv/*
|
venv/*
|
||||||
|
.idea/
|
||||||
|
__pycache__/
|
||||||
|
__pycache__/*
|
||||||
|
__pycache__/config.cpython-37.pyc
|
||||||
|
app/__pycache__/
|
||||||
|
app/__pycache__/*
|
||||||
|
app/__pycache__/__init__.cpython-37.pyc
|
||||||
|
app/__pycache__/views.cpython-37.pyc
|
||||||
|
app/static/dewatermark/
|
||||||
|
app/static/dewatermark/*
|
||||||
|
app/static/republish/
|
||||||
|
app/static/republish/*
|
||||||
|
app/static/covers/*
|
||||||
|
*.pyc
|
@ -0,0 +1,95 @@
|
|||||||
|
# Run
|
||||||
|
|
||||||
|
## in Development
|
||||||
|
**only using flask; no Unicorn**
|
||||||
|
|
||||||
|
`export FLASK_APP=run.py`
|
||||||
|
`export FLASK_ENV=development`
|
||||||
|
`flask run`
|
||||||
|
|
||||||
|
|
||||||
|
**Using gunicorn:**
|
||||||
|
|
||||||
|
`gunicorn --env SCRIPT_NAME=/watermark -w 4 -b 127.0.0.1:5000 app:app --log-level debug`
|
||||||
|
* `-w` workers
|
||||||
|
* `-b` bind to address / unix socker
|
||||||
|
|
||||||
|
**And gunicorn with using unix sock:** (this how it should run in production)
|
||||||
|
` gunicorn --env SCRIPT_NAME=/watermark --workers 4 --bind unix:app.sock -m 007 app:app --log-level debug
|
||||||
|
|
||||||
|
## in Production with gunicorn and unix sockets
|
||||||
|
Based on https://medium.com/faun/deploy-flask-app-with-nginx-using-gunicorn-7fda4f50066a
|
||||||
|
|
||||||
|
### systemd service file
|
||||||
|
|
||||||
|
Add to /etc/systemd/system/watermarks.service
|
||||||
|
|
||||||
|
```
|
||||||
|
[Unit]
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
User=psc
|
||||||
|
Group=www-data
|
||||||
|
WorkingDirectory=/var/www/TacticalApp
|
||||||
|
Environment="PATH=/var/www/TacticalApp/venv/bin"
|
||||||
|
ExecStart=/var/www/TacticalApp/venv/bin/gunicorn --env SCRIPT_NAME=/watermarks --workers 4 --bind unix:app.sock -m 007 app:app
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
```
|
||||||
|
|
||||||
|
## enable & start service file
|
||||||
|
`systemctl enable watermarks.service`
|
||||||
|
|
||||||
|
`systemctl start watermarks.service`
|
||||||
|
|
||||||
|
It is also a good idea to check the status of the service
|
||||||
|
`systemctl status watermarks.service`
|
||||||
|
|
||||||
|
## Nginx config
|
||||||
|
|
||||||
|
```
|
||||||
|
location / {
|
||||||
|
# if using gunicorn with app sock, use:
|
||||||
|
proxy_pass http://unix:/var/www/TacticalApp/app.sock;
|
||||||
|
# if using gunicord with port 5000, use:
|
||||||
|
proxy_pass http://127.0.0.1:5000;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## debug.
|
||||||
|
|
||||||
|
It might be helpful to enable gunicorn logging, while in development, to check what is going on,
|
||||||
|
by replacing in watermarks.service, the `ExecStart=` value with:
|
||||||
|
|
||||||
|
`ExecStart=/var/www/TacticalApp/venv/bin/gunicorn --log-level debug --error-logfile /var/www/TacticalApp/app.log --workers 4 --bind unix:app.sock -m 007 app:app`
|
||||||
|
|
||||||
|
And reloading the services
|
||||||
|
`systemctl daemon-reload`
|
||||||
|
|
||||||
|
`systemctl restart watermarks.service`
|
||||||
|
|
||||||
|
and the start following app.log:
|
||||||
|
`tail -f /var/www/TacticalApp/app.log`
|
||||||
|
|
||||||
|
But in the long run logging should be disabled
|
||||||
|
|
||||||
|
----
|
||||||
|
09.06.2020 Handling url path /watermarks
|
||||||
|
|
||||||
|
* gunicorn has to be started with argument `--env SCRIPT_NAME=/watermark` which defines its path:
|
||||||
|
`gunicorn --env SCRIPT_NAME=/watermark --workers 4 --bind unix:app.sock -m 007 app:app --log-level debug`
|
||||||
|
* allows for the following URLs
|
||||||
|
* http://127.0.0.1/watermark
|
||||||
|
* http://127.0.0.1/watermark/uploadbook
|
||||||
|
* http://127.0.0.1/watermark/about
|
||||||
|
|
||||||
|
* added page /test `watermark/test` for testing url_for() - correct
|
||||||
|
* made urls relative
|
||||||
|
* service file with `--env SCRIPT_NAME=/watermark` see above
|
||||||
|
*
|
||||||
|
gunicorn -w 4 -b :5000 app:app
|
||||||
|
gunicorn -w 4 -b :5000 app:app
|
||||||
|
|
||||||
|
#
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,449 @@
|
|||||||
|
@font-face {
|
||||||
|
font-family: "Lyon";
|
||||||
|
src: url("LyonJeanTrue.ttf");
|
||||||
|
font-weight: 300;
|
||||||
|
font-style: normal;}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: "Favorit";
|
||||||
|
src: url("Favorit_Regular.ttf");
|
||||||
|
font-weight: 300;
|
||||||
|
font-style: normal;}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: "Favorit";
|
||||||
|
src: url("Favorit_Regular-Italic.ttf");
|
||||||
|
font-weight: 300;
|
||||||
|
font-style: italic;}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: "Favorit";
|
||||||
|
src: url("Favorit_Medium.ttf");
|
||||||
|
font-weight: 400;
|
||||||
|
font-style: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: "Favorit";
|
||||||
|
src: url("Favorit_Medium-Italic.ttf");
|
||||||
|
font-weight: 400;
|
||||||
|
font-style: italic;}
|
||||||
|
|
||||||
|
body {
|
||||||
|
background-color: #e6e7e8;
|
||||||
|
overflow-x: hidden;
|
||||||
|
width: 100vw;
|
||||||
|
}
|
||||||
|
|
||||||
|
.spaceleft{
|
||||||
|
margin-left: 15vw;
|
||||||
|
padding-top: 30px;
|
||||||
|
padding-left: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
h3{
|
||||||
|
font-weight: 400;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
text-transform: uppercase;
|
||||||
|
transform: scaleX(0.75);
|
||||||
|
transform-origin: 0 0;
|
||||||
|
font-size: calc(10px + 0.3vw);
|
||||||
|
font-family: "Favorit", Arial, Helvetica, sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
h4{
|
||||||
|
font-weight: 400;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
text-transform: uppercase;
|
||||||
|
transform: scaleX(0.75);
|
||||||
|
transform-origin: 0 0;
|
||||||
|
font-size: calc(10px + 0.3vw);
|
||||||
|
font-family: "Favorit", Arial, Helvetica, sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
a{
|
||||||
|
color: #000;
|
||||||
|
text-decoration: none;
|
||||||
|
display: inline;
|
||||||
|
font-family: "Favorit", Arial, Helvetica, sans-serif;
|
||||||
|
font-weight: 300;
|
||||||
|
}
|
||||||
|
|
||||||
|
a:hover{
|
||||||
|
color: #cfff00;
|
||||||
|
text-decoration: none;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
a:visited{
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ASIDE */
|
||||||
|
|
||||||
|
aside{
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: calc(15vw - 30px);
|
||||||
|
height: 100vh;
|
||||||
|
z-index: 2;
|
||||||
|
display: inline-block;
|
||||||
|
background-color: #cfff00;
|
||||||
|
font-family: "Favorit", Arial, Helvetica, sans-serif;
|
||||||
|
font-size: calc(10px + 0.3vw);
|
||||||
|
font-weight: 400;
|
||||||
|
font-style: normal;
|
||||||
|
line-height: 110%;
|
||||||
|
padding-left: 30px;
|
||||||
|
padding-top: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
li{
|
||||||
|
transform: scaleX(0.75);
|
||||||
|
transform-origin: 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
h2{
|
||||||
|
transform: scaleX(0.75);
|
||||||
|
transform-origin: 0 0;
|
||||||
|
font-weight: 400;
|
||||||
|
}
|
||||||
|
|
||||||
|
a.mapping:hover{
|
||||||
|
color: #FFF;
|
||||||
|
text-decoration: none;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* INDEX */
|
||||||
|
|
||||||
|
h1{
|
||||||
|
color: #FFF;
|
||||||
|
font-family: "Lyon", Arial, Helvetica, sans-serif;
|
||||||
|
font-size: calc(15px + 5vw);
|
||||||
|
text-align: center;
|
||||||
|
width: 100vw;
|
||||||
|
padding-bottom: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#indexabout{
|
||||||
|
padding-top: 20vh;
|
||||||
|
padding-bottom: 25px;
|
||||||
|
}
|
||||||
|
|
||||||
|
dl{
|
||||||
|
font-family: "Favorit", Arial, Helvetica, sans-serif;
|
||||||
|
font-size: calc(12px + 0.3vw);
|
||||||
|
text-align: center;
|
||||||
|
width: 100vw;
|
||||||
|
font-weight: 400;
|
||||||
|
font-style: italic;
|
||||||
|
transform: scaleX(0.75);
|
||||||
|
line-height: 110%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.colorbackground{
|
||||||
|
margin-top: -5px;
|
||||||
|
position: absolute;
|
||||||
|
overflow: hidden;
|
||||||
|
width: 100vw;
|
||||||
|
height: 100vh;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
#indexyellowleft{
|
||||||
|
position: fixed;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
display: inline-block;
|
||||||
|
width: 38vw;
|
||||||
|
height: 100vh;
|
||||||
|
background-color: #cfff00;
|
||||||
|
}
|
||||||
|
|
||||||
|
#indexyellowright{
|
||||||
|
position: fixed;
|
||||||
|
left: 76vw;
|
||||||
|
top: 0;
|
||||||
|
display: inline-block;
|
||||||
|
height: 100vh;
|
||||||
|
width: 24vw;
|
||||||
|
background-color: #cfff00;
|
||||||
|
}
|
||||||
|
|
||||||
|
.indextext{
|
||||||
|
position: fixed;
|
||||||
|
z-index: 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* HEADER */
|
||||||
|
|
||||||
|
header{
|
||||||
|
position: fixed;
|
||||||
|
top: 5px;
|
||||||
|
width: calc(100vw - 15px);
|
||||||
|
font-size: 12px;
|
||||||
|
font-family: "Lyon", Arial, Helvetica, sans-serif;
|
||||||
|
font-weight: 300;
|
||||||
|
font-style: normal;
|
||||||
|
z-index: 999;
|
||||||
|
}
|
||||||
|
|
||||||
|
.marquee {
|
||||||
|
position: relative;
|
||||||
|
width: calc(100vw - 15px);
|
||||||
|
max-width: 100%;
|
||||||
|
overflow-x: hidden;
|
||||||
|
height: 50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.track {
|
||||||
|
position: absolute;
|
||||||
|
white-space: nowrap;
|
||||||
|
will-change: transform;
|
||||||
|
animation: marquee 20s linear infinite;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes marquee {
|
||||||
|
from { transform: translateX(0); }
|
||||||
|
to { transform: translateX(-50%); }
|
||||||
|
}
|
||||||
|
|
||||||
|
a.head{
|
||||||
|
color: #FFF;
|
||||||
|
text-decoration: none;
|
||||||
|
display: inline;
|
||||||
|
font-family: "Lyon", Arial, Helvetica, sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
a.head:hover{
|
||||||
|
text-decoration: none;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
a.head:visited{
|
||||||
|
text-decoration: none;
|
||||||
|
|
||||||
|
/* BOOKS REQUESTS */
|
||||||
|
|
||||||
|
.requestabook{
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 80vw;
|
||||||
|
width: calc(20vw - 30px);
|
||||||
|
height: 100vh;
|
||||||
|
z-index: 3;
|
||||||
|
display: inline-block;
|
||||||
|
background-color: #cfff00;
|
||||||
|
font-family: "Favorit", Arial, Helvetica, sans-serif;
|
||||||
|
font-size: calc(10px + 0.3vw);
|
||||||
|
font-weight: 300;
|
||||||
|
font-style: normal;
|
||||||
|
line-height: 110%;
|
||||||
|
padding-left: 30px;
|
||||||
|
padding-top: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.scrollrequests{
|
||||||
|
overflow: auto;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.booksrequested{
|
||||||
|
padding-bottom: 15px;
|
||||||
|
padding-top: 15px;
|
||||||
|
padding-left: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info{
|
||||||
|
transform: scaleX(0.75);
|
||||||
|
transform-origin: 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
a.linktorequest{
|
||||||
|
text-decoration: none;
|
||||||
|
font-style: italic;
|
||||||
|
display: inline;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
a.linktorequest:hover{
|
||||||
|
color: #FFF;
|
||||||
|
text-decoration: none;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes blinker {
|
||||||
|
50% {
|
||||||
|
opacity: 0.5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.compressed{
|
||||||
|
animation: blinker 1s linear infinite;
|
||||||
|
transform: scaleX(0.75);
|
||||||
|
transform-origin: 0 0;
|
||||||
|
padding-top: 10px;
|
||||||
|
padding-bottom: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* UPLOAD A BOOK */
|
||||||
|
.watermarkspace{
|
||||||
|
padding-top: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uploadspace{
|
||||||
|
padding-top: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-group{
|
||||||
|
padding-bottom: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.finalbutton{
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
button{
|
||||||
|
border-top: 2px solid white;
|
||||||
|
border-left: 2px solid white;
|
||||||
|
border-right: 2px solid black;
|
||||||
|
border-bottom: 2px solid black;
|
||||||
|
padding-bottom: 1px;
|
||||||
|
transform-origin: 0 0;
|
||||||
|
font-family: "Favorit", Arial, Helvetica, sans-serif;
|
||||||
|
text-transform: uppercase;
|
||||||
|
}
|
||||||
|
|
||||||
|
label {
|
||||||
|
line-height: 120%;
|
||||||
|
}
|
||||||
|
|
||||||
|
input{
|
||||||
|
margin-top: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
form{
|
||||||
|
margin-left: 40px;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.explainspace{
|
||||||
|
width: 320px;
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align:top;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
.secondp{
|
||||||
|
text-indent: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* TOR BROWSER */
|
||||||
|
|
||||||
|
img{
|
||||||
|
height: 300px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cover{
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: top;
|
||||||
|
}
|
||||||
|
|
||||||
|
figcaption{
|
||||||
|
font-weight: 400;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
text-transform: uppercase;
|
||||||
|
transform: scaleX(0.75);
|
||||||
|
transform-origin: 0 0;
|
||||||
|
font-size: calc(7px + 0.3vw);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* TEXT ABOUT */
|
||||||
|
|
||||||
|
.indentedblock{
|
||||||
|
padding-left: 15px;
|
||||||
|
padding-bottom: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
h5{
|
||||||
|
font-family: "Lyon", Arial, Helvetica, sans-serif;
|
||||||
|
font-size: calc(15px + 0.3vw);
|
||||||
|
}
|
||||||
|
|
||||||
|
.aboutparagraph{
|
||||||
|
font-family: "Favorit", Arial, Helvetica, sans-serif;
|
||||||
|
width: 600px;
|
||||||
|
padding-bottom: 15px;
|
||||||
|
font-size: calc(10px + 0.3vw);
|
||||||
|
font-weight: 300;
|
||||||
|
font-style: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
.aboutlastparagraph{
|
||||||
|
width: 600px;
|
||||||
|
padding-bottom: 50px;
|
||||||
|
font-size: calc(10px + 0.3vw);
|
||||||
|
font-weight: 300;
|
||||||
|
font-style: normal;
|
||||||
|
font-family: "Favorit", Arial, Helvetica, sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* GUIDELINES */
|
||||||
|
.subfour{
|
||||||
|
transform: scaleX(0.65);
|
||||||
|
padding-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
blockquote{
|
||||||
|
width: 600px;
|
||||||
|
padding-bottom: 30px;
|
||||||
|
font-size: calc(10px + 0.3vw);
|
||||||
|
font-style: italic;
|
||||||
|
padding-top: 5px;
|
||||||
|
transform: scaleX(0.85);
|
||||||
|
transform-origin: 0 0;
|
||||||
|
font-weight: 300;
|
||||||
|
font-family: "Favorit", Arial, Helvetica, sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
dd{
|
||||||
|
font-family: "Favorit", Arial, Helvetica, sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
.termslastparagraph{
|
||||||
|
width: 600px;
|
||||||
|
padding-bottom: 25px;
|
||||||
|
font-size: calc(10px + 0.3vw);
|
||||||
|
}
|
||||||
|
|
||||||
|
dd{
|
||||||
|
line-height: 115%;
|
||||||
|
padding-bottom: 5px;
|
||||||
|
width: 600px;
|
||||||
|
font-size: calc(10px + 0.3vw);
|
||||||
|
font-weight: 300;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bulletnumber{
|
||||||
|
font-family: "Lyon", Arial, Helvetica, sans-serif;
|
||||||
|
font-size: calc(10px + 0.3vw);
|
||||||
|
}
|
||||||
|
|
||||||
|
p{
|
||||||
|
font-family: "Favorit", Arial, Helvetica, sans-serif;
|
||||||
|
font-weight: 300;
|
||||||
|
}
|
||||||
|
|
||||||
|
label{
|
||||||
|
font-family: "Favorit", Arial, Helvetica, sans-serif;
|
||||||
|
font-weight: 300;
|
||||||
|
}
|
||||||
|
|
||||||
|
.explainspace{
|
||||||
|
font-size: calc(8px + 0.25vw);
|
||||||
|
line-height: 110%;
|
||||||
|
}
|
File diff suppressed because one or more lines are too long
@ -1 +0,0 @@
|
|||||||
['Hello', 'Hello', 'Hello', 'Hello', 'Hello']
|
|
@ -0,0 +1 @@
|
|||||||
|
/etc/systemd/system/watermarks.service
|
Loading…
Reference in New Issue