-
-
Notifications
You must be signed in to change notification settings - Fork 126
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
Docker Compose Template for Traefik Has Issues #59
Comments
And of course after painstakingly figuring out all these details, then reproducing it from the start the above seems incorrect! The However, the note about |
I got the same error. I followed your steps and it solved the first issue. However I still can't log in (401 Unauthorized). I have tried using my user and password without success. Which password did work for you (with ubuntu username) ? |
The password set in the $PASSWORD variable did work for me once I used the |
In my case, it doesn't work using the password I set in the $PASSWORD. How did you find out |
|
In my case both
I have tried to write the credetials directly on yml file:
I have also tried placing hash instead: example:$apr1$nyeKGV3t$Qj1EEOqrS1wKoURU6CPCU/ But no success either. |
I believe you may need to add an additional So try: example:$apr1$BVhy2emr$PRkqFeoHHQbIQtE5McvOc0` Then place the following in your yaml file: Any luck? |
Unfortunately I still get the same - 401 Unauthorized message. |
Hi @coltonbh, After some hours, it worked doing the following: 1- To create user:password pair, it's possible to use this command: 2- Add quotes in this line: Thanks to point out this issue. |
@kaleming congrats! I figured it was something small like that. Nice sleuthing. |
You know what, @kaleming I set up a new swarm yesterday and had the exact same issue again--traefik always gave me 401 responses with the variable defined |
Hi @coltonbh, I'm glad this approach worked for you too. |
Yeah I'm curious what the issue with using the environment variables in the main example. I can't figure it out... |
Are you setting the
|
Using @coltonbh suggestion:
Works like a charm in my case. I do not really understand if the problem is related to the template file or to a bug in docker-compose (it is documented here). I share my current environment:
|
My problem was caused because of In this case, just share current environments using |
Try changing the template from $ to $$ (Ubuntu 20.04) |
I had this issue on Windows. I thought it was a problem with variable expansion as well, but I was wrong. I set a few env variables the .toml was looking for and it fixed the issue. # run in dir with a .env file. prints text block to paste into cmd to load env variables
import os
import re
with open('.env', 'r', encoding='utf-8') as fs:
env_vars = fs.read().splitlines()
good_pairs = []
[good_pairs.append(f'set {var_pair}') for var_pair in env_vars if not re.findall('^ ?#', var_pair) and var_pair != '']
# [os.system(f'set {var_pair}') for var_pair in env_vars if not re.findall('^ ?#', var_pair) and var_pair != '']
print(good_pairs)
for pair in good_pairs:
print(pair)
# os.system(pair) |
Thanks for the patience! And thanks for the notes. Maybe if someone wants to update the examples to use something different than Nevertheless, I should let you know, I had to deprecate this website and ideas, I would no longer recommend Docker Swarm Mode for new projects: https://dockerswarm.rocks/swarm-or-kubernetes/ 🥲 |
Assuming the original issue was solved, it will be automatically closed now. But feel free to add more comments or create new issues. |
Great website, tutorial etc...! Thank you for providing this.
I'd like to document my issues using the guide for setting up Traefik at https://dockerswarm.rocks/traefik/ to try and help others...
Deploying the template exactly as described and having followed all the steps:
- invalid interpolation format for services.traefik.deploy.labels.[]: "required variable HASHED_PASSWORD is missing a value: Variable not set". You may need to escape any $ with another $.
According to this stack overflow answer, extended shell-style features, such as ${VARIABLE-default} and ${VARIABLE/foo/bar}, are not supported. So I changed the
${HASHED_PASSWORD?Variable not set}
and other related values containing the?Variable not set
addendum to${HASHED_PASSWORD}
.Next issue: Cannot login--incorrect password.
For those running
ubuntu
they may find thatexport USERNAME=admin
doesn't do anything--their$USERNAME
will still beubuntu
. It took me forever to find out why my login never worked! So log in with usernameubuntu
and the password they set.Perhaps updating the docs would be helpful? I'm happy to make a PR and update, but I wanted to check here first to make sure I wasn't missing something elementary before suggesting changes. Thank you again for the great tutorial!
The text was updated successfully, but these errors were encountered: