init commit
This commit is contained in:
commit
cf9b13efdf
|
@ -0,0 +1,80 @@
|
||||||
|
# OSX
|
||||||
|
#
|
||||||
|
.DS_Store
|
||||||
|
|
||||||
|
# Xcode
|
||||||
|
#
|
||||||
|
build/
|
||||||
|
*.pbxuser
|
||||||
|
!default.pbxuser
|
||||||
|
*.mode1v3
|
||||||
|
!default.mode1v3
|
||||||
|
*.mode2v3
|
||||||
|
!default.mode2v3
|
||||||
|
*.perspectivev3
|
||||||
|
!default.perspectivev3
|
||||||
|
xcuserdata
|
||||||
|
*.xccheckout
|
||||||
|
*.moved-aside
|
||||||
|
DerivedData
|
||||||
|
*.hmap
|
||||||
|
*.ipa
|
||||||
|
*.xcuserstate
|
||||||
|
ios/.xcode.env.local
|
||||||
|
|
||||||
|
# Android/IntelliJ
|
||||||
|
#
|
||||||
|
build/
|
||||||
|
.idea
|
||||||
|
.gradle
|
||||||
|
local.properties
|
||||||
|
*.iml
|
||||||
|
*.hprof
|
||||||
|
.cxx/
|
||||||
|
|
||||||
|
# node.js
|
||||||
|
#
|
||||||
|
node_modules/
|
||||||
|
npm-debug.log
|
||||||
|
yarn-error.log
|
||||||
|
.npm
|
||||||
|
|
||||||
|
# BUCK
|
||||||
|
buck-out/
|
||||||
|
\.buckd/
|
||||||
|
*.keystore
|
||||||
|
!debug.keystore
|
||||||
|
|
||||||
|
# fastlane
|
||||||
|
#
|
||||||
|
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
|
||||||
|
# screenshots whenever they are needed.
|
||||||
|
# For more information about the recommended setup visit:
|
||||||
|
# https://docs.fastlane.tools/best-practices/source-control/
|
||||||
|
|
||||||
|
**/fastlane/report.xml
|
||||||
|
**/fastlane/Preview.html
|
||||||
|
**/fastlane/screenshots
|
||||||
|
**/fastlane/test_output
|
||||||
|
|
||||||
|
# Bundle artifact
|
||||||
|
*.jsbundle
|
||||||
|
*.jsbundle.map
|
||||||
|
|
||||||
|
# Ruby / CocoaPods
|
||||||
|
/ios/Pods/
|
||||||
|
/vendor/bundle/
|
||||||
|
|
||||||
|
.eslintcache
|
||||||
|
e2e/starter.test.js
|
||||||
|
e2e/jest.config.js
|
||||||
|
|
||||||
|
# detox
|
||||||
|
artifacts/
|
||||||
|
|
||||||
|
# java keystores for android release builds
|
||||||
|
*.jks
|
||||||
|
|
||||||
|
# release builds from Android
|
||||||
|
android/app/release/**/*
|
||||||
|
Dockerfile
|
|
@ -0,0 +1,3 @@
|
||||||
|
CONTAINER_NAME="frayt-driver-v3-dockerized"
|
||||||
|
RN_PROJECT_FOLDER_NAME="frayt-driver-v3"
|
||||||
|
SSH_KEY="~/.ssh/id_docker_dev"
|
|
@ -0,0 +1,4 @@
|
||||||
|
.env.secret
|
||||||
|
.docker-sync
|
||||||
|
id_docker_dev
|
||||||
|
.idea
|
|
@ -0,0 +1,34 @@
|
||||||
|
FROM reactnativecommunity/react-native-android
|
||||||
|
|
||||||
|
|
||||||
|
# config and update
|
||||||
|
ENV DEBIAN_FRONTEND noninteractive
|
||||||
|
WORKDIR /home
|
||||||
|
RUN apt-get update
|
||||||
|
RUN mkdir /var/log/app
|
||||||
|
ARG SSH_KEY
|
||||||
|
|
||||||
|
# set up NVM and use v16 LTS
|
||||||
|
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
|
||||||
|
ENV NVM_DIR /root/.nvm
|
||||||
|
ENV NODE_VERSION 16.20.1
|
||||||
|
RUN . "$NVM_DIR/nvm.sh" && nvm install $NODE_VERSION && nvm alias default $NODE_VERSION && nvm use default
|
||||||
|
ENV NODE_PATH $NVM_DIR/versions/node/v$NODE_VERSION/lib/node_modules
|
||||||
|
ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH
|
||||||
|
RUN npm install -g react-native-cli
|
||||||
|
|
||||||
|
# Install SSH server
|
||||||
|
RUN apt-get -y install openssh-server
|
||||||
|
COPY sshd_config /etc/ssh/sshd_config
|
||||||
|
RUN mkdir /root/.ssh
|
||||||
|
RUN touch /root/.ssh/authorized_keys
|
||||||
|
RUN chmod 600 /root/.ssh/authorized_keys
|
||||||
|
RUN mkdir -p /run/sshd
|
||||||
|
|
||||||
|
# set up on-launch commands
|
||||||
|
RUN apt-get install -y supervisor
|
||||||
|
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
||||||
|
COPY entrypoint.sh /entrypoint.sh
|
||||||
|
RUN chmod +x /entrypoint.sh
|
||||||
|
|
||||||
|
ENTRYPOINT ["/entrypoint.sh"]
|
|
@ -0,0 +1,133 @@
|
||||||
|
# Dockerized React Native
|
||||||
|
|
||||||
|
This repository aims to establish a reliable Android build environment for QA and sanity checks in React Native apps. It's designed for parallel iOS development, as 'node_modules', 'Pods', and iOS build artifacts aren't synced between the host and the container, allowing them to function independently of the Docker setup.
|
||||||
|
|
||||||
|
Things to keep in mind:
|
||||||
|
|
||||||
|
* **This does not support iOS builds**. For that, you'd require a remote Mac host. While there exist Docker images for Mac, they are experimental and using them goes against Apple's EULA.._
|
||||||
|
|
||||||
|
* **It's intended strictly for development purposes**. The Dockerfile sets up a container that operates everything as root, using default sshd configurations.
|
||||||
|
|
||||||
|
## Requirements
|
||||||
|
|
||||||
|
* [Android Studio](https://developer.android.com/studio) installed with `platform-tools` in your path.
|
||||||
|
* _Note:_ This is likely configured if you've already developed for Android/RN on your machine
|
||||||
|
* [Docker Desktop ](https://docs.docker.com/desktop/install/mac-install/)
|
||||||
|
* [OrbStack](https://orbstack.dev/) _(great alternative but it will be out of its free beta soon and may not be stable)_
|
||||||
|
* A React Native project to dockerize!
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
You will either want to dockerize an app you haven't cloned/created yet, or an existing repository on your machine.
|
||||||
|
|
||||||
|
#### Option 1: Cloning A Project
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Expand</summary>
|
||||||
|
|
||||||
|
Let's say you have a React Native repository you've yet to clone but wish to run under docker. You'll clone this repository first, then clone your React Native project inside this repository with its folder named `app`.
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
cd ~/Projects
|
||||||
|
git clone git@github.com:my-github-org/react-native-dockerized.git my-rn-project-dockerized
|
||||||
|
cd my-rn-project-dockerized && rm -rf .git
|
||||||
|
git clone git@github.com:my-github-org/my-rn-project.git app
|
||||||
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
#### Option 2: An Existing Project
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Expand</summary>
|
||||||
|
|
||||||
|
Let's say you've already cloned a React Native repository and your directory structure is: `~/Projects/my-rn-project`. You'll want to clone this repository, then move the entirety of your react native repository into this repository under a folder named `app`.
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
cd ~/Projects
|
||||||
|
git clone git@github.com:my-github-org/react-native-dockerized.git my-rn-project-dockerized
|
||||||
|
mv my-rn-project my-rn-project-dockerized/app
|
||||||
|
cd my-rn-project-dockerized && rm -rf .git
|
||||||
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|


|
||||||
|
|
||||||
|
Jump through the other optional setup, particularly [Configure Github Auth](#configure-github-auth) if your project has dependencies that install from a private Github repository.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
After going through [Installation](#installation) and any of the optional setup:
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
docker-compose up
|
||||||
|
./dockdroid.sh start-metro
|
||||||
|
# boot up an Android emulator before this step
|
||||||
|
./dockdroid.sh run-android
|
||||||
|
```
|
||||||
|
|
||||||
|
And you're all set! The following are all of the helper commands for managing the container. Regular docker commands work as well. Refer to `dockdroid.sh` for examples.
|
||||||
|
|
||||||
|
| Command | Description |
|
||||||
|
| ------------- | ------------- |
|
||||||
|
| `./dockdroid.sh stop-metro` | Stop the Metro server |
|
||||||
|
| `./dockdroid.sh start-metro` | Start the Metro server and reset its cache |
|
||||||
|
| `./dockdroid.sh metro-logs` | Check the server logs |
|
||||||
|
| `./dockdroid.sh connect-android` | Connect to your host machine's Android device |
|
||||||
|
| `./dockdroid.sh run-android` | Connects to your host machine's Android device, builds and deploys the app |
|
||||||
|
| `./dockdroid.sh reinstall-node-modules` | Removes the node_modules directory in the project and re-installs dependencies |
|
||||||
|
| `./dockdroid.sh clear-known-hosts` | Removes the Docker container's entries from the host's ~/.ssh/known_hosts file |
|
||||||
|
| `./dockdroid.sh shell` | Starts a bash shell in the project's directory inside the Docker container |
|
||||||
|
| `./dockdroid.sh init-ssh` | Generates an SSH key and adds it to the host's SSH config |
|
||||||
|
|
||||||
|
_You may need to run `sudo chmod +x ./dockdroid.sh` first for executable permissions._
|
||||||
|
|
||||||
|
## Settings
|
||||||
|
|
||||||
|
You can adjust a few settings in the `.env` file at the root of the repository.
|
||||||
|
|
||||||
|
| Variable | Description | Default |
|
||||||
|
| ------------- | ------------- | ------------- |
|
||||||
|
| `CONTAINER_NAME` | The name of the Docker container that the script interacts with. | `react-native-dockerized` |
|
||||||
|
| `SSH_KEY` | Location of the SSH key file that is used for secure communication with the Docker container. | `~/.ssh/id_docker_dev` |
|
||||||
|
| `RN_PROJECT_FOLDER_NAME` | The name of the React Native project folder. This should match the name of the folder that you cloned at the root of your repository. | `app` |
|
||||||
|
|
||||||
|
You will need to rename your container if you'd like to run more than one of these containers at the same time. For example, if you're working on two separate React Native apps, you will not be able to dockerize the second app without it using a different container name.
|
||||||
|
|
||||||
|
Please be aware that modifying the RN_PROJECT_FOLDER_NAME variable doesn't rename the project folder on your host machine. Instead, this variable should reflect the name you have already assigned to your project folder.
|
||||||
|
|
||||||
|
### Configure Github Auth
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Expand - optional, but highly recommended</summary>
|
||||||
|
|
||||||
|
Before booting up the container, the image will run `npm install` as its getting built and will need to authenticate with a Github account to install any NPM packages from private Github repositories.
|
||||||
|
|
||||||
|
1. Create a [legacy access token](https://github.com/settings/tokens) with all Repo-related permissions checked, and save the token in your password manager.
|
||||||
|
2. Add `export GH_TOKEN="your_legacy_access_token"` to your `~/.zshrc` file
|
||||||
|
* Alternatively, you could add it to the `.env` file
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
### Remote Workspace Inside The Container:
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Expand - optional</summary>
|
||||||
|
|
||||||
|
You can open a new remote workspace in your IDE to access the React Native project within your container. With VS Code, you may not require SSH for this task, thanks to the robust integration of the [Dev Containers](https://code.visualstudio.com/docs/devcontainers/containers) extension with Docker. However, if you're using VSCodium, your best bet is the [Open Remote SSH](https://open-vsx.org/vscode/item?itemName=jeanp413.open-remote-ssh) extension.
|
||||||
|
|
||||||
|
Do note, VSCodium comes with certain limitations, such as the need to manually provision an SSH server and client - but hey that's the FOSS life.
|
||||||
|
|
||||||
|
To simplify the setup for a remote workspace in VSCodium, you can run `init-ssh` and it will provision everything necessary. You can confirm this by running `ssh root@{your.dockers.ip.address}`.
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
- If hot reloading doesn't work, first check the Metro logs with ./dockdroid.sh metro-logs. If the logs don't help, make sure your Metro configuration includes watchFolders: ['/home/app'],, replacing 'app' with the value of RN_PROJECT_FOLDER_NAME. This ensures changes are detected in both your local machine and the container.
|
||||||
|
|
||||||
|
- If you have issues connecting via SSH, try running `ssh root@{your.docker.ip.address} -v` for more debug info. Often times the logs will be clear and verbose enough to instruct you further.
|
||||||
|
|
||||||
|
- Your known_hosts file will likely throw an error after recreating the container, and you'll have to run `./dockdroid.sh clear-known-hosts`. SSH in again to confirm it's fixed, and accept the new known_host entry.
|
||||||
|
|
|
@ -0,0 +1,76 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [[ -z "${RN_PROJECT_FOLDER_NAME}" ]]; then
|
||||||
|
echo "Please set the RN_PROJECT_FOLDER_NAME environment variable before running the script."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
case $1 in
|
||||||
|
stop-metro)
|
||||||
|
docker exec -it ${RN_PROJECT_FOLDER_NAME} supervisorctl stop npm
|
||||||
|
;;
|
||||||
|
start-metro)
|
||||||
|
docker exec -it ${RN_PROJECT_FOLDER_NAME} supervisorctl start npm -- --reset-cache
|
||||||
|
docker logs -f ${RN_PROJECT_FOLDER_NAME}
|
||||||
|
;;
|
||||||
|
metro-logs)
|
||||||
|
docker exec -it ${RN_PROJECT_FOLDER_NAME} cat /var/log/app/npm.log
|
||||||
|
;;
|
||||||
|
connect-android)
|
||||||
|
docker exec -ti ${RN_PROJECT_FOLDER_NAME} adb connect host.docker.internal
|
||||||
|
;;
|
||||||
|
run-android)
|
||||||
|
docker exec -ti ${RN_PROJECT_FOLDER_NAME} adb connect host.docker.internal
|
||||||
|
docker exec -ti ${RN_PROJECT_FOLDER_NAME} npx react-native run-android
|
||||||
|
;;
|
||||||
|
reinstall-node-modules)
|
||||||
|
docker exec -it ${RN_PROJECT_FOLDER_NAME} /bin/bash -c "cd /home/${RN_PROJECT_FOLDER_NAME} && rm -rf node_modules && npm install"
|
||||||
|
;;
|
||||||
|
shell)
|
||||||
|
if [[ -z "${RN_PROJECT_FOLDER_NAME}" ]]; then
|
||||||
|
echo "Please set the RN_PROJECT_FOLDER_NAME environment variable before running the script."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
docker exec -it ${RN_PROJECT_FOLDER_NAME} /bin/bash -c "cd /home/${RN_PROJECT_FOLDER_NAME} && exec /bin/bash"
|
||||||
|
;;
|
||||||
|
init-ssh)
|
||||||
|
if [[ -z "${SSH_KEY}" ]]; then
|
||||||
|
echo "Please set the SSH_KEY environment variable before running the script."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# generate ssh key
|
||||||
|
if [ ! -f "${SSH_KEY}" ]; then
|
||||||
|
ssh-keygen -t ed25519 -f "${SSH_KEY}" -N ""
|
||||||
|
echo "SSH key generated at ${SSH_KEY}"
|
||||||
|
else
|
||||||
|
echo "SSH key already exists at ${SSH_KEY}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# get docker container's IP
|
||||||
|
CONTAINER_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${CONTAINER_NAME})
|
||||||
|
|
||||||
|
# check if the docker IP is already in the ssh config
|
||||||
|
if grep -q "${CONTAINER_IP}" ~/.ssh/config
|
||||||
|
then
|
||||||
|
echo "SSH config already contains the Docker IP."
|
||||||
|
else
|
||||||
|
echo "Adding Docker IP to SSH config..."
|
||||||
|
echo -e "Host ${CONTAINER_IP}\n\tPort 22\n\tUser root\n\tPubkeyAuthentication yes\n\tIdentityFile ${SSH_KEY}" >> ~/.ssh/config
|
||||||
|
echo "Docker IP added to SSH config."
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
clear-known-hosts)
|
||||||
|
if [ "$EUID" -ne 0 ]
|
||||||
|
then
|
||||||
|
echo "Please run this command as root or use sudo."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
CONTAINER_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${CONTAINER_NAME})
|
||||||
|
ssh-keygen -R ${CONTAINER_IP}
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Invalid command"
|
||||||
|
echo "Usage: $0 {logs|connect|run-android|stop}"
|
||||||
|
;;
|
||||||
|
esac
|
|
@ -0,0 +1,19 @@
|
||||||
|
version: "3.7"
|
||||||
|
|
||||||
|
services:
|
||||||
|
react-native-android:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
args:
|
||||||
|
- SSH_KEY=${SSH_KEY}
|
||||||
|
container_name: "${CONTAINER_NAME}"
|
||||||
|
volumes:
|
||||||
|
- type: bind
|
||||||
|
source: ./${RN_PROJECT_FOLDER_NAME}
|
||||||
|
target: /home/app
|
||||||
|
ports:
|
||||||
|
- 8081:8081
|
||||||
|
environment:
|
||||||
|
- EXPO_DEVTOOLS_LISTEN_ADDRESS=0.0.0.0
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Github auth for private npm packages
|
||||||
|
su -c "echo \"//github.com/:_authToken=$GH_TOKEN\" > /home/${RN_PROJECT_FOLDER_NAME}/.npmrc"
|
||||||
|
|
||||||
|
# install npm dependencies
|
||||||
|
su -c "cd /home/${RN_PROJECT_FOLDER_NAME} && npm install"
|
||||||
|
|
||||||
|
# remove the token
|
||||||
|
su -c "rm -f /home/${RN_PROJECT_FOLDER_NAME}/.npmrc"
|
||||||
|
|
||||||
|
# run supervisord
|
||||||
|
exec /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf
|
|
@ -0,0 +1,122 @@
|
||||||
|
# $OpenBSD: sshd_config,v 1.101 2017/03/14 07:19:07 djm Exp $
|
||||||
|
|
||||||
|
# This is the sshd server system-wide configuration file. See
|
||||||
|
# sshd_config(5) for more information.
|
||||||
|
|
||||||
|
# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin
|
||||||
|
|
||||||
|
# The strategy used for options in the default sshd_config shipped with
|
||||||
|
# OpenSSH is to specify options with their default value where
|
||||||
|
# possible, but leave them commented. Uncommented options override the
|
||||||
|
# default value.
|
||||||
|
|
||||||
|
#Port 22
|
||||||
|
#AddressFamily any
|
||||||
|
#ListenAddress 0.0.0.0
|
||||||
|
#ListenAddress ::
|
||||||
|
|
||||||
|
#HostKey /etc/ssh/ssh_host_rsa_key
|
||||||
|
#HostKey /etc/ssh/ssh_host_ecdsa_key
|
||||||
|
#HostKey /etc/ssh/ssh_host_ed25519_key
|
||||||
|
|
||||||
|
# Ciphers and keying
|
||||||
|
#RekeyLimit default none
|
||||||
|
|
||||||
|
# Logging
|
||||||
|
#SyslogFacility AUTH
|
||||||
|
#LogLevel INFO
|
||||||
|
|
||||||
|
# Authentication:
|
||||||
|
|
||||||
|
#LoginGraceTime 2m
|
||||||
|
PermitRootLogin yes
|
||||||
|
#StrictModes yes
|
||||||
|
#MaxAuthTries 6
|
||||||
|
#MaxSessions 10
|
||||||
|
|
||||||
|
PubkeyAuthentication yes
|
||||||
|
|
||||||
|
# Expect .ssh/authorized_keys2 to be disregarded by default in future.
|
||||||
|
AuthorizedKeysFile .ssh/authorized_keys .ssh/authorized_keys2
|
||||||
|
|
||||||
|
#AuthorizedPrincipalsFile none
|
||||||
|
|
||||||
|
#AuthorizedKeysCommand none
|
||||||
|
#AuthorizedKeysCommandUser nobody
|
||||||
|
|
||||||
|
# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
|
||||||
|
#HostbasedAuthentication no
|
||||||
|
# Change to yes if you don't trust ~/.ssh/known_hosts for
|
||||||
|
# HostbasedAuthentication
|
||||||
|
#IgnoreUserKnownHosts no
|
||||||
|
# Don't read the user's ~/.rhosts and ~/.shosts files
|
||||||
|
#IgnoreRhosts yes
|
||||||
|
|
||||||
|
# To disable tunneled clear text passwords, change to no here!
|
||||||
|
PasswordAuthentication no
|
||||||
|
#PermitEmptyPasswords no
|
||||||
|
|
||||||
|
# Change to yes to enable challenge-response passwords (beware issues with
|
||||||
|
# some PAM modules and threads)
|
||||||
|
ChallengeResponseAuthentication no
|
||||||
|
|
||||||
|
# Kerberos options
|
||||||
|
#KerberosAuthentication no
|
||||||
|
#KerberosOrLocalPasswd yes
|
||||||
|
#KerberosTicketCleanup yes
|
||||||
|
#KerberosGetAFSToken no
|
||||||
|
|
||||||
|
# GSSAPI options
|
||||||
|
#GSSAPIAuthentication no
|
||||||
|
#GSSAPICleanupCredentials yes
|
||||||
|
#GSSAPIStrictAcceptorCheck yes
|
||||||
|
#GSSAPIKeyExchange no
|
||||||
|
|
||||||
|
# Set this to 'yes' to enable PAM authentication, account processing,
|
||||||
|
# and session processing. If this is enabled, PAM authentication will
|
||||||
|
# be allowed through the ChallengeResponseAuthentication and
|
||||||
|
# PasswordAuthentication. Depending on your PAM configuration,
|
||||||
|
# PAM authentication via ChallengeResponseAuthentication may bypass
|
||||||
|
# the setting of "PermitRootLogin without-password".
|
||||||
|
# If you just want the PAM account and session checks to run without
|
||||||
|
# PAM authentication, then enable this but set PasswordAuthentication
|
||||||
|
# and ChallengeResponseAuthentication to 'no'.
|
||||||
|
UsePAM yes
|
||||||
|
|
||||||
|
#AllowAgentForwarding yes
|
||||||
|
#AllowTcpForwarding yes
|
||||||
|
GatewayPorts no
|
||||||
|
X11Forwarding yes
|
||||||
|
#X11DisplayOffset 10
|
||||||
|
#X11UseLocalhost yes
|
||||||
|
#PermitTTY yes
|
||||||
|
PrintMotd no
|
||||||
|
#PrintLastLog yes
|
||||||
|
#TCPKeepAlive yes
|
||||||
|
#UseLogin no
|
||||||
|
#PermitUserEnvironment no
|
||||||
|
#Compression delayed
|
||||||
|
#ClientAliveInterval 0
|
||||||
|
#ClientAliveCountMax 3
|
||||||
|
#UseDNS no
|
||||||
|
#PidFile /var/run/sshd.pid
|
||||||
|
#MaxStartups 10:30:100
|
||||||
|
#PermitTunnel no
|
||||||
|
#ChrootDirectory none
|
||||||
|
#VersionAddendum none
|
||||||
|
|
||||||
|
# no default banner path
|
||||||
|
#Banner none
|
||||||
|
|
||||||
|
# Allow client to pass locale environment variables
|
||||||
|
AcceptEnv LANG LC_*
|
||||||
|
|
||||||
|
# override default of no subsystems
|
||||||
|
Subsystem sftp /usr/lib/openssh/sftp-server
|
||||||
|
|
||||||
|
# Example of overriding settings on a per-user basis
|
||||||
|
#Match User anoncvs
|
||||||
|
# X11Forwarding no
|
||||||
|
# AllowTcpForwarding no
|
||||||
|
# PermitTTY no
|
||||||
|
# ForceCommand cvs server
|
|
@ -0,0 +1,22 @@
|
||||||
|
[supervisord]
|
||||||
|
nodaemon=true
|
||||||
|
|
||||||
|
[unix_http_server]
|
||||||
|
file=/var/run/supervisor.sock
|
||||||
|
|
||||||
|
[program:ssh]
|
||||||
|
command=/usr/sbin/sshd -D
|
||||||
|
user=root
|
||||||
|
autostart=true
|
||||||
|
autorestart=true
|
||||||
|
stdout_logfile=/var/log/supervisor/%(program_name)s.log
|
||||||
|
stderr_logfile=/var/log/supervisor/%(program_name)s.log
|
||||||
|
|
||||||
|
[program:npm]
|
||||||
|
command=bash -c "npm start -- --reset-cache"
|
||||||
|
user=root
|
||||||
|
autostart=false
|
||||||
|
autorestart=false
|
||||||
|
directory=/home/app
|
||||||
|
stdout_logfile=/var/log/app/%(program_name)s.log
|
||||||
|
stderr_logfile=/var/log/app/%(program_name)s.log
|
Loading…
Reference in New Issue