diff --git a/README.md b/README.md index 1e7924697..f74cbf972 100644 --- a/README.md +++ b/README.md @@ -6,23 +6,61 @@ **Mangane FE** is a frontend for Pleroma with a focus on custom branding and ease of use. -## :rocket: Deploy on Pleroma +## :rocket: Deploy on Pleroma/Akkoma -Installing Mangane FE on an existing Pleroma server is extremely easy. -Just ssh into the server and download a .zip of the latest build. +Installing Mangane FE on an existing Pleroma server is easy. +Log in your server and follow those instructions depending on your configuration. -Then unpack it into Pleroma's `instance` directory: +### Download -```sh -busybox unzip static.zip -o -d /opt/pleroma/instance +First you need to download mangane on your server. + +#### OTP + +``` +/opt/pleroma/bin/pleroma_ctl frontend install mangane --ref dist --build-url https://github.com/Cl0v1s/mangane-ui/releases/latest/download/static.zip +``` +*Note: The pleroma_ctl path may vary on your system* + +#### Mix / Source + +``` +mix pleroma.frontend install mangane --ref dist --build-url https://github.com/Cl0v1s/mangane-ui/releases/latest/download/static.zip ``` +#### Admin-fe with database configuration enabled + +Just fill the form at Frontend/Available like this. + +![admin-fe](./admin-fe.png) + +### Activation + +Then you need to activate the frontend the it will be available to your users. + +#### Config.exs + +Edit your configuration files to add/edit the `config :pleroma, :frontends` section like this + +``` +config :pleroma, :frontends, + primary: %{ + "name" => "mangane", + "ref" => "dist" + } +``` + +##### Admin-fe with database configuration enabled + +Just fill the form at Frontend/frontends/Primary like this. + +![admin-fe](./admin-fe2.png) + + **That's it!** :tada: **Mangane FE is installed.** The change will take effect immediately, just refresh your browser tab. -It's not necessary to restart the Pleroma service. - -To remove Mangane FE and revert to the default pleroma-fe, simply `rm /opt/pleroma/instance/static/index.html` (you can delete other stuff in there too, but be careful not to delete your own HTML files). +You may need to restart pleroma/akkoma for the change to take effect. ## :elephant: Deploy on Mastodon diff --git a/admin-fe.png b/admin-fe.png new file mode 100644 index 000000000..fd87b2285 Binary files /dev/null and b/admin-fe.png differ diff --git a/admin-fe2.png b/admin-fe2.png new file mode 100644 index 000000000..88041ac2f Binary files /dev/null and b/admin-fe2.png differ diff --git a/app/soapbox/actions/notifications.ts b/app/soapbox/actions/notifications.ts index 79994bde5..3a554e38a 100644 --- a/app/soapbox/actions/notifications.ts +++ b/app/soapbox/actions/notifications.ts @@ -10,7 +10,7 @@ import api, { getLinks } from 'soapbox/api'; import compareId from 'soapbox/compare_id'; import { getFilters, regexFromFilters } from 'soapbox/selectors'; import { isLoggedIn } from 'soapbox/utils/auth'; -import { getFeatures, parseVersion, PLEROMA } from 'soapbox/utils/features'; +import { getFeatures, parseVersion, PLEROMA, AKKOMA } from 'soapbox/utils/features'; import { unescapeHTML } from 'soapbox/utils/html'; import { joinPublicPath } from 'soapbox/utils/static'; @@ -318,7 +318,7 @@ const markReadNotifications = () => dispatch(saveMarker(marker)); - if (v.software === PLEROMA) { + if (v.software === PLEROMA || v.software === AKKOMA) { dispatch(markReadPleroma(topNotificationId)); } } diff --git a/app/soapbox/features/hashtag_timeline/index.js b/app/soapbox/features/hashtag_timeline/index.js index 888573579..d1611a8c8 100644 --- a/app/soapbox/features/hashtag_timeline/index.js +++ b/app/soapbox/features/hashtag_timeline/index.js @@ -113,7 +113,9 @@ class HashtagTimeline extends React.PureComponent { return ( - +
+ +
) => { }; // Get the software's default attachment limit -const getAttachmentLimit = (software: string | null) => software === PLEROMA ? Infinity : 4; +const getAttachmentLimit = (software: string | null) => (software === PLEROMA || software === AKKOMA) ? Infinity : 4; // Normalize version const normalizeVersion = (instance: ImmutableMap) => { diff --git a/app/soapbox/reducers/compose.ts b/app/soapbox/reducers/compose.ts index d8fd41c3b..7d4b7fa09 100644 --- a/app/soapbox/reducers/compose.ts +++ b/app/soapbox/reducers/compose.ts @@ -2,7 +2,7 @@ import { Map as ImmutableMap, List as ImmutableList, OrderedSet as ImmutableOrde import { v4 as uuid } from 'uuid'; import { tagHistory } from 'soapbox/settings'; -import { PLEROMA } from 'soapbox/utils/features'; +import { PLEROMA, AKKOMA } from 'soapbox/utils/features'; import { hasIntegerMediaIds } from 'soapbox/utils/status'; import { @@ -445,7 +445,7 @@ export default function compose(state = ReducerRecord({ idempotencyKey: uuid(), map.set('content_type', action.contentType || 'text/plain'); map.set('quote', action.status.get('quote')); - if (action.v?.software === PLEROMA && action.withRedraft && hasIntegerMediaIds(action.status)) { + if ((action.v?.software === PLEROMA || action.v?.software === AKKOMA) && action.withRedraft && hasIntegerMediaIds(action.status)) { map.set('media_attachments', ImmutableList()); } else { map.set('media_attachments', action.status.media_attachments); diff --git a/app/soapbox/utils/features.ts b/app/soapbox/utils/features.ts index 02d98010e..6a986c490 100644 --- a/app/soapbox/utils/features.ts +++ b/app/soapbox/utils/features.ts @@ -27,6 +27,12 @@ export const MASTODON = 'Mastodon'; */ export const PLEROMA = 'Pleroma'; +/** + * Akkoma, a cooler fork of Pleroma + * @see {@link https://docs.akkoma.dev/stable/} + */ +export const AKKOMA = 'Akkoma'; + /** * Mitra, a Rust backend with deep Ethereum integrations. * @see {@link https://codeberg.org/silverpill/mitra} @@ -69,13 +75,13 @@ const getInstanceFeatures = (instance: Instance) => { * @see GET /api/pleroma/aliases * @see PATCH /api/v1/accounts/update_credentials */ - accountAliases: v.software === PLEROMA, + accountAliases: (v.software === PLEROMA || v.software === AKKOMA), /** * The accounts API allows an acct instead of an ID. * @see GET /api/v1/accounts/:acct_or_id */ - accountByUsername: v.software === PLEROMA, + accountByUsername: (v.software === PLEROMA || v.software === AKKOMA), /** * Ability to create accounts. @@ -83,7 +89,7 @@ const getInstanceFeatures = (instance: Instance) => { */ accountCreation: any([ v.software === MASTODON, - v.software === PLEROMA, + (v.software === PLEROMA || v.software === AKKOMA), ]), /** @@ -92,14 +98,14 @@ const getInstanceFeatures = (instance: Instance) => { * @see POST /api/v1/accounts/:id/unpin * @see GET /api/v1/pleroma/accounts/:id/endorsements */ - accountEndorsements: v.software === PLEROMA && gte(v.version, '2.4.50'), + accountEndorsements: (v.software === PLEROMA || v.software === AKKOMA) && gte(v.version, '2.4.50'), /** * Ability to set one's location on their profile. * @see PATCH /api/v1/accounts/update_credentials */ accountLocation: any([ - v.software === PLEROMA && v.build === SOAPBOX && gte(v.version, '2.4.50'), + (v.software === PLEROMA || v.software === AKKOMA) && v.build === SOAPBOX && gte(v.version, '2.4.50'), v.software === TRUTHSOCIAL, ]), @@ -109,7 +115,7 @@ const getInstanceFeatures = (instance: Instance) => { */ accountLookup: any([ v.software === MASTODON && gte(v.compatVersion, '3.4.0'), - v.software === PLEROMA && gte(v.version, '2.4.50'), + (v.software === PLEROMA || v.software === AKKOMA) && gte(v.version, '2.4.50'), v.software === TRUTHSOCIAL, ]), @@ -117,7 +123,7 @@ const getInstanceFeatures = (instance: Instance) => { * Move followers to a different ActivityPub account. * @see POST /api/pleroma/move_account */ - accountMoving: v.software === PLEROMA && gte(v.version, '2.4.50'), + accountMoving: (v.software === PLEROMA || v.software === AKKOMA) && gte(v.version, '2.4.50'), /** * Ability to subscribe to notifications every time an account posts. @@ -125,7 +131,7 @@ const getInstanceFeatures = (instance: Instance) => { */ accountNotifies: any([ v.software === MASTODON && gte(v.compatVersion, '3.3.0'), - v.software === PLEROMA && gte(v.version, '2.4.50'), + (v.software === PLEROMA || v.software === AKKOMA) && gte(v.version, '2.4.50'), v.software === TRUTHSOCIAL, ]), @@ -134,7 +140,7 @@ const getInstanceFeatures = (instance: Instance) => { * @see POST /api/v1/pleroma/accounts/:id/subscribe * @see POST /api/v1/pleroma/accounts/:id/unsubscribe */ - accountSubscriptions: v.software === PLEROMA && gte(v.version, '1.0.0'), + accountSubscriptions: (v.software === PLEROMA || v.software === AKKOMA) && gte(v.version, '1.0.0'), /** * Ability to set one's website on their profile. @@ -150,7 +156,7 @@ const getInstanceFeatures = (instance: Instance) => { */ announcements: any([ v.software === MASTODON && gte(v.compatVersion, '3.1.0'), - v.software === PLEROMA && gte(v.version, '2.2.49'), + (v.software === PLEROMA || v.software === AKKOMA) && gte(v.version, '2.2.49'), ]), /** @@ -167,7 +173,7 @@ const getInstanceFeatures = (instance: Instance) => { * @see POST /api/v1/accounts * @see PATCH /api/v1/accounts/update_credentials */ - birthdays: v.software === PLEROMA && v.build === SOAPBOX && gte(v.version, '2.4.50'), + birthdays: (v.software === PLEROMA || v.software === AKKOMA) && v.build === SOAPBOX && gte(v.version, '2.4.50'), /** Whether people who blocked you are visible through the API. */ blockersVisible: features.includes('blockers_visible'), @@ -179,7 +185,7 @@ const getInstanceFeatures = (instance: Instance) => { */ bookmarks: any([ v.software === MASTODON && gte(v.compatVersion, '3.1.0'), - v.software === PLEROMA && gte(v.version, '0.9.9'), + (v.software === PLEROMA || v.software === AKKOMA) && gte(v.version, '0.9.9'), v.software === PIXELFED, ]), @@ -189,20 +195,20 @@ const getInstanceFeatures = (instance: Instance) => { */ bots: any([ v.software === MASTODON, - v.software === PLEROMA, + (v.software === PLEROMA || v.software === AKKOMA), ]), /** * Pleroma chats API. * @see {@link https://docs.pleroma.social/backend/development/API/chats/} */ - chats: v.software === PLEROMA && gte(v.version, '2.1.0'), + chats: (v.software === PLEROMA || v.software === AKKOMA) && gte(v.version, '2.1.0'), /** * Paginated chats API. * @see GET /api/v2/chats */ - chatsV2: v.software === PLEROMA && gte(v.version, '2.3.0'), + chatsV2: (v.software === PLEROMA || v.software === AKKOMA) && gte(v.version, '2.3.0'), /** * Mastodon's newer solution for direct messaging. @@ -210,7 +216,7 @@ const getInstanceFeatures = (instance: Instance) => { */ conversations: any([ v.software === MASTODON && gte(v.compatVersion, '2.6.0'), - v.software === PLEROMA && gte(v.version, '0.9.9'), + (v.software === PLEROMA || v.software === AKKOMA) && gte(v.version, '0.9.9'), v.software === PIXELFED, ]), @@ -220,7 +226,7 @@ const getInstanceFeatures = (instance: Instance) => { */ directTimeline: any([ v.software === MASTODON && lt(v.compatVersion, '3.0.0'), - v.software === PLEROMA && gte(v.version, '0.9.9'), + (v.software === PLEROMA || v.software === AKKOMA) && gte(v.version, '0.9.9'), ]), editStatuses: any([ @@ -250,13 +256,13 @@ const getInstanceFeatures = (instance: Instance) => { * @see GET /api/v1/pleroma/statuses/:id/reactions/:emoji? * @see DELETE /api/v1/pleroma/statuses/:id/reactions/:emoji */ - emojiReacts: v.software === PLEROMA && gte(v.version, '2.0.0'), + emojiReacts: (v.software === PLEROMA || v.software === AKKOMA) && gte(v.version, '2.0.0'), /** * The backend allows only RGI ("Recommended for General Interchange") emoji reactions. * @see PUT /api/v1/pleroma/statuses/:id/reactions/:emoji */ - emojiReactsRGI: v.software === PLEROMA && gte(v.version, '2.2.49'), + emojiReactsRGI: (v.software === PLEROMA || v.software === AKKOMA) && gte(v.version, '2.2.49'), /** * Sign in with an Ethereum wallet. @@ -269,7 +275,9 @@ const getInstanceFeatures = (instance: Instance) => { * @see POST /api/v1/statuses */ explicitAddressing: any([ - v.software === PLEROMA && gte(v.version, '1.0.0'), + // Keep as comment for the day mastodon will show things correctly + // https://github.com/Cl0v1s/mangane/issues/27 + // v.software === PLEROMA && gte(v.version, '1.0.0'), v.software === TRUTHSOCIAL, ]), @@ -298,7 +306,7 @@ const getInstanceFeatures = (instance: Instance) => { */ filters: any([ v.software === MASTODON && lt(v.compatVersion, '3.6.0'), - v.software === PLEROMA, + (v.software === PLEROMA || v.software === AKKOMA), ]), /** @@ -313,20 +321,20 @@ const getInstanceFeatures = (instance: Instance) => { */ followRequests: any([ v.software === MASTODON, - v.software === PLEROMA, + (v.software === PLEROMA || v.software === AKKOMA), ]), /** * Whether client settings can be retrieved from the API. * @see GET /api/pleroma/frontend_configurations */ - frontendConfigurations: v.software === PLEROMA, + frontendConfigurations: (v.software === PLEROMA || v.software === AKKOMA), /** * Can hide follows/followers lists and counts. * @see PATCH /api/v1/accounts/update_credentials */ - hideNetwork: v.software === PLEROMA, + hideNetwork: (v.software === PLEROMA || v.software === AKKOMA), /** * Pleroma import API. @@ -334,7 +342,7 @@ const getInstanceFeatures = (instance: Instance) => { * @see POST /api/pleroma/blocks_import * @see POST /api/pleroma/mutes_import */ - import: v.software === PLEROMA, + import: (v.software === PLEROMA || v.software === AKKOMA), /** * Pleroma import endpoints. @@ -342,7 +350,7 @@ const getInstanceFeatures = (instance: Instance) => { * @see POST /api/pleroma/blocks_import * @see POST /api/pleroma/mutes_import */ - importData: v.software === PLEROMA && gte(v.version, '2.2.0'), + importData: (v.software === PLEROMA || v.software === AKKOMA) && gte(v.version, '2.2.0'), /** * Can create, view, and manage lists. @@ -351,7 +359,7 @@ const getInstanceFeatures = (instance: Instance) => { */ lists: any([ v.software === MASTODON && gte(v.compatVersion, '2.1.0'), - v.software === PLEROMA && gte(v.version, '0.9.9'), + (v.software === PLEROMA || v.software === AKKOMA) && gte(v.version, '0.9.9'), ]), /** @@ -365,7 +373,7 @@ const getInstanceFeatures = (instance: Instance) => { */ mastodonAdmin: any([ v.software === MASTODON && gte(v.compatVersion, '2.9.1'), - v.software === PLEROMA && v.build === SOAPBOX && gte(v.version, '2.4.50'), + (v.software === PLEROMA || v.software === AKKOMA) && v.build === SOAPBOX && gte(v.version, '2.4.50'), ]), /** @@ -382,14 +390,14 @@ const getInstanceFeatures = (instance: Instance) => { mediaV2: any([ v.software === MASTODON && gte(v.compatVersion, '3.1.3'), // Even though Pleroma supports these endpoints, it has disadvantages - // v.software === PLEROMA && gte(v.version, '2.1.0'), + // (v.software === PLEROMA || v.software === AKKOMA) && gte(v.version, '2.1.0'), ]), /** * Ability to hide notifications from people you don't follow. * @see PUT /api/pleroma/notification_settings */ - muteStrangers: v.software === PLEROMA, + muteStrangers: (v.software === PLEROMA || v.software === AKKOMA), /** * Add private notes to accounts. @@ -398,7 +406,7 @@ const getInstanceFeatures = (instance: Instance) => { */ notes: any([ v.software === MASTODON && gte(v.compatVersion, '3.2.0'), - v.software === PLEROMA && gte(v.version, '2.4.50'), + (v.software === PLEROMA || v.software === AKKOMA) && gte(v.version, '2.4.50'), ]), /** @@ -407,7 +415,7 @@ const getInstanceFeatures = (instance: Instance) => { */ notificationsIncludeTypes: any([ v.software === MASTODON && gte(v.compatVersion, '3.5.0'), - v.software === PLEROMA && gte(v.version, '2.4.50'), + (v.software === PLEROMA || v.software === AKKOMA) && gte(v.version, '2.4.50'), ]), /** @@ -429,7 +437,7 @@ const getInstanceFeatures = (instance: Instance) => { * Displays a form to follow a user when logged out. * @see POST /main/ostatus */ - pleromaRemoteFollow: v.software === PLEROMA, + pleromaRemoteFollow: (v.software === PLEROMA || v.software === AKKOMA), /** * Can add polls to statuses. @@ -437,7 +445,7 @@ const getInstanceFeatures = (instance: Instance) => { */ polls: any([ v.software === MASTODON && gte(v.version, '2.8.0'), - v.software === PLEROMA, + (v.software === PLEROMA || v.software === AKKOMA), v.software === TRUTHSOCIAL, ]), @@ -462,7 +470,7 @@ const getInstanceFeatures = (instance: Instance) => { */ profileFields: any([ v.software === MASTODON, - v.software === PLEROMA, + (v.software === PLEROMA || v.software === AKKOMA), ]), /** @@ -472,7 +480,7 @@ const getInstanceFeatures = (instance: Instance) => { */ publicTimeline: any([ v.software === MASTODON, - v.software === PLEROMA, + (v.software === PLEROMA || v.software === AKKOMA), ]), /** @@ -480,7 +488,7 @@ const getInstanceFeatures = (instance: Instance) => { * @see POST /api/v1/statuses */ quotePosts: any([ - v.software === PLEROMA && v.build === SOAPBOX && gte(v.version, '2.4.50'), + (v.software === PLEROMA || v.software === AKKOMA) && v.build === SOAPBOX && gte(v.version, '2.4.50'), instance.feature_quote === true, ]), @@ -488,7 +496,7 @@ const getInstanceFeatures = (instance: Instance) => { * Interact with statuses from another instance while logged-out. * @see POST /api/v1/pleroma/remote_interaction */ - remoteInteractions: v.software === PLEROMA && gte(v.version, '2.4.50'), + remoteInteractions: (v.software === PLEROMA || v.software === AKKOMA) && gte(v.version, '2.4.50'), /** * Ability to remove an account from your followers. @@ -496,19 +504,19 @@ const getInstanceFeatures = (instance: Instance) => { */ removeFromFollowers: any([ v.software === MASTODON && gte(v.compatVersion, '3.5.0'), - v.software === PLEROMA && v.build === SOAPBOX && gte(v.version, '2.4.50'), + (v.software === PLEROMA || v.software === AKKOMA) && v.build === SOAPBOX && gte(v.version, '2.4.50'), ]), reportMultipleStatuses: any([ v.software === MASTODON, - v.software === PLEROMA, + (v.software === PLEROMA || v.software === AKKOMA), ]), /** * Can request a password reset email through the API. * @see POST /auth/password */ - resetPassword: v.software === PLEROMA, + resetPassword: (v.software === PLEROMA || v.software === AKKOMA), /** * Ability to post statuses in Markdown, BBCode, and HTML. @@ -516,7 +524,7 @@ const getInstanceFeatures = (instance: Instance) => { */ richText: any([ v.software === MASTODON && v.build === GLITCH, - v.software === PLEROMA, + (v.software === PLEROMA || v.software === AKKOMA), ]), /** @@ -526,7 +534,7 @@ const getInstanceFeatures = (instance: Instance) => { */ scheduledStatuses: any([ v.software === MASTODON && gte(v.version, '2.7.0'), - v.software === PLEROMA, + (v.software === PLEROMA || v.software === AKKOMA), ]), /** @@ -534,7 +542,7 @@ const getInstanceFeatures = (instance: Instance) => { * @see POST /api/v1/apps * @see POST /oauth/token */ - scopes: v.software === PLEROMA ? 'read write follow push admin' : 'read write follow push admin:read admin:write', + scopes: (v.software === PLEROMA || v.software === AKKOMA) ? 'read write follow push admin' : 'read write follow push admin:read admin:write', /** * Ability to search statuses from the given account. @@ -543,7 +551,7 @@ const getInstanceFeatures = (instance: Instance) => { */ searchFromAccount: any([ v.software === MASTODON && gte(v.version, '2.8.0'), - v.software === PLEROMA && gte(v.version, '1.0.0'), + (v.software === PLEROMA || v.software === AKKOMA) && gte(v.version, '1.0.0'), ]), /** @@ -553,7 +561,7 @@ const getInstanceFeatures = (instance: Instance) => { * @see POST /api/pleroma/delete_account */ security: any([ - v.software === PLEROMA, + (v.software === PLEROMA || v.software === AKKOMA), v.software === TRUTHSOCIAL, ]), @@ -562,14 +570,14 @@ const getInstanceFeatures = (instance: Instance) => { * @see GET /api/oauth_tokens.json * @see DELETE /api/oauth_tokens/:id */ - sessions: v.software === PLEROMA, + sessions: (v.software === PLEROMA || v.software === AKKOMA), /** * Can store client settings in the database. * @see PATCH /api/v1/accounts/update_credentials */ settingsStore: any([ - v.software === PLEROMA, + (v.software === PLEROMA || v.software === AKKOMA), v.software === TRUTHSOCIAL, ]), @@ -629,7 +637,7 @@ const getInstanceFeatures = (instance: Instance) => { * Whether the backend allows adding users you don't follow to lists. * @see POST /api/v1/lists/:id/accounts */ - unrestrictedLists: v.software === PLEROMA, + unrestrictedLists: (v.software === PLEROMA || v.software === AKKOMA), }; }; diff --git a/app/soapbox/utils/quirks.ts b/app/soapbox/utils/quirks.ts index 6abfec205..aec44f38d 100644 --- a/app/soapbox/utils/quirks.ts +++ b/app/soapbox/utils/quirks.ts @@ -1,7 +1,7 @@ /* eslint sort-keys: "error" */ import { createSelector } from 'reselect'; -import { parseVersion, PLEROMA, MITRA } from './features'; +import { parseVersion, PLEROMA, MITRA, AKKOMA } from './features'; import type { RootState } from 'soapbox/store'; import type { Instance } from 'soapbox/types/entities'; @@ -16,7 +16,7 @@ export const getQuirks = createSelector([ * @see GET /api/v1/blocks * @see GET /api/v1/mutes */ - invertedPagination: v.software === PLEROMA, + invertedPagination: v.software === PLEROMA || v.software === AKKOMA, /** * Apps are not supported by the API, and should not be created during login or registration. diff --git a/package.json b/package.json index 3362bbea0..3cd225d01 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mangane-fe", - "version": "dry-axolotl-test", + "version": "hot-snowleopard", "displayName": "Mangane", "description": "Devanture pour https://bdx.town", "homepage": "https://bdx.town",