bookwyrm icon indicating copy to clipboard operation
bookwyrm copied to clipboard

Fresh install; no config screen, taken to /login

Open rickcecil opened this issue 1 year ago • 4 comments

Describe the bug After the initial setup, I am not taken to the config screen where I can enter my admin account code. Instead, I am taken to the sign in screen.

To Reproduce

  1. Follow set up instructions
  2. Run ./bw-dev migrate
  3. Run docker compose up --build
  4. Ctrl+c
  5. ./bw-dev setup
  6. docker compose up -d
  7. Visit domain
  8. Taken to /login and no config screen

Expected behavior Config screen should load so that I can create an admin user.

Instance Production

Additional context I've tried starting completely over doing the following:

  1. docker compose down -v
  2. delete container
  3. remove volumes
  4. delete images
  5. change secret key in env
  6. Change the host port
  7. Clear browser cache

And I am still taken to the login screen.

I had a lot of trouble getting this setup. Most (all) errors were between the keyboard and the seat, but I got them sorted. The only thing that makes any sense is that, somewhere in my troubleshooting I screwed something up.

This is a completely new setup, so it is fine to start completely over, but I am having trouble making that happen, too.

If I remove the docker containers, volumes, and images, then follow the same steps as above, I get the same result. Shouldn't wiping everything out remove all the data?

So, I have one of two requests...

  1. How do I see if there is a user in the system already? Is there a CLI command that would do this? And if there is, how do I reset their password?

OR

  1. How do I start with a completely fresh install? I am hoping that I don't have to re-pull the code from Github since I've been working on this for the last several hours and finally got this working. Well, it's kinda working.

Thanks for any help... I am stumped.


Desktop (please complete the following information): - OS: MacOS - Browser Firefox - Version 104.0.2

rickcecil avatar Sep 13 '22 23:09 rickcecil

How frustrating! I'm going to see if I can replicate this locally. ARE you installing in production or dev? And did you run ./bw-dev initdb in the setup process?

By the way, if there were places the instructions could have been clearer or provided more help, let me know ❤️

mouse-reeve avatar Sep 14 '22 01:09 mouse-reeve

Hi mouse-reeve,

Appreciate the help! Here's a bit more detail... I made several snafus will installing the app. All in, I probably installed and reinstalled Bookwyrm 15 times. I may not be the brightest bulb, but I am persistent. :D Honestly, I may be the only one to have this much trouble.

Here are some of the things I ran into ... in case any of it helps you troubleshoot the issue:

  • I did not define the ports in all the right places (I am using Nginx Proxy Manager, so couldn't use the default... and I already have something on 8001)
  • I attempted to use folders on the host computer rather than docker volumes (could have made this work, I think, but realized it was likely more trouble than it was worth, so backed the changes out).
  • I uncommented "Reverse Proxy Manager" in the Nginx default.conf file -- this one took me a bit to actually see what I had done wrong. That was probably the worst of my idiotic errors.
  • It was difficult to tell when docker had stopped when running the docker compose up --build. I would hit the server to determine if docker was done.

--

ARE you installing in production or dev?

Production.

And did you run ./bw-dev initdb in the setup process?

I did not. Well, I don't think I did. Pretty sure that I did not. I am pretty sure that I only ran the migrate. Should I have? Should I now?

--

As for the instructions, I very much appreciate how thorough the instructions were. There were a few things gave me pause, but I was able to sort them out... Here's a mix of things that could improve the instructions... these are, more or less, nitpicks.

(After having written all this up, it turned out to be much longer than expected. These really are minor revisions and if you decide not to make them, no worries. I think people will still be able to figure it all out -- obviously they have been!)

  1. Use a numbered list instead of a bulleted list. It would be easier to know what step I am on.

  2. As I mentioned above, I was never sure if the docker build process was finished, so an example the of the final lines of the docker build process would be useful. Similar to how you show the admin code. Though, this may just be me...

The rest of the issues had to do with the reverse proxy instructions. Before I dive into this, though, that you had the instructions for the reverse proxy was awesome. I so very much appreciate that.

  1. Under the "Configure Nginx" step, I might structure it like so:

(Can't quite figure out nested bullets in markdown, so hopefully this makes sense...)

- Configure nginx
-- As a reverse proxy
-- Make a copy of the production template config and set it for use in nginx cp nginx/production nginx/default.conf
-- Update nginx/default.conf:
-- Replace your-domain.com with your domain name everywhere in the file (including the lines that are currently commented out)
- If you aren't using the www subdomain, remove the www.your-domain.com version of the domain from the server_name in the first server block in nginx/default.conf and remove the -d www.${DOMAIN} flag at the end of the certbot command in docker-compose.yml.
- In use with a reverse proxy external to the docker container
-- In nginx/default.conf:
--- Comment out the two default servers
--- Uncomment the server labeled Reverse-Proxy server
--- Replace your-domain.com with your domain name
-- In docker-compose.yml:
--- In services -> nginx -> ports, comment out the default ports and add - 8001:8001
--- In services -> nginx -> volumes, comment out the two volumes that begin ./certbot/
--- In services, comment out the certbot service
-- See [reverse-proxy instructions](https://docs.joinbookwyrm.com/reverse-proxy.html) for additional information.
  1. On the reverse proxy page itself, I found this paragraph a little confusing:

At this point, you can follow, the setup instructions as listed (a). Once docker is running, you can access your BookWyrm instance at http://localhost:8001 (NOTE: your server is not accessible over https).(b)

a - It was a pit of a PITA to figure out where to pick things up again. I mean, like a 3 on a PITA scale of 1-10. But you asked for suggestions. :D If you do change the steps to a bulleted list, indicating the step number that they would resume things on would make that so much better.

b - That the server isn't accessible over https. This gave me pause. Cuz the whole reason that I am using Nginx Proxy Manager is because it handles https for all my internal apps/sites for me. I initally read it as that this would not work for me. Again, a minor PITA (2/10) as I figured out what you meant pretty quickly.

I would suggest rephrasing the paragraph like so:

You can resume the setup instructions at step 5. Once docker is running, you can access your BookWyrm instance at http://localhost:8001. (NOTE: your server is not directly accessible over https -- your reverse proxy should now be handling that for you.)

  1. Still on the reverse proxy page, I found the section heading "Nginx" to be confusing. If you just look at the headings to get a feel for the content that is on the page, it looks like that is a set of instructions that will need to be followed and, as an Nginx Proxy Manager user, I was concerned that it wouldn't work with Nginx Proxy Manager. (I mean, that made no sense to me, but I don't know how many strange things I have come across that seem like they should work, but don't.)

The previous sentence ("Steps for setting up a reverse-proxy are server dependent.") gives some context, but I think a minor tweak could alleviate all confusion:

Setting up Nginx as a reverse proxy Steps for setting up a reverse-proxy are server dependent. These are steps for configuring Nginx to be a reverse proxy for Bookwyrm.

  1. I would rephrase this line: "Run the application (this should also set up a Certbot ssl cert for your domain) with docker-compose up --build" to be

"Run the application with docker-compose up --build" If you are using our standard nginx install, this should also set up a Certbot ssl cert for your domain.

  1. I got hung up for a couple of hours because I didn't read all of the instructions. That's 100% on me. I just have a hard time reading instructions in an orderly fashion. However, if you are looking for areas to improve, I thought I was finished at the "Set up HTTPS redirect" ... after all, I was using the Nginx proxy, so I assumed that everything that followed after did not apply to me. Boy was I wrong!

So, if it made sense, I would make the following changes to the section that starts with "Set up HTTPS Redirect" and the section that starts with "Set up a cron"

- If you are using the Nginx included in the docker as a reverse proxy, follow these steps. If not, skip to the next step.
-- Set up the HTTPS redirect
--- In docker-compose.yml, comment out the active certbot command, which installs the certificate, and uncomment the line below, which sets up automatically renewals.
--- In nginx/default.conf, uncomment lines 18 through 50 to enable forwarding to HTTPS. You should have two server blocks enabled
-- Set up a cron job to keep your certificates up to date (Lets Encrypt certificates expire after 90 days)
--- Type crontab -e to edit your cron file in the host machine
--- add a line to try renewing once a day: 5 0 * * * cd /path/to/your/bookwyrm && docker-compose run --rm certbot

rickcecil avatar Sep 14 '22 21:09 rickcecil

Oops, I should have checked the steps - initbd is run during ./bw-dev setup step; that's the place where "install mode" is turned on, and my guess is that's the thing that didn't work correctly.

mouse-reeve avatar Sep 14 '22 23:09 mouse-reeve

And thank you for the thorough feedback, I think your wording suggestions are great.

mouse-reeve avatar Sep 14 '22 23:09 mouse-reeve