-
-
Save bonelifer/8b07d5bde9e703c2b903aa2fc87dd09d to your computer and use it in GitHub Desktop.
Script to migrate from Dashy (https://dashy.to/) to Homepage (https://gethomepage.dev/)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Script to migrate from Dashy (https://dashy.to/) to Homepage (https://gethomepage.dev/) | |
Get your config.yml from Dashy and place it in the same folder as this script. | |
Run the script with Python. | |
The script takes a list of known services that have Widgets in Dashy and tries to automatically match your existing entries to this list, to decide whether an entry should be a bookmark or a service entry. | |
Adjust MATCH_THRESHOLD as needed depending on how much your titles match service names. | |
""" | |
import yaml | |
import difflib | |
# Threshold for fuzzy matching (0.0 to 1.0) | |
MATCH_THRESHOLD = 0.85 | |
with open("dashy_config.yml", "r", encoding="utf-8") as f: | |
dashy_config = yaml.safe_load(f.read()) | |
homepage_bookmarks = [] | |
homepage_services = [] | |
KNOWN_SERVICES = """Adguard Home | |
Atsumeru | |
Audiobookshelf | |
Authentik | |
Autobrr | |
Azure DevOps | |
Bazarr | |
Caddy | |
Calendar | |
Calibre-web | |
Changedetection.io | |
Channels DVR Server | |
Cloudflare Tunnels | |
Coin Market Cap | |
Crowdsec | |
Custom API | |
Deluge | |
DeveLanCacheUI | |
Synology Disk Station | |
Synology Download Station | |
Emby | |
ESPHome | |
EVCC | |
Fileflows | |
Flood | |
FreshRSS | |
Frigate | |
FRITZ!Box | |
GameDig | |
Gatus | |
Ghostfolio | |
Gitea | |
Glances | |
Gluetun | |
Gotify | |
Grafana | |
HDHomerun | |
Health checks | |
Home Assistant | |
Homebox | |
Homebridge | |
iFrame | |
Immich | |
Jackett | |
JDownloader | |
Jellyfin | |
Jellyseerr | |
Kavita | |
Komga | |
Kopia | |
Lidarr | |
Linkwarden | |
LubeLogger | |
Mastodon | |
Mailcow | |
Mealie | |
Medusa | |
Mikrotik | |
Minecraft | |
Miniflux | |
MJPEG | |
Moonraker (Klipper) | |
Mylar3 | |
MySpeed | |
Navidrome | |
Netdata | |
NetAlertX | |
Nextcloud | |
NextDNS | |
Nginx Proxy Manager | |
NZBget | |
OctoPrint | |
Omada | |
Ombi | |
OpenDTU | |
OpenMediaVault | |
OPNSense | |
OpenWRT | |
Overseerr | |
Paperless-ngx | |
PeaNUT | |
pfSense | |
PhotoPrism | |
PiHole | |
Plant-it | |
Tautulli (Plex) | |
Plex | |
Portainer | |
Prometheus | |
Prowlarr | |
Proxmox | |
Proxmox Backup Server | |
Pterodactyl | |
Pyload | |
qBittorrent | |
QNAP | |
Radarr | |
Readarr | |
Romm | |
ruTorrent | |
SABnzbd | |
Scrutiny | |
Sonarr | |
Speedtest Tracker | |
Stash | |
Stocks | |
SWAG Dashboard | |
Syncthing Relay Server | |
Tailscale | |
Tandoor | |
Technitium DNS Server | |
Tdarr | |
Traefik | |
Transmission | |
TrueNas | |
Tube Archivist | |
Unifi Controller | |
Unmanic | |
Uptime Kuma | |
UptimeRobot | |
UrBackup | |
Vikunja | |
Watchtower | |
Wg-Easy | |
What's Up Docker | |
Xteve | |
Zabbix | |
Date & Time | |
Glances | |
Greeting | |
Kubernetes | |
Logo | |
Longhorn | |
Open-Meteo | |
OpenWeatherMap | |
Resources | |
Search | |
Stocks | |
Unifi Controller | |
Composerize | |
phpMyAdmin | |
myMPD | |
Firefly-III | |
mpd2chromecast | |
IsItDownOrJustMe | |
Bookstack | |
phpsysinfo | |
NPM Stats | |
LittleLinkCustom | |
Adminer | |
pgAdmin | |
Code Server | |
Heimdall | |
Firefly-III (Finanace) | |
HTTPD | |
Weather API""" | |
# Convert known services to a list and normalize | |
known_services_list = [service.strip().lower().replace(" ", "") for service in KNOWN_SERVICES.split("\n")] | |
def is_known_service(title): | |
""" | |
Check if a title matches any known service using fuzzy matching | |
""" | |
# Normalize the title | |
normalized_title = title.strip().lower().replace(" ", "") | |
# Use difflib to find the closest match | |
matches = difflib.get_close_matches(normalized_title, known_services_list, n=1, cutoff=MATCH_THRESHOLD) | |
return len(matches) > 0 | |
for dashy_section in dashy_config['sections']: | |
services_entries = [] | |
bookmarks_entries = [] | |
for dashy_entry in dashy_section['items']: | |
# Create entry with icon if it exists | |
entry = { | |
dashy_entry['title']: { | |
"href": dashy_entry["url"], | |
"description": dashy_entry.get("description", "") | |
} | |
} | |
# Add icon if it exists and isn't "favicon" | |
if "icon" in dashy_entry and dashy_entry["icon"] and dashy_entry["icon"] != "favicon": | |
entry[dashy_entry['title']]["icon"] = dashy_entry["icon"] | |
entry_bookmark = { | |
dashy_entry['title']: [{ | |
"href": dashy_entry["url"], | |
"abbr": dashy_entry['title'][0:2].upper() | |
}] | |
} | |
# Add icon to bookmark if it exists and isn't "favicon" | |
if "icon" in dashy_entry and dashy_entry["icon"] and dashy_entry["icon"] != "favicon": | |
entry_bookmark[dashy_entry['title']][0]["icon"] = dashy_entry["icon"] | |
# Check if the entry is a known service | |
if is_known_service(dashy_entry['title']): | |
services_entries.append(entry) | |
else: | |
bookmarks_entries.append(entry_bookmark) | |
# Only add sections that have entries | |
if services_entries: | |
homepage_services.append({ | |
dashy_section['name']: services_entries | |
}) | |
if bookmarks_entries: | |
homepage_bookmarks.append({ | |
dashy_section['name']: bookmarks_entries | |
}) | |
homepage_bookmarks = yaml.dump(homepage_bookmarks) | |
homepage_services = yaml.dump(homepage_services) | |
with open("services.yaml", "w+", encoding="utf-8") as f: | |
f.write(f"""--- | |
# For configuration options and examples, please see: | |
# https://gethomepage.dev/latest/configs/services | |
# Converted from Dashy | |
{homepage_services}""") | |
with open("bookmarks.yaml", "w+", encoding="utf-8") as f: | |
f.write(f"""--- | |
# For configuration options and examples, please see: | |
# https://gethomepage.dev/latest/configs/bookmarks | |
# Converted from Dashy | |
{homepage_bookmarks}""") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
changelog:
Used DeepSeek AI to add the following
Added icon link to conversion.
Added more apps/important websites:
Composerize
phpMyAdmin
myMPD
Firefly-III
mpd2chromecast
IsItDownOrJustMe
Bookstack
phpsysinfo
NPM Stats
LittleLinkCustom
Adminer
pgAdmin
Code Server
Heimdall
Firefly-III (Finanace)
HTTPD