# Configuring docker swish

**URL:** <https://swi-prolog.discourse.group/t/configuring-docker-swish/1401>\
**Category:** Help!\
**Created:** [October 18, 2019, 8:21am UTC](https://swi-prolog.discourse.group/t/configuring-docker-swish/1401 "2019-10-18T08:21:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![grossdan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/grossdan/32/23_2.png) [@grossdan](https://swi-prolog.discourse.group/u/grossdan)\
**Post date:** [October 18, 2019, 8:21am UTC](https://swi-prolog.discourse.group/t/configuring-docker-swish/1401/1 "2019-10-18T08:21:52Z")

</div>

Hello,

After installing swish via docker, I am trying to follow instructions to configure authentication – however, the instructions given are for locally installed swish. See below:

However, its unclear to me where commands are submitted.

First, there is the mkdir command – I presume it needs to be run in a command line within the swish docker image so, shell needs to be started first (I managed to do that).

> mkdir -p config-enabled  
> (cd config-enabled && ln -s ../config-available/auth\_http\_always.pl)

(interestingly, this added the auth\_http\_always, in the config-available directory _outside_ of the docker image within the ubuntu file system – not sure what the mechanism here is)

Then, there is the swish\_add\_user.

> ?- swish\_add\_user.

However, this isn’t a shell command, but appears to be a prolog predicate – and I am wondering how this is done – does one need to start a swipl within docker (tried this, but doesn’t recognize the swish\_add\_user/0 predicate).

Or, is this done within a browser pointing at the local swish page? (tried that as well, and predicate is also not recognized).

Any help clarify this, would be much appreciated.

Dan

> **[GitHub - SWI-Prolog/swish: SWI-Prolog for SHaring: a SWI-Prolog web IDE](https://github.com/SWI-Prolog/swish#docker-image)**
>
> SWI-Prolog for SHaring: a SWI-Prolog web IDE

### Running SWISH without sandbox limitations

By default, SWISH does not require the user to login but lets you run only _safe_ commands. If you want to use SWISH for unrestricted development, enable the config file `auth_http_always.pl` :

```prolog
mkdir -p config-enabled
(cd config-enabled && ln -s ../config-available/auth_http_always.pl)

```

> Next, for first usage, you need to create a user. The authentication module defines swish\_add\_user/0, which asks for details about the user to be created and updates or creates a file called `passwd` . At the moment _Group_ and _E-Mail_ are stored, but not used.
> 
> ```prolog
> ?- swish_add_user.
> 
> ```

---

<div class="post-metadata">

**Author:** ![grossdan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/grossdan/32/23_2.png) [@grossdan](https://swi-prolog.discourse.group/u/grossdan)\
**Post date:** [October 18, 2019, 8:42am UTC](https://swi-prolog.discourse.group/t/configuring-docker-swish/1401/2 "2019-10-18T08:42:31Z")

</div>

getting closer …

I now downloaded auth\_http\_always.pl from git into the config\_enabled folder; I also ran add user swish docker command, restarted the image, and now get a “sink” error in the browser:

btw, when adding a user I was asked what group, and entered swish – perhaps this is related – not sure what group the new user needs to be part of.

# Internal server error

source\_sink `passwd’ does not exist

[SWI-Prolog](http://www.swi-prolog.org/) httpd at ca8879beb09e

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [October 19, 2019, 2:42am UTC](https://swi-prolog.discourse.group/t/configuring-docker-swish/1401/3 "2019-10-19T02:42:48Z")

</div>

I’m travelling with a poor connection. I think we went through all this, no?. You do all the swish config using `docker run -it swish <options>` commands. The basic commands are in the readme. You may download `swish.sh`, which is a simple shell script that simplifies some of these commands a bit. `--help` shows all commands.

---

<div class="post-metadata">

**Author:** ![grossdan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/grossdan/32/23_2.png) [@grossdan](https://swi-prolog.discourse.group/u/grossdan)\
**Post date:** [October 19, 2019, 5:11pm UTC](https://swi-prolog.discourse.group/t/configuring-docker-swish/1401/4 "2019-10-19T17:11:57Z")

</div>

Hi Jan,

Thanks. Yes, we did, but I never got it to work, and am trying again.

Dan
