百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
M

morph

> DevOps
开源

把麻烦从网络刮去

480 stars0 点赞3 次浏览
访问官网GitHub

工具介绍

把麻烦从网络刮去

morph.io: A scraping platform

  • A Heroku lookalike system for Scrapers
  • All code and collaboration through GitHub
  • Write your scrapers in Ruby, Python, PHP, Perl or JavaScript (NodeJS, PhantomJS)
  • Simple API to grab data
  • Schedule scrapers or run manually
  • Process isolation via Docker
  • Email alerts for broken scrapers

Dependencies

Ruby, Docker, MySQL, SQLite 3, Redis, mitmproxy. (See below for more details about installing Docker)

Provisioning using Ansible

An ansible playbook is provided to provision:

  • staging on a local Vagrant VM
  • production

Read the provisioning README for further details.

Requirements

  • A supported version of Ubuntu LTS, macOS/X or MS Windows is required.
  • 8 GB of memory is the minimum, 16 GB is recommended
  • SSD Disk

Coding Standards

  • Must pass RuboCop (as configured in .rubocop.yml) to encourage good practices
  • Must pass RSpec tests – please write specs for any new code
  • Be nice to other developers and future you:
    • Clear, descriptive naming - code should tell you what it's doing
    • Add comments to explain WHY – when it's not obvious from the code itself
    • Keep methods small – ideally one paragraph, definitely under one screen page
    • Split large files – keep files /users/auth/github/callback
    • Change the port for the local urls if you are not using the default port 3000 for the rails app
  • Add an image - you can use the standard logo at app/assets/images/logo.png (you can add this after the app is created)
  • If the webhooks are active and being used in production (currently not the case) then you'll also need to:
    • add a "Webhook secret" for security.
    • add a "Webhook URL" - the ngrok url with /github/webhook on the end

For staging servers, you will need to add the callback url.

  • User settings switch context to Open Australia (if you have sufficient permissions), otherwise you will need to use an app under your personal or an organisation you have permission for.
  • Navigate to Developer Settings
  • Under GitHub Apps you should have a Morph.io app
  • Click Edit and scroll down to the "Identifying and authorizing users" section
  • Click "Add Callback URL" if your url is not already present, eg:
    • https://morph-staging.thesite.info/users/auth/github/callback

Next you'll need to fill in some values in the .env file which come from the GitHub App that you've just created.

  • GITHUB_APP_ID - Look for "App ID" near the top of the page. This should be an integer
  • GITHUB_APP_NAME - Look for "Public link". The name is what appears after "https://github.com/settings/apps/". It's essentially a url happy version of the name you gave the app.
  • GITHUB_APP_CLIENT_ID - Look for "Client ID" near the top of the page.
  • GITHUB_APP_CLIENT_SECRET - Go to "Generate a new client secret".
  • GITHUB_APP_INSTALLED_BY - A user that has installed the app (used by tests)

Also, a private key for the GitHub app is needed. This can be generated by clicking the "Generate a private key" button and will be automatically downloaded. Move and rename it to config/morph-github-app.private-key.pem.

For the staging server it will need to be copied to: deploy@morph-staging:/var/www/shared/config/morph-github-app.private-key.pem And it should have permission 0600 and be owned by deploy user. You may have to add write perms to this file first using chmod +w /var/www/shared/config/morph-github-app.private-key.pem, if the staging server is a clone of production as otherwise you won't be able to update it.

Now setup the databases:

bundle exec dotenv rake db:setup

Now you can start the server

bundle exec dotenv foreman start

and point your browser at http://127.0.0.1:3000

To get started, log in with GitHub. There is a simple admin interface accessible at http://127.0.0.1:3000/admin. To access this, run the following to give your account admin rights:

bundle exec rake app:promote_to_admin

Testing

See TESTING.md for automated and manual testing instructions.

Guard Livereload

We use Guard and Livereload so that whenever you edit a view in development the web page gets automatically reloaded. It's a massive time saver when you're doing design or lots of work in the view. To make it work run

bundle exec guard

Guard will also run tests when files change. See TESTING.md for how to control which tests are run.

Mail in development

By default in development mails are sent to Mailcatcher. To install

gem install mailcatcher

Rubymine specific advice

Disable Spring in RubyMine:

Under Run → Edit Configurations → your RSpec configuration, set Environment variable: DISABLE_SPRING=1

Deploying to production

This section will not be relevant to most people. It will however be relevant if you're deploying to a production server.

To deploy morph.io to production, normally you'll just want to deploy using Capistrano:

cap production deploy

Read the provisioning README for details of how to provision from updated ansible playbooks.

Copyright & License

Copyright OpenAustralia Foundation Limited. Licensed under the Affero GPL. See LICENSE file for more details.

Issues· 220 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Rubycivictechdockerwebscraping

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类DevOps
定价开源

> 相关工具

D
Docker
容器化平台,标准化应用交付
G
GitHub Actions
GitHub 原生 CI/CD 工作流
N
Nginx
高性能 Web 服务器与反向代理