packages feed

github-backup 1.20191219 → 1.20200721

raw patch · 6 files changed

+38/−28 lines, 6 files

Files

CHANGELOG view
@@ -1,3 +1,10 @@+github-backup (1.20200721) unstable; urgency=medium++  * Removed support for GITHUB_USER/GITHUB_PASSWORD since github will soon+    remove support for http basic auth. Use GITHUB_OAUTH_TOKEN instead.++ -- Joey Hess <id@joeyh.name>  Tue, 21 Jul 2020 23:24:03 -0400+ github-backup (1.20191219) unstable; urgency=medium    * Updated to use github-0.23 (0.24 needs larger changes)
Github/GetAuth.hs view
@@ -1,27 +1,30 @@ module Github.GetAuth where  import Utility.Env-import Utility.Monad+import Data.Maybe+import System.IO +import Common import qualified GitHub.Auth as Github-import Data.Text.Encoding (encodeUtf8)-import qualified Data.Text as T import qualified Data.ByteString.UTF8 as B  getAuth :: IO (Maybe Github.Auth)-getAuth = getM id-	[ do-		user <- getEnv "GITHUB_USER"-		password <- getEnv "GITHUB_PASSWORD"-		return $ case (user, password) of-			(Just u, Just p) -> Just $ -				Github.BasicAuth (tobs u) (tobs p)-			_ -> Nothing-	, do-		oauthtoken <- getEnv "GITHUB_OAUTH_TOKEN"-		return $ case oauthtoken of-			Just t -> Just $ Github.OAuth (B.fromString t)-			Nothing -> Nothing-	]-  where-	tobs = encodeUtf8 . T.pack+getAuth = do+	oauthtoken <- getEnv "GITHUB_OAUTH_TOKEN"+	case oauthtoken of+		Just t -> return $ Just $ Github.OAuth (B.fromString t)+		Nothing -> do+			checkDeprecatedVars+			return Nothing++checkDeprecatedVars :: IO ()+checkDeprecatedVars = do+	user <- getEnv "GITHUB_USER"+	password <- getEnv "GITHUB_PASSWORD"+	when (isJust user && isJust password) $+		hPutStrLn stderr $ unwords+			[ "GITHUB_USER and GITHUB_PASSWORD are no longer"+			, "supported, because Github is removing that"+			, "authentication method."+			, "Set GITHUB_OAUTH_TOKEN instead."+			]
README.md view
@@ -90,9 +90,9 @@ Bear in mind that this uses the GitHub API; don't run it every 5 minutes. GitHub [rate limits](http://developer.github.com/v3/#rate-limiting) the API to some small number of requests per hour when used without-authentication. To avoid this limit, you can set `GITHUB_USER` and-`GITHUB_PASSWORD` (or `GITHUB_OAUTH_TOKEN` obtained from-<https://github.com/settings/tokens>) in the environment and+authentication. To avoid this limit, you can set the environment+variable `GITHUB_OAUTH_TOKEN` to a token obtained from +<https://github.com/settings/tokens> and it will log in when making (most) API requests.  Anyway, github-backup *does* do an incremental backup, picking up where it
github-backup.1 view
@@ -17,7 +17,6 @@ the name of an organization using GitHub.) .PP By default it runs without logging in to GitHub. To log in, set-the GITHUB_USER and GITHUB_PASSWORD environment variables. Or, set GITHUB_OAUTH_TOKEN to an oath or personal access token. However note that logging in only works around API rate limiting; it does not allow private repositories to be downloaded.
github-backup.cabal view
@@ -1,6 +1,6 @@ Name: github-backup-Version: 1.20191219-Cabal-Version: >= 1.8+Version: 1.20200721+Cabal-Version: >= 1.10 Maintainer: Joey Hess <id@joeyh.name> Author: Joey Hess Stability: Stable@@ -33,6 +33,7 @@ Executable github-backup   Main-Is: github-backup.hs   GHC-Options: -Wall -fno-warn-tabs -threaded+  Default-Language: Haskell98   Build-Depends:     base (>= 4.8 && < 5),     github (>= 0.23 && < 0.24),@@ -102,6 +103,7 @@ Executable gitriddance   Main-Is: gitriddance.hs   GHC-Options: -Wall -fno-warn-tabs+  Default-Language: Haskell98   Build-Depends:      base (>= 4.8 && < 5),     github (>= 0.23 && < 0.24),
gitriddance.1 view
@@ -20,8 +20,7 @@ .IP git config core.gitriddance "Please submit patches to http://ikiwiki.info/todo/" .PP-In order for gitriddance to log into GitHub, you need to set -the GITHUB_USER and GITHUB_PASSWORD environment variables.-Or, set GITHUB_OAUTH_TOKEN to an oath or personal access token.+In order for gitriddance to log into GitHub, you need to set+GITHUB_OAUTH_TOKEN to an oath or personal access token. .SH AUTHOR  Joey Hess <id@joeyh.name>