Metadata-Version: 2.1
Name: rygforms
Version: 0.5.11
Summary: OAuth2 Login for Typeform and Tripetto
Home-page: https://forms.ryg.one/
License: AGPL-3.0-or-later
Keywords: oauth2,tripetto,typeform,flask,ryg
Author: Stefano Pigozzi
Author-email: me@steffo.eu
Maintainer: Stefano Pigozzi
Maintainer-email: me@steffo.eu
Requires-Python: >=3.7,<4.0
Classifier: License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Requires-Dist: authlib (>=1.0.0,<2.0.0)
Requires-Dist: click (>=8.0.3,<9.0.0)
Requires-Dist: flask (>=2.0.3,<3.0.0)
Requires-Dist: gunicorn (>=20.1.0,<21.0.0)
Requires-Dist: itsdangerous (>=2.1.2,<3.0.0)
Requires-Dist: python-dotenv (>=0.15.0,<0.16.0)
Requires-Dist: requests (>=2.25.1,<3.0.0)
Project-URL: Repository, https://github.com/RYGhub/rygforms
Description-Content-Type: text/markdown

# RYGforms

Ask for a OAuth2 login, then redirect to a Typeform having one or more hidden fields.

## Running

### Development

1. Clone this repository:
   ```bash
   git clone git@github.com:RYGhub/rygforms.git
   ```

2. Enter the cloned directory:
   ```bash
   cd rygforms
   ```

3. Create a new `.env` file inside containing your configuration (see [the example](EXAMPLE.env)):
   ```bash
   cp EXAMPLE.env .env
   vim .env
   ```

4. Install the requirements using Poetry:
   ```bash
   poetry install
   ```

5. Run the debug server from inside the Poetry environment:
   ```bash
   poetry shell
   python -m rygforms
   ```

### Production

1. Create a new `rygforms` user:
   ```bash
   adduser rygforms --system
   ```

1. Create a working directory for RYGforms, set the owner to `rygforms` and enter it:
   ```
   mkdir /opt/rygforms
   cd /opt/rygforms
   ```

1. Create a new venv and enter it:
   ```bash
   python -m venv venv
   source venv/bin/activate
   ```

1. Install through PyPI:
   ```bash
   pip install rygforms gunicorn
   ```

1. Create a new `.env` file inside containing your configuration (see [the example](EXAMPLE.env)):
   ```bash
   curl https://raw.githubusercontent.com/RYGhub/rygforms/master/EXAMPLE.env > .env
   vim .env
   ```

1. Change the owner of the working directory to `rygforms`:
   ```bash
   chown rygforms: /opt/rygforms
   ```
   
1. Copy the [provided systemd unit file](web-rygforms.service) to the `/etc/systemd/system` directory:
   ```bash
   curl https://raw.githubusercontent.com/RYGhub/rygforms/master/web-rygforms.service > /etc/systemd/system/web-rygforms.service
   ```   

1. Reload the systemd unit files:
   ```bash
   systemctl daemon-reload
   ```

1. Start (and optionally enable) the service:
   ```bash
   systemctl start "web-rygforms"
   systemctl enable "web-rygforms"
   ```

1. Copy the [provided Apache site file](rp-rygforms.conf) to the `/etc/apache2/sites-available` directory:
   ```bash
   curl https://raw.githubusercontent.com/RYGhub/rygforms/master/rp-rygforms.conf > /etc/apache2/sites-available/rp-rygforms.conf
   ```

1. Enable the `rp-rygforms` site and reload the Apache configuration:
   ```bash
   a2ensite rp-rygforms
   systemctl reload apache2
   ```

