Gumroad 现已开源
Navigation Menu
- Product
Explore * All features * Documentation * GitHub Skills * Blog
- Solutions
By company size * Enterprises * Small and medium teams * Startups * Nonprofits
By use case * DevSecOps * DevOps * CI/CD * View all use cases
By industry * Healthcare * Financial services * Manufacturing * Government * View all industries
- Resources
Topics * AI * DevOps * Security * Software Development * View all
Explore * Learning Pathways * Events & Webinars * Ebooks & Whitepapers * Customer Stories * Partners * Executive Insights
- Open Source
Repositories * Topics * Trending * Collections
Available add-ons * GitHub Advanced Security Enterprise-grade security features * Copilot for business Enterprise-grade AI features * Premium Support Enterprise-grade 24/7 support
搜索代码、仓库、用户、问题、Pull Request...
搜索 清除 搜索语法提示
提供反馈
我们阅读每一条反馈,并认真对待您的意见。
Include my email address so I can be contacted 取消 Submit feedback
保存的搜索
使用保存的搜索可以更快地过滤结果
Name Query To see all available qualifiers, see our documentation. 取消 Create saved search antiwork / gumroad Public
- Notifications You must be signed in to change notification settings
- Fork 20
- Star 259
License
View license 259 stars 20 forks Branches Tags Activity
Star Notifications You must be signed in to change notification settings
Additional navigation options
antiwork/gumroad
main BranchesTags Go to file Code
Folders and files
Name| Name| Last commit message| Last commit date ---|---|---|---
Latest commit
History
8 Commits .buildkite| .buildkite .githooks| .githooks .github/workflows| .github/workflows .vscode| .vscode app| app bin| bin ci_scripts| ci_scripts config| config db| db docker| docker docs| docs lib| lib log| log patches| patches public| public scripts| scripts spec| spec vendor/assets/javascripts| vendor/assets/javascripts .cursorrules| .cursorrules .dockerignore| .dockerignore .env.development| .env.development .env.example| .env.example .env.production.example| .env.production.example .env.test| .env.test .git-blame-ignore-revs| .git-blame-ignore-revs .gitattributes| .gitattributes .gitignore| .gitignore .node-version| .node-version .npmrc| .npmrc .prettierignore| .prettierignore .prettierrc| .prettierrc .rspec| .rspec .rubocop.yml| .rubocop.yml .ruby-version| .ruby-version CODE_OF_CONDUCT.md| CODE_OF_CONDUCT.md CONTRIBUTING.md| CONTRIBUTING.md Gemfile| Gemfile Gemfile.lock| Gemfile.lock LICENSE.md| LICENSE.md Makefile| Makefile Procfile.debug| Procfile.debug Procfile.dev| Procfile.dev README.md| README.md Rakefile| Rakefile SECURITY.md| SECURITY.md TRADEMARK_GUIDELINES.md| TRADEMARK_GUIDELINES.md config.ru| config.ru eslint.config.js| eslint.config.js package-lock.json| package-lock.json package.json| package.json postcss.config.js| postcss.config.js tailwind.config.js| tailwind.config.js tsconfig.json| tsconfig.json View all files
Repository files navigation
出售你的产品,看看什么最受欢迎。
License • Code of Conduct • Contributing
目录
Getting Started
Prerequisites
在开始之前,请确保已安装以下组件:
Ruby
Node.js
Docker & Docker Compose
我们使用 docker
和 docker compose
来设置开发环境的服务。
- 对于 MacOS:从 Docker website 获取 docker mac 安装包
- 对于 Linux:
sudo wget -qO- https://get.docker.com/ | sh
sudo usermod -aG docker $(whoami)
MySQL & Percona Toolkit
安装本地版本的 MySQL 8.0.x 以匹配生产环境中运行的版本。
本地版本的 MySQL 是 Ruby mysql2
gem 的依赖项。 您无需在本地启动 MySQL 服务的实例。 该应用程序将连接到在 Docker 容器中运行的 MySQL 实例。
- 对于 MacOS:
brew install mysql@8.0 percona-toolkit
brew link --force mysql@8.0
# to use Homebrew's `openssl`:
brew install openssl
bundle config --global build.mysql2 --with-opt-dir="$(brew --prefix openssl)"
# ensure MySQL is not running as a service
brew services stop mysql@8.0
- 对于 Linux:
- MySQL:
- https://dev.mysql.com/doc/refman/8.0/en/linux-installation.html
apt install libmysqlclient-dev
- Percona Toolkit: https://www.percona.com/doc/percona-toolkit/LATEST/installation.html
- MySQL:
Image Processing Libraries
ImageMagick
我们使用 imagemagick
进行预览编辑。
- 对于 MacOS:
brew install imagemagick
- 对于 Linux:
sudo apt-get install imagemagick
libvips
对于较新的图像格式,我们使用 libvips
进行图像处理,并结合 ActiveStorage。
- 对于 MacOS:
brew install libvips
- 对于 Linux:
sudo apt-get install libvips-dev
FFmpeg
我们使用 ffprobe
(它随 FFmpeg
包一起提供)从视频文件中提取元数据。
- 对于 MacOS:
brew install ffmpeg
- 对于 Linux:
sudo apt-get install ffmpeg
PDFtk
我们使用 pdftk 在 PDF 文件上盖上 Gumroad 徽标和买家电子邮件。
- 对于 MacOS:从 here 下载
- 对于 Linux:
sudo apt-get install pdftk
Installation
Bundler and gems
我们使用 Bundler 来安装 Ruby gems。
gem install bundler
如果您有 Sidekiq Pro 的许可证,请配置其凭据:
bundle config gems.contribsys.com <key>
如果您没有 Sidekiq Pro 的许可证,请在 shell 中设置环境变量 GUMROAD_SIDEKIQ_PRO_DISABLED
:
export GUMROAD_SIDEKIQ_PRO_DISABLED=true
echo "export GUMROAD_SIDEKIQ_PRO_DISABLED=true" >> ~/.bashrc
运行 bundle install
以安装必要的依赖项。
另请确保安装 dotenv
,因为某些控制台命令需要它:
gem install dotenv
npm 和 Node.js 依赖项
确保已启用正确版本的 npm
:
corepack enable
安装依赖项:
npm install
Configuration
Setup Custom credentials
App can be booted without any custom credentials. But if you would like to use services that require custom credentials (e.g. S3, Stripe, Resend, etc.), you can copy the .env.example
file to .env
and fill in the values.
Local SSL Certificates
- 在 macOS 上安装 mkcert:
brew install mkcert
对于其他操作系统,请参阅 mkcert installation instructions。 2. 通过运行以下命令生成证书:
bin/generate_ssl_certificates
Running Locally
Start Docker services
如果您安装了 Docker Desktop(在 Mac 或 Windows 机器上),则可以运行以下命令来启动 Docker 服务:
make local
如果您使用的是 Linux,或者通过 mac 上的软件包管理器安装了 Docker,您可能必须手动为 docker 提供超级用户访问权限才能打开端口 80 和 443。为此,请改用 sudo make local
。
此命令不会终止。 您在一个选项卡中运行它,然后在另一个选项卡中启动应用程序。 如果要在后台运行 Docker 服务,请改用 LOCAL_DETACHED=true make local
。
Setup the database
bin/rails db:prepare
对于 Linux (Debian / Ubuntu),您可能需要以下内容:
apt install libxslt-dev libxml2-dev
Start the application
bin/dev
这会启动 rails 服务器、javascript 构建系统和一个 Sidekiq worker。
如果您知道 foreman 的作用并且不想使用它,您可以检查 Procfile.dev
文件的内容并单独运行所需的组件。
您现在可以在 https://gumroad.dev
访问该应用程序。
Development
Logging in
您可以使用用户名 seller@gumroad.com
和密码 password
登录。 两因素身份验证代码为 000000
。
在 Users & authentication 了解更多关于以具有不同团队角色的用户身份登录的信息。
Resetting Elasticsearch indices
您需要显式地重新索引 Elasticsearch 才能在设置后填充索引,否则在访问开发应用程序时会看到 index_not_found_exception
错误。 您可以使用以下命令重置它们:
# Run this in a rails console:
DevTools.delete_all_indices_and_reindex_all
Push Notifications
要发送推送通知:
INITIALIZE_RPUSH_APPS=true bundle exec rpush start -e development -f
Common Development Tasks
Rails console:
bin/rails c
Rake tasks:
bin/rake task_name
Linting
我们使用 ESLint 处理 JS,使用 Rubocop 处理 Ruby。 您的编辑器应该支持以内联方式显示和修复这些工具报告的问题,并且 CI 将自动检查并修复(如果可能)这些问题。
如果您愿意,可以运行 git config --local core.hooksPath .githooks
,以便在本地提交时检查这些问题。
About
Resources
[Readme](https://github.com/antiwork/<#readme