Merge branch 'soon' into fileManager
commit
4278ac7637
@ -0,0 +1,5 @@
|
||||
data
|
||||
Dockerfile
|
||||
docker-compose.yml
|
||||
.git
|
||||
.gitignore
|
@ -0,0 +1,4 @@
|
||||
VERSION=latest
|
||||
USE_SSL=true
|
||||
STORAGE='./storage/file'
|
||||
LOG_TO_STDOUT=true
|
@ -0,0 +1,43 @@
|
||||
FROM ubuntu:16.04
|
||||
|
||||
RUN apt-get update && apt-get install -y \
|
||||
vim \
|
||||
wget \
|
||||
git \
|
||||
curl \
|
||||
npm \
|
||||
nodejs-legacy
|
||||
|
||||
ARG VERSION=0.3.0
|
||||
|
||||
# Download stable version
|
||||
# RUN wget https://github.com/xwiki-labs/cryptpad/archive /${VERSION}.tar.gz -O /cryptpad.tar.gz \
|
||||
# && mkdir -p /cryptpad \
|
||||
# && tar -xzf /cryptpad.tar.gz -C /cryptpad --strip-components=1 \
|
||||
# && rm /cryptpad.tar.gz
|
||||
|
||||
# Download from github
|
||||
# RUN git clone https://github.com/xwiki-labs/cryptpad.git
|
||||
|
||||
# Add code directly
|
||||
ADD . /cryptpad
|
||||
|
||||
WORKDIR /cryptpad
|
||||
|
||||
RUN npm install \
|
||||
&& npm install -g bower \
|
||||
&& bower install --allow-root
|
||||
|
||||
ADD container-start.sh /container-start.sh
|
||||
RUN chmod u+x /container-start.sh
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
VOLUME /cryptpad/datastore
|
||||
VOLUME /cryptpad/customize
|
||||
|
||||
ENV USE_SSL=false
|
||||
ENV STORAGE='./storage/file'
|
||||
ENV LOG_TO_STDOUT=true
|
||||
|
||||
CMD /container-start.sh
|
@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Creating customize folder
|
||||
mkdir -p customize
|
||||
[[ ! "$(ls -A customize)" ]] && echo "Creating customize folder" \
|
||||
&& cp -R customize.dist/* customize/ \
|
||||
&& cp config.js.dist customize/config.js
|
||||
|
||||
# Linking config.js
|
||||
[[ ! -h config.js ]] && echo "Linking config.js" && ln -s customize/config.js config.js
|
||||
|
||||
# Configure
|
||||
[[ -n "$USE_SSL" ]] && echo "Using secure websockets: $USE_SSL" \
|
||||
&& sed -i "s/useSecureWebsockets: .*/useSecureWebsockets: ${USE_SSL},/g" customize/config.js
|
||||
|
||||
[[ -n "$USE_SSL" ]] && echo "Using storage adapter: $STORAGE" \
|
||||
&& sed -i "s/storage: .*/storage: ${STORAGE},/g" customize/config.js
|
||||
|
||||
[[ -n "$LOG_TO_STDOUT" ]] && echo "Logging to stdout: $LOG_TO_STDOUT" \
|
||||
&& sed -i "s/logToStdout: .*/logToStdout: ${LOG_TO_STDOUT},/g" customize/config.js
|
||||
|
||||
|
||||
exec node ./server.js
|
@ -0,0 +1,69 @@
|
||||
# Cryptpad Docker Image
|
||||
|
||||
- Configuration via .env file
|
||||
- Ready for use with traffic
|
||||
- Using github master for now, release 0.3.0 too old
|
||||
- Creating customize folder
|
||||
- Adding config.js to customize folder
|
||||
- Persistance for datastore and customize folder
|
||||
|
||||
## TODO
|
||||
|
||||
```
|
||||
cryptpad_1 | Linking config.js
|
||||
cryptpad_1 | Using secure websockets: true
|
||||
cryptpad_1 | Using storage adapter: './storage/file'
|
||||
cryptpad_1 | sed: -e expression #1, char 27: unknown option to `s'
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
Set configurations Dockerfile or in .env (using docker-compose) file.
|
||||
|
||||
- VERSION=latest
|
||||
- USE_SSL=false
|
||||
- STORAGE='./storage/file'
|
||||
- LOG_TO_STDOUT=true
|
||||
|
||||
The .env variables are read by docker-compose and forwarded to docker container.
|
||||
On runtime, in `bin/container-start.sh` the settings are written to the `config.js` file.
|
||||
|
||||
## Run
|
||||
|
||||
With docker
|
||||
|
||||
```
|
||||
docker build -t xwiki/cryptpad .
|
||||
docker -d --name cryptpad -p 3000:3000 -v ${PWD}/data:/cryptpad/datastore xwiki/cryptpad
|
||||
```
|
||||
|
||||
With docker-compose
|
||||
|
||||
```
|
||||
docker-compose up -d
|
||||
```
|
||||
|
||||
|
||||
## Persistance
|
||||
|
||||
The docker-compose file is preconfigured to persist folders
|
||||
|
||||
- cryptpad/datastore --> ./data/customize
|
||||
- cryptpad/customize --> ./data/customize
|
||||
|
||||
In customize included find your configuration in `config.js`.
|
||||
|
||||
The data folder is ignored by git, so if you want to add your customizations to git versioning change the volume:
|
||||
|
||||
```
|
||||
./customize:/cryptpad/customize:rw
|
||||
```
|
||||
|
||||
## SSL Proxy
|
||||
|
||||
The [traefik](https://traefik.io/) proxy has builtin Let'sEncrypt for easy SSL setup.
|
||||
In the docker-compose file you can find preset lables for usage with traefik.
|
||||
|
||||
[Traefik Docker Image](https://hub.docker.com/_/traefik/)
|
||||
|
||||
Alternativly just use plain old nginx.
|
@ -0,0 +1,23 @@
|
||||
version: '2'
|
||||
services:
|
||||
|
||||
cryptpad:
|
||||
build:
|
||||
context: .
|
||||
args:
|
||||
- VERSION=${VERSION}
|
||||
image: "xwiki/cryptpad:${VERSION}"
|
||||
hostname: cryptpad
|
||||
|
||||
labels:
|
||||
- traefik.port=3000
|
||||
- traefik.frontend.passHostHeader=true
|
||||
environment:
|
||||
- USE_SSL=${USE_SSL}
|
||||
- STORAGE=${STORAGE}
|
||||
- LOG_TO_STDOUT=${LOG_TO_STDOUT}
|
||||
|
||||
restart: always
|
||||
volumes:
|
||||
- ./data/files:/cryptpad/datastore:rw
|
||||
- ./data/customize:/cryptpad/customize:rw
|
@ -1,58 +0,0 @@
|
||||
# This is Cryptpad
|
||||
|
||||
There are quite a few realtime editors packed into this installation.
|
||||
Most are prototypes that could use a lot of work.
|
||||
|
||||
All editors make use of Cryptpad's end to end encryption.
|
||||
Some of them have much better UI.
|
||||
|
||||
## /pad/
|
||||
|
||||
Pad is the main feature of Cryptpad. It features a CKEditor for realtime WYSIWYG editing.
|
||||
|
||||
## /code/
|
||||
|
||||
Code has syntax highlighting features.
|
||||
|
||||
## /sheet/
|
||||
|
||||
Sheet is under development. It will feature realtime collaborative spreadsheets.
|
||||
|
||||
## /text/
|
||||
|
||||
Text is a very simple encrypted plain text editor with no highlighting.
|
||||
|
||||
## /render/
|
||||
|
||||
Render takes advantage of the fact that multiple editors can both use the same 'channel' at once.
|
||||
Channel, in this sense, refers to part of the unique hash of a page which groups messages together.
|
||||
If you visit a /text/ and a /render/ page simultaneously, the changes you make in /text/ will be
|
||||
rendered as markdown in /render/. You can't edit in /render/ directly, but it adds value to other
|
||||
editors by allowing a realtime preview of your work.
|
||||
|
||||
## /vdom/
|
||||
|
||||
Vdom is under heavy development, and features an alternative approach to the realtime WYSIWYG
|
||||
editor. It syncs a representation of a virtual-dom instead of syncing the HTML itself. In practice,
|
||||
this means that there are fewer inconsistencies between different browsers' representations of the dom.
|
||||
This makes the codebase much simpler, and eliminates many classes of bugs. It's still far from perfect,
|
||||
but it is quite promising.
|
||||
|
||||
## /hack/
|
||||
|
||||
Hack leaves it to the user to decide whether XSS (Cross site scripting) is a bug or a feature.
|
||||
It exposes a realtime text pad to multiple users, and provides a button which will cause the
|
||||
contents of the pad to be passed to an `eval` call. Anyone with the hash of the page can edit
|
||||
the contents, so make sure you read the code you're about to run. If you can't read it, you
|
||||
probably shouldn't run it. In any case, it might be useful for pair programming or when you want
|
||||
to sketch out and prototype simple demos.
|
||||
|
||||
## Coming soon
|
||||
|
||||
* style
|
||||
- live editing of CSS as applied to some Lorum Ipsum
|
||||
* polyweb
|
||||
- a multi-featured editor which connects to multiple channels at once, for:
|
||||
1. live rendered markdown
|
||||
2. live style editing
|
||||
3. live javascript
|
@ -1,28 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta content="text/html; charset=utf-8" http-equiv="content-type"/>
|
||||
<!--
|
||||
|
||||
This file only exists for supporting some old URLs that we're trying not to break.
|
||||
|
||||
Legacy support is tricky.
|
||||
|
||||
:(
|
||||
|
||||
-->
|
||||
<script>
|
||||
(function () {
|
||||
if (/cryptpad\.fr$/i.test(window.location.hostname)) {
|
||||
window.location.hostname = 'old.cryptpad.fr';
|
||||
}
|
||||
}());
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<p>There's nothing here.</p>
|
||||
<p>You probably want to visit <strong><a href="https://old.cryptpad.fr">old.cryptpad.fr</a></strong></p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
Loading…
Reference in New Issue