Skip to content
/ jay Public

Jay is a simple markdown editor for memo and taking minutes

License

Notifications You must be signed in to change notification settings

nomlab/jay

Repository files navigation

README

What is jay?

jay is a simple markdown editor for memo and taking minutes

Setup Ruby Environment

Ruby3.0.0
Rails6.1.3

I recommend you to install new Ruby and Bundler on the top of Rbenv before install jay.

  1. Install rbenv + ruby-build (check https://github.com/sstephenson/rbenv#basic-github-checkout for details)
    $ git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
    $ git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
    # Edit your shell dot files to add some path and environment variables.
        
  2. Install Ruby and Bundler
    # Install ruby 3.0.0
    $ rbenv install 3.0.0
    
    # Installation check
    $ rbenv global 3.0.0
    $ ruby -v # -> You will see: ruby 3.0.0...
    
    # Install bundler for your new Ruby
    $ gem install bundler
    
    # Activate bundler
    $ rbenv rehash
    
    # Get back to your system default Ruby if you want
    $ rbenv global system # say, /usr/bin/ruby
    $ ruby -v
        

Install jay

Clone jay

  1. clone jay from github
    $ git clone https://github.com/nomlab/jay.git ~/Programs/jay
        
  2. Setup to use installed ruby
    $ cd ~/Programs/jay
    $ ruby -v # -> You will see: ruby 3.0.0...
        

Setup config files

  1. Install vendor/bundle stuffs
    $ bundle install --path vendor/bundle
        
  2. Setup secret key
    $ bundle exec rake secret # -> You will see: foobarbuz... Copy the string.
    $ vim config/secrets.yml # -> Replace all <SECRETKEY> with the string outputted
        
  3. Initialize application settings from sample
    $ cp config/application_settings_sample.yml config/application_settings.yml
        
  4. Set your github organization
    $ vim config/application_settings.yml
    # Set as the following if your organization name is foobarbuz:
    # default: &default
    #   github:
    #     organization: foobarbuz
        
  5. Setup GitHub OAuth
    1. Register a new OAuth application
      Authorization callback URL
      http://example.com/auth/github/callback
    2. Set client id, client secret, allowed team id
      $ vim config/application_settings.yml
      # Set as the following:
      # default: &default
      #   oauth:
      #     github:
      #       client_id: foo
      #       client_secret: bar
      #       ## allowed_team_id is a github team id adllowed to login.
      #       ## It can be checked by:
      #       ##   curl -u [your-github-account] https://api.github.com/orgs/:org/teams
      #       allowed_team_id: buz
              
  6. Setup incoming webhook
    • GitHub
      1. Generate token
        $ bundle exec rake secret # -> You will see: foobarbuz... Copy the string.
                    
      2. Add webhook to your repository
        Payload URL
        http://example.com/incoming_webhook/github
        Secret
        foobarbuz…
        Which events would you like to trigger this webhook?
        Let me select individual events. -> Issues
      3. Set strategy and token
        $ vim config/application_settings.yml
        # Set as the following:
        # default: &default
        #  incoming_webhooks:
        #    - strategy: github
        #      token: foobarbuz
                    
  7. create master.key
    $ EDITOR='vi' bundle exec rails credential:edit
        
  8. Setup DB
    $ bundle exec rake db:migrate
    $ bundle exec rake db:migrate RAILS_ENV=production
        

Setup by Docker

  1. Clone jay from github
    $ git clone https://github.com/nomlab/jay.git ~/Programs/jay
    $ cd ~/Programs/jay
        
  2. Setup application settings
    1. See above items 3 ~ 6
  3. Setup jay image
    $ ./scripts/setup-docker.sh jay
    # Replace "jay" with the name of user that runs jay container
        

Launch jay

development

# start
$ export RAILS_ENV="development"
$ export RAILS_SERVE_STATIC_FILES=true
$ bundle exec rails server -p 3000 -d -e "$RAILS_ENV"
$ open http://localhost:3000

# stop
$ kill $(cat tmp/pids/server.pid)

production

# start
$ export RAILS_ENV="production"
$ export RAILS_SERVE_STATIC_FILES=true
$ bundle exec rails server -p 3000 -d -e "$RAILS_ENV"
$ bundle exec rake assets:precompile RAILS_ENV="$RAILS_ENV"
$ bundle exec rake assets:precompile:image
$ open http://localhost:3000

# stop
$ kill $(cat tmp/pids/server.pid)

launch production by Docker

# start with foreground
$ ./scripts/jay-docker.sh start

# start with background
$ ./scripts/jay-docker.sh start -d

# stop
$ ./scripts/jay-docker.sh stop

systemd

settings

  1. Copy service file to systemd service directory
    $ sudo cp systemd_conf/jay.service /etc/systemd/system/jay.service
        
  2. Change below settings in service file to suit your environment
    1. Path of jay
    2. Port to bind

launch

# manual start
$ sudo systemctl start jay

# manual stop
$ sudo systemctl stop jay

# check status
$ sudo systemctl status jay

About

Jay is a simple markdown editor for memo and taking minutes

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published