<commit_before># signapp
Sign Approval Application for guidance and conseling Lecturer

## Requirement
 * virtualenv
 * uwsgi
 * pymongo
 * pycrypto
 * redis

### Instalation
Centos 6 x86_64_ (still on progress)
```sh
# yum --enablerepo=extras install centos-release-SCL
# yum install python27
# cd /etc/yum.repos.d/ 
# wget https://copr.fedorainfracloud.org/coprs/pypa/pypa/repo/epel-6/pypa-pypa-epel-6.repo
# yum clean all
# yum install python-backports
# rpm -ivh ftp://rpmfind.net/linux/centos/6.8/os/x86_64/Packages/python-backports-ssl_match_hostname-3.4.0.2-2.el6.noarch.rpm
# yum install python-pip
# pip install virtualenv
# pip install uwsgi
# pip install pymongo
# pip install pycrypto
# pip install redis
```

Centos 7
```sh
# yum install python-pip python-dev nginx
# pip install virtualenv
# pip install uwsgi
```


Ubuntu Installation
```sh
# sudo apt-get install build-essential libssl-dev libffi-dev python-pip python-dev nginx
# pip install virtualenv
# pip install uwsgi
```

### Setup
#### Direktory

```sh
$ cd signapp
$ virtualenv signappenv
$ source signappenv/bin/activate
$ deactivate
```

#### uwsgi
Please edit first signapp .ini

Centos 7
edit uwsgi.service; and copy to your centos 7 service dir

```sh
# cp uwsgi.service /etc/systemd/system/
# systemctl start uwsgi
# systemctl status uwsgi
# systemctl enable uwsgi
```
PLease check selinux for enabling nginx to read socket
```sh
# tail /var/log/audit/audit.log
# getenforce
Enforcing
# setenforce 0
# getenforce
Permissive
# systemctl restart nginx
```
Beware, command above will not work after restart, you must set selinux to enable read socket
```sh
# yum install policycoreutils-python
# grep nginx /var/log/audit/audit.log | audit2allow
# grep nginx /var/log/audit/audit.log | audit2allow -m nginx
# grep nginx /var/log/audit/audit.log | audit2allow -M nginx
# semodule -i nginx.pp
```


Ubuntu
edit signapp.conf; after that please copy .conf to your startup init

```sh
$ sudo cp signapp.conf /etc/init/
$ sudo start signapp
```

#### nginx

```sh
server {
    listen 80;
    server_name sign.vas.web.id;

    location / {
        include         uwsgi_params;
        uwsgi_pass      unix:/run/uwsgi/signapp.sock;
    }
}
```

#### MongoDB
This application need mongodb for storing student guidance data. please install first rely on your Operating System

Centos 7
```sh
# vi /etc/yum.repos.d/mongodb-org.repo
[mongodb-org-3.2]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.2/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-3.2.asc
# yum repolist
# yum install mongodb-org
# systemctl start mongod
# tail /var/log/mongodb/mongod.log
# mongo
# vi /etc/security/limits.d/20-nproc.conf
…
mongod soft nproc 32000
# systemctl restart mongod
```

Use mongo db run mongo
```sh
> use signapp
> db.sign.insert({NPM:"1234455"})
> db.sign.find()
> quit()
```

#### Redis
This apps using redis to store TTL Token

centos 7
```sh
# yum install redis
# systemctl enable redis
# systemctl start redis
# systemctl status redis
# redis-cli
```

<commit_msg>release new readme<commit_after># signapp
Sign Approval Application for guidance and conseling Lecturer

## Requirement
 * heroku account
 * python 3
 * Redis Cloud add-on
 * git
 * heroku cli client
 

### Instalation
Using Heroku
```sh
# heroku create signappname
# git clone https://github.com/awangga/signapp.git
# cd signapp
# heroku git:remote -a signappname
# heroku addons:create rediscloud
# git push heroku master
# heroku logs
# heroku ps -a signappname
```



{'fraction_non_alphanumeric': 0.1128806929309863, 'fraction_numerical': 0.01648505169041632, 'mean_word_length': 3.958448753462604, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 4, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 1, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2418126', 'n_tokens_mistral': 1384, 'n_tokens_neox': 1272, 'n_words': 367}