Subscribie / subscribie-deployer

Subscribie-deployer sets the initial settings and config needed for a new shop during sign-up. You don't need this to run Subscribie locally. You do need this if you want to work on the onboarding/sign-up process.
https://subscribie.co.uk/#start-now
0 stars 1 forks source link
saas stripe subscriptions subscriptions-and-payments

Subscribie Deployer

Standalone starlette app which receives a new site build request, and builds the site. (ref https://github.com/Subscribie/module-builder/issues/7)

Responsible for building new subscribie sites.

Configuration

Create virtual env & install requirements:

virtualenv -p python3 venv . venv/bin/activate pip install -r requirements.txt

For running locally in development: ./run.sh

Speed improvements

UWSGI notes

How to run:

uwsgi --ini config.ini # add -d to demonize

Ensure that dir /tmp/sockets/ exists (for the vassal sites .ini files)

Then chmod /tmp/sock1 (todo fix this using chmod uwsgi flag)

Example Nginx Config (deployer)

# mysite_nginx.conf
#

# configuration of the server
server {
    # the port your site will be served on
    listen      80;
    # the domain name it will serve for
    server_name *.app1 example.com ~^.*.example.com app2 site1.local site2.local; # substitute your machine's IP address or FQDN
    root /home/chris/Documents/python/uwsgi/vassals/;
    charset     utf-8;

    client_max_body_size 75M;

    # max upload size

    location / {
        proxy_pass http://127.0.0.1:8002/;
    }
}

Apache config example (deployer)

(Using ip rather than sockets)

<VirtualHost *:80>

  ServerAdmin webmaster@localhost
  DocumentRoot /var/www/html

  ErrorLog ${APACHE_LOG_DIR}/error.log
  CustomLog ${APACHE_LOG_DIR}/access.log combined

  ServerName example.com
  ServerAlias *.example.com
  ProxyPass / http://127.0.0.1:8002/

</VirtualHost>

Test

curl http://127.0.0.1:5001/ -d '{"company": {"name": "My Test Shop"}, "users": ["sam@example.com"], "password": "123", "plans": [{"title": "Hair Gel", "description": "Luxuary hair gel", "interval_amount": 100, "interval_unit": "monthly", "sell_price": 1500}]}'