Commit afa8bee2 authored by Daniel Niecke's avatar Daniel Niecke

added app site

parent b2c67f82
......@@ -24,7 +24,7 @@ COPY /server /news-reader/server
RUN chown www-data:www-data -R /news-reader
RUN a2enmod ssl
# RUN a2enmod ssl
COPY ssl.crt /
COPY ssl.key /
......@@ -34,6 +34,8 @@ RUN touch /saved_urls.txt && \
COPY /pw /pw
RUN chmod 666 /pw
EXPOSE 80
CMD /usr/sbin/apache2ctl -D FOREGROUND
......
LoadModule ssl_module modules/mod_ssl.so
#LoadModule ssl_module modules/mod_ssl.so
<VirtualHost *>
WSGIDaemonProcess news-reader user=www-data group=www-data threads=5
......@@ -12,11 +12,11 @@ LoadModule ssl_module modules/mod_ssl.so
SetEnv ENV ${ENV}
SSLEngine on
SSLCertificateFile "/ssl.crt"
SSLCertificateKeyFile "/ssl.key"
# SSLEngine on
# SSLCertificateFile "/ssl.crt"
# SSLCertificateKeyFile "/ssl.key"
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel debug
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
\ No newline at end of file
</VirtualHost>
......@@ -75,6 +75,7 @@ def process_one_url(url):
username = 'd.p.a.niecke@googlemail.com'
with open("/pw") as pw:
password = pw.readline()
server = smtplib.SMTP('smtp.gmail.com:587')
server.starttls()
server.login(username, password)
......
......@@ -35,5 +35,14 @@ def save_url():
return render_template('url_form.html', form=form)
@app.route("/app", methods=['GET'])
def save_from_app():
if request.args.get("url"):
parse_golem.process_one_url(request.args.get("url"))
return '', 200
else:
return '', 400
if __name__ == "__main__":
app.run()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment