Skip to content

makino-makino/tokumei-ikenbako

Repository files navigation

neo-polling

Usage

How to run

  1. clone
git clone https://github.com/makino-makino/neo-polling
cd neo-polling
  1. set env
PASSWORD="email password"
EMAIL_FROM="email address"
PRIVKEY="pkcs8 private key"
PUBKEY="pkcs8 public key"
TIME="time to start vote"
DEPLOY_HOST="server hostname" # default to localhost
SERV_ENV=dev # change to `prod` to run in production env
INCUBATOR_PASS="BASIC auth password"
  1. create empty mount points
mkdir -p data/certbot/{www,conf}
  1. compile crypto module
cd crypto
docker-compose up
  1. (production deploy only) generate TLS certificate
cd ../
./init-letsencrypt.sh

NOTE: If you need to renew certificate, run following.

docker-compose up certbot
  1. run server
cd ../  # if you ran 4., skip this
docker-compose up

Administration

You can send blind signature email using /incubator.

It requires BASIC auth, with username incubator and password defined in .env.

Testing

Integrated test

First, run:

pip3 install -r requirements.txt

Then run chromedriver-path, and replace chromedriver_path variable string with the output. For example,

$ chromedriver-path
/opt/homebrew/lib/python3.9/site-packages/chromedriver_binary
chromedriver_path = "/opt/homebrew/lib/python3.9/site-packages/chromedriver_binary/chromedriver" # previous output

Finally, you can run the integrated test:

python3 integrated-test.py

ログについて

Docker のログは、何もしなくても /var/lib/docker/containers 以下に保存される。

各コンテナのログを見るときは、以下のようにする。

docker inspect --format='{{.LogPath}}' neo-polling_api_1
# e.g.) /var/lib/docker/containers/4598a887451112374f717b28ab56b12eb9687d20be1db9033c700a3e6bc4e056/4598a887451112374f717b28ab56b12eb9687d20be1db9033c700a3e6bc4e056-json.log

sudo less /var/lib/docker/containers/4598a887451112374f717b28ab56b12eb9687d20be1db9033c700a3e6bc4e056/4598a887451112374f717b28ab56b12eb9687d20be1db9033c700a3e6bc4e056-json.log

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published