How do you create an admin account from the command line in Pixelfed?

I already searched for the answer but didn’t find it.

It’s more complicated then doing it generically since Yunohost has its own locations for files. In Gitea it’s under /opt/gitea.

When I create the app it didn’t create an account and I can’t register an account through the site because email is broken.

Administrator

After being first registered, you need to execute the folloing command to promote first registered as admin

Run:

sudo php8.2 /var/www/pixelfed/artisan user:admin 1

and respond yes to the question Add admin privileges to this user?.

Allow/Close registrations

Registrations are open by default.
To change that setting, edit /var/www/pixelfed/.env and set OPEN_REGISTRATION=false instead of true.
Then run php8.2 artisan config:cache to reload the settings.

Notice: sometimes running this → php8.2 artisan config:cache and sudo php8.2 /var/www/pixelfed/artisan user:admin 1
- wont work, just change the php8.2 to php8.1 php8.3 php8.0 till it works.
- also you need to be in the folder /var/www/pixelfed/ for the code to work, before you can issue php8.2 artisan config:cache and sudo php8.2 /var/www/pixelfed/artisan user:admin 1 most of the time

1 Like

it dont make an account, you need to register one, unless that has changed.

once you register an account, it will ask you to verify the email (which many of us cant since we dont have working email) so youll need to bypass that, just do the command line, make your account admin, then go to the menu top right, look for ADMIN MENU *if its NOT there, locate the OLD UI button/link and then menu top right and look for admin menu, go to admin area, and look for your user account an manually active your email.

then go into command line and disable signup other wise you will get a lot of signups later.

Notice: sometimes you can get local emails, just install roundcube, login with all of the accounts you have on the server untill you find the emails that are going to default or sftp/ssh into server and go to var/mail and look under their for all emails sent local.

many emails local have activation links and keys for many of the apps you install but NOT always, sometimes.

1 Like

This allowed me to create an admin account, but it’s still trying to get me to confirm my email address when email is completely broken on the site. Is there a way to automatically confirm the account from the admin panel to avoid email confirmation, which is impossible?

read my last post… before this… last post.

1 Like

I went to /var/mail and under the username and I see a lot of files, but I’m not sure which one has the mail. I tried opening a few of the files in a text editor, but they aren’t legible.

many emails local have activation links and keys for many of the apps you install but NOT always, sometimes.

once you register an account, it will ask you to verify the email (which many of us cant since we dont have working email) *so youll need to bypass that, just do the command line, make your account admin, then go to the menu top right, look for ADMIN MENU if its NOT there, locate the OLD UI button/link and then menu top right and look for admin menu, go to admin area, and look for your user account an manually active your email.

1 Like

This is what I’m having trouble with. I can go into the admin menu from the dropdown menu in the top right and then go to the page for my account, but I don’t see any option to confirm the email address. It says the email address is unverified, but I don’t see any option to verify it.


might also be in another menu

if you still cant get it working, just go into env file turn off email verification, make a new account set it to admin or start over turn off email verification then register account make it admin.

so many ways to do this

1 Like

Thanks. I was able to verify the email address with this command:

php8.2 /var/www/pixelfed/artisan user:verify sonsofliberty

2 Likes

look at this i learned something new didnt even know that one.

1 Like

This should be fixed (on Pixelfed side, not Yunohost one if you have something to configure here) by the latest update of the package : Fix mail sendmail by themancalledjakob · Pull Request #230 · YunoHost-Apps/pixelfed_ynh · GitHub

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.