Take server side encrypted notes for free, self hosted, WYSIWYG editor.
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github V0.3.2 - Updated README + Contributing guides + .github templates Nov 14, 2018
app V1.0.4 - readme updates + resolved 2 factor auth drift Jan 8, 2019
bin Initial commit Jul 18, 2018
config V0.3.0 - Start SamVer + Readme updates + bug fixes Nov 13, 2018
db Users with 2 factor auth done also association with Notes - till pt 12 Jul 21, 2018
lib Initial commit Jul 18, 2018
log Initial commit Jul 18, 2018
public Notes Scaffold with all views, encryption - till Pt 7 Jul 18, 2018
test Users with 2 factor auth done also association with Notes - till pt 12 Jul 21, 2018
tmp Initial commit Jul 18, 2018
vendor Initial commit Jul 18, 2018
zips V1.0.3 - upgrade rails 5.2.0 to 5.2.2 and zips folders Jan 8, 2019
zips_archive V1.0.3 - upgrade rails 5.2.0 to 5.2.2 and zips folders Jan 8, 2019
.gitignore V1.0.3 - upgrade rails 5.2.0 to 5.2.2 and zips folders Jan 8, 2019
.ruby-version Initial commit Jul 18, 2018
CODE_OF_CONDUCT.md V0.3.2 - Updated README + Contributing guides + .github templates Nov 14, 2018
CONTRIBUTING.md V0.3.2 - Updated README + Contributing guides + .github templates Nov 14, 2018
Dockerfile V1.0.1 - docker support for dev + readme updates Dec 27, 2018
Dockerfile_prod V1.0.2 - docker support for production + readme updates Dec 27, 2018
Gemfile V1.0.3 - upgrade rails 5.2.0 to 5.2.2 and zips folders Jan 8, 2019
Gemfile.lock V1.0.3 - upgrade rails 5.2.0 to 5.2.2 and zips folders Jan 8, 2019
LICENSE Initial commit Jul 21, 2018
README.md V1.0.4 - readme updates + resolved 2 factor auth drift Jan 8, 2019
Rakefile Initial commit Jul 18, 2018
config.ru Initial commit Jul 18, 2018
docker-compose.yml V1.0.2 - docker support for production + readme updates Dec 27, 2018
package.json Initial commit Jul 18, 2018

README.md

Abrays Notes

Note: This project is production ready, but still in early stages.

Visit Website here


Features

  • Simple UI & Material Design
  • SimpleMDE Editor - WYSIWYG(What You See Is What You Get)
  • Inline Editor Attachments
  • Users with Two Factor Authentication
  • Mobile friendly
  • Data Encryption
  • Shortcuts to navigate with Ease:
    • ctrl + f or ctrl + F - New Note
    • crtl + e or crtl + E - Edit Note
    • crtl + s or crtl + S - Save Note
    • ctrl + j or ctrl + J - Go Back
    • crtl + h or crtl + H - Go Home

Installation

Development:

Local server:

  1. You'll need Ruby version 2.5.1 and Rails 5.2.2. All of these can be installed using GoRails Setup Guide.

    • Make sure you select Ruby version 2.5.1 from dropdown! And make sure you run rbenv install 2.5.1, for now don't use future versions.
    • When you come to the step to install rails run gem install rails -v 5.2.2, for now don't use future versions.
    • That's it you have everything installed for local server.
  2. Get the copy of this repository and cd into it

    git clone https://github.com/abrays/notes.git
    cd notes
    
  3. Now you'll need 2 environment variables to assign:

    • DEVISE_SECRET_KEY - For Devise Gem user authentication purposes. To generate this run rake secret in your terminal
    • NOTES_PASS_KEY - For Encrypting and decrypting your notes. To generate this:
      # First enter to Ruby IRB by typing
      $ irb
      # Then generate a ramdom number
      require 'securerandom'
      SecureRandom.hex(16)
      # 4fc34061921c72fa5182b5bc393ac062
      # Copy whatever content you get like above
    • Simple method to add Environment variable is by editing your ~/.bashrc file:
      # At the bottom of the file
      export DEVISE_SECRET_KEY=YOUR KEY HERE
      export NOTES_PASS_KEY=YOUR KEY HERE
    • Then don't forget: source ~/.bashrc
  4. Run following commands: These will install required dependencies gems

    bundle install
    rake db:migrate
    # Now Run the server
    rails s -b 0.0.0.0 -p 3000
  5. now go to http://localhost:3000 and signup - That's it. You're good to go.


Docker:

  1. You'll need Docker to follow, you can install it for your platform here

  2. Fork this repo or just clone it with:

    $ git clone https://github.com/abrays/notes.git
    $ cd notes
  3. Optional: In the Dockerfile, you can change the ENV variables - NOTES_PASS_KEY and DEVISE_SECRET_KEY if you want to. You can see how to generate them from point 3 - here

  4. Then run:

    $ docker build -t notes .
    $ docker run -it -d -p 3000:3000 notes
  5. That's it, see your development version of Abrays Notes at http://localhost:3000



Production:

Your cloud Server:

  1. You'll need a VPS to host this on your website! We recommend using Digital Ocean - My Referral Link

  2. You'll need Ruby version 2.5.1, Rails 5.2.2 and MySQL for Database. All of these can be installed using GoRails Setup Guide.

    • Make sure you select Ruby version 2.5.1 from dropdown! And make sure you run rbenv install 2.5.1, for now don't use future versions.
    • When you come to the step to install rails run gem install rails -v 5.2.2, for now don't use future versions.
    • Setup your database to use MySQL and not Postgres
    • That's it you have everything installed.
  3. Setting up MySQL Database: (In CLI commands don't include $, also use some other username and password for MYSQL user.)

    # Login to mysql using CLI
    $ mysql -u root -p
    # Enter your mysql root password
    CREATE DATABASE notes_prod DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
    GRANT ALL ON notes_prod.* TO 'dbuser'@'localhost' IDENTIFIED BY 'password';
    FLUSH PRIVILEGES;
    EXIT;
  4. Now run RAILS_ENV=production bundle install in CLI.

  5. Now you'll need some ENV variables, we'll use built in Rails Credentials for these.

    • DEVISE_SECRET_KEY - For Devise Gem user authentication purposes. To generate this run rake secret in your terminal in rails app.
    • NOTES_PASS_KEY - For Encrypting and decrypting your notes. To generate this:
      # First enter to Ruby IRB by typing
      $ irb
      # Then generate a ramdom number
      require 'securerandom'
      SecureRandom.hex(16)
      # 4fc34061921c72fa5182b5bc393ac062
      # Copy whatever content you get like above
    • Then run EDITOR=nano rails credentials:edit in CLI and add these at the bottom:
      DEVISE_SECRET_KEY: YOUR_KEY
      NOTES_PASS_KEY: YOUR_KEY
      DATABASE_URL: "mysql2://dbuser:password@localhost/notes_prod"
    • This will generate 2 files config/credentials.yml.enc and config/master.key. You can add credentials.yml.enc to Git but not master/key - It must be kept private. However we've added both to.gitignore for security purpose.
  6. Now Run RAILS_ENV=production rake db:migrate


Docker:

  1. You'll need Docker and Docker Compose for this to work. We'll use built-in puma server.

  2. Fork this repo or just clone it with:

    $ git clone https://github.com/abrays/notes.git
    $ cd notes
  3. Optional: In the Dockerfile, you can change the ENV variables - NOTES_PASS_KEY and DEVISE_SECRET_KEY if you want to. You can see how to generate them from point 3 - here

  4. In config/environments/production.rb, change config.assets.js_compressor = :uglifier line to:

    # config.assets.js_compressor = :uglifier
    config.assets.js_compressor = Uglifier.new(harmony: true)
  5. Next, change production section in config/database.yml to below:

    production:
      adapter: mysql2
      database: notes_prod
      hostname: mysql
      username: root
      password: root
      pool: 5
      timeout: 5000
  6. Then run:

    $ docker-compose build
    $ docker-compose run web rails db:setup
  7. If the docker-compose run web rails db:setup fails, wait for around 30 seconds then re-run the command. This happens because mysql image takes time to spin up.

  8. Then run:

    $ docker-compose run web rake assets:precompile
    $ docker-compose up -d
  9. That's it, see your production version of Abrays Notes at http://localhost:3000



Next Steps:

  • : Production steps for Heroku Installation
  • : Installation of Docker for Development and Production

Contributing

If you would like to contribute, please check this contributing guide

Please check this Code of Conduct guide before contributing or having any kind of discussion(issues, pull requests etc.) with the Abrays Notes project!


Connect:

Need help? Questions? Or just say us hi!

  1. Abrays Discord Server
  2. Abrays Blog
  3. Gitter
  4. Facebook
  5. Instagram