1
0
mirror of https://github.com/Luzifer/cloudkeys-go.git synced 2024-09-19 15:42:58 +00:00
A small keepass alternative you can host by yourself
Go to file
Knut Ahlers 7bdc430812
Fix component naming
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2020-01-11 20:22:36 +01:00
coffee Handle information for user 2017-01-22 14:44:25 +01:00
cryptocore Add initial implementation of cryptocore 2018-11-04 16:46:57 +01:00
public Interface WIP 2018-11-05 12:20:29 +01:00
src Fix component naming 2020-01-11 20:22:36 +01:00
templates Fix: Broken script URLs 2017-12-08 13:20:38 +01:00
vendor Update vendoring using dep 2017-12-29 23:13:47 +01:00
.browserslistrc Interface WIP 2018-11-05 12:20:29 +01:00
.eslintrc.js Manually fix more linter errors 2020-01-11 19:11:23 +01:00
.gitignore Interface WIP 2018-11-05 12:20:29 +01:00
.repo-runner.yaml Switch to Github publishing 2017-12-08 12:58:02 +01:00
api_funcs.go Minor API fixes 2018-11-04 14:30:02 +01:00
api.go Reimplement Go server as API-Server 2018-11-04 11:50:03 +01:00
app.yaml.example AppEngine app.yaml example file 2017-12-28 01:28:44 +00:00
appengine.go split up main.go to different files to get the stuff running on GAE 2017-12-28 01:38:30 +00:00
assets.go Remove old assets, prepare adding Vue serving 2018-11-04 14:32:00 +01:00
babel.config.js Interface WIP 2018-11-05 12:20:29 +01:00
bindata.go Interface WIP 2018-11-05 12:20:29 +01:00
common.go Cleanup makefile, import path and bindata generation 2018-08-25 12:11:08 +02:00
config_default.go Add fix for config parsing into code 2017-12-29 21:49:50 +01:00
config_gae.go Add fix for config parsing into code 2017-12-29 21:49:50 +01:00
config.go Add fix for config parsing into code 2017-12-29 21:49:50 +01:00
dataObject.go Reimplement Go server as API-Server 2018-11-04 11:50:03 +01:00
Dockerfile Renew Dockerfile 2018-08-25 12:07:53 +02:00
Gopkg.lock Update vendoring using dep 2017-12-29 23:13:47 +01:00
Gopkg.toml Update vendoring using dep 2017-12-29 23:13:47 +01:00
gzip.go Reimplement Go server as API-Server 2018-11-04 11:50:03 +01:00
History.md prepare release v1.9.0 2017-12-30 11:48:40 +01:00
LICENSE Update Meta-Files 2017-12-08 12:57:04 +01:00
main.go Cleanup makefile, import path and bindata generation 2018-08-25 12:11:08 +02:00
Makefile Manually fix more linter errors 2020-01-11 19:11:23 +01:00
package-lock.json Add linting 2020-01-11 17:33:12 +01:00
package.json Add linting 2020-01-11 17:33:12 +01:00
postcss.config.js Interface WIP 2018-11-05 12:20:29 +01:00
Procfile Added Procfile for Heroku 2015-07-30 18:24:11 +02:00
README.md changed documentation 2017-12-30 00:03:00 +00:00
router.go Remove old assets, prepare adding Vue serving 2018-11-04 14:32:00 +01:00
server.go Remove old assets, prepare adding Vue serving 2018-11-04 14:32:00 +01:00
sessionData.go Reimplement Go server as API-Server 2018-11-04 11:50:03 +01:00
storage.go Reimplement Go server as API-Server 2018-11-04 11:50:03 +01:00
storageLocal.go introduced context to all http handlers and use a specific http client 2017-12-28 01:40:20 +00:00
storageRedis.go introduced context to all http handlers and use a specific http client 2017-12-28 01:40:20 +00:00
storageS3.go introduced context to all http handlers and use a specific http client 2017-12-28 01:40:20 +00:00
vue.config.js Interface WIP 2018-11-05 12:20:29 +01:00

Go Report Card

CloudKeys Go

CloudKeys Go is a port of the former CloudKeys project written in PHP. This Go port is 100% compatible to the data written by the older version but adds more storage options. Also it's faster, more stable and last but not least it's not longer based on PHP but working as a tiny webserver implemented in pure Go.

Usage

# cloudkeys-go --help
Usage of ./cloudkeys-go:
      --cookie-authkey="": Key used to authenticate the session
      --cookie-encryptkey="": Key used to encrypt the session
      --listen=":3000": IP and port to listen on
      --password-salt="": A random unique salt for encrypting the passwords
      --storage="local:///./data": Configuration for storage adapter (see README.md)
      --username-salt="": A random unique salt for encrypting the usernames

What you definitely should set when starting the server:

  • cookie-authkey - This flag protects the encrypted cookies you're putting on the users computers containing the session. If you don't set it yourself it will be randomly generated. In that case your users will get logged out every time you restart the server. You need to use a key with length of 16 characters (AES128) or 32 characters (AES256).
  • cookie-encryptkey - This flag is the encryption key itself. Like the authkey it will get autogenerated with the same result. You need to use a key with length of 16 characters (AES128) or 32 characters (AES256).
  • password-salt - [deprecated] In version <=v1.6.1 the password was hashed with a static salt. You only need to provide this if you started using Cloudkeys in one of those versions.
  • username-salt - The usernames are the keys in the database. They are hashed but you can put an additional salt to them to make it harder to decipher them.

If you don't want to define the secrets using command line flags you also can use environment variables to set those flags:

FLAG                ENV-Variable

password-salt       passwordSalt
username-salt       usernameSalt
storage             storage
listen              listen
cookie-authkey      authkey
cookie-encryptkey   encryptkey

Supported storage engines

Local file storage (default)

This storage engine is used in the default config when you just start up the server as you can see in the output above. You don't have many options to set for this one. The only thing is the path where all the data is stored.

Schema:  local:///<your data directory>
Example: local:///./data

The directory can be set absolute or relative. Please ensure there are 3 slashes between local: and the begin of your path. (So if you're setting an absolute path you will set 4 slashes in a row.)

Amazon Web Services S3

This is the storage engine you want to use if you're migrating from the old CloudKeys version. This option is fully compatible to every piece of data the old version stored.

Schema:  s3://<bucket><path>
Example: s3://mybucket/

You can specify the bucket and also a prefix for the storage. That way you even could use one bucket for different instances of CloudKeys Go. In case you're migrating from the old version you need to set the path to /.

For this to work you also need to set three environment variables: AWS_ACCESS_KEY, AWS_SECRET_ACCESS_KEY and AWS_REGION. When its about AWS_REGION pay attention to select the right region for your bucket.

Redis

If you want to utilize a Redis storage server or even a Redis cluster you can choose this storage type. Authentication is supported as well as selecting the database to use. Aditionally you can set a prefix for the keys.

Schema:  redis+tcp://auth:<password>@127.0.0.1:6379/<db>?timeout=10s&maxidle=1&prefix=<prefix>
Example: redis+tcp://auth:mypass@redis.example.com:6379/5?prefix=cloudkeys::

Install on Heroku

  1. Create a new Heroku app

    # heroku create -b https://github.com/heroku/heroku-buildpack-go
    
  2. Push the code to your app

    # git push heroku master
    
  3. Set your configuration variables in the Heroku apps dashboard (see env variables in usage section above)

Install on Google App Engine

  1. Prepare the repository for GAE environment and get the current libraries

    $ make prepare-gae-deploy && go get -v -u ./...
    
  2. Create app.yaml and set the correct settings

    $ copy app.yaml.example app.yaml
    
  3. Deploy on App Engine

    $ appcfg.py update .