Go to file
Earlopain 1dc250290c
[Users] Properly allow admins to edit users with blank email
See e4cfa55f35
That fix wasn't sufficient because prod doesn't have an unique index on emails.
2022-12-01 17:38:29 +01:00
.vscode [Docker] Add solargraph to the image, and a few more things 2022-10-18 23:35:18 +02:00
app [Users] Properly allow admins to edit users with blank email 2022-12-01 17:38:29 +01:00
bin Merge pull request #439 from zwagoth/rails-7 2022-11-24 17:13:58 -05:00
config [Users] Style usernames by default 2022-11-27 17:44:03 +01:00
db [Docker] Add seeding for mascots 2022-10-20 18:52:07 +02:00
docker [Docker] Use healthcheck to wait for elasticsearch 2022-11-09 18:18:30 +01:00
lib [Cleanup] Remove unused binstubs + capistrano 2022-04-25 21:10:20 +02:00
public [Posts] Move popular posts route to /popular 2022-08-06 11:07:25 +02:00
script [Versions] Rename post/pool archive classes to versions 2022-08-06 18:58:24 +02:00
test [Cleanup] Use the same method names for Cache as Rails 2022-11-29 19:14:09 +01:00
.browserslistrc [JS] Add missing browserslist file that makes all of this work. 2021-09-30 02:35:06 -07:00
.dockerignore [Docker] Install gems and js packages into the image 2022-01-05 13:41:41 +01:00
.editorconfig
.env.sample [Docker] Add solargraph to the image, and a few more things 2022-10-18 23:35:18 +02:00
.eslintrc.yml
.gitattributes [.gitattributes] Always ensure LF line endings 2021-11-08 17:23:23 +01:00
.gitignore [Docker] Clean up bin/setup 2022-11-09 18:35:20 +01:00
.rubocop.yml [Docker] Add solargraph to the image, and a few more things 2022-10-18 23:35:18 +02:00
.ruby-version [Docker] Explicitly use new alpine version 2022-12-01 15:57:24 +01:00
.solargraph.yml [Docker] Add solargraph to the image, and a few more things 2022-10-18 23:35:18 +02:00
babel.config.js
config.ru
docker-compose.yml [Docker] Use healthcheck to wait for elasticsearch 2022-11-09 18:18:30 +01:00
Dockerfile [Docker] Explicitly use new alpine version 2022-12-01 15:57:24 +01:00
Gemfile [Tests] Use factory_bot_rails and clean up test_helper requires 2022-11-25 19:56:14 +01:00
Gemfile.lock [Tests] Use factory_bot_rails and clean up test_helper requires 2022-11-25 19:56:14 +01:00
LICENSE
package.json [Vue] Use fork of vue-loader to fix const in js bundle 2022-06-14 00:17:50 +02:00
postcss.config.js
Procfile [Docker] Add iqdb/s to composer 2021-11-18 01:13:38 +01:00
Rakefile
README.md [Docker] Clean up bin/setup 2022-11-09 18:35:20 +01:00
yarn.lock [Vue] Use fork of vue-loader to fix const in js bundle 2022-06-14 00:17:50 +02:00

Installation (Easy mode - For development environments)

Prerequisites

  • Latest version of Docker (download). The WSL2 backend on Windows is required.
  • Latest version of Docker Compose (download)
  • Git (download)

If you are on Windows Docker Compose is already included, you do not need to install it yourself. If you are on Linux/MacOS you can probably use your package manager.

Windows development environment

Developing on Windows requires some special setup to get good response times. Unfortunately performance across file systems is not great for WSL2 and recieving inotify events isn't possible. This leads to an all-around unpleasant experience. Read more about this here.

To mitigate this you can install a WSL distribution and clone the project inside there. Executing docker inside the container will still work, without directly accessing the host. Access the code with Remote Development for VSCode or simply use the network address \\wsl$.

Installation

  1. Download and install the prerequisites.
  2. Clone the repo with git clone https://github.com/zwagoth/e621ng.git.
  3. cd into the repo.
  4. Copy the sample environment file with cp .env.sample .env.
  5. Uncomment the COMPOSE_PROFILES variable if you wish to use solargraph. Doesn't work on Windows without WSL.
  6. Run the following commands:
    docker-compose run -e SEED_POST_COUNT=100 e621 /app/bin/setup
    docker-compose up
    
    After running the commands once only docker-compose up is needed to bring up the containers.
  7. This would be a good time to rewatch your favorite TV series installment, cook & have breakfast/lunch/dinner, walk the dog, clean your room, etc.
    By the time you get back the install will surely have completed.1
  8. To confirm the installation worked, open the web browser of your choice and enter http://localhost:3000 into the address bar and see if the website loads correctly. An admin account has been created automatically, the username and password are admin and e621test respectively.

Note: When gems or js packages were updated you need to execute docker-compose build to reflect them in the container.

1 If the install did not finish by the time an activity is complete please select another activity to avoid crippling boredom.

Useful docker services

docker-compose run --rm tests to execute the test suite.

docker-compose run --rm rubocop to run the linter. Run it against changed files only, there are too many existing violations at the moment.

Development Database

The postgres server accepts outside connections which you can use to connect with a local client. Use localhost:34517 to connect to a database named danbooru2 with the user danbooru. Leave the password blank, anything will work.

Installation

Installation follows the same steps as the docker compose file. Ubuntu 20.04 is the current installation target. There is no script that performs these steps for you, as you need to split them up to match your infrastructure. Running a single machine install in production is possible, but is likely to be somewhat sluggish due to contention in disk between postgresql and elasticsearch. Minimum RAM is 4GB. You will need to adjust values in config files to match how much RAM is available. If you are targeting more than a hundred thousand posts and reasonable user volumes, you probably want to procure yourself a database server. See tuning guides for postgresql and elasticsearch for help planning these requirements.

Troubleshooting

These instructions won't work for everyone. If your setup is not working, here are the steps I usually recommend to people:

  1. Test the database. Make sure you can connect to it using psql. Make sure the tables exist. If this fails, you need to work on correctly installing PostgreSQL, importing the initial schema, and running the migrations.

  2. Test the Rails database connection by using rails console. Run Post.count to make sure Rails can connect to the database. If this fails, you need to make sure your Danbooru configuration files are correct.

  3. Test Nginx to make sure it's working correctly. You may need to debug your Nginx configuration file.

  4. Check all log files.

IQDB Service

IQDB integration is delegated to the IQDBS service.