Skip to content
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

Self-hosted not unrestricted​ #6641

Open
1 task
deckerjulian opened this issue Apr 19, 2024 · 15 comments
Open
1 task

Self-hosted not unrestricted​ #6641

deckerjulian opened this issue Apr 19, 2024 · 15 comments

Comments

@deckerjulian
Copy link

What happened?

The Github README names:
"Self-Host
Begin with Docker to deploy your own feature-rich, unrestricted version of AFFiNE. Our team is diligently updating to the latest version. For more information on how to self-host AFFiNE, please refer to our documentation."

but after deploying the self-hosted Version and login I see a "Free" Label beside the Username having all restrictions like 10GB and only 3 members per Workspace. How to get the unrestricted self-hosted Version?

Distribution version

macOS x64 (Intel)

What browsers are you seeing the problem on if you're using web version?

No response

Are you self-hosting?

  • Yes

Relevant log output

No response

Anything else?

No response

@affine-issue-bot
Copy link

Issue Status: 🆕 *Untriaged

*🆕 Untriaged

The team has not yet reviewed the issue. We usually do it within one business day.
Docs: https://github.com/toeverything/AFFiNE/blob/canary/docs/issue-triaging.md

This is an automatic reply by the bot.

@pengx17
Copy link
Collaborator

pengx17 commented Apr 24, 2024

We will provide more options to config these settings in the future.

@StudyingLover
Copy link

When will provide more options? 😭 We deploy self-hosted version. My team is more than 10 people, but pro user only invite 10 people to a workspace.

@Macbook-Specter
Copy link

Hello, how to lift the 10GB restriction?
I have self-host and limit storage.

@StudyingLover
Copy link

@Macbook-Specter #6156 (comment) Maybe it useful for you. You can change storageQuota I think. (btw, I never try)

@Macbook-Specter
Copy link

@StudyingLover Thank you very much

@deckerjulian
Copy link
Author

deckerjulian commented May 20, 2024

Hey,

for everyone wanted to change limitations on a self-hosted instance until there's an update in the future to do this with a gui:

  • Enter Docker PostgreSQL Server
    docker exec -it affine_postgres psql -U affine
  • List possible feature id's
    select id, feature, configs from features;
  • List users with id's
    select * from users;
  • List features assigned to users
    select * from user_features;
  • assigne for example 'pro_plan_v1' to the user
    feature_id = YOUR FEATURE ID YOU WANT TO ASSIGN (get it from 'List possible feature id's')
    user_id = YOUR USER ID YOU WANT TO CHANGE (get it from 'List users with id's')
    update user_features set feature_id = 35 where user_id = 'xxxxxx-xxxx-xxxxxxx-xxxx-xxxxxxxxxxxxxx';

@deckerjulian
Copy link
Author

For everyone need more than the pro plan limitations:
It is also possible to update the feature configs to change limitations like members for e.x.

update features set configs = '{"name":"Pro","blobLimit":104857600,"storageQuota":107374182400,"historyPeriod":2592000000,"memberLimit":100,"copilotActionLimit":10}' where id = 14;

Just restart the docker container afterwards. Now the limit of the members should be 100.

@lennon101
Copy link

update features set configs = '{"name":"Pro","blobLimit":104857600,"storageQuota":107374182400,"historyPeriod":2592000000,"memberLimit":100,"copilotActionLimit":10}' where id = 14;

Thannks for this, but where do I run this command? Can you please provide a little more detail? Is there a docker compose environment variable that I can add to edit this setting? or needs to be done via the terminal only?

@deckerjulian
Copy link
Author

update features set configs = '{"name":"Pro","blobLimit":104857600,"storageQuota":107374182400,"historyPeriod":2592000000,"memberLimit":100,"copilotActionLimit":10}' where id = 14;

Thannks for this, but where do I run this command? Can you please provide a little more detail? Is there a docker compose environment variable that I can add to edit this setting? or needs to be done via the terminal only?

Hey there,
changes have to be done in the PostgreSQL Database. Access is possible with the commands mentioned above:

Enter Docker PostgreSQL Server
docker exec -it affine_postgres psql -U affine
List possible feature id's
select id, feature, configs from features;

@svenseeberg
Copy link

svenseeberg commented Sep 15, 2024

update features set configs = '{"name":"Pro","blobLimit":104857600,"storageQuota":107374182400,"historyPeriod":2592000000,"memberLimit":100,"copilotActionLimit":10}' where id = 14;

Thannks for this, but where do I run this command? Can you please provide a little more detail? Is there a docker compose environment variable that I can add to edit this setting? or needs to be done via the terminal only?

As the back end is not Open Source, this is AFAICT an infringement of the Terms of Service, you need to agree to. They specifically state in section 8:

Circumvent, disable, or otherwise interfere with security-related features of the Services, including features that prevent or restrict the use or copying of any Content or enforce limitations on the use of the Services and/or the Content contained therein.

Can someone confirm this?

@ccrvlh
Copy link

ccrvlh commented Oct 10, 2024

Hm, @svenseeberg good catch. Can't confirm from a legal perspective, but seems workspace quota fits this use case
as it is a feature that enforces limitations.

I just wish the description of the project was different.

Privacy first, open-source, customizable and ready to use.

Doesn't seem to be a precise description of the project, nor the repository.

@kendofriendo
Copy link

update features set configs = '{"name":"Pro","blobLimit":104857600,"storageQuota":107374182400,"historyPeriod":2592000000,"memberLimit":100,"copilotActionLimit":10}' where id = 14;

Thannks for this, but where do I run this command? Can you please provide a little more detail? Is there a docker compose environment variable that I can add to edit this setting? or needs to be done via the terminal only?

As the back end is not Open Source, this is AFAICT an infringement of the Terms of Service, you need to agree to. They specifically state in section 8:

Circumvent, disable, or otherwise interfere with security-related features of the Services, including features that prevent or restrict the use or copying of any Content or enforce limitations on the use of the Services and/or the Content contained therein.

Can someone confirm this?

That license also states:

This EE License applies only to the part of this Software that is not
distributed as part of AFFiNE Community Edition

And at the bottom of the distro:

AFFiNE Community Edition (CE) is the current available version, it's free for self-host under the MIT license.

Thus, the restriction does not apply here since it is included with the community edition. The restriction is, imo, clearly intended to prevent subscribers of the enterprise edition, or users of the "basic" edition from manually editing the backend to remove restrictions without paying for them.

An admin at on their community site says in response to asking about self-hosted file-size limits:

With the initial versions there are some limits on the accounts, I believe they are similar to the Pro account in terms of restrictions.

Before the full administration panel or other management settings come out you may have luck editing some of the config files.

@kendofriendo
Copy link

Also, you may want to use the 'insert' command instead of 'update', since this will replace the features you already have; i.e. if you use it to assign yourself the pro license, you will no longer be an admin. If you want to remain admin and add features to your account:

insert into user_features (id, user_id, feature_id, reason, created_at, expired_at, activated) values (3, 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx', 16, 'selfhost', DEFAULT, DEFAULT, 't');

Change the 3 to be n+1 where n is the current highest id in the user_features table. Change the 16 to be the id of whatever feature_id you're trying to add. 'selfhost' can be whatever, it's an arbitrary field for the reason column. Make sure the last one is 't' to make sure the feature is activated.

@snmnr
Copy link

snmnr commented Nov 15, 2024

  • update user_features set feature_id = 35 where user_id = 'xxxxxx-xxxx-xxxxxxx-xxxx-xxxxxxxxxxxxxx';

I can use this method to change the configuration, the capacity limit can see the change, but the upload limit is still 10M

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🆕 *Untriaged
Development

No branches or pull requests

9 participants