mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-11-22 13:11:31 +00:00
Merge pull request #3 from avatao-content/project_restructure
Project restructure
This commit is contained in:
commit
fde26fb0c8
@ -59,7 +59,7 @@ ENV TFW_LIB_DIR="/usr/local/lib/"
|
||||
ENV TFW_SUPERVISORD_CONF="/etc/supervisor/supervisord.conf"
|
||||
ENV PYTHONPATH=${TFW_LIB_DIR}
|
||||
|
||||
COPY src/nginx /etc/nginx
|
||||
COPY nginx /etc/nginx
|
||||
RUN chown -R ${AVATAO_USER}: /var/log/nginx /var/lib/nginx && \
|
||||
# nginx runs as a regular user, and can't write to /run
|
||||
sed -i 's#pid /run/nginx.pid;#pid /tmp/nginx.pid;#g' /etc/nginx/nginx.conf && \
|
||||
@ -70,7 +70,7 @@ RUN chown -R ${AVATAO_USER}: /var/log/nginx /var/lib/nginx && \
|
||||
USER ${AVATAO_USER}
|
||||
WORKDIR /home/${AVATAO_USER}
|
||||
COPY lib ${TFW_LIB_DIR}
|
||||
COPY supervisord.conf ${TFW_SUPERVISORD_CONF}
|
||||
COPY supervisor/supervisord.conf ${TFW_SUPERVISORD_CONF}
|
||||
COPY src/app ${TFW_APP_DIR}
|
||||
COPY src/event_handlers ${TFW_EVENT_HANDLERS_DIR}
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import json
|
||||
|
||||
from server_connector import ServerConnector
|
||||
from .networking.server_connector import ServerConnector
|
||||
|
||||
|
||||
class EventHandlerBase:
|
@ -1,7 +1,7 @@
|
||||
import json
|
||||
from datetime import datetime
|
||||
|
||||
from server_connector import ServerUplinkConnector
|
||||
from .networking.server_connector import ServerUplinkConnector
|
||||
|
||||
|
||||
class MessageSender:
|
@ -2,10 +2,10 @@ import zmq
|
||||
from zmq.eventloop import ioloop
|
||||
from zmq.eventloop.zmqstream import ZMQStream
|
||||
|
||||
from config import PUBLISHER_PORT, RECEIVER_PORT
|
||||
from config.logs import logging
|
||||
from ..config import PUBLISHER_PORT, RECEIVER_PORT
|
||||
from ..config.logs import logging
|
||||
log = logging.getLogger(__name__)
|
||||
from util import parse_anchor_from_message, ZMQConnectorBase
|
||||
from ..util import parse_anchor_from_message, ZMQConnectorBase
|
||||
|
||||
|
||||
ioloop.install()
|
@ -1,11 +1,11 @@
|
||||
from functools import partial
|
||||
|
||||
import zmq
|
||||
from functools import partial
|
||||
from zmq.eventloop import ioloop
|
||||
from zmq.eventloop.zmqstream import ZMQStream
|
||||
|
||||
from config import PUBLISHER_PORT, RECEIVER_PORT
|
||||
from util import ZMQConnectorBase
|
||||
from ..config import PUBLISHER_PORT, RECEIVER_PORT
|
||||
from ..util import ZMQConnectorBase
|
||||
|
||||
|
||||
ioloop.install()
|
||||
|
@ -1,9 +1,9 @@
|
||||
import json
|
||||
from tornado.websocket import WebSocketHandler
|
||||
from util import parse_anchor_from_message
|
||||
|
||||
from event_handler_connector import EventHandlerConnector
|
||||
from config.logs import logging
|
||||
from ..util import parse_anchor_from_message
|
||||
from .event_handler_connector import EventHandlerConnector
|
||||
from ..config.logs import logging
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import json, xmlrpc.client, zmq
|
||||
|
||||
from config.envvars import SUPERVISOR_HTTP_URI
|
||||
from .config.envvars import SUPERVISOR_HTTP_URI
|
||||
|
||||
|
||||
def parse_anchor_from_message(message):
|
@ -4,10 +4,10 @@ import zmq
|
||||
from tornado.web import Application
|
||||
from tornado.ioloop import IOLoop
|
||||
|
||||
from config import WEB_PORT
|
||||
from config.logs import logging
|
||||
from tfw.config import WEB_PORT
|
||||
from tfw.config.logs import logging
|
||||
log = logging.getLogger(__name__)
|
||||
from handlers import FSMManagingSocketHandler
|
||||
from tfw.networking.zmq_websocket_handler import FSMManagingSocketHandler
|
||||
from sql_injection_fsm import SQLInjectionFSM
|
||||
|
||||
|
||||
|
@ -1 +0,0 @@
|
||||
from .zmq_websocket_handler import FSMManagingSocketHandler
|
@ -1,4 +1,4 @@
|
||||
from fsm_base import FSMBase
|
||||
from tfw.fsm_base import FSMBase
|
||||
|
||||
|
||||
class SQLInjectionFSM(FSMBase):
|
||||
|
@ -3,9 +3,9 @@ from os.path import splitext
|
||||
from contextlib import suppress
|
||||
from xmlrpc.client import Fault as SupervisorFault
|
||||
|
||||
from util import SupervisorMixin
|
||||
from config import LOGIN_APP_DIR
|
||||
from event_handler_base import EventHandlerBase
|
||||
from tfw.util import SupervisorMixin
|
||||
from tfw.config import LOGIN_APP_DIR
|
||||
from tfw.event_handler_base import EventHandlerBase
|
||||
|
||||
|
||||
class SourceCodeEventHandler(EventHandlerBase, SupervisorMixin):
|
||||
|
@ -3,7 +3,7 @@ import json
|
||||
from tornado.ioloop import IOLoop
|
||||
from tornado.web import RequestHandler, Application
|
||||
|
||||
from config import LOGIN_APP_PORT
|
||||
from tfw.config import LOGIN_APP_PORT
|
||||
from login_component import authorize_login
|
||||
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
from shutil import rmtree, copytree
|
||||
|
||||
from event_handler_base import EventHandlerBase
|
||||
from util import SupervisorMixin
|
||||
from config import TERMINADO_DIR
|
||||
from config.logs import logging
|
||||
from tfw.event_handler_base import EventHandlerBase
|
||||
from tfw.util import SupervisorMixin
|
||||
from tfw.config import TERMINADO_DIR
|
||||
from tfw.config.logs import logging
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
|
@ -2,8 +2,8 @@ from tornado.ioloop import IOLoop
|
||||
from tornado.web import Application
|
||||
from terminado import TermSocket, UniqueTermManager
|
||||
|
||||
from config import TERMINADO_PORT, TERMINADO_WD
|
||||
from config.logs import logging
|
||||
from tfw.config import TERMINADO_PORT, TERMINADO_WD
|
||||
from tfw.config.logs import logging
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user