Skip to content
This repository was archived by the owner on May 16, 2019. It is now read-only.

Commit 7b8426d

Browse files
author
Tom Galloway
committed
Merge remote-tracking branch 'upstream/master' into market_listeners_tests
2 parents 6a8df11 + da0c261 commit 7b8426d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+2495
-1254
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,9 @@ target/
5959

6060
.idea/
6161
_trial_temp/
62+
63+
# Docker data
64+
data/
65+
66+
# SSL
67+
ssl/

Dockerfile

Lines changed: 38 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,44 @@
1-
FROM ubuntu:14.04
2-
3-
MAINTAINER Joshua Sindy <[email protected]>
4-
# Examples
5-
# docker build -t observer .
6-
# docker run --rm -it -e flags="--help" observer
7-
# docker run -d --name observer -e flags="--testnet" observer
8-
# docker logs observer
9-
10-
RUN apt-get update
11-
RUN apt-get install -y python-dev python-pip build-essential git libffi-dev libssl-dev
12-
RUN pip install pyopenssl ndg-httpsclient pyasn1
13-
RUN pip install --upgrade pip virtualenv
14-
RUN pip install mock coverage nose pylint
1+
FROM ubuntu:15.04
2+
MAINTAINER eiabea <[email protected]>
3+
4+
# Install required Debian packages
5+
RUN set -ex \
6+
&& echo "deb http://us.archive.ubuntu.com/ubuntu vivid main universe" | tee -a /etc/apt/sources.list \
7+
&& apt-get update -q \
8+
&& apt-get install -q -y build-essential libssl-dev libffi-dev python-dev openssl python-pip libzmq3-dev libsodium-dev autoconf automake pkg-config libtool git \
9+
&& apt-get clean autoclean -q -y \
10+
&& apt-get autoremove -q -y \
11+
&& rm -rf /var/lib/apt/lists/* /var/lib/apt/lists/partial/* /tmp/* /var/tmp/*
12+
13+
# Install libzmq from github
14+
RUN git clone https://github.com/zeromq/libzmq
15+
WORKDIR /libzmq
16+
RUN ./autogen.sh
17+
RUN ./configure
18+
RUN make
19+
RUN make install
20+
RUN ldconfig
21+
22+
# Install cryptography
23+
WORKDIR /
24+
RUN pip install cryptography
25+
26+
# Install Openbazaar-Server from github
1527
RUN git clone https://github.com/OpenBazaar/OpenBazaar-Server.git
1628
WORKDIR /OpenBazaar-Server/
17-
RUN pip install -r requirements.txt && pip install -r test_requirements.txt
29+
RUN pip install -r requirements.txt -r test_requirements.txt
1830
RUN make
31+
32+
# Copy entrypoint script and mark it executable
33+
COPY ./docker-entrypoint.sh /docker-entrypoint.sh
34+
RUN chmod +x /docker-entrypoint.sh
35+
36+
# Create Openbazaar user and set correct permissions
1937
RUN adduser --disabled-password --gecos \"\" openbazaar
2038
RUN chown -R openbazaar:openbazaar /OpenBazaar-Server
2139

22-
USER openbazaar
23-
CMD python openbazaard.py start $flags
40+
VOLUME /root/.openbazaar
41+
VOLUME /ssl
42+
43+
ENTRYPOINT ["/docker-entrypoint.sh"]
44+
CMD ["python", "openbazaard.py", "start"]

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ TESTPATH=./dht/tests ./db/tests ./market/tests
66
all: check unittest
77

88
unittest:
9-
nosetests -vs --with-coverage --cover-package=dht --cover-package=db --cover-package=market --cover-inclusive $(TESTPATH)
9+
nosetests -vs --with-doctest --with-coverage --cover-package=dht --cover-package=db --cover-package=market --cover-inclusive $(TESTPATH)
1010

1111
check: pycheck
1212

README.md

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@ a Kademlia style DHT. Rest and websocket APIs are available for clients to commu
88

99
Pre-built installers which bundle the client and server components can be found [here](https://github.com/OpenBazaar/OpenBazaar-Installer/releases).
1010

11+
Depending on your system configuration you may need to install some additional dependencies. You can find more detailed, OS specific, instructions [here](https://slack-files.com/T02FPGBKB-F0KJU1CLX-cbbcf8a02c).
12+
1113
To install just this server:
14+
1215
```bash
13-
pip install -r requirements.txt
16+
sudo pip install -r requirements.txt
1417
```
1518

16-
Depending on your system configuration you may need to install some additional dependencies. You can find more detailed, OS specific, instructions [here](https://slack-files.com/T02FPGBKB-F0KJU1CLX-cbbcf8a02c).
17-
1819
## Usage
1920

2021
```bash
@@ -45,5 +46,40 @@ optional arguments:
4546
--pidfile PIDFILE name of the pid file
4647
```
4748

49+
## Docker
50+
51+
- Install [Docker](https://docs.docker.com/engine/installation/).
52+
- Install [DockerCompose](https://docs.docker.com/compose/install/).
53+
54+
#### Set Username and Password
55+
```bash
56+
nano ./docker-compose.yml
57+
```
58+
59+
#### Build and run
60+
```bash
61+
docker-compose up
62+
```
63+
64+
#### Backup
65+
All relevant data will go to
66+
```bash
67+
./data
68+
```
69+
70+
#### SSL Support
71+
- Generate certificate as described [here](https://slack-files.com/T02FPGBKB-F0XK9ND2Q-fc5e6500a3)
72+
73+
- Place the *server.crt* and *server.key* into
74+
```bash
75+
./ssl
76+
```
77+
78+
- Enable SSL in
79+
```bash
80+
./docker-compose.yml
81+
```
82+
83+
4884
## License
4985
OpenBazaar Server is licensed under the [MIT License](LICENSE).

api/__init__.py

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,44 @@
11
__author__ = 'chris'
2+
3+
ALLOWED_TAGS = [
4+
'a',
5+
'b',
6+
'blockquote',
7+
'em',
8+
'hr',
9+
'h2',
10+
'h3',
11+
'h4',
12+
'h5',
13+
'i',
14+
'img',
15+
'li',
16+
'p',
17+
'ol',
18+
'nl',
19+
'span',
20+
'strike',
21+
'strong',
22+
'ul',
23+
]
24+
ALLOWED_ATTRIBUTES = {
25+
'a': ['href', 'title', 'alt', 'style'],
26+
'img': ['src', 'width', 'height'],
27+
'b': ['style'],
28+
'blockquote': ['style'],
29+
'em': ['style'],
30+
'h2': ['style'],
31+
'h3': ['style'],
32+
'h4': ['style'],
33+
'h5': ['style'],
34+
'i': ['style'],
35+
'li': ['style'],
36+
'p': ['style'],
37+
'ol': ['style'],
38+
'nl': ['style'],
39+
'span': ['style'],
40+
'strike': ['style'],
41+
'strong': ['style']
42+
}
43+
44+
ALLOWED_STYLES = ['color', 'background']

0 commit comments

Comments
 (0)