Skip to content

๐Ÿš€ Keyword Based ๋ฐ”๋กœ๊ฐ€๊ธฐ ์„œ๋น„์Šค

Notifications You must be signed in to change notification settings

hy-lionlab/hyu-pass

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

60 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

HY-PASS

ํ•œ์–‘๋Œ€ํ•™๊ต Keyword Based Short URL ์„œ๋น„์Šค

๐Ÿ“ฆ Requirements

๐Ÿ”ฅ ๊ด€๋ฆฌ์ž ๊ธฐ๋Šฅ ๊ฐœ๋ฐœ ์‹œ ์ฃผ์˜ ์‚ฌํ•ญ

๊ด€๋ฆฌ์ž ๊ธฐ๋Šฅ ๊ฐœ๋ฐœ ์‹œ @auth.login_required ๋ฐ์ฝ”๋ ˆ์ดํ„ฐ๋ฅผ ์ฃผ์„ ์ฒ˜๋ฆฌ ํ•ด์•ผ๋  ์ˆ˜๋„ ์žˆ์Šต๋‹ˆ๋‹ค. (์ฐธ๊ณ !)

๐Ÿ”ฅ๐Ÿ”ฅ Development Environment

Based on Mac OSX Mojave

# Installation Homebrew

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew update

# Pipenv Installation
brew install python3
brew reinstall python3 #python3๋ฅผ ์˜ˆ์ „์— ์„ค์น˜ํ–ˆ๊ฑฐ๋‚˜ pip ์—…๊ทธ๋ ˆ์ด๋“œ๋ฅผ ํ•œ์ง€ ์‹œ๊ฐ„์ด ์ง€๋‚œ ๊ฒฝ์šฐ
pip3 install pip --upgrade
pip3 --version

pip3 install pipenv
pipenv --version

# Yarn Install
brew install yarn

# Pipenv Package Install & Virutal Env Activate
cd {SOURCE_PATH}
pipenv install

# docker-compose.yaml
docker-compose up -d

# .env ๊ฐœ๋ฐœํ™˜๊ฒฝ์šฉ ์„ค์ •
# Flask Running
pipenv shell

# Flask DB
python manage.py db init
python manage.py db upgrade
python manage.py db migrate

๐Ÿ”ฅ๐Ÿ”ฅ Deployment

Based on Ubuntu 18.04 LTS

# ํ•„์ˆ˜ ์œ ํ‹ธ๋ฆฌํ‹ฐ ์„ค์น˜
sudo apt-get update
sudo apt install build-essential libssl-dev libffi-dev python3-setuptools
sudo apt install libmysqlclient-dev

# Python PIP + Pipenv install
sudo apt install python3-pip
pip3 --version # PIP ์„ค์น˜ ํ™•์ธ
pip3 install --user pipenv # PIPENV ์„ค์น˜
export PATH="$HOME/.local/bin:$PATH"

# Python 3.7 Install
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt install python3.7 python3.7-dev
sudo ln -sfn /usr/bin/python3.7 /usr/bin/python

# Nginx install
sudo apt install nginx

# Yarn install
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list

sudo apt-get update
sudo apt install yarn

yarn --version # Yarn ์„ค์น˜ ํ™•์ธ

# Source install
cd ~/
git clone {SOURCE_URL}
cd {$PROJECT_ROOT}

# Python + Yarn Package Install
pipenv install

cd app
yarn install
yarn build

# Supervisor Settings
sudo apt install supervisor
cd /etc/supervisor/conf.d/
sudo vi hypass.conf # config/supervisor/conf.d/hypass.conf ์ฐธ์กฐ

# Nginx Settings
cd /etc/nginx/sites-available
sudo vi default # config/nginx/conf.d/hypass.conf ์ฐธ์กฐ

# Supervisor Applying
sudo supervisorctl reread
sudo service supervisor restart
sudo service nginx restart

# .env ๊ฐ’ ์„ค์ • (.env.example์„ ์ฐธ์กฐ)

# Flask DB
python manage.py db init
python manage.py db upgrade
python manage.py db migrate

## Cerbot + Let's Encrypt
sudo apt-get install software-properties-common
sudo add-apt-repository universe
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update

sudo apt-get install certbot python-certbot-nginx

# ๋ฐฉํ™”๋ฒฝ 443 port ์˜คํ”ˆ ํ•„์ˆ˜!
sudo certbot --nginx # Certbot Setup

sudo service supervisor restart
sudo service nginx restart

๐Ÿ“– References

About

๐Ÿš€ Keyword Based ๋ฐ”๋กœ๊ฐ€๊ธฐ ์„œ๋น„์Šค

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published