You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. Copy the `.env.example` to `.env` and insert the required credentials
14
+
2. Build the dev environment with `docker compose build`
15
+
3. Start the dev environment with `docker compose up`
16
+
4. Run the database migrations with `docker exec -it packet-packet-1 flask db upgrade`
17
+
5. Go check out the app at http://localhost.localdomain:8000
18
+
19
+
> Useful Tip: use `docker compose up --watch` so that you don't need to rebuild the container every time you want to test a change
20
+
21
+
### Secrets and configuration
22
+
23
+
Packet pulls in environment variables via the `config.env.py` so consult that file for all environment variables that configure the application.
24
+
Use the `.env.example` file as an example to get started with development by making a copy called `.env` and adding what you need.
25
+
26
+
**Required configuration values:**
27
+
28
+
*`PACKET_DATABASE_URI` - Must be set to a valid [SQLAlchemy DB URI](http://flask-sqlalchemy.pocoo.org/2.3/config/#connection-uri-format). The `.env.example` has the default value for the containerized PostgreSQL database defined in the `docker-compose.yml`
29
+
*`PACKET_LDAP_BIND_DN` - Must point to a valid CSH account on LDAP. Use the form
*`PACKET_LDAP_BIND_PASS` - The password for that CSH account.
32
+
*`PACKET_SECRET_KEY` - Use a sufficiently long random string here. The `flask create-secret` command can generate a good one
33
+
for you.
34
+
*`PACKET_OIDC_CLIENT_SECRET` - Required to use CSH auth. Contact a current maintainer of packet for the details.
35
+
36
+
To switch between OIDC realms you'll need to set the modify the following values:
37
+
38
+
*`PACKET_OIDC_CLIENT_SECRET` - Unique to each realm. Again, contact a current maintainer of packet for the details.
39
+
*`PACKET_OIDC_ISSUER` - The OIDC issuer URL.
40
+
*`PACKET_REALM` - Set to `"csh"` or `"intro"` depending on the realm you want.
41
+
42
+
By default `PACKET_OIDC_ISSUER` and `PACKET_REALM` are configured for the CSH members realm.
43
+
44
+
## Develop locally (Not Recommended)
45
+
46
+
### Setup
47
+
11
48
**Requires Python 3.9 or newer.**
12
49
13
50
To get the server working you'll just need the Python dependencies and some secrets. There will be some UI issues due
@@ -18,6 +55,7 @@ Alternatively, you can set up a Docker container using `Dockerfile`. This is wha
18
55
reliable method.
19
56
20
57
### Python dependencies
58
+
21
59
Use `pip3 install -r requirements.txt` to install the required python dependencies. A
22
60
[venv](https://packaging.python.org/tutorials/installing-packages/#creating-virtual-environments) is *highly*
23
61
recommended. To add new dependencies, add them to `requirements.in` and run `pip-compile requirements.in` to update
@@ -29,6 +67,7 @@ pain. Try using [WSL](https://docs.microsoft.com/en-us/windows/wsl/about) or fin
29
67
trustworthy source.
30
68
31
69
### Frontend dependencies
70
+
32
71
To build any of the frontend dependencies you're going to need [node](https://nodejs.org/),
33
72
[npm](https://www.npmjs.com/get-npm), and [yarn](https://yarnpkg.com/).
34
73
@@ -49,6 +88,7 @@ npm install -g gulp
49
88
```
50
89
51
90
### Local Development
91
+
52
92
* PostgreSQL
53
93
You'll need a postgres instance to use as a development DB.
54
94
You can use an existing database, like the instance used for the dev branch, use a database on another server, or spin up a container using docker or podman.
@@ -62,32 +102,8 @@ Once the container is up, run the following to set up the database tables.
62
102
flask db upgrade
63
103
```
64
104
65
-
### Secrets and configuration
66
-
Packet supports 2 primary configuration methods:
67
-
1. Environment variables - See `config.env.py` for the expected names and default values.
68
-
2. Pyfile config - Create a `config.py` file in the root directory of the project and set variables to override the
69
-
values in `config.env.py`.
70
-
71
-
Both methods can be used at the same time, though Pyfile config will take priority over environment variables.
105
+
### Usage
72
106
73
-
**Required configuration values:**
74
-
*`SQLALCHEMY_DATABASE_URI` - Must be set to a valid [SQLAlchemy DB URI](http://flask-sqlalchemy.pocoo.org/2.3/config/#connection-uri-format).
75
-
A dev database for the project is hosted by CSH. Contact a current maintainer of packet for the details.
76
-
*`LDAP_BIND_DN` - Must point to a valid CSH account on LDAP. Use the form
0 commit comments