Issue with Caddyfile from ultimate-torrent-setup

1. Caddy version (caddy version):

v2.4.5

2. How I run Caddy:

a. System environment:

Ubuntu, systemctl, xmlrpc, libtorrent

b. Command:

caddy validate

c. Service/unit/compose file:

Paste full file contents here.
Make sure backticks stay on their own lines,
and the post looks nice in the preview pane.

d. My complete Caddyfile or JSON config:

	default_sni africanarchers.com
	email rehcram@gmail.com
}

https://africanarchers.com {
	root * /var/www
	file_server
	encode gzip
	header Cache-Control "no-cache"
	php_fastcgi unix//run/php/php7.4-fpm.sock

	route /auth* {
		auth_portal {
			local_backend /etc/caddy/auth/local/users.json
			jwt_token_file 1 /etc/caddy/auth/local/jwt_privatekey.pem
			ui {
				links {
					"Tautulli" /tautulli
					"ruTorrent" /rutorrent
					"Sonarr" /sonarr
					"Radarr" /radarr
					"Lidarr" /lidarr
					"Resillio Sync" /sync
				}
			}
		}
	}

	@protected not path /favicon.ico /public* /tautulli/api*
	route @protected {
		jwt {
			primary yes
			user_identity subject
			trusted_public_key 1 /etc/caddy/auth/local/jwt_publickey.pem
		}
	}

	@logout path_regexp /logout$
	rewrite @logout /auth/logout

	@restricted path_regexp /\.(git|htaccess)|/rutorrent/(conf|share)
	respond @restricted 404

	reverse_proxy /sonarr* 127.0.0.1:8989

	reverse_proxy /radarr* 127.0.0.1:7878

	reverse_proxy /lidarr* 127.0.0.1:8686

	reverse_proxy /tautulli* 127.0.0.1:8181

	@rslsync path /sync* /gui*
	route @rslsync {
		jwt
		redir /sync /sync/
		uri replace /sync/ /gui/
		reverse_proxy 127.0.0.1:8888
	}
}

http://localhost {
	root * /var/www
	file_server
	encode gzip
	php_fastcgi unix//run/php/php7.4-fpm.sock
}

http://africanarchers.com/public* {
	root * /var/www
	file_server
	encode gzip
	php_fastcgi unix//run/php/php7.4-fpm.sock
}

http://africanarchers.com {
	redir https://{host}{uri}
}

3. The problem I’m having:


I use systemctl enable --now caddy.service and all appears fine. However the next step is to get some log in credentials using systemctl enable --now caddy.service. Output from this includes an error "n ExecStart= process belonging to unit caddy.service has exited.

– The process’ exit code is ‘exited’ and its exit status is 226.
Nov 03 20:49:51 33Tmedia systemd[1]: caddy.service: Failed with result ‘exit-code’.
– Subject: Unit failed
– Defined-By: systemd"

4. Error messages and/or full log output:

When I use caddy validate I get the following error message “using adjacent Caddyfile
validate: adapting config using caddyfile: parsing caddyfile tokens for ‘route’: Caddyfile:29 - Error during parsing: unrecognized directive: auth_portal - are you sure your Caddyfile structure (nesting and braces) is correct?”

5. What I already tried:

OK, so I am a noob here. Please don’t shoot me. I am trying to follow the instructions for a torrent build here - Home · t0phux/ultimate-torrent-setup Wiki · GitHub. I am new to Linux and have never used Caddy. One of the steps in instructions had a script to update caddy using github.com/greenpau/caddy-auth-jwt. It appears that this is now github.com/greenpau/caddy-authorize so I built it with that. Now I am stuck with the above caddyfile. (When I use a very basic caddyfile and curl, the caddyfile works so I assume that at least caddy is working?)
Now I am stuck and any help / advice to help me learn would be appreciated.

6. Links to relevant resources:

I think auth_portal is now authp. See the docs:

Thanks for reply! I don’t know if I am missing something, but still seems to be auth-portal to me? GitHub - greenpau/caddy-auth-portal: Authentication Plugin for Caddy v2 implementing Form-Based, Basic, Local, LDAP, OpenID Connect, OAuth 2.0 (Github, Google, Facebook, Okta, etc.), SAML Authentication. MFA with App Authenticators and Yubico.

1 Like

Yes, but the Caddyfile directive seems to have been renamed.

/cc @greenpau

1 Like

Apologies! I understand now. Getting a different error now, but let me dig around the auth-portal documentation

1 Like

I have found where greenpau assissed with caddyfile update with same issue. from this I have noted that I don’t have

http.authentication.providers.jwt v1.3.12

I know this is probably properly basic, but how do I get this? i now get an error " Error during parsing: unrecognized directive: jwt - are you sure your Caddyfile structure (nesting and braces) is correct?"

@rehcram , the plugin was renamed to “caddy-authorize”. Please compile with it and change “jwt” to “authorize” in your Caddyfile

For more info, please see https://github.com/greenpau/caddy-authorize/issues/86

2 Likes

Thank you! That worked

This topic was automatically closed after 30 days. New replies are no longer allowed.