Skip to content

Commit

Permalink
Migrate in Ngrok/migration tools to Nginx container.
Browse files Browse the repository at this point in the history
  • Loading branch information
vpetersson committed Nov 20, 2020
1 parent 6b82e72 commit 6acc510
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 19 deletions.
6 changes: 0 additions & 6 deletions ansible/roles/tools/files/nginx.conf

This file was deleted.

8 changes: 0 additions & 8 deletions ansible/roles/tools/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,3 @@
mode: 0755
owner: root
group: root

- name: Installs nginx config
copy:
src: nginx.conf
dest: /etc/nginx/sites-enabled/screenly_assets.conf
mode: 644
owner: root
group: root
12 changes: 10 additions & 2 deletions bin/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,16 @@ fi

sudo sed -i 's/apt.screenlyapp.com/archive.raspbian.org/g' /etc/apt/sources.list
sudo apt update -y
sudo apt-get purge -y python-setuptools python-pip python-pyasn1
sudo apt-get install -y python-dev git-core libffi-dev libssl-dev whois
sudo apt-get purge -y \
python-setuptools \
python-pip \
python-pyasn1
sudo apt-get install -y \
python-dev \
git-core \
libffi-dev \
libssl-dev \
whois
curl -s https://bootstrap.pypa.io/get-pip.py | sudo python

if [ "$NETWORK" == 'y' ]; then
Expand Down
1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ services:
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro


srly-ose-celery:
image: screenly/srly-ose-celery:latest
depends_on:
Expand Down
12 changes: 12 additions & 0 deletions docker/nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,15 @@ server {
}
}
}

server {
# Only allow from localhost and Docker's CIDR
allow 172.17.0.0/16;
allow 172.0.0.1;
deny all;

server_name *.ngrok.io;
listen 80;
root /data/screenly_assets;
try_files $uri /data/screenly_assets$uri;
}
4 changes: 2 additions & 2 deletions tools/assets-migration-to-screenly-pro.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
HOME = os.getenv('HOME', '/home/pi')

BASE_API_SCREENLY_URL = 'https://api.screenlyapp.com'
ASSETS_SCREENLY_OSE_API = 'http://127.0.0.1:8080/api/v1.1/assets'
ASSETS_SCREENLY_OSE_API = 'http://127.0.0.1/api/v1.1/assets'

PORT_NGROK = 4040
PORT = 8000
PORT = 80

token = None
ngrok_public_url = None
Expand Down

0 comments on commit 6acc510

Please sign in to comment.