From 29e06f49fe9bb2d0063c4837f89604cc1d953805 Mon Sep 17 00:00:00 2001 From: cupcakearmy Date: Wed, 8 May 2019 11:53:36 +0200 Subject: [PATCH] docker --- Dockerfile | 19 +++++ dirty.db | 0 docker-compose.yml | 15 ++++ settings.json | 201 +++++++++++++++++++++++++++++++++++++++++++++ start.sh | 2 + 5 files changed, 237 insertions(+) create mode 100644 Dockerfile create mode 100644 dirty.db create mode 100644 docker-compose.yml create mode 100644 settings.json create mode 100755 start.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..0d86e0d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +FROM node:lts-alpine + +# master | develop | ... +ARG ETHERPAD_VERSION=master + +ARG DIR=/etherpad +ARG TMP=/tmp/etherpad.tar.gz + +ENV NODE_ENV=production + +WORKDIR ${DIR} + +RUN echo "Getting version: ${ETHERPAD_VERSION}" && \ + apk add --no-cache git && \ + git clone --branch ${ETHERPAD_VERSION} git://github.com/ether/etherpad-lite.git . + +ADD start.sh . + +CMD ["sh", "start.sh"] \ No newline at end of file diff --git a/dirty.db b/dirty.db new file mode 100644 index 0000000..e69de29 diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..3010abf --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,15 @@ +version: '3.6' + +volumes: + data: + +services: + pad: + build: ./ + restart: always + ports: + - 80:80 + volumes: + - data:/etherpad/ + - ./dirty.db:/etherpad/dirty.db + - ./settings.json:/etherpad/settings.json \ No newline at end of file diff --git a/settings.json b/settings.json new file mode 100644 index 0000000..f90a864 --- /dev/null +++ b/settings.json @@ -0,0 +1,201 @@ +{ + "title": "Etherpad", + "favicon": "favicon.ico", + "skinName": "colibris", + "ip": "0.0.0.0", + "port": 80, + "showSettingsInAdminPage": true, + "dbType": "dirty", + "dbSettings": { + "filename": "dirty.db" + }, + "defaultPadText": "Ready, Set, Pad 🚀", + "padOptions": { + "noColors": false, + "showControls": true, + "showChat": true, + "showLineNumbers": true, + "useMonospaceFont": false, + "userName": false, + "userColor": false, + "rtl": false, + "alwaysShowChat": false, + "chatAndUsers": false, + "lang": "en-gb" + }, + "padShortcutEnabled": { + "altF9": true, /* focus on the File Menu and/or editbar */ + "altC": true, /* focus on the Chat window */ + "cmdShift2": true, /* shows a gritter popup showing a line author */ + "delete": true, + "return": true, + "esc": true, /* in mozilla versions 14-19 avoid reconnecting pad */ + "cmdS": true, /* save a revision */ + "tab": true, /* indent */ + "cmdZ": true, /* undo/redo */ + "cmdY": true, /* redo */ + "cmdI": true, /* italic */ + "cmdB": true, /* bold */ + "cmdU": true, /* underline */ + "cmd5": true, /* strike through */ + "cmdShiftL": true, /* unordered list */ + "cmdShiftN": true, /* ordered list */ + "cmdShift1": true, /* ordered list */ + "cmdShiftC": true, /* clear authorship */ + "cmdH": true, /* backspace */ + "ctrlHome": true, /* scroll to top of pad */ + "pageUp": true, + "pageDown": true + }, + /* + * Should we suppress errors from being visible in the default Pad Text? + */ + "suppressErrorsInPadText": true, + /* + * If this option is enabled, a user must have a session to access pads. + * This effectively allows only group pads to be accessed. + */ + "requireSession": false, + /* + * Users may edit pads but not create new ones. + * + * Pad creation is only via the API. + * This applies both to group pads and regular pads. + */ + "editOnly": false, + /* + * If set to true, those users who have a valid session will automatically be + * granted access to password protected pads. + */ + "sessionNoPassword": false, + /* + * If true, all css & js will be minified before sending to the client. + * + * This will improve the loading performance massively, but makes it difficult + * to debug the javascript/css + */ + "minify": true, + /* + * How long may clients use served javascript code (in seconds)? + * + * Not setting this may cause problems during deployment. + * Set to 0 to disable caching. + */ + "maxAge": 21600, // 60 * 60 * 6 = 6 hours + /* + * Absolute path to the Abiword executable. + * + * Abiword is needed to get advanced import/export features of pads. Setting + * it to null disables Abiword and will only allow plain text and HTML + * import/exports. + */ + "abiword": null, + /* + * This is the absolute path to the soffice executable. + * + * LibreOffice can be used in lieu of Abiword to export pads. + * Setting it to null disables LibreOffice exporting. + */ + "soffice": null, + /* + * Path to the Tidy executable. + * + * Tidy is used to improve the quality of exported pads. + * Setting it to null disables Tidy. + */ + "tidyHtml": null, + /* + * Allow import of file types other than the supported ones: + * txt, doc, docx, rtf, odt, html & htm + */ + "allowUnknownFileEnds": true, + /* + * This setting is used if you require authentication of all users. + * + * Note: "/admin" always requires authentication. + */ + "requireAuthentication": false, + /* + * Require authorization by a module, or a user with is_admin set, see below. + */ + "requireAuthorization": false, + /* + * When you use NGINX or another proxy/load-balancer set this to true. + */ + "trustProxy": false, + /* + * Privacy: disable IP logging + */ + "disableIPlogging": false, + /* + * Time (in seconds) to automatically reconnect pad when a "Force reconnect" + * message is shown to user. + * + * Set to 0 to disable automatic reconnection. + */ + "automaticReconnectionTimeout": 0, + /* + * By default, when caret is moved out of viewport, it scrolls the minimum + * height needed to make this line visible. + */ + "scrollWhenFocusLineIsOutOfViewport": { + /* + * Percentage of viewport height to be additionally scrolled. + * + * E.g.: use "percentage.editionAboveViewport": 0.5, to place caret line in + * the middle of viewport, when user edits a line above of the + * viewport + * + * Set to 0 to disable extra scrolling + */ + "percentage": { + "editionAboveViewport": 0, + "editionBelowViewport": 0 + }, + /* + * Time (in milliseconds) used to animate the scroll transition. + * Set to 0 to disable animation + */ + "duration": 0, + /* + * Flag to control if it should scroll when user places the caret in the + * last line of the viewport + */ + "scrollWhenCaretIsInTheLastLineOfViewport": false, + /* + * Percentage of viewport height to be additionally scrolled when user + * presses arrow up in the line of the top of the viewport. + * + * Set to 0 to let the scroll to be handled as default by Etherpad + */ + "percentageToScrollWhenUserPressesArrowUp": 0 + }, + "users": { + "admin": { + // "password" can be replaced with "hash" if you install ep_hash_auth + "password": "admin", + "is_admin": true + }, + }, + "socketTransportProtocols": [ + "xhr-polling", + "jsonp-polling", + "htmlfile" + ], + "loadTest": false, + "exposeVersion": false, + /* + * The log level we are using. + * + * Valid values: DEBUG, INFO, WARN, ERROR + */ + "loglevel": "INFO", + "logconfig": { + "appenders": [ + { + "type": "console" + //, "category": "access"// only logs pad access + } + ] + } // logconfig +} \ No newline at end of file diff --git a/start.sh b/start.sh new file mode 100755 index 0000000..6762069 --- /dev/null +++ b/start.sh @@ -0,0 +1,2 @@ +git pull +./bin/run.sh --root \ No newline at end of file