docker releases
This commit is contained in:
39
.github/workflows/docker-publish.yml
vendored
Normal file
39
.github/workflows/docker-publish.yml
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
name: Build and Push Docker Image to GHCR
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ["main"]
|
||||
tags: ["v*.*.*"]
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Log in to GHCR
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Extract Docker metadata
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: ghcr.io/${{ github.repository }}
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
21
Dockerfile
Normal file
21
Dockerfile
Normal file
@@ -0,0 +1,21 @@
|
||||
FROM golang:1.25 AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
ENV CGO_ENABLED=1 GOOS=linux GOARCH=amd64
|
||||
RUN apt-get update && apt-get install -y gcc libc6-dev sqlite3 ca-certificates
|
||||
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
COPY . .
|
||||
|
||||
RUN go build -ldflags="-w -s" -o passport
|
||||
|
||||
# ---- Runtime Stage ----
|
||||
FROM gcr.io/distroless/cc-debian12
|
||||
|
||||
WORKDIR /data
|
||||
COPY --from=builder /app/passport /usr/local/bin/passport
|
||||
EXPOSE 3000
|
||||
|
||||
CMD ["/usr/local/bin/passport"]
|
||||
39
README.md
39
README.md
@@ -17,17 +17,37 @@ Passport is a simple, fast, and lightweight web dashboard/new tab replacement.
|
||||
|
||||
## Usage
|
||||
|
||||
1. Clone the repository
|
||||
2. Configure the `.env` file, an example is provided in the `.env.example` file, see below for every available environment variable
|
||||
4. Deploy `passport` to your web server
|
||||
5. profit
|
||||
### Docker
|
||||
|
||||
Passport is available as a Docker image via this repository. This is the recommended way to run Passport.
|
||||
|
||||
```bash
|
||||
docker run -d --name passport -p 3000:3000 -e PASSPORT_ADMIN_USERNAME=admin -e PASSPORT_ADMIN_PASSWORD=password ghcr.io/juls0730/passport:latest
|
||||
```
|
||||
|
||||
### Building from source
|
||||
|
||||
If you want to build from source, you will need to install the dependencies first.
|
||||
|
||||
```bash
|
||||
go install github.com/juls0730/zqdgr@latest
|
||||
go install github.com/tailwindlabs/tailwindcss-cli@latest
|
||||
```
|
||||
|
||||
Then you can build the binary.
|
||||
|
||||
```bash
|
||||
go build -o passport
|
||||
```
|
||||
|
||||
You can then run the binary.
|
||||
|
||||
### Configuration
|
||||
|
||||
#### Passport configuration
|
||||
|
||||
| Environment Variable | Description | Required | Default |
|
||||
| --- | --- | --- | --- |
|
||||
| -------------------------------------- | ------------------------------------------------------------------------------- | -------- | ------- |
|
||||
| `PASSPORT_DEV_MODE` | Enables dev mode | false | false |
|
||||
| `PASSPORT_ENABLE_PREFORK` | Enables preforking | false | false |
|
||||
| `PASSPORT_ENABLE_WEATHER` | Enables weather data, see [Weather configuration](#weather-configuration) | false | false |
|
||||
@@ -35,12 +55,12 @@ Passport is a simple, fast, and lightweight web dashboard/new tab replacement.
|
||||
| `PASSPORT_ADMIN_USERNAME` | The username for the admin dashboard | true |
|
||||
| `PASSPORT_ADMIN_PASSWORD` | The password for the admin dashboard | true |
|
||||
| `PASSPORT_SEARCH_PROVIDER` | The search provider to use for the search bar, without any query parameters | true |
|
||||
| `PASSPORT_SEARCH_PROVIDER_QUERY_PARAM` | The query parameter to use for the search provider, e.g. `q` for most providers |false | q |
|
||||
| `PASSPORT_SEARCH_PROVIDER_QUERY_PARAM` | The query parameter to use for the search provider, e.g. `q` for most providers | false | q |
|
||||
|
||||
#### Weather configuration
|
||||
|
||||
| Environment Variable | Description | Required | Default |
|
||||
| --- | --- | --- | --- |
|
||||
| ----------------------------- | ------------------------------------------------------------------------- | ---------- | -------------- |
|
||||
| `OPENWEATHER_PROVIDER` | The weather provider to use, currently only `openweathermap` is supported | true | openweathermap |
|
||||
| `OPENWEATHER_API_KEY` | The OpenWeather API key | if enabled | |
|
||||
| `OPENWEATHER_TEMP_UNITS` | The temperature units to use, either `metric` or `imperial` | false | metric |
|
||||
@@ -51,13 +71,14 @@ Passport is a simple, fast, and lightweight web dashboard/new tab replacement.
|
||||
#### Uptime configuration
|
||||
|
||||
| Environment Variable | Description | Required | Default |
|
||||
| --- | --- | --- | --- |
|
||||
| ----------------------------- | ------------------------------------------------- | ---------- | ------- |
|
||||
| `UPTIMEROBOT_API_KEY` | The UptimeRobot API key | if enabled | |
|
||||
| `UPTIMEROBOT_UPDATE_INTERVAL` | The interval in seconds to update the uptime data | false | 300 |
|
||||
|
||||
### Adding links and categories
|
||||
|
||||
The admin dashboard can be accessed at `/admin`, you will be redirected to the login page if you are not logged in, use the credentials you configured in the `.env` file to login. Once logged in you can add links and categories.
|
||||
The admin dashboard can be accessed at `/admin`, you will be redirected to the login page if you are not logged in, use
|
||||
the credentials you configured via the environment variables to login. Once logged in you can add links and categories.
|
||||
|
||||
## License
|
||||
|
||||
|
||||
Reference in New Issue
Block a user