Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Access denied" after installing #3

Closed
decentral1se opened this issue Sep 9, 2022 · 11 comments
Closed

"Access denied" after installing #3

decentral1se opened this issue Sep 9, 2022 · 11 comments
Labels
documentation Improvements or additions to documentation

Comments

@decentral1se
Copy link

decentral1se commented Sep 9, 2022

Using :packages tag, and when I deploy, the site says "Access denied"...

In /var/log/amusewiki/installation.log it has .localdomain wired up and I'm not sure how to replace that with my real domain?

What are the post-install steps in the docker context?

Thanks for the work!

@decentral1se
Copy link
Author

decentral1se commented Sep 9, 2022

This is what I find right after deploying the container:

root@303e30884969:/var/lib/amusewiki# cat /var/log/nginx/error.log  
2022/09/09 21:36:27 [warn] 8#8: conflicting server name "amusewiki.localdomain" on 0.0.0.0:80, ignored
2022/09/09 21:36:27 [warn] 8#8: conflicting server name "amusewiki.localdomain" on [::]:80, ignored
2022/09/09 21:36:27 [warn] 8#8: conflicting server name "amusewiki.localdomain" on 0.0.0.0:443, ignored
2022/09/09 21:36:27 [warn] 8#8: conflicting server name "amusewiki.localdomain" on [::]:443, ignored
2022/09/09 21:36:27 [notice] 8#8: signal process started
2022/09/09 21:36:27 [error] 8#8: open() "/run/nginx.pid" failed (2: No such file or directory)
2022/09/09 21:36:27 [warn] 10#10: conflicting server name "amusewiki.localdomain" on 0.0.0.0:80, ignored
2022/09/09 21:36:27 [warn] 10#10: conflicting server name "amusewiki.localdomain" on [::]:80, ignored
2022/09/09 21:36:27 [warn] 10#10: conflicting server name "amusewiki.localdomain" on 0.0.0.0:443, ignored
2022/09/09 21:36:27 [warn] 10#10: conflicting server name "amusewiki.localdomain" on [::]:443, ignored
root@303e30884969:/var/lib/amusewiki# cat /etc/hosts
127.0.0.1	localhost
::1	localhost ip6-localhost ip6-loopback
fe00::0	ip6-localnet
ff00::0	ip6-mcastprefix
ff02::1	ip6-allnodes
ff02::2	ip6-allrouters
10.0.1.64	303e30884969

@decentral1se
Copy link
Author

decentral1se commented Sep 9, 2022

Ah, I found this:

root@b6b7ec2e502e:/var/lib/amusewiki# grep -iR "foo" .
./log/amw.log:2022/09/09 22:46:13 INFO - AmuseWikiFarm.Controller.Root - /usr/share/perl5/AmuseWikiFarm/Controller/Root.pm:299 - Access denied to http://foo.com/

Then I was trying to somehow set the site varilable like so:

amusewiki set-site-variable --all --set ...

But I don't know what to wire up for --set?

@rojenzaman
Copy link
Owner

rojenzaman commented Sep 11, 2022

Thanks for the work!

Thank you!


When accessing with an undefined domain name, amusewiki shows "Access denied" error, you need to define the domain name you want to use first.

If you want the setup custom domain when building the docker image you can use texlive-base or texlive-full tag so for that.
example for texlive-base:

But the above steps are not necessary and are not official packages. I usually use these tags when I want to work with git source.

And it is not possible to set the domain name before building package image because when installing the amusewiki official packages on the system, it considers amusewiki.localdomain as the main site/domain.

Solution

But you can create a new site/domain after running the package image.
You should create own domain/site at: amusewiki.localdomain/admin/sites area.

Another way:
Go /admin/sites/edit/amw area and edit "Main canonical hostname, without protocol" box or add one more domain to "Virtual hosts, one per line" box. But it makes more sense to create a new site like above.

@rojenzaman rojenzaman added the documentation Improvements or additions to documentation label Sep 11, 2022
@decentral1se
Copy link
Author

Thank you @rojenzaman! I did make some progress which I was posting about on melmothx/amusewiki#254 where I got past this "Access denied" situation and got to a HTTP/HTTPS proxying issue... but have a solution which is documented in the IRC chat 🙃 I will hopefully get something working this week... idk if you want to keep this open to have documentation here or I can also add it to my docker swarm configs repository? I'm using traefik and swarm in my deployment...

@decentral1se
Copy link
Author

https://git.coopcloud.tech/coop-cloud/amusewiki

@rojenzaman
Copy link
Owner

Thank you @rojenzaman! I did make some progress which I was posting about on melmothx/amusewiki#254 where I got past this "Access denied" situation and got to a HTTP/HTTPS proxying issue... but have a solution which is documented in the IRC chat 🙃 I will hopefully get something working this week... idk if you want to keep this open to have documentation here or I can also add it to my docker swarm configs repository? I'm using traefik and swarm in my deployment...

Of course!

https://git.coopcloud.tech/coop-cloud/amusewiki

Great.

@rojenzaman
Copy link
Owner

Amusewiki images now support changing the domain of the initial site. To this, set POST_DOMAIN variable in ENV.

Example:

docker run -d -e "POST_DOMAIN=localhost" --network host rojen/amusewiki:package
version: '3.3'
services:
    amusewiki:
        environment:
            - POST_DOMAIN=localhost
        network_mode: host
        image: 'rojen/amusewiki:package'

@rojenzaman rojenzaman reopened this Sep 24, 2022
@rojenzaman
Copy link
Owner

Also following step can be automated depend on env variable:

  • change /etc/nginx/amusewiki_debian from fastcgi_param HTTPS $https if_not_empty to fastcgi_param HTTPS on

@rojenzaman
Copy link
Owner

You can change fastcgi param from $https if_not_empty to HTTPS on. To this, set CONTAINER_IS_BEHIND_HTTPS_TRAEFIK variable to true in ENV.

Example:

docker run -d \
   -e "POST_DOMAIN=localhost" \
   -e "CONTAINER_IS_BEHIND_HTTPS_TRAEFIK=true" \
--network host rojen/amusewiki:package

@rojenzaman
Copy link
Owner

@decentral1se Now, you can set username and password before running the amusewiki container.

To this, set CHANGE_PASSWORD_BEFORE_RUN variable to true in ENV and then set these: AMW_USERNAME, AMW_PASSWORD.

  • The default username is: amusewiki
  • The default password is: changeme

You can explain all of these to: https://git.coopcloud.tech/coop-cloud/amusewiki, now you can clear the post-install steps.

@decentral1se
Copy link
Author

Thanks so much @rojenzaman! Opened https://git.coopcloud.tech/coop-cloud/amusewiki/issues/1 to track this 👏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants