Skip to content

Commit 90690fd

Browse files
author
Guillim
committed
Merge branch 'master' of https://github.com/chakki-works/doccano into authentification
2 parents 3e7234e + ed2791e commit 90690fd

File tree

9 files changed

+495
-10
lines changed

9 files changed

+495
-10
lines changed

.travis.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
1-
language: minimal
1+
language: python
2+
3+
python:
4+
- "3.6"
25

36
services:
47
- docker
58

9+
install:
10+
- pip install mkdocs mkdocs-material
11+
612
script:
713
- docker build --target=builder .
814

15+
before_deploy:
16+
- mkdocs build --verbose --clean
17+
918
deploy:
1019
- provider: script
1120
script: tools/cd.sh travis-${TRAVIS_BUILD_NUMBER}
@@ -16,3 +25,10 @@ deploy:
1625
script: tools/cd.sh ${TRAVIS_TAG}
1726
on:
1827
tags: true
28+
29+
- provider: pages
30+
skip_cleanup: true
31+
github_token: $GITHUB_TOKEN
32+
local_dir: site
33+
on:
34+
branch: master

CODE_OF_CONDUCT.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, sex characteristics, gender identity and expression,
9+
level of experience, education, socio-economic status, nationality, personal
10+
appearance, race, religion, or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
* Trolling, insulting/derogatory comments, and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies both within project spaces and in public spaces
49+
when an individual is representing the project or its community. Examples of
50+
representing a project or community include using an official project e-mail
51+
address, posting via an official social media account, or acting as an appointed
52+
representative at an online or offline event. Representation of a project may be
53+
further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team at [email protected]. All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72+
73+
[homepage]: https://www.contributor-covenant.org
74+
75+
For answers to common questions about this code of conduct, see
76+
https://www.contributor-covenant.org/faq

docs/advanced/aws_https_settings.md

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# HTTPS settings for doccano in AWS
2+
3+
4+
1. Create hosted zone in Route 53
5+
2. Create certificate in ACM
6+
3. Create EC2 instance
7+
4. Create ELB
8+
5. Create A record in Route 53
9+
10+
11+
12+
# Create hosted zone in Route 53
13+
14+
HTTPS need a domain name. If you don't have one, you can register it by the AWS Route 53 service, or you can get one from other domain seller.
15+
16+
After you get a domain name, you can create Hosted Zone by Route 53.
17+
18+
If you register domain from Route 53, you can find it in the `Hosted Zone`.
19+
20+
![2B0FF02C-42DA-41D1-BFA1-31018BE006ED](https://camo.githubusercontent.com/998dab1eca0e9673ab98d92b65b199cb4e2f96ea/68747470733a2f2f7773332e73696e61696d672e636e2f6c617267652f303036744b665463677931673132397a346c3733726a333131783065673078332e6a7067)
21+
22+
23+
24+
# Create certificate in ACM
25+
26+
![22F3520E-909A-4215-B73A-DBB452E3D4E2](https://camo.githubusercontent.com/e3e0a24d2265728072d9e65220a41d2ddd6b42bb/68747470733a2f2f7773322e73696e61696d672e636e2f6c617267652f303036744b6654636779316731326132653362306a6a3331666c3062683433312e6a7067)
27+
28+
You should replace the domain name by yours.
29+
30+
![image-20190314145326046](https://camo.githubusercontent.com/faf83a9ee1774d92a01de9f69e48ed002c7a827e/68747470733a2f2f7773312e73696e61696d672e636e2f6c617267652f303036744b66546367793167313261336a356d33756a333166393066613077342e6a7067)
31+
32+
33+
34+
35+
36+
![image-20190314145344449](https://camo.githubusercontent.com/874362144a3547629383ad93e1f13831e35d0b82/68747470733a2f2f7773312e73696e61696d672e636e2f6c617267652f303036744b665463677931673132613375736232626a33306b6b3039626a73762e6a7067)
37+
38+
39+
40+
![4FC120A2-6DB5-4F03-A209-12C22EDD6097](https://camo.githubusercontent.com/b75bc07e8d96b796872c697de951ab44d74d04d3/68747470733a2f2f7773342e73696e61696d672e636e2f6c617267652f303036744b665463677931673132613873643730786a3331667630686637646d2e6a7067)
41+
42+
43+
44+
Don't forget to Create record in Route 53 in step 4.
45+
46+
After you request a certificate, wait for a while, You should see the status become 'Issued'.
47+
48+
49+
50+
![3AAE20BC-FC34-4738-AED0-D7D67929F6FF](https://camo.githubusercontent.com/82528820652678c19ee46ff5a0f07dbfaba31f5e/68747470733a2f2f7773322e73696e61696d672e636e2f6c617267652f303036744b66546367793167313261356a776270726a333136743066387139622e6a7067)
51+
52+
# Create EC2 instance
53+
54+
In this part, you can just click the launch button to create a EC2 instance.
55+
56+
[![AWS CloudFormation Launch Stack SVG Button](https://cdn.rawgit.com/buildkite/cloudformation-launch-stack-button-svg/master/launch-stack.svg)](https://us-east-1.console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/create/review?templateURL=https://s3-external-1.amazonaws.com/cf-templates-10vry9l3mp71r-us-east-1/20190732wl-new.templatexloywxxyimi&stackName=doccano)
57+
58+
# Create ELB
59+
60+
![image-20190314150439785](https://camo.githubusercontent.com/158c2fb2957546ed8bb82694497b60b9c7f38aa5/68747470733a2f2f7773332e73696e61696d672e636e2f6c617267652f303036744b6654636779316731326166376a676a746a3330663230337a3734742e6a7067)
61+
62+
Click the `Create Load Balancer` button and select `Application Load Balancer`.
63+
64+
Fill the name, change protocol to HTTPS, and do not forget add at least two availability zones. Make sure the zone that EC2 instance created is included.
65+
66+
![02BE83A7-4C43-48BE-BCF0-95D2DF7C603D](https://camo.githubusercontent.com/c4cc530aea78e66ea99eab905804cae66ab20a04/68747470733a2f2f7773342e73696e61696d672e636e2f6c617267652f303036744b665463677931673132616861756566736a3330796e306d6e6774732e6a7067)
67+
68+
Select the certificate we created early.
69+
70+
![image-20190314151004337](https://camo.githubusercontent.com/455140fc7b7a22a18e96e5f2aa31d9fd0e7c7722/68747470733a2f2f7773312e73696e61696d672e636e2f6c617267652f303036744b665463677931673132616b75693576366a333071763063303431382e6a7067)
71+
72+
You can select the same security groups created when you create the EC2 instance.
73+
74+
![image-20190314151110756](https://camo.githubusercontent.com/5d029d4fa494420ed077be6b57ab60935d378e7f/68747470733a2f2f7773322e73696e61696d672e636e2f6c617267652f303036744b665463677931673132616c7a796735756a33313272306139676f392e6a7067)
75+
76+
Or you can create a new one
77+
78+
![image-20190314151253917](https://camo.githubusercontent.com/e620c6738ff95f3311edf708b80a949f8b79f565/68747470733a2f2f7773312e73696e61696d672e636e2f6c617267652f303036744b665463677931673132616e736d3931706a333163313062646469652e6a7067)
79+
80+
81+
82+
Fill the target group name and leave others defualt.
83+
84+
![image-20190314151314109](https://camo.githubusercontent.com/f22b99c57ca9b8114683f1501942dcc3cc0874f1/68747470733a2f2f7773322e73696e61696d672e636e2f6c617267652f303036744b665463677931673132616f34797661746a3330716630666a74616d2e6a7067)
85+
86+
Add the instance to registered.
87+
88+
![image-20190314151358736](https://camo.githubusercontent.com/515649dce66466e9cefa730fc1a35a398ecb260d/68747470733a2f2f7773322e73696e61696d672e636e2f6c617267652f303036744b665463677931673132616f777667736f6a333136793066346164672e6a7067)
89+
90+
Then review and create.
91+
92+
# Create A record in Route 53
93+
94+
Back to route 53, and click `Create Record Set`. Fill the subname and the ELB name in the `Alias Target`.
95+
96+
![image-20190314151601030](https://camo.githubusercontent.com/82944e13e1ef3f4015484417a50635c9352dae33/68747470733a2f2f7773312e73696e61696d672e636e2f6c617267652f303036744b665463677931673132617231383931666a33306278306e6d6a746d2e6a7067)
97+
98+
Finally, you can access the doccano by HTTPS.
99+
100+
![image-20190314151841872](https://camo.githubusercontent.com/85dfef30b4b01df5e0d8e339b38e5a31592dd103/68747470733a2f2f7773332e73696e61696d672e636e2f6c617267652f303036744b6654636779316731326174746563636b6a3330716730396d6a73612e6a7067)

docs/advanced/oauth2_settings.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
This document aims to instruct how to setup OAuth for doccano. doccano now supports social login via GitHub and Active Directory by [#75](https://github.com/chakki-works/doccano/pull/75). In this document, we show GitHub OAuth as an example.
2+
3+
4+
## Create OAuth App
5+
6+
1. In the upper-right corner of GitHub, click your profile photo, then click **Settings**.
7+
2. In the left sidebar, click **Developer settings**.
8+
3. In the left sidebar, click **OAuth Apps**.
9+
4. Click **New OAuth App**.
10+
5. In "Application name", type the name of your app.
11+
6. In "Homepage URL", type the full URL to your app's website.
12+
7. In "Authorization callback URL", type the callback URL(e.g. <https://example.com/social/complete/github/>) of your app.
13+
8. Click Register application.
14+
15+
## Set enviromental variables
16+
17+
Once the application is registered, your app's `Client ID` and `Client Secret` will be displayed on the following page:
18+
![image](https://user-images.githubusercontent.com/6737785/51811605-1073d480-22f1-11e9-8be0-726a8ee5e832.png)
19+
20+
1. Copy the `Client ID` and `Client Secret` from the Developer Applications of your app on GitHub.
21+
2. Set the `Client ID` and `Client Secret` to enviromental variables:
22+
23+
```bash
24+
export OAUTH_GITHUB_KEY=YOUR_CLIENT_ID
25+
export OAUTH_GITHUB_SECRET=YOUR_CLIENT_SECRET
26+
```
27+
28+
## Run server
29+
30+
```bash
31+
python manage.py runserver
32+
```
33+
34+
Go to login page:
35+
36+
![image](https://user-images.githubusercontent.com/6737785/51812454-e7edd980-22f4-11e9-80c6-2f18fbc49108.png)

docs/faq.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
## I can't install doccano.
2+
3+
Following list is ordered by from easy to hard. If you are not familiar with Python development, please consider easy setup.
4+
5+
1. [One click deployment to Cloud Service.](https://github.com/chakki-works/doccano#deployment)
6+
* Only you have to do is create an account. Especially [Heroku](https://www.heroku.com/home) does not require your credit card (if free plan).
7+
* [![Deploy to Azure](https://azuredeploy.net/deploybutton.svg)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fchakki-works%2Fdoccano%2Fmaster%2Fazuredeploy.json)
8+
* [![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy)
9+
* [![AWS CloudFormation Launch Stack SVG Button](https://cdn.rawgit.com/buildkite/cloudformation-launch-stack-button-svg/master/launch-stack.svg)](https://us-east-1.console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/create/review?templateURL=https://s3-external-1.amazonaws.com/cf-templates-10vry9l3mp71r-us-east-1/20190732wl-new.templatexloywxxyimi&stackName=doccano)
10+
* > Notice: (1) EC2 KeyPair cannot be created automatically, so make sure you have an existing EC2 KeyPair in one region. Or [create one yourself](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html#having-ec2-create-your-key-pair). (2) If you want to access doccano via HTTPS in AWS, here is an [instruction](https://github.com/chakki-works/doccano/wiki/HTTPS-setting-for-doccano-in-AWS).
11+
2. [Use Docker](https://docs.docker.com/install/)
12+
* Docker doesn't bother you by the OS, Python version, etc problems. Because an environment for application is packed as a container.
13+
* Get doccano's image: `docker pull chakkiworks/doccano`
14+
* Create & Run doccano container: `docker run -d --name doccano -p 8000:80 chakkiworks/doccano`
15+
* Create a user: `docker exec doccano tools/create-admin.sh "admin" "[email protected]" "password"`
16+
* Stop doccano container: `docker stop doccano`
17+
* Re-Launch doccano container: `docker start doccano`
18+
3. Install from source
19+
* **I want to remember you that this is the hardest setup way. You have to install Python/Node.js and type many commands.**
20+
* [Install Python](https://www.python.org/downloads/)
21+
* [Install Node.js](https://nodejs.org/en/download/)
22+
* Get the source code of doccano: `git clone https://github.com/chakki-works/doccano.git`
23+
* Move to doccano directory: `cd doccano`
24+
* Create environment for doccano: `virtualenv venv`
25+
* Activate environment: `source venv/bin/activate`
26+
* Install required packages: `pip install -r requirements.txt`
27+
* Move server directory: `cd app/server`
28+
* Build frontend library: `npm install`
29+
* Build frontend source code: `npm run build`
30+
* Back to server directory: `cd ../`
31+
* Initialize doccano: `python manage.py migrate`
32+
* Create user: `python manage.py createsuperuser`
33+
* Run doccano: `python manage.py runserver`
34+
* Stop doccano: Ctrl+C
35+
* Re-Launch doccano: `python manage.py runserver` (Confirm you are at `app/server` directory and environment is active).
36+
37+
## I can't upload my data.
38+
39+
Please check the following list.
40+
41+
- File encoding: `UTF-8` is appropriate.
42+
- Filename: alphabetic file name is suitable.
43+
- File format selection: File format radio button should be selected properly.
44+
- When you are using JSON/JSONL: Confirm JSON data is valid.
45+
- You can use [JSONLint](https://jsonlint.com/) or some other tool (when JSONL, pick one data and check it).
46+
- When you are using CSV: Confirm CSV data is valid.
47+
- You can use Excel or some tools that have import CSV feature.
48+
- Lack of line: Data file should not contain blank line.
49+
- Lack of field: Data file should not contain blank field.
50+
51+
**You don't need your real & all data to validate file format. The picked data & masked data is suitable if your data is large or secret.**
52+
53+
## I want to add annotators.
54+
55+
* You can create other annotators by [Django Admin site](https://djangobook.com/django-admin-site/).

0 commit comments

Comments
 (0)