hetzner 0.7.1.0 → 0.7.1.1
raw patch · 6 files changed
+13/−132 lines, 6 filesdep −blaze-htmldep −directorydep ~basePVP ok
version bump matches the API change (PVP)
Dependencies removed: blaze-html, directory
Dependency ranges changed: base
API changes (from Hackage documentation)
Files
- apps/Docs.hs +0/−104
- changelog.md +5/−1
- hetzner.cabal +5/−13
- license +1/−1
- readme.md +1/−6
- src/Hetzner/Cloud.hs +1/−7
− apps/Docs.hs
@@ -1,104 +0,0 @@--module Main (main) where---- base-import Data.Foldable (forM_)-import Data.List (sortOn)-import Data.Maybe (isNothing)--- hetzner-import Hetzner.Cloud qualified as Hetzner--- bytestring-import qualified Data.ByteString.Lazy as ByteString--- directory-import System.Directory (createDirectoryIfMissing)--- blaze-html-import Text.Blaze.Html (toHtml, preEscapedToHtml, (!))-import Text.Blaze.Html.Renderer.Utf8 (renderHtml)-import Text.Blaze.Html5 qualified as H-import Text.Blaze.Html5.Attributes qualified as A--- time-import Data.Time.Clock.POSIX (getPOSIXTime)--main :: IO ()-main = do- mtoken <- Hetzner.getTokenFromEnv- token <- maybe (fail "HETZNER_API_TOKEN is not set") pure mtoken- now <- round <$> getPOSIXTime :: IO Int- -- Server types- let serverTypesFP = "public/server-types"- createDirectoryIfMissing True serverTypesFP- serverTypes0 <- Hetzner.streamToList $ Hetzner.streamPages $ Hetzner.getServerTypes token- let maxPrice = maximum . (:) 0- . fmap (Hetzner.grossPrice . Hetzner.monthlyPrice)- . Hetzner.serverPricing- let serverTypes = sortOn maxPrice $ filter (not . Hetzner.serverDeprecated) serverTypes0- ByteString.writeFile (serverTypesFP ++ "/index.html") $ renderHtml $ H.docTypeHtml $ do- H.head $ do- H.title "Hetzner Server Type List"- H.link ! A.rel "stylesheet" ! A.href "https://use.typekit.net/yxf7kgr.css"- H.link ! A.rel "stylesheet" ! A.href "../common.css"- H.body $ do- H.h1 "Hetzner Server Type List"- H.hr- H.table $ do- H.tr ! A.class_ "hrow" $ do- H.th "Server Type ID"- H.th "Name"- H.th "Architecture"- H.th "Cores"- H.th "Memory"- H.th "Disk"- H.th "CPU Type"- H.th "Max Monthly Price"- forM_ serverTypes $ \serverType -> H.tr $ do- H.td $ (\(Hetzner.ServerTypeID i) -> toHtml i) $ Hetzner.serverTypeID serverType- H.td $ toHtml $ Hetzner.serverTypeName serverType- H.td $ toHtml $ show $ Hetzner.serverArchitecture serverType- H.td $ toHtml $ Hetzner.serverCores serverType- H.td $ toHtml $ show (Hetzner.serverMemory serverType) ++ " GB"- H.td $ toHtml $ show (Hetzner.serverDisk serverType) ++ " GB"- H.td $ toHtml $ case Hetzner.serverCPUType serverType of- Hetzner.SharedCPU -> "Shared" :: String- Hetzner.DedicatedCPU -> "Dedicated"- H.td $ toHtml $ show (maxPrice serverType) ++ " €"- H.p $ H.em $ do- "Updated "- H.script $ preEscapedToHtml $- "const date = new Date(" ++ show (now * 1000) ++ "); "- ++ "document.write(date.toLocaleString());"- "."- -- Images- let imagesFP = "public/images"- createDirectoryIfMissing True imagesFP- images0 <- Hetzner.streamToList $ Hetzner.streamPages $ Hetzner.getImages token- let images = sortOn (show . Hetzner.imageName)- $ filter (isNothing . Hetzner.imageDeprecated) images0- print images- ByteString.writeFile (imagesFP ++ "/index.html") $ renderHtml $ H.docTypeHtml $ do- H.head $ do- H.title "Hetzner Image List"- H.link ! A.rel "stylesheet" ! A.href "https://use.typekit.net/yxf7kgr.css"- H.link ! A.rel "stylesheet" ! A.href "../common.css"- H.body $ do- H.h1 "Hetzner Image List"- H.p "These are the images available by default. Your project might have other images available in addition to these."- H.hr- H.table $ do- H.tr ! A.class_ "hrow" $ do- H.th "Image ID"- H.th "Name"- H.th "OS Flavor"- H.th "Architecture"- H.th "Size"- forM_ images $ \image -> H.tr $ do- H.td $ (\(Hetzner.ImageID i) -> toHtml i) $ Hetzner.imageID image- H.td $ toHtml $ Hetzner.imageName image- H.td $ toHtml $ show $ Hetzner.imageOSFlavor image- H.td $ toHtml $ show $ Hetzner.imageArchitecture image- H.td $ toHtml $ show (Hetzner.imageDiskSize image) ++ " GB"- H.p $ H.em $ do- "Updated "- H.script $ preEscapedToHtml $- "const date = new Date(" ++ show (now * 1000) ++ "); "- ++ "document.write(date.toLocaleString());"- "."
changelog.md view
@@ -1,3 +1,7 @@+## 0.7.1.1+* Metadata update.+* Remove server type and image list webpages.+ ## 0.7.1.0 * Introduce `HasActions` typeclass. @@ -10,7 +14,7 @@ ## 0.6.0.0 * Add new fields to the `Image` type: `imageArchitecture`, `imageName`.-* Add [image list webpage](https://daniel-casanueva.gitlab.io/haskell/hetzner/images).+* Add image list webpage. ## 0.5.0.0 * Do not export internal fingerprint parser.
hetzner.cabal view
@@ -2,13 +2,13 @@ category: Cloud synopsis: Hetzner Cloud and DNS library. description: Hetzner Cloud and DNS library. Check the readme and documentation for more details.-version: 0.7.1.0+version: 0.7.1.1 cabal-version: 1.18 build-type: Simple-author: Daniel Casanueva (daniel.casanueva `at` proton.me)-maintainer: Daniel Casanueva (daniel.casanueva `at` proton.me)-homepage: https://gitlab.com/daniel-casanueva/haskell/hetzner-bug-reports: https://gitlab.com/daniel-casanueva/haskell/hetzner/-/issues+author: Daniel Casanueva (coding `at` danielcasanueva.eu)+maintainer: Daniel Casanueva (coding `at` danielcasanueva.eu)+homepage: https://codeberg.org/daniel-casanueva/hetzner+bug-reports: https://codeberg.org/daniel-casanueva/hetzner/issues license: MIT license-file: license extra-doc-files: readme.md, changelog.md@@ -43,11 +43,3 @@ ghc-options: -Wall -Wunused-packages default-extensions: ImportQualifiedPost, OverloadedStrings build-depends: base, hetzner--executable hetzner-docs- default-language: Haskell2010- hs-source-dirs: apps- main-is: Docs.hs- ghc-options: -Wall -Wunused-packages- default-extensions: ImportQualifiedPost, OverloadedStrings- build-depends: base, bytestring, directory, blaze-html, hetzner, time
license view
@@ -1,6 +1,6 @@ MIT License -Copyright (c) 2023 Daniel Díaz Casanueva+Copyright (c) 2025 Daniel Díaz Casanueva Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal
readme.md view
@@ -10,15 +10,10 @@ This library doesn't cover (at least, not yet) the enterity of Hetzner's API. However, if there's anything you would like to see added, feel free to-[open an issue](https://gitlab.com/daniel-casanueva/haskell/hetzner/-/issues/new).+[open an issue](https://codeberg.org/daniel-casanueva/hetzner/issues/new). If it's urgent, send me an email. I mainly add features only when I myself need them, but I'd be happy to extend the library upon request. Of course, if you can contribute with a merge request, that'd be greatly appreciated. The only ask I have if you decide to contribute is to follow more or less the naming and styling already used in the rest of the library. Thanks!--## Documentation--Find documentation from the main (potentially unreleased) branch-[here](https://daniel-casanueva.gitlab.io/haskell/hetzner/doc).
src/Hetzner/Cloud.hs view
@@ -620,7 +620,7 @@ => ByteString -- ^ Method -> ByteString -- ^ Path -> Maybe body -- ^ Request body. You may use 'noBody' to skip.- -> Token -- ^ Authorization token+ -> Token -- ^ Authentication token -> Maybe Int -- ^ Page -> IO a cloudQuery method path mbody (Token token) mpage = do@@ -1348,9 +1348,6 @@ <*> o .: "labels" -- | Get images.------ A regularly updated list of images can be found--- [here](https://daniel-casanueva.gitlab.io/haskell/hetzner/images). getImages :: Token -> Maybe Int -- ^ Page.@@ -1997,9 +1994,6 @@ <*> o .: "storage_type" -- | Get all server types.------ A regularly updated list of server types can be browsed--- [here](https://daniel-casanueva.gitlab.io/haskell/hetzner/server-types). getServerTypes :: Token -> Maybe Int -> IO (WithMeta "server_types" [ServerType]) getServerTypes = cloudQuery "GET" "/server_types" noBody