Repository navigation
feat: Upgrade to bootstrap 5 #22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
686647f
34a1008
40d1bf0
4606d40
6c33636
528e13f
bbc26f9
5f97e95
4bb519b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| # Used by the Computer Science House "csh_auth" library | ||
| # For more info, see https://github.com/liam-middlebrook/csh-auth | ||
| # https://wiki.csh.rit.edu/wiki/SSO | ||
| CSH_AUTH_CLIENT_ID=develop | ||
| CSH_AUTH_CLIENT_SECRET= | ||
| CSH_AUTH_STATE=2b3e8ca35c5bb772b63760012c270f25 | ||
| CSH_AUTH_JWT_SECRET=3dde79fb4df2277cc9d84c93d3e0f69a | ||
| CSH_AUTH_SERVER_HOST=sso.csh.rit.edu | ||
| CSH_AUTH_REDIRECT_URI=http://localhost:8080/auth/redir | ||
|
|
||
| # S3 Bucket credentials. Ask an RTP for credentials or | ||
| # spin one up yourself using DEaDASS | ||
| # https://wiki.csh.rit.edu/wiki/S3 | ||
| S3_ACCESS_ID= | ||
| S3_SECRET_KEY= | ||
| S3_BUCKET_NAME= | ||
| S3_HOST=s3.csh.rit.edu | ||
|
|
||
| # Postgres URI. Spin up your own for development, | ||
| # or make one on DEADASS (don't do this) | ||
| DB_URI=postgresql://plug:fancypantspassword@plug-postgres:5432/plug?sslmode=disable | ||
|
|
||
| # LDAP Creds. Consult the wiki page listed in the README.md | ||
| # https://wiki.csh.rit.edu/wiki/LDAP | ||
| LDAP_BIND_DN=uid=<username>,cn=users,cn=accounts,dc=csh,dc=rit,dc=edu | ||
| LDAP_BIND_PW= | ||
| LDAP_HOST=ldap.csh.rit.edu:636 | ||
| LDAP_WRITE_MODE=false | ||
|
|
||
| # Gin-gonic settings. Base path should be set so it can find | ||
| # your resources. | ||
| GIN_MODE=release | ||
| BASE_PATH=./ |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,78 @@ | ||
| # csh-plug | ||
| CSH Plug | ||
| ======== | ||
|
|
||
| Plug is the advertisement platform of the future. | ||
|
|
||
| Development | ||
| ----------- | ||
|
|
||
| ## Running | ||
| It is likely easier to use containers like `podman` or `docker` or the corresponding compose file | ||
|
|
||
| With podman, I have been using | ||
|
|
||
| ```sh | ||
| podman compose up --watch | ||
| ``` | ||
|
|
||
| If you want, you can run without auto rebuild using | ||
| ```sh | ||
| podman compose up --force-recreate --build | ||
| ``` | ||
| Which can be restarted every time changes are made. | ||
|
|
||
| ## Config | ||
| To easily configure your workspace, copy the `.env.example` into a new `.env` file. | ||
|
|
||
| ### Add OIDC Config | ||
| Reach out to an RTP to get OIDC credentials that will allow you to develop locally behind OIDC auth | ||
|
|
||
| You can also fetch dev credentials from the wiki (https://wiki.csh.rit.edu/wiki/SSO). | ||
|
|
||
| The `CSH_AUTH_STATE` and `CSH_AUTH_CLIENT_SECRET` are each a unqiue sequence of 16+ random characters, I recommend using the openssl command line utilities `openssl rand -hex 16` | ||
|
|
||
| ```bash | ||
| CSH_AUTH_CLIENT_ID= | ||
| CSH_AUTH_CLIENT_SECRET= | ||
| CSH_AUTH_STATE= | ||
| CSH_AUTH_JWT_SECRET= | ||
| CSH_AUTH_SERVER_HOST=sso.csh.rit.edu | ||
| CSH_AUTH_REDIRECT_URI=http://localhost:8080/auth/redir | ||
| ``` | ||
|
|
||
| ### Add LDAP Config | ||
| Authenticate with LDAP using your CSH account credentials by following the instructions on the wiki (https://wiki.csh.rit.edu/wiki/LDAP). | ||
|
|
||
| Set the `LDAP_WRITE_MODE` environment variable to `false` to prevent attempted writes to LDAP, it will default to false if unset for safety. | ||
|
|
||
| ```bash | ||
| LDAP_BIND_DN=uid=<username>,cn=users,cn=accounts,dc=csh,dc=rit,dc=edu | ||
| LDAP_BIND_PW=(Your CSH account password) | ||
| ``` | ||
|
|
||
| ### Add S3 Config | ||
| An S3 bucket is used to store images that users upload. In order to have this work properly, you need to provide some credentials to the app. | ||
|
|
||
| There are 2 ways that you can get the needed credentials. | ||
| 1. Reach out to an RTP for creds to the dev bucket | ||
| 2. Create your own bucket using [DEaDASS](https://deadass.csh.rit.edu/), and the site will give you the credentials you need. | ||
|
|
||
| ```bash | ||
| S3_ACCESS_ID= | ||
| S3_SECRET_KEY= | ||
| S3_BUCKET_NAME= | ||
| S3_HOST=s3.csh.rit.edu | ||
| ``` | ||
|
|
||
| ### Database | ||
| You can either develop using the dev database, or use the local database provided in the docker compose file | ||
|
|
||
| Using the local database is detailed below, but both options will require the dev database password, so you will have to ask an RTP for this too | ||
|
|
||
| ## Testing Locally | ||
|
|
||
| ### Admin Dashboard Access | ||
| Modify the `CheckIfAdmin` function in `ldap.go` to always return true which will grant you admin access. | ||
|
|
||
| ### Drink Credits | ||
| Modify the `DecrementCredits` function in `ldap.go` to give yourself credits if your account doesn't have them already. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| services: | ||
| plug: | ||
| build: . | ||
| volumes: | ||
| - ./migrations:/opt/conditional/migrations | ||
| container_name: plug | ||
| depends_on: | ||
| plug-postgres: | ||
| condition: service_healthy | ||
| env_file: | ||
| - path: .env | ||
| required: false | ||
| environment: | ||
| - BASE_PATH=/ | ||
| ports: | ||
| - "127.0.0.1:8080:8080" | ||
| develop: | ||
| watch: | ||
| - action: sync+restart | ||
| target: /templates | ||
| path: ./templates | ||
|
|
||
| plug-postgres: | ||
| image: docker.io/postgres:18 | ||
| container_name: plug-postgres | ||
| environment: | ||
| POSTGRES_PASSWORD: fancypantspassword | ||
| POSTGRES_USER: plug | ||
| POSTGRES_DATABASE: plug | ||
| ports: | ||
| - "127.0.0.1:5432:5432" | ||
| volumes: | ||
| - pgdata:/var/lib/postgresql | ||
| healthcheck: | ||
| test: ["CMD-SHELL", "pg_isready -U plug"] | ||
| interval: 5s | ||
| timeout: 5s | ||
| retries: 5 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not gonna make you but you could add an s3 client :)
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do you mean like a lightweight s3 emulator in another container? Is this related to your review comment?
|
||
|
|
||
| volumes: | ||
| pgdata: | ||
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔴 High: Hardcoded credential in service environment
Storing credentials such as passwords, API keys, or tokens as literal values in the `environment` section exposes them in version control, container inspect output, and process listings. Any developer, CI system, or atta... (...read more)
Storing credentials such as passwords, API keys, or tokens as literal values in the
environmentsection exposes them in version control, container inspect output, and process listings. Any developer, CI system, or attacker with read access to the Compose file or the running container can retrieve the credential. Sensitive values should be passed via Docker secrets (secrets:) or referenced as environment variable placeholders (e.g.,DB_PASSWORD: ${DB_PASSWORD}) rather than hardcoded literals.Helpful? 👍/👎


🚩 Report as false positive. Flags the rule for review to improve detection accuracy.