Scoold

用 Java 编写的 Stack Overflow 克隆(自托管)。「 Stack Overflow clone written in Java (self-hosted) 」

Github stars Tracking Chart

JAR 中的 Stack Overflow

Scoold 是一个用 Java 编写的问答平台。该项目创建于2008年,2012年作为面向学校的社交网络发布,其灵感来自 Stack Overflow。2017年,它进行了重构、重新包装和开源。

Scoold 可以在任何地方运行 --- Heroku、DigitalOcean、AWS、Azure 或任何 VPS 主机提供商。它是轻量级的(~4000 LOC),后端由一个名为 Para 的独立服务处理。Scoold 不需要数据库,而且控制器逻辑非常简单,因为所有繁重的工作都委托给了 Para。这使得代码易于阅读,并且初级开发人员可以快速学习。

该项目由独立的自助公司 --- Erudika 公司提供资助和支持。

特性

  • 功能齐全的问答平台
  • 数据库无关,针对云部署进行了优化
  • 全文检索
  • 分布式对象缓存
  • 基于位置的搜索和"我附近的"帖子过滤
  • I18n 支持 RTL 语言
  • 有徽章的声誉和投票机制
  • 空间(团队) -- 由独立的问题和用户组成的组
  • 带有签名的 Webhooks
  • 基于 jQuery 的最小前端 JS 代码
  • 由 Materialise CSS 提供支持的现代响应式布局
  • 类似问题的建议和重复帖子的提示
  • 发送回复和评论的电子邮件通知
  • Spring Boot 项目(单 JAR)
  • LDAP 身份验证支持
  • 社交登录(Facebook,Google,GitHub,LinkedIn,微软,Slack,Twitter),支持 Gravatar
  • 文章中的代码语法高亮显示,GFM markdown 支持表格、任务列表和划线
  • Emoji 表情符号支持 -- 小抄
  • SEO 友好

专业版功能(这个版本是收费的,详情参见 Scoold Pro

  • Slack整合
  • SAML 支持
  • 匿名帖子
  • 无限空间
  • 多个管理员
  • 多个身份域
  • 粘贴/收藏帖子
  • 高级语法突出显示
  • 图片上传
  • 安全通知
  • 最近问题的电子邮件摘要
  • 帐户暂停/ permabans
  • 维基风格的答案
  • 提及通知

在线演示

演示部署在一个免费的dyno上,可能需要一分钟来唤醒。

Heroku 上的在线演示

构建 Scoold

要编译它,你需要 JDK 8+ 和 Maven。 一旦你拥有它,只需克隆和构建:

$ git clone https://github.com/erudika/scoold.git && cd scoold
$ mvn install

要运行 Scoold 的本地实例进行开发,请使用:

$ mvn -Dconfig.file=./application.conf spring-boot:run

支持

您可以通过提交问题获得支持。 您也可以前往 Gitter 聊天室寻求帮助。有关Scoold Pro 的问题须报告给 Erudika/scoold-pro此外,Erudika 还提供付费/优先支持服务

博客

在我们的博客上阅读更多关于 Scoold 的内容

许可

Apache 2.0

(First edition: vz edited at 2019.09.11)

Overview

Name With Owneraisuda/amis-admin
Primary LanguageHTML
Program languageJava (Language Count: 2)
PlatformBSD, Cross-platform, Linux, Mac, Solaris, Unix-like, Windows
License:
Release Count0
Created At2019-04-30 09:58:56
Pushed At2024-03-01 02:49:38
Last Commit At2023-07-27 12:23:43
Stargazers Count1.4k
Watchers Count36
Fork Count424
Commits Count105
Has Issues Enabled
Issues Count0
Issue Open Count0
Pull Requests Count4
Pull Requests Open Count0
Pull Requests Close Count1
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private

Scoold Q&A

Stack Overflow in a JAR

Join the chat at https://gitter.im/Erudika/scoold

Scoold is a Q&A platform written in Java. The project was created back in 2008, released in 2012 as social network for
schools inspired by Stack Overflow. In 2017 it was refactored, repackaged and open-sourced.

Scoold can run anywhere - Heroku, DigitalOcean, AWS, Azure or any VPS hosting provider. It's lightweight (~4000 LOC),
the backend is handled by a separate service called Para. Scoold does not require a
database, and the controller logic is really simple because all the heavy lifting is delegated to Para.
This makes the code easy to read and can be learned quickly by junior developers.

This project is fully funded and supported by Erudika - an independent, bootstrapped company.

Features

  • Full featured Q&A platform
  • Database-agnostic, optimized for cloud deployment
  • Full-text search
  • Distributed object cache
  • Location-based search and "near me" filtering of posts
  • I18n with RTL language support
  • Reputation and voting system with badges
  • Spaces (Teams) - groups of isolated questions and users
  • Webhooks with signature signing
  • Minimal frontend JS code based on jQuery
  • Modern, responsive layout powered by Materialize CSS
  • Suggestions for similar questions and hints for duplicate posts
  • Email notifications for post replies and comments
  • Spring Boot project (single JAR)
  • LDAP authentication support
  • Social login (Facebook, Google, GitHub, LinkedIn, Microsoft, Slack, Twitter) with Gravatar support
  • Syntax highlighting for code in posts, GFM markdown support with tables, task lists and strikethrough
  • Emoji support - cheat sheet
  • SEO friendly

Pro Features

  • Slack integration
  • SAML support
  • Anonymous posts
  • Unlimited spaces
  • Multiple admins
  • Multiple identity domains
  • Sticky / Favorite posts
  • Advanced syntax highlighting
  • Image uploads
  • Security notifications
  • Email digest of recent questions
  • Account suspensions/permabans
  • Wiki-style answers
  • Mentions with notifications

Buy Scoold Pro 299 EUR

Live Demo

The demo is deployed on a free dyno and it might take a minute to wake up.

Live demo on Heroku

Quick Start (option 1 - managed Para backend, easier)

JDK 1.8 or higher is required to build and run the project.

  1. First, you need to create a developer app with Facebook,
    Google or any other identity provider that you wish to use.
    This isn't necessary if you're planning to login with LDAP, SAML or with a email and password.
    Save the obtained API keys in application.conf, as shown below.

Important: Authorized redirect URLs for Google and Facebook should look like this: https://{your_scoold_host},
https://{your_scoold_host}/signin. For all the other identity providers you must whitelist the Para host with the
appropriate authentication endpoint. For example, for GitHub, the redirect URL could be: https://paraio.com/github_auth.

  1. Create a new app on ParaIO.com and copy your access keys to a file
  2. Click one of the quick deploy buttons:

Quick Start (option 2 - self-hosted Para backend, harder)

Note: The Para backend server is deployed separately and is required for Scoold to run.

  1. Create a new app on ParaIO.com and save the access keys in application.conf OR run Para locally on port 8080
  2. Create a separate application.conf for Scoold and configure it to connect to Para on port 8080
  3. Start Scoold on port 8000: java -jar -Dserver.port=8000 -Dconfig.file=./application.conf scoold.jar OR mvn spring-boot:run
  4. Open http://localhost:8000 in your browser

If you run Para locally, use the Para CLI tool to create a separate app for Scoold:

# run setup and enter the keys for the root app and endpoint 'http://localhost:8080'
$ para-cli setup
$ para-cli ping
$ para-cli new-app "scoold" --name "Scoold"

Important: Do not use the same application.conf file for both Para and Scoold!
Keep the two applications in separate directories, each with its own configuration file.
The settings shown below are all meant to be part of the Scoold config file.

Read the Para docs for more information.

SMTP settings must be configured correctly before you start using Scoold if you want to signup with an email and password.

Configuration

Important: Create a separate app for Scoold, instead of using app:para, when hosting your own instance of Para.

The most important settings are para.endpoint - the URL of the Para server, as well as,
para.access_key and para.secret_key. Connection to a Para server is required for Scoold to run.

Copy the Scoold example configuration below to your application.conf and edit it if necessary:

para.app_name = "Scoold"
# the port for Scoold
para.port = 8000
# change this to "production" later
para.env = "development"
# the URL where Scoold is hosted, or http://localhost:8000
para.host_url = "https://your-scoold-domain.com"
# the URL of Para - could also be "http://localhost:8080"
para.endpoint = "https://paraio.com"
# access key for your Para app
para.access_key = "app:scoold"
# secret key for your Para app
para.secret_key = ""
# enable or disable email and password authentication
para.password_auth_enabled = true
# if false, commenting is allowed after 100+ reputation
para.new_users_can_comment = true
# if true, posts by new users require approval from moderator
para.posts_need_approval = false
# reputation needed for posts to be auto-approved
para.posts_rep_threshold = 100
# needed for geolocation filtering of posts
para.gmaps_api_key = ""
# Enable/disable near me feature (geolocation)
para.nearme_feature_enabled = false
# the identifier of admin user - check Para user object
para.admins = "admin@domain.com"
# GA code
para.google_analytics_id = "UA-123456-7"
# enables syntax highlighting in posts
para.code_highlighting_enabled = true
# Facebook - create your own Facebook app first!
para.fb_app_id = "123456789"
# Google - create your own Google app first!
para.google_client_id = "123-abcd.apps.googleusercontent.com"
# If true, the default space will be accessible by everyone
para.is_default_space_public = true
# If true, users can change their profile pictures
para.avatar_edits_enabled = true
# If true, users can change their names
para.name_edits_enabled = true
# Enable/disable webhooks support
para.webhooks_enabled = true
# Enable/disable wiki style answers
para.wiki_answers_enabled = true

On startup, Scoold will try to connect to Para 10 times, with a 10 second interval between retries. After that it will
fail and the settings will not be persisted. If you set the maximum number of retries to -1 there will be an infinite
number of attempts to connect to Para. These parameters are controlled by:

para.connection_retries_max = 10
para.connection_retry_interval_sec = 10

Docker

Tagged Docker images for Scoold are located at erudikaltd/scoold on Docker Hub.
First, have your Scoold application.conf configuration file ready in the current directory and run this command:

$ docker run -ti -p 8000:8000 --rm -v $(pwd)/application.conf:/scoold/application.conf \
  -e JAVA_OPTS="-Dconfig.file=/scoold/application.conf" erudikaltd/scoold

Environment variables

JAVA_OPTS - Java system properties, e.g. -Dpara.port=8000
BOOT_SLEEP - Startup delay, in seconds

Docker Compose

You can start the whole stack, Para + Scoold, with a single command using docker-compose.
First, create a new directory and copy docker-compose.yml to it from this repository. Create these 4 files:

  1. para.env - containing environment variables for Para, like JAVA_OPTS
  2. scoold.env - containing environment variables for Scoold, like JAVA_OPTS
  3. para-application.conf - containing the Para configuration (see example below)
  4. scoold-application.conf - containing the Scoold configuration (see example above)

An example para.env file:

JAVA_OPTS=-Dconfig.file=/para/application.conf

Example for scoold.env:

JAVA_OPTS=-Dconfig.file=/scoold/application.conf
BOOT_SLEEP=6

Example for para-application.conf:

para.env = "production"
para.dao = "H2DAO"

Then you can start both Scoold and Para with Docker Compose like so:

$ docker-compose up

Follow the quick start guide above to initialize Para and create a new app for Scoold. Once you have the access keys
for that app, update scoold-application.conf with those and restart the Para + Scoold Docker stack.

Kubernetes

There's a Helm chart inside the helm/ folder. First edit helm/scoold/values.yaml and then you can deploy Scoold to
Kubernetes with a single command:

cd helm; helm install ./scoold

For more info, read the README at helm/README.md.

Docker registry for Scoold Pro images

If you purchase Scoold Pro you can get access to the private Docker registry hosted on the AWS Elastic Container Registry.
Access to the private registry is not given automatically upon purchase - you have to request it. You will then be issued
a special access key and secret for AWS ECR which you save as a new profile in your ~/.aws/credentials. Then execute
the following BASH commands:

# authenticate docker with ECR using the temporary access token
$(aws --profile ScooldEcrProfile ecr get-login --no-include-email --region eu-west-1)
# list all tags
aws --profile ScooldEcrProfile ecr list-images --repository-name scoold-pro
# pull image with a specific tag
docker pull 374874639893.dkr.ecr.eu-west-1.amazonaws.com/scoold-pro:{tag}

The :latest tag is not supported. The command aws get-login gives you an access token to the private Docker registry
which is valid for 12 hours.

For connecting Kubernetes to AWS ECR, please refer to this article.

Deploying Scoold to Heroku

One-click deployment

Deploy

Manual deployment

  1. First, clone this repository and create a new Heroku app
  2. Add Heroku as a Git remote target and push your changes with git push heroku master
  3. Go to the Heroku admin panel, under "Settings", "Reveal Config Vars" and set all the configuration variables shown above.
  4. Open the app in your browser at https://{appname}.herokuapp.com.

Note: On Heroku, all configuration variables (config vars) must be set without dots ".", for example para.endpoint
becomes para_endpoint.

It's also helpful to install the Heroku CLI tool.

Deploying Scoold to DigitalOcean

  1. Create a droplet running Ubuntu and SSH into it
  2. Create a user ubuntu with adduser ubuntu
  3. Execute (as root) wget https://raw.githubusercontent.com/Erudika/scoold/master/installer.sh && bash installer.sh
  4. Copy the configuration file to your droplet: scp application.conf root@123.234.12.34:/home/ubuntu
  5. Restart Scoold with ssh root@123.234.12.34 "systemctl restart scoold.service"
  6. Go to http://123.234.12.34:8000 and verify that Scoold is running (use the correct IP address of your droplet)
  7. Configure SSL on DigitalOcean or install nginx + letsencrypt on your droplet (see instructions below)

Deploying Scoold to AWS

Lightsail

  1. Click the button above
  2. Choose "Linux", "OS only", "Ubuntu 18.04 LTS"
  3. Click "+ Add launch script" and copy/paste the contents of installer.sh
  4. Download the default SSH key pair or upload your own
  5. Choose the 512MB instance or larger (1GB recommended)
  6. Wait for the instance to start and open the IP address in your browser at port 8000

Elastic Container Service

  1. Find Scoold on the AWS Marketplace
  2. Click "Subscribe" and "Continue to Configuration/Launch"
  3. Follow the usage instructions and pull the container image from the given ECR registry URL

Elatic Beanstalk

  1. Clone this repo and change directory to it
  2. Generate a WAR package with mvn -Pwar package
  3. Create a new Beanstalk web app
  4. Upload the WAR package target/scoold-x.y.z.war to Beanstalk, modify any additional options and hit "Create"

Deploying Scoold to Azure

Deploy to Azure

  1. Click the button above
  2. Fill in the required parameters
  3. Launch the container
  4. Go to your container and press "Connect" using /bin/sh
  5. In the terminal type in vi application.conf, hit i and paste in your configuration
  6. Hit Esc and type in :wq then restart your container
    Another option is to attach a secret volume
    to your container, containing the configuration. It should be mounted as /scoold/application.conf.

Deploying Scoold to Google App Engine

  1. Clone this repo and change directory to it
  2. Create a project in the Google Cloud Platform Console
  3. Install the Google Cloud SDK
  4. Delete Dockerfile and app.yml
  5. Edit app.gae.yaml to suit your needs
  6. Deploy it with gcloud preview app deploy app.gae.yaml

Deploying Scoold to a servlet container

The instructions for Tomcat in particular are:

  1. Generate a WAR package with mvn -Pwar package
  2. Rename the WAR package to ROOT.war if you want it deployed to the root context or leave it as is
  3. Put the WAR package in Tomcat/webapps/ & start Tomcat
  4. Put application.conf in Tomcat/webapps/scoold-folder/WEB-INF/classes/ & restart Tomcat

Scoold is compatible with Tomcat 9+.

Deploying Scoold under a specific context path

To deploy Scoold at a different path instead of the root path, set para.context_path = "/newpath. The default value
for this setting is blank, meaning Scoold will be deployed at the root directory.

Content-Security-Policy header

This header is enabled by default for enhanced security. It can be disabled with para.csp_header_enabled = false.
The default value is modified through para.csp_header = "new_value". The default CSP header is:

default-src 'self';
base-uri 'self';
connect-src 'self' scoold.com www.google-analytics.com www.googletagmanager.com;
frame-src 'self' accounts.google.com staticxx.facebook.com;
font-src cdnjs.cloudflare.com fonts.gstatic.com fonts.googleapis.com;
style-src 'self' 'unsafe-inline' fonts.googleapis.com cdnjs.cloudflare.com static.scoold.com;
img-src 'self' https: data:;
object-src 'none;
report-uri /reports/cspv;
script-src 'unsafe-inline' https: 'nonce-{{nonce}}' 'strict-dynamic';

The placeholder {{nonce}} will get replaced by the CSP nonce value used for whitelisting scripts.

Note: If you get CSP violation errors, check your para.host_url and para.cdn_url configuration,
or edit the value of para.csp_header.

Additionally, there are 4 options to extend the values of connect-src, frame-src, font-src and style-src
respectively:

para.csp_connect_sources = "connect-domain1.com connect-domain2.com"
para.csp_frame_sources = "frame-domain1.com frame-domain2.com"
para.csp_font_sources = "font-domain1.com font-domain2.com"
para.csp_style_sources = "style-domain1.com style-domain2.com"

You can also enable or disable CSP violation reports (visible only to admins) by setting para.csp_reports_enabled = true.
Keep in mind that if your website has a lot of traffic, this will result in hundreds of new reports being created each hour.

External scripts and JS snippets

You can append external scripts and JS snippets to the end of the page by setting the para.external_scripts property.

# URL
para.external_scripts.myscript1 = "https://mydomain.com/script.js"
# Base64 encoded JavaScript snippet
para.external_scripts.myscript2 = "J2Y2M3VlcH .... enZ2OScpOw=="

Important: Watch out for console errors in the browser after you add external scripts. In such cases you might have to
modify the frame-src or connect-src portions of the CSP header (see the 4 options above).

Serving static files from a CDN

Scoold will serve static files (JS, CSS, fonts) from the same domain where it is deployed. You can configure the
para.cdn_url to enable serving those files from a CDN. The value of the CDN URL must not end in "/".

SMTP configuration

Scoold uses the JavaMail API to send emails. If you want Scoold to send notification emails you should add the
following SMTP settings to your config file:

# system email address
para.support_email = "support@scoold.com"

para.mail.host = "smtp.example.com"
para.mail.port = 587
para.mail.username = "user@example.com"
para.mail.password = "password"
para.mail.tls = true
para.mail.ssl = false

The email template is located in src/main/resources/emails/notify.html.

For Gmail you have to turn on "Less secure app access" in your Google account settings. There's no need to configure
mail.tls or mail.ssl, just set the mail.host to smtp.gmail.com and your Gmail email and password.

Email verification

You can enable or disable the email verification step by setting para.security.allow_unverified_emails = true.
This will allow new users to register with fake emails and Scoold will not send them a confirmation email. It's useful
for testing purposes or in certain situations where you want to programmatically sign up users who don't have an email.

Social login

For authenticating with Facebook or Google, you only need your Google client id
(e.g. 123-abcd.apps.googleusercontent.com), or Facebook app id (only digits).
For all the other providers, GitHub, LinkedIn, Twitter, Slack and Microsoft, you need to set both the app id and secret key.
Note: if the credentials are blank, the sign in button is hidden for that provider.

# Facebook
para.fb_app_id = "123456789"
# Google
para.google_client_id = "123-abcd.apps.googleusercontent.com"
# GitHub
para.gh_app_id = ""
para.gh_secret = ""
# LinkedIn
para.in_app_id = ""
para.in_secret = ""
# Twitter
para.tw_app_id = ""
para.tw_secret = ""
# Microsoft
para.ms_app_id = ""
para.ms_secret = ""
# Slack
para.sl_app_id = ""
para.sl_secret = ""

You also need to set your host URL when running Scoold in production:

para.host_url = "https://your.scoold.url"

This is required for authentication requests to be redirected back to the origin.

OAuth 2.0 login

You can authenticate users against your own OAuth 2.0/OpenID Connect server through the generic OAuth 2 filter in Para.
Here are all the options which you can set in the Scoold configuration file:

# minimal setup
para.oa2_app_id = ""
para.oa2_secret = ""
para.security.oauth.authz_url = "https://your-idp.com/login"
para.security.oauth.token_url = "https://your-idp.com/token"
para.security.oauth.profile_url = "https://your-idp.com/userinfo"

# extra options
para.security.oauth.scope = "openid email profile"
para.security.oauth.accept_header = ""
para.security.oauth.parameters.id = "sub"
para.security.oauth.parameters.picture = "picture"
para.security.oauth.parameters.email = "email"
para.security.oauth.parameters.name = "name"

# Sets the string on the login button
para.security.oauth.provider = "Continue with OpenID Connect"

# Enable/disable access token delegation
para.security.oauth.token_delegation_enabled = false

Access token delegation is an additional security feature, where the access token from the identity provider (IDP)
is stored in the user's idpAccessToken field and validated on each authentication request with the IDP. If the IDP
revocates a delegated access token, then that user would automatically be logged out from Scoold and denied access
immediately.

LDAP configuration

LDAP authentication is initiated with a request like this POST /signin?provider=ldap&access_token=username:password.
There are several configuration options which Para needs in order to connect to your LDAP server. These are the defaults:

para.security.ldap.server_url = "ldap://localhost:8389/"
para.security.ldap.base_dn = "dc=springframework,dc=org"
para.security.ldap.user_search_base = ""
para.security.ldap.user_search_filter = "(cn={0})"
para.security.ldap.user_dn_pattern = "uid={0}"
para.security.ldap.password_attribute = "userPassword"
# set this only if you are connecting to Active Directory
para.security.ldap.active_directory_domain = ""

# Sets the string on the login button (PRO)
para.security.ldap.provider = "Continue with LDAP"

For Active Directory LDAP, the search filter defaults to (&(objectClass=user)(userPrincipalName={0})). The syntax for
this allows either {0} (replaced with username@domain) or {1} (replaced with username only).
For regular LDAP, only {0} is a valid placeholder and it gets replaced with the person's username.

Please, read the LDAP docs for Para to learn more about the settings above.

SAML configuration

PRO
First, you have to setup Para as a SAML service provider using the config below. Then you can exchange SAML metadata with
your SAML identity provider (IDP). The SP metadata endpoint is /saml_metadata/{appid}. For example, if your Para
endpoint is paraio.com and your appid is scoold, then the metadata is available at
https://paraio.com/saml_metadata/scoold.

SAML authentication is initiated by sending users to the Para SAML authentication endpoint /saml_auth/{appid}.
For example, if your Para endpoint is paraio.com and your appid is scoold, then the user should be sent to
https://paraio.com/saml_auth/scoold. Para (the service provider) will handle the request and redirect to the SAML IDP.
Finally, upon successful authentication, the user is redirected back to https://paraio.com/saml_auth/scoold which is
also the assertion consumer service (ACS).

Note: The X509 certificate and private key must be encoded as Base64 in the configuration file. Additionally,
the private key must be in the PKCS#8 format (---BEGIN PRIVATE KEY---). To convert from PKCS#1 to PKCS#8, use this:

openssl pkcs8 -topk8 -inform pem -nocrypt -in sp.rsa_key -outform pem -out sp.pem

There are lots of configuration options but Para needs only a few of those in order to successfully
authenticate with your SAML IDP (listed in the first rows below).

# minimal setup
# IDP metadata URL, e.g. https://idphost/idp/shibboleth
para.security.saml.idp.metadata_url = ""

# SP endpoint, e.g. https://paraio.com/saml_auth/scoold
para.security.saml.sp.entityid = ""

# SP public key as Base64(x509 certificate)
para.security.saml.sp.x509cert = ""

# SP private key as Base64(PKCS#8 key)
para.security.saml.sp.privatekey = ""

# attribute mappings (usually required)
# e.g. urn:oid:0.9.2342.19200300.100.1.1
para.security.saml.attributes.id = ""
# e.g. urn:oid:0.9.2342.19200300.100.1.3
para.security.saml.attributes.email = ""
# e.g. urn:oid:2.5.4.3
para.security.saml.attributes.name = ""


# extra options (optional)
# this is usually the same as the "EntityId"
para.security.saml.sp.assertion_consumer_service.url = ""
para.security.saml.sp.nameidformat = ""

# IDP metadata is usually automatically fetched
para.security.saml.idp.entityid = ""
para.security.saml.idp.single_sign_on_service.url = ""
para.security.saml.idp.x509cert = ""

para.security.saml.security.authnrequest_signed = false
para.security.saml.security.want_messages_signed = false
para.security.saml.security.want_assertions_signed = false
para.security.saml.security.want_assertions_encrypted = false
para.security.saml.security.want_nameid_encrypted = false
para.security.saml.security.sign_metadata = false
para.security.saml.security.want_xml_validation = true
para.security.saml.security.signature_algorithm = ""

para.security.saml.attributes.firstname = ""
para.security.saml.attributes.picture = ""
para.security.saml.attributes.lastname = ""
para.security.saml.domain = "paraio.com"

# Sets the string on the login button
para.security.saml.provider = "Continue with SAML"

Spaces (a.k.a. Teams)

Spaces are a way to organize users and questions into isolated groups. There's a default space, which is publicly
accessible by default. Each user can belong to one or more spaces, but a question can only belong to a single space.
Permission to access a space is given by an administrator. You can bulk edit users' spaces and also move a question to a
different space.

By default there's a public "default" space where all questions go. When you create a new space and assign users to it
they will still see all the other questions when they switch to the "default" space. To make the default space private
set para.is_default_space_public = false.

PRO In Scoold PRO you can create as many space as you need. The open source version is limited to 10 spaces. Also
in PRO you can automatically assign multiple spaces to new users, whereas in the OSS version you can only assign one.

If you want to assign space(s) to new users automatically, add this to your configuration:

# put space ids here, the "scooldspace:" prefix is optional
para.auto_assign_spaces = "my-space-one,my-other-space"

Alternatively, Scoold Pro can have spaces delegated to users from an OpenID Connect/OAuth 2.0 identity provider.
You have to enable access token delegation with para.security.oauth.token_delegation_enabled = true and Scoold will
try to obtain spaces from a custom attribute like spaces. Such custom attributes can be configured in the IDP and
pushed to clients (Scoold) embedded in access tokens. If you want to change the name of the custom attribute supplied
by your IDP, set para.security.oauth.spaces_attribute_name, which by default is equal to spaces. The value of that
attribute should contain comma-separated list of spaces. If the spaces pushed from the IDP do not exist, Scoold will
create them for you.

Webhooks

Webhooks are enabled by default in Scoold. To disable this functionality set para.webhooks_enabled = false. If you
are self-hosting Para, you need to also enable webhooks there using the same configuration option.
You can add/remove webhooks in the "Administration" page.

For more details about webhooks, please read the Para docs on webhooks.

Domain-restricted user registrations

You can restrict signups only to users from a particular identity domain, say acme-corp.com. To do so, set the
following configuration property:

para.approved_domains_for_signups = "acme-corp.com"

Then a user with email john@acme-corp.com will be allowed to login (the identity provider is irrelevant), but user
bob@gmail.com will be denied access.

PRO In Scoold PRO this setting can also contain a comma-separated list of identity domains:

para.approved_domains_for_signups = "acme-corp.com,gmail.com"

Admins

You can specify the user with administrative privileges in your application.conf file:

para.admins = "joe@example.com"

PRO In Scoold PRO you can have multiple admin users by specifying a comma-separated list of user identifiers.
This works both for new and existing users.

para.admins = "joe@example.com,fb:1023405345366,gh:1234124"

If you remove users who are already admins from the list of admins para.admins, they will be demoted to regular
users. Similarly, existing regular users will be promoted to admins if they appear in the list above.

Anonymous posts

PRO
This feature is enabled with para.anonymous_posts_enabled = true. It allows everyone to ask questions and write
replies, without having a Scoold account. Posting to the "Feedback" section will also be open without requiring users
to sign in. This feature is disabled by default.

Disabling the "Feedback" section

PRO
In Scoold PRO you can disable the "Feedback" functionality of the site by setting para.feedback_enabled = false.
This will remove the link to /feedback and disable the feature entirely.

LaTeX/MathML support and advanced highlighting

PRO
You can enable this feature by setting para.mathjax_enabled = true. Then you can use MathML expressions by surrounding
them with $$ signs, e.g. $$ \frac {1}{2} $$ By default, MathJax is disabled.

The Prism syntax highlighter is included and it supports many different languages. You need to specify the language for
each code block if you want the highlighting to be more accurate (see all supported languages).
For example:

```csharp
var dict = new Dictionary<string>();
```

Image uploads

PRO
Image uploads are handled by Imgur. In the future, more upload services could be supported such as S3. To initiate a new
image upload, open up the Markdown editor and drag'n'drop the image you want to upload. A link will automatically appear
when the upload is finished. For this feature to work correctly you have to specify your Imgur API client id:

para.imgur_client_id = "x23e8t0askdj"

Slack integration

Scoold PRO integrates with Slack on a number of levels. First, Scoold users can sign in with Slack. They can also
use slash commands to search and post questions. Also Scoold can notify Slack users when they are mentioned on Scoold.
Finally, Scoold allows you to map spaces to Slack workspaces or channels. By default, each Slack workspace (team) is
mapped to a single Scoold space when people sign in with Slack.

Important: Most of the Slack operations require a valid Slack ID stored in Scoold which enables the mapping of
Slack users to Scoold accounts and vice versa. Slack IDs are set automatically when a Scoold user signs in with Slack.

The integration endpoint for Slack is /slack - this is where Scoold will accept and process requests from Slack.
To enable the Slack integration you need to register for a Slack app first and set para.sl_app_id and para.sl_secret.
Follow the detailed instructions here.

Here are the configuration properties for Slack:

para.slack.app_id = "SHORT_APPID"
para.slack.map_workspaces_to_spaces = true
para.slack.map_channels_to_spaces = false
para.slack.post_to_space = "workspace
To the top