A question & answer search tool for Sonar.
239
To use Supman, you first need to correctly fill in a .env file, then either use docker run or docker compose. We recommend the latter for ease of administration and flexibility.
Create a .env file in the directory you will run Supman from and fill it as shown below.
Note: Supman only works with a domain over https. If you need to temporarily disable that during troubleshooting to access via http://ip:port, just change APP_ENV to local and APP_URL to http://yourIP:yourPort.
APP_NAME=Supman
APP_ENV=production
APP_KEY=
APP_URL=https://supman.yourdomain.com
ASSET_URL=/
API_TOKEN="yourSonarAccessToken"
INSTANCE_URL=https://your.sonar.instance/
API_URL=${INSTANCE_URL}api/graphql
G_CID="yourGoogleOauth2ClientID"
G_SEC="yourGoogleOauth2SecretID"
G_REDIR=${APP_URL}/auth/goog
AUTH_EMAIL="[email protected], [email protected]"
JWT_SECRET=yourJWTtokenHere
It is a good practice to lock down the permissions for the .env file. If you are accessing your server as root, something like this may be appropriate:
chown www-data:root .env && chmod 400 .env
This will restrict access to the .env to the webserver user that needs it. Even other users of the same www-data group will not be able to read the file without root access. This assumes you are logged in as root. If not, you may consider slightly different permissions appropriate for your user.
If anything about the .env is wrong, you will see an error 500, so triple check that it is correctly filled and permissioned.
You can generate a JWT_SECRET with something like openssl rand -hex 32. See your Google cloud console for oauth2 credentials.
Leave APP_KEY= blank for now as we will fill that in the following steps.
Generate the APP_KEY:
docker run --rm --name supman -v ./.env:/var/www/.env gomarcd/supman php artisan key:generate
Run the application:
docker run -d --name supman -p 8080:80 -v ./.env:/var/www/.env gomarcd/supman
Point your reverse proxy to 127.0.0.1:8080.
Using Docker Compose can provide more flexibility and ease of administration instead of docker run.
Create a docker-compose.yml:
version: "3"
services:
supman:
image: gomarcd/supman
container_name: supman
restart: always
volumes:
- "./.env:/var/www/.env"
ports:
- "8080:80"
Create the APP_KEY:
docker compose run supman php artisan key:generate
Run the application:
docker compose up -d
Point your reverse proxy to 127.0.0.1:8080. If using Traefik, remove ports and add your Traefik labels to the compose yaml.
Content type
Image
Digest
sha256:e685f47d1…
Size
181.4 MB
Last updated
about 3 years ago
docker pull gomarcd/supman