Skip to content

docs(setup): Add setup docs and easy install script - #160

Merged
Kaushl2208 merged 1 commit into
fossology:mainfrom
siemens:docs/setup
Oct 1, 2026
Merged

Kaushl2208 merged 1 commit into
fossology:mainfrom
siemens:docs/setup

Conversation

@deo002

@deo002 deo002 commented Aug 22, 2025

Copy link
Copy Markdown
Collaborator

Changes

  • Add clear set up docs for different ways to run the project
  • Add easy install script
  • Improve README.

Submitter Checklist

  • Includes tests (if there is a feature changed/added)
  • Includes docs ( if changes are user facing)
  • I have tested my changes locally.

@avinal avinal left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, some changes required.

Comment thread cmd/laas/main.go Outdated
datafile = flag.String("datafile", "licenseRef.json", "(optional) path of the file from which licenses are to be imported")
// auto-update the database
populatedb = flag.Bool("populatedb", false, "boolean variable to update database")
populatedb = flag.Bool("populatedb", false, "(optional) boolean variable to populate database with licences, obligation types and classifications on start up")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
populatedb = flag.Bool("populatedb", false, "(optional) boolean variable to populate database with licences, obligation types and classifications on start up")
populatedb = flag.Bool("populatedb", false, "(optional) boolean variable to populate database with licenses, obligation types and classifications on start up")

Can safely ignore. Both are correct spellings, just in different regions. 😅

Comment thread easy_install.sh Outdated
ADMIN_USER="fossy_super_admin"
ADMIN_PASS="fossy_super_admin"
ADMIN_DISPLAY="fossy_super_admin"
ADMIN_EMAIL="fossy_super_admin@licensedb.org"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ADMIN_EMAIL="fossy_super_admin@licensedb.org"
ADMIN_EMAIL="fossy_super_admin@example.org"

I would not use a domain that we do not own. Use example domains if required.

Comment thread easy_install.sh Resolved
Comment thread README.md Outdated

- Create the `external_ref_fields.yaml` file in the root directory of the project and change the
values of the extra license json keys as per your requirement.
### 3. Install golang-migrate CLI

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add the command/script or refer to the repository.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The instructions are under a wrong header; please fix.

Comment thread README.md Outdated
### 4. Install swagger document generator

- Generate Go struct for the extra fields listed in the external_ref_fields.yaml.
You'll need```swag``` installed to build swagger docs.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
You'll need```swag``` installed to build swagger docs.
You'll need ```swag``` installed to build swagger docs.

Comment thread README.md Outdated
Comment on lines +95 to +103
#### For Linux & macOS

```bash
go build ./cmd/laas
```

- Create the `.env` file in the root directory of the project and change the
values of the environment variables as per your requirement.

```bash
cp configs/.env.dev.example .env
vim .env
```

- Run the migration files.
```bash
migrate -path pkg/db/migrations -database "postgres://fossy:fossy@localhost:5432/licensedb?sslmode=disable" up
```

- Run the executable.

```bash
./laas
```

- You can directly run it by the following command.

```bash
go run ./cmd/laas
curl -L https://github.com/golang-migrate/migrate/releases/latest/download/migrate.linux-amd64.tar.gz | tar xvz
sudo mv migrate /usr/local/bin/
```

### Create first user
Connect to the database using `psql` with the following command.
```bash
psql -h localhost -p 5432 -U fossy -d licensedb
```
For other platforms and installation methods, check the official docs:
👉 [https://github.com/golang-migrate/migrate](https://github.com/golang-migrate/migrate)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this needs to go under step 3.

Comment thread SETUP.md Outdated
- Build the app image

```bash
docker build -t licensedb/latest

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the reference to the Dockerfile and the context is missing. Please check.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some things that need to be changed in the docker file. We have another PR open for that. We'll add the details here once it is merged.

Comment thread SETUP.md Outdated

### 2. Setting up the database

- Create database licensedb and provide user fossy all priviliges to it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Create database licensedb and provide user fossy all priviliges to it.
- Create database licensedb and provide user fossy all privileges to it.

Comment thread SETUP.md Outdated
swag fmt --generalInfo ./pkg/api/api.go --dir ./pkg/api,./pkg/auth,./pkg/db,./pkg/models,./pkg/utils
```

- The super admin user can only create new app users and import licenses and obligations.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- The super admin user can only create new app users and import licenses and obligations.
- Only the super admin user can create new app users, import licenses and obligations.

@Kaushl2208 Kaushl2208 left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @deo002 , I think we dont need the easy script part anymore. It was planned when both frontend and backend setup was discussed.

We should push for Docker and Bare Metal installation. Operationally this will lag behind otherwise.

Other point is: If we are removing the setup guide from README, We should also add some of the other things that should be there in a README. Like project description. Features and Functionalities etc etc.
Basic Testing and running steps (With Docker) can also be mentioned in the README. Link all the other documents that we have in the projects. Like Contributing & Setup(bare metal)

I like the ER Diagram idea, but it doesnt load anymore.

Comment thread configs/.env.dev.example Outdated
TOKEN_HOUR_LIFESPAN=1
# Secret key to sign tokens (openssl rand -hex 32)
API_SECRET=some-random-string
API_SECRET=0195067722c9213eee87c3db9b087ade

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to type a SECRET looking string in API_SECRET? Can we put these steps in README? Setup guide? Like how to generate and what variable to update?

Comment thread configs/.env.dev.example Outdated
# refresh token information(30 days)
REFRESH_TOKEN_HOUR_LIFESPAN=720
REFRESH_TOKEN_SECRET=some-other-random-string
REFRESH_TOKEN_SECRET=d78cded51eff6ab87e255b8f72f2215c

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

Comment thread easy_install.sh Outdated
# SPDX-FileCopyrightText: 2025 Dearsh Oberoi <dearsh.oberoi@siemens.com>
# SPDX-License-Identifier: GPL-2.0-only

set -euo pipefail

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure about creating one more setup mechanism. We already have something similar to this for Docker.

Comment thread external_ref_fields.example.yaml Outdated
Comment on lines +4 to +5
# add the same yaml file to your frontend project

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

THIS?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a line regarding this in the Post Install section of SETUP.md

Comment thread README.md Outdated
### Option 2: Run with Docker Compose (recommended)

A `docker-compose.yml` is included in this repository to make it easy to spin up LicenseDB along with PostgreSQL.
You'll need ```swag``` installed to build swagger docs.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we are creating a separate guide for setup, That information should exclusively be there.

Comment thread README.md Outdated
```
👉 Please follow the [Setup Guide](./SETUP.md) for step-by-step instructions on how to run the project.

### Testing (local)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also then belong to setup.md then

Comment thread SETUP.md Outdated
Comment on lines +10 to +34
## 1. Easy Install Script

The easiest of them all is via the easy install script.

- (Optional) Edit the ```configs/.env.dev.example``` to set the environment variables. If not done, default values will be taken.

- (Optional) Edit the ```external_ref_fields.example.yaml``` to extend the schema of licenses and obligations with custom fields. If not done, default values will be taken.

- Run the easy install script to generate the app binary.

```bash
./easy_install.sh
```

- Run the executable

```bash
./laas
```

Use the command below for more startup options.

```bash
./laas --help
```

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, This should not be the primary way for the installation. I dont think this should even be a way altogether

Comment thread SETUP.md
Comment on lines +40 to +42
```bash
docker build -t licensedb/latest .
```

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can also mention the DockerHub/GHCR image where we push some of the latest builds.

@deo002
deo002 force-pushed the docs/setup branch 2 times, most recently from 34270e8 to c295fa7 Compare September 24, 2026 06:21
Signed-off-by: deo002 <oberoidearsh@gmail.com>

@Kaushl2208 Kaushl2208 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@Kaushl2208
Kaushl2208 merged commit 14c88bf into fossology:main Oct 1, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants