toeverything / AFFiNE

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.
https://affine.pro
Other
42.69k stars 2.79k forks source link

Self-hosted not unrestricted​ #6641

Open deckerjulian opened 7 months ago

deckerjulian commented 7 months ago

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?

Relevant log output

No response

Anything else?

No response

affine-issue-bot[bot] commented 7 months ago

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 commented 7 months ago

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

StudyingLover commented 6 months ago

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

Macbook-Specter commented 6 months ago

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

StudyingLover commented 6 months ago

@Macbook-Specter https://github.com/toeverything/AFFiNE/issues/6156#issuecomment-2084366898 Maybe it useful for you. You can change storageQuota I think. (btw, I never try)

Macbook-Specter commented 6 months ago

@StudyingLover Thank you very much

deckerjulian commented 6 months ago

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:

deckerjulian commented 5 months ago

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 commented 5 months ago

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 commented 5 months ago

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 commented 2 months ago

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 commented 1 month ago

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 commented 3 weeks ago

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 commented 2 weeks ago

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 commented 1 week ago
  • 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