toolkit icon indicating copy to clipboard operation
toolkit copied to clipboard

Admin > Manager Users only allows for adding new users

Open richardotomislav opened this issue 8 months ago • 2 comments

Hello, documentation states that I should try to get help here. I'm a beginner to self-hosting Overleaf due to needing multiple collaborators; I'm already including new users, but I don't know how to see them.

Documentation doesn't help because for some reason it assumes you want to delete users right away. This is what Admin > Manager Users show:

Image

As a side note, I cannot manage to link my email server (hosted somewhere else than the Overleaf instance), and the docs say it needs to be reachable by Docker, which I assume that's the main issue.

richardotomislav avatar May 10 '25 09:05 richardotomislav

I also have this problem. Following.

NickOveracker avatar Jul 28 '25 12:07 NickOveracker

I also encountered this problem, but i found a workaround:

  1. On the server, navigate to the overleaf-toolkit directory
  2. Start mongo container shell with docker exec -it mongo mongosh
  3. Switch to sharelatex database: use sharelatex
  4. Print list of all users: db.users.find({}, {email:1, _id:0}).forEach(u => print(u.email))

If you need this often, I recommend adding a script (e.g. file called list-users) like this:

#!/bin/bash
docker exec -i mongo mongosh --quiet < path/to/list-users.js | grep -v "^overleaf.*>" | grep -v "^\.\.\." | grep -v "switched to db" | grep -v "^\[Function:"

with path/to/list-users.js:

use sharelatex;
(function(){
  function col(v,w){ return (v==null?"-":v.toString()).padEnd(w); }
  function formatDate(d){ return d && typeof d.toISOString==="function"?d.toISOString().slice(0,19)+"Z":"-"; }

  // Print header
  print();
  print([col("EMAIL",30),col("ADMIN",5),col("CREATED",25),col("LAST_ACTIVE",25),col("LAST_LOGIN_IP",16)].join(" | "));
  print("-".repeat(110));

  // Print each user
  db.users.find({}, {email:1,isAdmin:1,_id:1,lastActive:1,lastLoginIp:1}).forEach(u=>{
    let created="-";
    try{
      created = u._id && typeof u._id.getTimestamp==="function" ? formatDate(u._id.getTimestamp()) : "-";
    } catch(e){ created="-"; }
    const lastAct = u.lastActive ? formatDate(u.lastActive) : "-";
    const ip = u.lastLoginIp || "-";
    print([col(u.email,30),col(u.isAdmin?"yes":"no",5),col(created,25),col(lastAct,25),col(ip,16)].join(" | "));
  });
})();

You can make list-users executable like this:

chmod +x list-users

Usage of the script then looks like this:

$ ./list-users
EMAIL                          | ADMIN | CREATED                   | LAST_ACTIVE               | LAST_LOGIN_IP
--------------------------------------------------------------------------------------------------------------
[email protected]                | yes   | 2025-09-12T19:09:45Z      | 2025-09-14T10:50:32Z      | 00.00.00.00
[email protected]                | no    | 2025-09-13T20:34:30Z      | -                         | -

felix12123 avatar Sep 14 '25 12:09 felix12123