fix font family and bugs, better docs
This commit is contained in:
25
README.md
25
README.md
@@ -18,16 +18,27 @@ Passport is a simple, fast, and lightweight web dashboard/new tab replacement.
|
|||||||
### Usage
|
### Usage
|
||||||
|
|
||||||
1. Clone the repository
|
1. Clone the repository
|
||||||
2. Configure the `.env` file, an example is provided in the `.env example` file
|
2. Configure the `.env` file, an example is provided in the `.env.example` file, see below for every available environment variable
|
||||||
- The `OPENWEATHER_API_KEY` is required for the weather data to be displayed, if you want to disable the weather data, set `PASSPORT_ENABLE_WEATHER` to `false`
|
|
||||||
- The `OPENWEATHER_LAT` and `OPENWEATHER_LON` are required for the weather data to be displayed
|
|
||||||
- The `PASSPORT_ADMIN_USERNAME` and `PASSPORT_ADMIN_PASSWORD` are required for the admin dashboard
|
|
||||||
- The `PASSPORT_SEARCH_PROVIDER` is the search provider used for the search bar, %s is replaced with the search query
|
|
||||||
- The `UPTIMEROBOT_API_KEY` is required for the uptime data to be displayed, if you want to disable the uptime data, set `PASSPORT_ENABLE_UPTIME` to `false`
|
|
||||||
3. Run `zqdgr build` to build a standalone binary
|
|
||||||
4. Deploy `passport` to your web server
|
4. Deploy `passport` to your web server
|
||||||
5. profit
|
5. profit
|
||||||
|
|
||||||
|
#### Configuration
|
||||||
|
|
||||||
|
| Environment Variable | Description | Required | Default |
|
||||||
|
| --- | --- | --- | --- |
|
||||||
|
| `PASSPORT_DEV_MODE` | Enables dev mode | false | false |
|
||||||
|
| `PASSPORT_ENABLE_WEATHER` | Enables weather data, requires an OpenWeather API key | false | true |
|
||||||
|
| `PASSPORT_ENABLE_UPTIME` | Enables uptime data, requires an UptimeRobot API key | false | true |
|
||||||
|
| `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 | true |
|
||||||
|
| `OPENWEATHER_API_KEY` | The OpenWeather API key | if enabled |
|
||||||
|
| `OPENWEATHER_LAT` | The latitude of your location | if enabled |
|
||||||
|
| `OPENWEATHER_LON` | The longitude of your location | if enabled |
|
||||||
|
| `OPENWEATHER_UPDATE_INTERVAL` | The interval in minutes to update the weather data | false | 15 |
|
||||||
|
| `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
|
### 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 in the `.env` file to login. Once logged in you can add links and categories.
|
||||||
|
|||||||
7
main.go
7
main.go
@@ -135,7 +135,7 @@ func NewUptimeManager() *UptimeManager {
|
|||||||
|
|
||||||
updateInterval, err := strconv.Atoi(os.Getenv("UPTIMEROBOT_UPDATE_INTERVAL"))
|
updateInterval, err := strconv.Atoi(os.Getenv("UPTIMEROBOT_UPDATE_INTERVAL"))
|
||||||
if err != nil || updateInterval < 1 {
|
if err != nil || updateInterval < 1 {
|
||||||
updateInterval = 5
|
updateInterval = 300
|
||||||
}
|
}
|
||||||
|
|
||||||
uptimeManager := &UptimeManager{
|
uptimeManager := &UptimeManager{
|
||||||
@@ -159,7 +159,7 @@ func (u *UptimeManager) getUptime() []UptimeRobotSite {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (u *UptimeManager) updateWorker() {
|
func (u *UptimeManager) updateWorker() {
|
||||||
ticker := time.NewTicker(time.Duration(u.updateInterval) * time.Minute)
|
ticker := time.NewTicker(time.Duration(u.updateInterval) * time.Second)
|
||||||
defer ticker.Stop()
|
defer ticker.Stop()
|
||||||
|
|
||||||
for {
|
for {
|
||||||
@@ -196,8 +196,6 @@ func (u *UptimeManager) update() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Printf("%+v", monitors.Monitors)
|
|
||||||
|
|
||||||
u.mutex.Lock()
|
u.mutex.Lock()
|
||||||
u.sites = monitors.Monitors
|
u.sites = monitors.Monitors
|
||||||
u.lastUpdate = time.Now()
|
u.lastUpdate = time.Now()
|
||||||
@@ -675,7 +673,6 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if os.Getenv("PASSPORT_ENABLE_UPTIME") != "false" {
|
if os.Getenv("PASSPORT_ENABLE_UPTIME") != "false" {
|
||||||
fmt.Printf("%+v", app.UptimeManager.getUptime())
|
|
||||||
renderData["UptimeData"] = app.UptimeManager.getUptime()
|
renderData["UptimeData"] = app.UptimeManager.getUptime()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,10 @@
|
|||||||
font-display: swap;
|
font-display: swap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
:root {
|
||||||
|
--default-font-family: "Instrument Sans", ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
|
||||||
|
}
|
||||||
|
|
||||||
html {
|
html {
|
||||||
line-height: normal;
|
line-height: normal;
|
||||||
color-scheme: dark;
|
color-scheme: dark;
|
||||||
|
|||||||
Reference in New Issue
Block a user