anubis.go 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. // Package anubis contains the version number of Anubis.
  2. package anubis
  3. import "time"
  4. // Version is the current version of Anubis.
  5. //
  6. // This variable is set at build time using the -X linker flag. If not set,
  7. // it defaults to "devel".
  8. var Version = "devel"
  9. // CookieName is the name of the cookie that Anubis uses in order to validate
  10. // access.
  11. const CookieName = "techaro.lol-anubis-auth"
  12. // WithDomainCookieName is the name that is prepended to the per-domain cookie used when COOKIE_DOMAIN is set.
  13. const WithDomainCookieName = "techaro.lol-anubis-auth-for-"
  14. const TestCookieName = "techaro.lol-anubis-cookie-test-if-you-block-this-anubis-wont-work"
  15. // CookieDefaultExpirationTime is the amount of time before the cookie/JWT expires.
  16. const CookieDefaultExpirationTime = 7 * 24 * time.Hour
  17. // BasePrefix is a global prefix for all Anubis endpoints. Can be emptied to remove the prefix entirely.
  18. var BasePrefix = ""
  19. // StaticPath is the location where all static Anubis assets are located.
  20. const StaticPath = "/.within.website/x/cmd/anubis/"
  21. // APIPrefix is the location where all Anubis API endpoints are located.
  22. const APIPrefix = "/.within.website/x/cmd/anubis/api/"
  23. // DefaultDifficulty is the default "difficulty" (number of leading zeroes)
  24. // that must be met by the client in order to pass the challenge.
  25. const DefaultDifficulty = 4